Skip to content

TheM.fundsTransfer 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.

TheM.doInit('subclassName1 subclassName2 subclassName3 etc');

Example

TheM.doInit('common user accounts cards fundsTransfer');

Properties

Property table for TheM.fundsTransfer

Property Description Required Schema
amount Gets (returns) or sets the amount that is to be transferred. The setter can accept a string or a number and the amount must be greater than or equal to 0. Yes {
  "title": "TheM.fundsTransfer.amount",
  "type": "number",
  "description": "Gets (returns) or sets the amount
that is to be transferred. The setter can accept a
string or a number and the amount must be greater than
or equal to 0.",
  "$comment": "getter setter",
  "examples": [
    20.01
  ],
  "nullable": false
}
currency Gets (returns) or sets the currency that is to be transferred. The currency must be an allowed value. In other words, TheM.restrictions.isCurrencyAllowed(TheM.fundsTransfer.transactionTypeId, givenCurrency) must return true. Yes {
  "title": "TheM.fundsTransfer.currency",
  "type": "number",
  "description": "Gets (returns) or sets the
currency that is to be transferred. The currency
must be an allowed value. In other words,
TheM.restrictions.isCurrencyAllowed(TheM.fund
sTransfer.transactionTypeId, givenCurrency)
must return true.",
  "$comment": "getter setter",
  "examples": [
    "USD"
  ],
  "nullable": false
}
destinationAccount Gets (returns) or sets the destination account for the funds transfer. The destination account must belong to the user. When setting a new destination account, use TheM.fundsTransfer.destinationAccount = AFiAccountId, where AFiAccountId is the account ID in ampliFi of the desired destination account. Optionally, the setter can also take an Account object value, like TheM.fundsTransfer.destinationAccount = TheM.accounts[0]. The getter will return the Account object that corresponds with the set AFiAccountId. The destination account cannot be the same as the source account. Yes {
  "title":
"TheM.fundsTransfer.destinationAccount",
  "type": "object",
  "description": "Gets (returns) or sets the
destination account for the funds transfer. The
destination account must belong to the user. When
setting a new destination account, use
TheM.fundsTransfer.destinationAccount =
AFiAccountId, where AFiAccountId is the account ID
in ampliFi of the desired destination account.
Optionally, the setter can also take an Account
object value, like
TheM.fundsTransfer.destinationAccount =
TheM.accounts[0]. The getter will return the
Account object that corresponds with the set
AFiAccountId. The destination account cannot be
the same as the source account.",
  "$comment": "getter setter",
  "examples": [
    {
      "AFiCardId": "testgalx8wfq4sqfgb",
      "backOfficeId": "connectFiBOIS",
      "backOfficeName": "connectFiBOIS",
      "currency": "USD",
      "isClosed": false,
      "lastDepositAmount": 0,
      "rn": "123456789",
      "status": "Card was issued but has not yet been
activated",
      "type": "Current",
      "AFiAccountId": "testgalx8wfq4sqfgb",
      "AFiUserId": "testaurlx8wfimcrw",
      "balance": {
        "available": 10,
        "currency": "USD",
        "native": 10,
        "toJSON": {
          "available": 10,
          "currency": "USD",
          "native": 10
        }
      },
      "card": {},
      "cards": [
        {}
      ],
      "dtsOpened": "Mon Jun 10 2024 07:37:54 GMT-0400
(Eastern Daylight Time)",
      "dtsUpdated": "Wed Jun 12 2024 12:06:30 GMT-0400
(Eastern Daylight Time)",
      "fullName": "Main account",
      "id": "testgalx8wfq4sqfgb",
      "isActive": false,
      "isHidden": false,
      "isMain": false,
      "name": "Main account",
      "num": "1000000123456789",
      "primaryUserAFiUserId": "testaurlx8wfimcrw",
      "toJSON": {
        "AFiAccountId": "testgalx8wfq4sqfgb",
        "AFiUserId": "testaurlx8wfimcrw",
        "balance": {
          "available": 10,
          "native": 10,
          "currency": "USD"
        },
        "dtsOpened": "Mon Jun 10 2024 07:37:54 GMT-0400
(Eastern Daylight Time)",
        "dtsUpdated": "Wed Jun 12 2024 08:47:17 GMT-0400
(Eastern Daylight Time)",
        "isActive": false,
        "isHidden": false,
        "name": "Main account",
        "num": "1000000123456789",
        "transactions": [
          {}
        ],
        "typeId": "Standard"
      },
      "transactions": [
        {
          "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": {}
        }
      ],
      "typeId": "Standard"
    }
  ],
  "nullable": false
}
sourceAccount Gets (returns) or sets the source account for the funds transfer. The source account must belong to the user. When setting a new source account, use TheM.fundsTransfer.sourceAccount = AFiAccountId, where AFiAccountId is the account ID in ampliFi of the desired source account. Optionally, the setter can also take an Account object value, like TheM.fundsTransfer.sourceAccount = TheM.accounts[0]. The getter will return the Account object that corresponds with the set AFiAccountId. The source account cannot be the same as the destination account. Yes {
  "title": "TheM.fundsTransfer.sourceAccount",
  "type": "object",
  "description": "Gets (returns) or sets the source
account for the funds transfer. The source account
must belong to the user. When setting a new source
account, use TheM.fundsTransfer.sourceAccount =
AFiAccountId, where AFiAccountId is the account ID
in ampliFi of the desired source account.
Optionally, the setter can also take an Account
object value, like
TheM.fundsTransfer.sourceAccount =
TheM.accounts[0]. The getter will return the
Account object that corresponds with the set
AFiAccountId. The source account cannot be the same
as the destination account.",
  "$comment": "getter setter",
  "examples": [
    {
      "AFiCardId": "testgalx8wfq4sqfgb",
      "backOfficeId": "connectFiBOIS",
      "backOfficeName": "connectFiBOIS",
      "currency": "USD",
      "isClosed": false,
      "lastDepositAmount": 0,
      "rn": "123456789",
      "status": "Card was issued but has not yet been
activated",
      "type": "Current",
      "AFiAccountId": "testgalx8wfq4sqfgb",
      "AFiUserId": "testaurlx8wfimcrw",
      "balance": {
        "available": 10,
        "currency": "USD",
        "native": 10,
        "toJSON": {
          "available": 10,
          "currency": "USD",
          "native": 10
        }
      },
      "card": {},
      "cards": [
        {}
      ],
      "dtsOpened": "Mon Jun 10 2024 07:37:54 GMT-0400
(Eastern Daylight Time)",
      "dtsUpdated": "Wed Jun 12 2024 12:06:30 GMT-0400
(Eastern Daylight Time)",
      "fullName": "Main account",
      "id": "testgalx8wfq4sqfgb",
      "isActive": false,
      "isHidden": false,
      "isMain": false,
      "name": "Main account",
      "num": "1000000123456789",
      "primaryUserAFiUserId": "testaurlx8wfimcrw",
      "toJSON": {
        "AFiAccountId": "testgalx8wfq4sqfgb",
        "AFiUserId": "testaurlx8wfimcrw",
        "balance": {
          "available": 10,
          "native": 10,
          "currency": "USD"
        },
        "dtsOpened": "Mon Jun 10 2024 07:37:54 GMT-0400
(Eastern Daylight Time)",
        "dtsUpdated": "Wed Jun 12 2024 08:47:17 GMT-0400
(Eastern Daylight Time)",
        "isActive": false,
        "isHidden": false,
        "name": "Main account",
        "num": "1000000123456789",
        "transactions": [
          {}
        ],
        "typeId": "Standard"
      },
      "transactions": [
        {
          "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": {}
        }
      ],
      "typeId": "Standard"
    }
  ],
  "nullable": false
}
comment Gets (returns) or sets a comment about the funds transfer. No {
  "title": "TheM.fundsTransfer.comment",
  "type": "string",
  "description": "Gets (returns) or sets a comment
about the funds transfer.",
  "$comment": "getter setter",
  "examples": [
    "Transfer between user's accounts"
  ],
  "nullable": true
}
narrative Gets (returns) or sets the narrative description (up to 128 characters) for this funds transfer. Note that you can specify a 'narrative' string or you can provide two separate 'narrativeSource' and 'narrativeDestination' strings for the source and destination accounts respectively. No {
  "title": "TheM.fundsTransfer.narrative",
  "type": "string",
  "description": "Gets (returns) or sets the
narrative description (up to 128 characters) for
this funds transfer. Note that you can specify a
'narrative' string or you can provide two separate
'narrativeSource' and 'narrativeDestination'
strings for the source and destination accounts
respectively.",
  "$comment": "getter setter",
  "examples": [
    "Account to account transfer"
  ]
}
narrativeSource Gets (returns) or sets the source account narrative description (up to 128 characters) for this funds transfer. Note that you can specify a 'narrative' string or you can provide two separate 'narrativeSource' and 'narrativeDestination' strings for the source and destination accounts respectively. No {
  "title":
"TheM.fundsTransfer.narrativeSource",
  "type": "string",
  "description": "Gets (returns) or sets the source
account narrative description (up to 128
characters) for this funds transfer. Note that you
can specify a 'narrative' string or you can provide
two separate 'narrativeSource' and
'narrativeDestination' strings for the source and
destination accounts respectively.",
  "$comment": "getter setter",
  "examples": [
    "Transfer from my Checking account"
  ]
}
narrativeDestination Gets (returns) or sets the destination account narrative description (up to 128 characters) for this funds transfer. Note that you can specify a 'narrative' string or you can provide two separate 'narrativeSource' and 'narrativeDestination' strings for the source and destination accounts respectively. No {
  "title":
"TheM.fundsTransfer.narrativeDestination",
  "type": "string",
  "description": "Gets (returns) or sets the
destination account narrative description (up to
128 characters) for this funds transfer. Note that
you can specify a 'narrative' string or you can
provide two separate 'narrativeSource' and
'narrativeDestination' strings for the source and
destination accounts respectively.",
  "$comment": "getter setter",
  "examples": [
    "Transfer to my Savings account"
  ]
}
transactionTypeId Gets (returns) the transaction type ID for the funds transfer. No {
  "title":
"TheM.fundsTransfer.transactionTypeId",
  "type": "string",
  "description": "Gets (returns) the transaction
type ID for the funds transfer.",
  "$comment": "getter",
  "examples": [
    "1"
  ],
  "default": "1"
}
validationMessage Gets (returns) a validation message if the funds transfer transaction (fundsTransfer entity) has invalid or missing properties. No {
  "title":
"TheM.fundsTransfer.validationMessage",
  "type": "string",
  "nullable": true,
  "description": "Gets (returns) a validation
message if the funds transfer transaction
(fundsTransfer entity) has invalid or missing
properties.",
  "$comment": "getter",
  "examples": [
    "Please, select the currency",
    "Wrong source account",
    "Wrong destination account",
    "Source and destination accounts can not be the
same",
    "Transaction is not allowed",
    "Source account does not have that much. Maximum
avalable is ${tempAmount1} ${_currency}"
  ],
  "default": " "
}
isReady Gets (returns) true if TheM.fundsTransfer is fully ready. Yes {
  "title": "TheM.fundsTransfer.isReady",
  "type": "boolean",
  "description": "Gets (returns) true if
TheM.fundsTransfer is fully ready.",
  "$comment": "getter",
  "examples": [
    true,
    false
  ],
  "default": false,
  "nullable": false
}
isValid Gets (returns) a promise that will resolve to true if all the data required for the funds transfer transaction is valid with current properties and transaction is ready to be submitted to the server. No {
  "title": "TheM.fundsTransfer.isValid",
  "type": "boolean",
  "description": "Gets (returns) a promise that will
resolve to true if all the data required for the funds
transfer transaction is valid with current
properties and transaction is ready to be submitted
to the server.",
  "$comment": "getter",
  "examples": [
    true,
    false
  ]
}

Methods

Method Name Parameter Descriptions Description Example
doAcc2Acc
[
{
"title": "given",
"type": "object",
"nullable": true,
"properties": {
"amount": {
"title": "amount",
"type": "number",
"nullable": true,
"example": 20.01
},
"currency": {
"title": "currency",
"type": "string",
"nullable": true,
"example": "USD"
},
"narrative": {
"title": "narrative",
"type": "string",
"nullable": true,
"example": "Transfer to account"
},
"sourceAccount": {
"title": "sourceAccount",
"type": "string",
"nullable": true,
"example": ""
},
"destinationAccount": {
"title": "destinationAccount",
"type": "string",
"nullable": true,
"example": ""
},
"comment": {
"title": "comment",
"type": "string",
"nullable": true,
"example": "A transfer between
user's accounts"
}
},
"example": {
"amount": 20.01,
"currency": "USD",
"narrative": "Transfer to
account",
"sourceAccount": "",
"destinationAccount": "",
"comment": "Transfer between
user's accounts"
}
}
]
If given object properties are present, this method will first check to make sure the given properties are equivalent to the corresponding TheM.fundsTransfer properties. The given object is not required and the TheM.fundsTransfer properties will be used as previously defined to make the transfer if all required properties have been set and are valid. This method calls the POST /transfer/acc2acc ampliFi endpoint to make the transfer. If successful, TheM.accounts will automatically be updated. TheM.fundsTransfer.doAcc2Acc(
  {
   "amount": 20.01,
   "currency": "USD",
   "narrative": "Transfer to account",
   "sourceAccount": "",
   "destinationAccount": "",
   "comment": "Transfer between user's accounts"
  }
);