Skip to content

BeneficiaryToCard Reference

Constructor

The BeneficiaryToCard class extends the Beneficiary class and has all of the corresponding properties and methods, with the addition of the card properties specified in this documentation. See the Beneficiary Reference documentation for additional information on the base Beneficiary class.

const newBeneficiary = TheM.beneficiaries.newTempBeneficiary('tocard', {//beneficiary properties});
await newBeneficiary.doSubmit(givenProperties);

Example

const newBeneficiary = TheM.beneficiaries.newTempBeneficiary('tocard', {
  txnType: 'tocard',
  name: 'Card Payee',
  destinationPAN: '1234567890123456',
  expiryMM: '10',
  expiryYY: '26',
  destinationFirstName: 'John',
  destinationLastName: 'Doe',
  mobile: '5556667777',
  defaultAmount: 20,
  narrativeDebit: 'Card payment',
  isFavourite: true,
  address: {
    addressLine1: '123 Main Str.',
    addressLine2: 'Suite 456',
    city: 'Harrisburg',
    province: 'PA',
    state: 'PA',
    postalCode: '12345'
    countryCode: 'US'
  }
});
await newBeneficiary.doSubmit({});

Properties

Property table for BeneficiaryToCard

Property Description Required Schema
destinationPAN Gets (returns) the beneficiary's card PAN. Yes {
  "title":
"TheM.beneficiaries[0].destinationPAN",
  "type": "string",
  "description": "Gets (returns) the beneficiary's
card PAN.",
  "examples": [
    "1234567890123456"
  ],
  "nullable": false
}
cvv The beneficiary's card CVV. Yes {
  "title": "TheM.beneficiaries[0].cvv",
  "type": "string",
  "description": "The beneficiary's card CVV.",
  "examples": [
    "123"
  ],
  "nullable": false
}
expiryMM Gets (returns) the beneficiary's card expiration month in MM format. Yes {
  "title": "TheM.beneficiaries[0].expiryMM",
  "type": "string",
  "description": "Gets (returns) the beneficiary's
card expiration month in MM format.",
  "examples": [
    "07"
  ],
  "nullable": false
}
expiryYY Gets (returns) the beneficiary's card expiration year in YY format. Yes {
  "title": "TheM.beneficiaries[0].expiryYY",
  "type": "string",
  "description": "Gets (returns) the beneficiary's
card expiration year in YY format.",
  "examples": [
    "24"
  ],
  "nullable": false
}
destinationFirstName Gets (returns) the beneficiary's first name. Yes {
  "title":
"TheM.beneficiaries[0].destinationFirstName",
  "type": "string",
  "description": "Gets (returns) the beneficiary's
first name.",
  "examples": [
    "John"
  ],
  "nullable": false
}
destinationLastName Gets (returns) the beneficiary's last name. Yes {
  "title":
"TheM.beneficiaries[0].destinationLastName",
  "type": "string",
  "description": "Gets (returns) the beneficiary's
last name.",
  "examples": [
    "Doe"
  ],
  "nullable": false
}
mobile Gets (returns) the beneficiary's mobile number Yes {
  "title": "TheM.beneficiaries[0].mobile",
  "type": "string",
  "description": "Gets (returns) the beneficiary's
mobile number",
  "examples": [
    "5556667777"
  ],
  "nullable": false
}
type Gets (returns) the beneficiary account type. Yes {
  "title": "TheM.beneficiaries[0].type",
  "type": "string",
  "description": "Gets (returns) the beneficiary
account type.",
  "examples": [
    "CHECKING",
    "SAVINGS"
  ],
  "nullable": false
}
address Gets (returns) the beneficiary address. Yes address object
isValid Gets (returns) true if all the required beneficiary details are present and valid. For BeneficiaryToCard class instances, the transaction type (txnType) is 'tocard', representing a transfer to a card, and will require the following properties to be considered valid: name, destinationPAN, expiryMM, expiryYY, destinationFirstName, and destinationLastName. Yes {
  "title": "TheM.beneficiaries[0].isValid",
  "type": "boolean",
  "description": "Gets (returns) true if all the
required beneficiary details are present and
valid. For BeneficiaryToCard class instances, the
transaction type (txnType) is 'tocard',
representing a transfer to a card, and will require
the following properties to be considered valid:
name, destinationPAN, expiryMM, expiryYY,
destinationFirstName, and
destinationLastName.",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
toJSON Gets (returns) the beneficary properties in a JSON formatted object. Yes {
  "title": "TheM.beneficiaries[0].toJSON",
  "type": "object",
  "description": "Gets (returns) the beneficary
properties in a JSON formatted object.",
  "examples": [
    {
      "AFiBeneficiaryId": "testpgbenlxuma31jlu",
      "AFiPayeeId":
"3gzvss70aqhkjh0gcmwz6fr6eutmzmf8",
      "accountNumber": "1234567890123456",
      "routingNumber": "123456789",
      "bankName": "Citibank NA",
      "defaultAmount": 20,
      "destinationName": "Receiving account title",
      "isActive": true,
      "isBusiness": false,
      "isFavourite": true,
      "isHidden": false,
      "status": "Active",
      "type": "CHECKING",
      "imageBase64":
"Very_Long_Base64_Image_String",
      "dtsCreated": "2024-07-01T13:51:32.218Z",
      "name": "To Card Payee",
      "txnType": "tocard",
      "destinationPAN": "1234567890123456",
      "expiryMM": "07",
      "expiryYY": "24",
      "destinationFirstName": "John",
      "destinationLastName": "Doe",
      "narrativeDebit": "Card payment",
      "mobile": "5556667777",
      "address": {
        "addressLine1": "123 Main Str.",
        "addressLine2": "Suite 456",
        "city": "Harrisburg",
        "province": "PA",
        "state": "PA",
        "countryCode": "US",
        "postalCode": "12345"
      }
    }
  ],
  "nullable": false
}

Property table for address object

Property Description Required Schema
addressLine1 Gets (returns) or sets the beneficiary address line 1. Yes {
  "title":
"TheM.beneficiaries[0].address.addressLine1",
  "type": "string",
  "description": "Gets (returns) or sets the
beneficiary address line 1.",
  "examples": [
    "123 Main Str."
  ],
  "nullable": false
}
addressLine2 Gets (returns) or sets the beneficiary address line 2. No {
  "title":
"TheM.beneficiaries[0].address.addressLine2",
  "type": "string",
  "description": "Gets (returns) or sets the
beneficiary address line 2.",
  "examples": [
    "Suite 456"
  ],
  "nullable": true
}
city Gets (returns) or sets the beneficiary city. Yes {
  "title":
"TheM.beneficiaries[0].address.city",
  "type": "string",
  "description": "Gets (returns) or sets the
beneficiary city.",
  "examples": [
    "Harrisburg"
  ],
  "nullable": false
}
province Gets (returns) or sets the beneficiary province or state. Yes {
  "title":
"TheM.beneficiaries[0].address.province",
  "type": "string",
  "description": "Gets (returns) or sets the
beneficiary province or state.",
  "examples": [
    "PA"
  ],
  "nullable": false
}
state Gets (returns) or sets the beneficiary province or state. No {
  "title":
"TheM.beneficiaries[0].address.state",
  "type": "string",
  "description": "Gets (returns) or sets the
beneficiary province or state.",
  "examples": [
    "PA"
  ],
  "nullable": true
}
countryCode Gets (returns) or sets the beneficiary countryCode. No {
  "title":
"TheM.beneficiaries[0].address.countryCode",
  "type": "string",
  "description": "Gets (returns) or sets the
beneficiary countryCode.",
  "examples": [
    "US"
  ],
  "nullable": true
}
postalCode Gets (returns) or sets the beneficiary postalCode. Yes {
  "title":
"TheM.beneficiaries[0].address.postalCode",
  "type": "string",
  "description": "Gets (returns) or sets the
beneficiary postalCode.",
  "examples": [
    "12345"
  ],
  "nullable": false
}