TheM.beneficiaries Reference
Constructor
The parent TheM class contains functionality enabling the initialization of any TheM subclass or submodule instance by simply calling TheM.doInit('subclassName'), where the input string is a case sensitive space-delimited string containing the names of all submodules that may be required in the current session. Most TheM subclasses also require the 'common' submodule. It is common to initialize the target submodule and any other submodule dependencies concurrently. The following example will initialize a new instance of the necessary submodules using a proxy constructor in TheM parent class.
Example
Properties
Property table for TheM.beneficiaries
Property | Description | Required | Schema |
---|---|---|---|
all | Gets (returns) an array with all the beneficiaries associated with the user that are not closed or hidden (may be pending). | Yes | { "title": "TheM.beneficiaries.all", "type": "array", "description": "Gets (returns) an array with all the beneficiaries associated with the user that are not closed or hidden (may be pending).", "$comment": "getter", "examples": [ [ { "AFiBeneficiaryId": "testpgbenlxuma31jlu", "beneficiaryId": "testpgbenlxuma31jlu", "AFiPayeeId": "3gzvss70aqhkjh0gcmwz6fr6eutmzmf8", "AFiUserId": "testaurlx8wfimcrw", "userId": "testaurlx8wfimcrw", "name": "ACH Payee Account", "destinationName": "Receiving account title", "backOfficeId": "connectFiBOIS", "backOfficeName": "connectFiBOIS", "backOffices": [], "type": "CHECKING", "typeName": "USA interbank transfer", "accountNumber": "1234567890123456", "routingNumber": "123456789", "bankName": "Citibank NA", "txnType": "USA", "status": "Active", "defaultAmount": 0, "defaultCurrency": "USD", "narrativeDebit": "ACH payment", "narrativeCredit": "", "imageBase64": "Very_Long_Base64_Image_String", "dtsCreated": "2024-06-28T11:12:10.053Z", "dtsUpdated": "2024-06-28T11:12:10.053Z", "isActive": true, "isBusiness": false, "isDeleted": false, "isFavourite": false, "isHidden": false, "isPaying": false, "isValid": true, "transactions": [], "validationMessage": "", "toJSON": {} } ] ], "nullable": false } |
allActive | Gets (returns) an array with all the beneficiaries associated with the user that are not closed, not hidden, and not pending. | Yes | { "title": "TheM.beneficiaries.allActive", "type": "array", "description": "Gets (returns) an array with all the beneficiaries associated with the user that are not closed, not hidden, and not pending.", "$comment": "getter", "examples": [ [ { "AFiBeneficiaryId": "testpgbenlxuma31jlu", "beneficiaryId": "testpgbenlxuma31jlu", "AFiPayeeId": "3gzvss70aqhkjh0gcmwz6fr6eutmzmf8", "AFiUserId": "testaurlx8wfimcrw", "userId": "testaurlx8wfimcrw", "name": "ACH Payee Account", "destinationName": "Receiving account title", "backOfficeId": "connectFiBOIS", "backOfficeName": "connectFiBOIS", "backOffices": [], "type": "CHECKING", "typeName": "USA interbank transfer", "accountNumber": "1234567890123456", "routingNumber": "123456789", "bankName": "Citibank NA", "txnType": "USA", "status": "Active", "defaultAmount": 0, "defaultCurrency": "USD", "narrativeDebit": "ACH payment", "narrativeCredit": "", "imageBase64": "Very_Long_Base64_Image_String", "dtsCreated": "2024-06-28T11:12:10.053Z", "dtsUpdated": "2024-06-28T11:12:10.053Z", "isActive": true, "isBusiness": false, "isDeleted": false, "isFavourite": false, "isHidden": false, "isPaying": false, "isValid": true, "transactions": [], "validationMessage": "", "toJSON": {} } ] ], "nullable": false } |
allTransactions | Gets (returns) an array with all the transactions pertaining to user's beneficiaries. | Yes | { "title": "TheM.beneficiaries.allTransactions", "type": "array", "description": "Gets (returns) an array with all the transactions pertaining to user's beneficiaries.", "$comment": "getter", "examples": [ [ { "AFiAccountId": "testgalx8wfq4sqfgb", "AFiUserId": "testaurlx8wfimcrw", "arn": "0000000000000006LBor", "dtsAtMerchant": "Mon Jun 10 2024 07:37:55 GMT-0400 (Eastern Daylight Time)", "dtsRecorded": "Mon Jun 10 2024 07:38:51 GMT-0400 (Eastern Daylight Time)", "fee": 0, "internal": {}, "is3DSecure": false, "isComplete": true, "isDigitalWalletTrans": false, "isPaymentTrans": true, "isRecurring": false, "reference": "testrr8wgyjgssximb", "transactionIdBO": "F2167329415", "transactionState": "complete", "typeName": "", "amount": 10, "attachments": {}, "attachmentsArray": [], "credit": 10, "currency": "USD", "debit": 0, "dtsBooked": "Mon Jun 10 2024 07:37:55 GMT-0400 (Eastern Daylight Time)", "dtsValue": "Mon Jun 10 2024 07:37:55 GMT-0400 (Eastern Daylight Time)", "isBlacklistable": false, "isWhitelistable": false, "narrative": "🎁 Welcome bonus", "newBalance": null, "transactionId": "dcuosrklcjxpyzxagroxbbrspacuhiecwfzltzke", "txnType": "credit", "toJSON": {}, "beneficiary": {} } ] ], "nullable": false } |
length | Gets (returns) the length of the beneficiaries array. | Yes | { "title": "TheM.beneficiaries.length", "type": "number", "description": "Gets (returns) the length of the beneficiaries array.", "examples": [ 1 ], "default": 0, "nullable": false } |
isReady | Gets (returns) or sets true if TheM.beneficiaries is fully ready. When setting isReady true for the first time, a(n) 'TheM.beneficiaries ready' event is also triggered. | Yes | { "title": "TheM.beneficiaries.isReady", "type": "boolean", "description": "Gets (returns) or sets true if TheM.beneficiaries is fully ready. When setting isReady true for the first time, a(n) 'TheM.beneficiaries ready' event is also triggered.", "$comment": "getter setter", "examples": [ true, false ], "default": false, "nullable": false } |
Methods
Method Name | Parameter Descriptions | Description | Example |
---|---|---|---|
doSave | [] |
Saves beneficiaries data in local storage. Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. Returns true. | TheM.beneficiaries.doSave(); |
doLoad | [] |
Loads beneficiaries data from local storage and returns a boolean value to indicate success. On success, a(n) 'modelBank beneficiaries updated' event will occur.Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. | TheM.beneficiaries.doLoad(); |
doUpdate | [ |
Causes framework to pull fresh beneficiaries data from the server. If the data is fresh enough, meaning an update has happened recently, the framework will ignore the suggestion. However, you can force the framework to update the data by sending true as an argument. On success, a(n) 'modelBank beneficiaries refreshed' event will occur. |
TheM.beneficiaries.doUpdate(true); |
newTempBeneficiary | [ |
Accepts givenTxnType as a string and a given object containing the properties that will be passed down to the new beneficiary. The properties required in the given object are dependent on the txnType of the desired beneficiary. Returns the newly created beneficiary object. |
TheM.beneficiaries.newTempBeneficiary("USA",{); |
beneficiary | [ |
Returns the beneficiary specified by the givenBeneficiaryId that is associated with the user, if a match exists. | TheM.beneficiaries.beneficiary("testpgbenlxuma31jlu"); |
forTxnTypes | [ |
Returns a list of beneficiaries that match the given txnTypes. The givenTypes parameter is a string containing one or more txnTypes. | TheM.beneficiaries.forTxnTypes("USA_wire paypal tocard"); |
forAFiPayeeId | [ |
Returns a list of not-closed, not-hidden beneficiaries that are associated with the current user and that match the given AFiPayeeId. | TheM.beneficiaries.forAFiPayeeId("3gzvss70aqhkjh0gcmwz6fr6eutmzmf8"); |
filtered | [ |
This method accepts an object, givenParams , containing filter criteria (key:value pairs where key is a beneficiary property) and then returns an array of beneficiaries with properties matching the given criteria. If no givenParams are included, then an unfiltered beneficiary list is returned. |
TheM.beneficiaries.filtered({); |
Submodules
Submodule Name | Link |
---|---|
Beneficiary | Beneficiary Reference |
BeneficiaryUSA | BeneficiaryUSA Reference |
BeneficiaryUSA_wire | BeneficiaryUSA_wire Reference |
BeneficiaryPayPal | BeneficiaryPayPal Reference |
BeneficiaryCheque | BeneficiaryCheque Reference |
BeneficiaryToCard | BeneficiaryToCard Reference |