Skip to content

RemittanceValidationClass Reference

Constructor

An instance of the RemittanceValidationClass is automatically created when the remittance submodule is initialized in a TheM.doInit('remittance') call and can be referenced by using TheM.remittance.validator.

//Automatically created when the remittance submodule is initialized

Example

//TheM.remittance.validator
{
  2: {
    isValid: () => { /* */ },
    toJSON: () => { /* */ },
    typeName: 'Transfer within AmpliFi',
    validationMessage: ''
  },
  USA: {
    isValid: () => { /* */ },
    toJSON: () => { /* */ },
    typeName: 'Local funds transfer',
    validationMessage: ''
  },
  USA_wire: {
    isValid: () => { /* */ },
    toJSON: () => { /* */ },
    typeName: 'USA wire',
    validationMessage: ''
  },
  cheque: {
    isValid: () => { /* */ },
    toJSON: () => { /* */ },
    typeName: 'Cheque',
    validationMessage: ''
  },
  international: {
    isValid: () => { /* */ },
    toJSON: () => { /* */ },
    typeName: 'International transfer',
    validationMessage: ''
  },
  tocard: {
    isValid: () => { /* */ },
    toJSON: () => { /* */ },
    typeName: 'Tocard',
    validationMessage: ''
  },
  precheck: () => { /* */ },
  toJSON: () => { /* */ },
  typeName: () => { /* */ },
  validate: () => { /* */ }
}

Properties

Property table for RemittanceValidationClass

Property Description Required Schema
2 Gets (returns) an object that will allow the validation of transfers within ampliFi. Yes 2 object
USA Gets (returns) an object that will allow the validation of ACH remittance transfers. Yes USA object
USA_wire Gets (returns) an object that will allow the validation of wire remittance transfers. Yes USA_wire object
international Gets (returns) an object that will allow the validation of international transfers. Yes international object
cheque Gets (returns) an object that will allow the validation of paper checks. Yes cheque object
tocard Gets (returns) an object that will allow the validation of remittance transfers to cards. Yes tocard object

Property table for tocard object

Property Description Required Schema
isValid A method that accepts a Remittance object instance and returns a boolean indicating if the given Remittance is valid for transactionTypeId 'tocard'. Yes {
  "title":
"TheM.remittance.validator.tocard.isValid",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance and returns a boolean indicating if
the given Remittance is valid for
transactionTypeId 'tocard'.",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
toJSON A method that accepts a Remittance object instance, along with two additional optional fields: comment and labels. Returns a JSON formatted object that includes the AFiBeneficiaryId, amount, currency, narrativeDebit, narrativeCredit, sourceAccountId, and an extrasDebit object containing the comment and labels properties, if they were provided. Yes {
  "title":
"TheM.remittance.validator.tocard.toJSON",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance, along with two additional
optional fields: comment and labels. Returns a JSON
formatted object that includes the
AFiBeneficiaryId, amount, currency,
narrativeDebit, narrativeCredit,
sourceAccountId, and an extrasDebit object
containing the comment and labels properties, if
they were provided.",
  "examples": [
    {
      "AFiBeneficiaryId": "testpgbenlxuma31jlu",
      "amount": 10.01,
      "currency": "USD",
      "narrativeDebit": "Transfer to beneficiary",
      "narrativeCredit": "Transfer from beneficiary",
      "sourceAccountId": {},
      "extrasDebit": {
        "comment": "given.comment",
        "labels": "given.labels"
      }
    }
  ],
  "nullable": false
}
typeName Returns the typeName associated with transactionTypeId 'tocard'. Yes {
  "title":
"TheM.remittance.validator.tocard.typeName",
  "type": "string",
  "description": "Returns the typeName associated
with transactionTypeId 'tocard'.",
  "examples": [
    "Tocard"
  ],
  "default": "Tocard",
  "nullable": false
}
validationMessage Returns the validationMessage that results after TheM.remittance.validator.tocard.isValid('remittanceName') is called. No {
  "title":
"TheM.remittance.validator.tocard.validationM
essage",
  "type": "string",
  "description": "Returns the validationMessage
that results after
TheM.remittance.validator.tocard.isValid('rem
ittanceName') is called.",
  "examples": [
    "Select the account your want to transfer from",
    "Select the beneficiary you want to transfer to",
    "Select the currency",
    "The beneficiary has no address",
    "Type in the amount",
    "Can not transfer money from this account to this
beneficiary",
    "Amount exceeds the balance available on the source
account"
  ],
  "default": ""
}

Property table for cheque object

Property Description Required Schema
isValid A method that accepts a Remittance object instance and returns a boolean indicating if the given Remittance is valid for transactionTypeId 'cheque'. Yes {
  "title":
"TheM.remittance.validator.cheque.isValid",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance and returns a boolean indicating if
the given Remittance is valid for
transactionTypeId 'cheque'.",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
toJSON A method that accepts a Remittance object instance, along with two additional optional fields: comment and labels. Returns a JSON formatted object that includes the AFiBeneficiaryId, amount, currency, narrativeDebit, narrativeCredit, sourceAccountId, and an extrasDebit object containing the comment and labels properties, if they were provided. Yes {
  "title":
"TheM.remittance.validator.cheque.toJSON",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance, along with two additional
optional fields: comment and labels. Returns a JSON
formatted object that includes the
AFiBeneficiaryId, amount, currency,
narrativeDebit, narrativeCredit,
sourceAccountId, and an extrasDebit object
containing the comment and labels properties, if
they were provided.",
  "examples": [
    {
      "AFiBeneficiaryId": "testpgbenlxuma31jlu",
      "amount": 10.01,
      "currency": "USD",
      "narrativeDebit": "Transfer to beneficiary",
      "narrativeCredit": "Transfer from beneficiary",
      "sourceAccountId": {},
      "extrasDebit": {
        "comment": "given.comment",
        "labels": "given.labels"
      }
    }
  ],
  "nullable": false
}
typeName Returns the typeName associated with transactionTypeId 'cheque'. Yes {
  "title":
"TheM.remittance.validator.cheque.typeName",
  "type": "string",
  "description": "Returns the typeName associated
with transactionTypeId 'cheque'.",
  "examples": [
    "Cheque"
  ],
  "default": "Cheque",
  "nullable": false
}
validationMessage Returns the validationMessage that results after TheM.remittance.validator.cheque.isValid('remittanceName') is called. No {
  "title":
"TheM.remittance.validator.cheque.validationM
essage",
  "type": "string",
  "description": "Returns the validationMessage
that results after
TheM.remittance.validator.cheque.isValid('rem
ittanceName') is called.",
  "examples": [
    "Select the account your want to transfer from",
    "Select the beneficiary you want to transfer to",
    "Select the currency",
    "The beneficiary has no address",
    "Type in the amount",
    "Can not transfer money from this account to this
beneficiary",
    "Amount exceeds the balance available on the source
account"
  ],
  "default": ""
}

Property table for international object

Property Description Required Schema
isValid A method that accepts a Remittance object instance and returns a boolean indicating if the given Remittance is valid for transactionTypeId 'international'. Yes {
  "title":
"TheM.remittance.validator.international.isVa
lid",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance and returns a boolean indicating if
the given Remittance is valid for
transactionTypeId 'international'.",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
toJSON A method that accepts a Remittance object instance, along with two additional optional fields: comment and labels. Returns a JSON formatted object that includes the AFiBeneficiaryId, amount, currency, narrativeDebit, narrativeCredit, sourceAccountId, and an extrasDebit object containing the comment and labels properties, if they were provided. Yes {
  "title":
"TheM.remittance.validator.international.toJS
ON",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance, along with two additional
optional fields: comment and labels. Returns a JSON
formatted object that includes the
AFiBeneficiaryId, amount, currency,
narrativeDebit, narrativeCredit,
sourceAccountId, and an extrasDebit object
containing the comment and labels properties, if
they were provided.",
  "examples": [
    {
      "AFiBeneficiaryId": "testpgbenlxuma31jlu",
      "amount": 10.01,
      "currency": "USD",
      "narrativeDebit": "Transfer to beneficiary",
      "narrativeCredit": "Transfer from beneficiary",
      "sourceAccountId": {},
      "extrasDebit": {
        "comment": "given.comment",
        "labels": "given.labels"
      }
    }
  ],
  "nullable": false
}
typeName Returns the typeName associated with transactionTypeId 'international'. Yes {
  "title":
"TheM.remittance.validator.international.type
Name",
  "type": "string",
  "description": "Returns the typeName associated
with transactionTypeId 'international'.",
  "examples": [
    "International transfer"
  ],
  "default": "International transfer",
  "nullable": false
}
validationMessage Returns the validationMessage that results after TheM.remittance.validator.international.isValid('remittanceName') is called. No {
  "title":
"TheM.remittance.validator.international.vali
dationMessage",
  "type": "string",
  "description": "Returns the validationMessage
that results after
TheM.remittance.validator.international.isVal
id('remittanceName') is called.",
  "examples": [
    "Select the account your want to transfer from",
    "Select the beneficiary you want to transfer to",
    "Select the currency",
    "The beneficiary has no address",
    "Type in the amount",
    "Can not transfer money from this account to this
beneficiary",
    "Amount exceeds the balance available on the source
account"
  ],
  "default": ""
}

Property table for USA_wire object

Property Description Required Schema
isValid A method that accepts a Remittance object instance and returns a boolean indicating if the given Remittance is valid for transactionTypeId 'USA_wire'. Yes {
  "title":
"TheM.remittance.validator.USA_wire.isValid",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance and returns a boolean indicating if
the given Remittance is valid for
transactionTypeId 'USA_wire'.",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
toJSON A method that accepts a Remittance object instance, along with two additional optional fields: comment and labels. Returns a JSON formatted object that includes the AFiBeneficiaryId, amount, currency, narrativeDebit, narrativeCredit, sourceAccountId, and an extrasDebit object containing the comment and labels properties, if they were provided. Yes {
  "title":
"TheM.remittance.validator.USA_wire.toJSON",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance, along with two additional
optional fields: comment and labels. Returns a JSON
formatted object that includes the
AFiBeneficiaryId, amount, currency,
narrativeDebit, narrativeCredit,
sourceAccountId, and an extrasDebit object
containing the comment and labels properties, if
they were provided.",
  "examples": [
    {
      "AFiBeneficiaryId": "testpgbenlxuma31jlu",
      "amount": 10.01,
      "currency": "USD",
      "narrativeDebit": "Transfer to beneficiary",
      "narrativeCredit": "Transfer from beneficiary",
      "sourceAccountId": {},
      "extrasDebit": {
        "comment": "given.comment",
        "labels": "given.labels"
      }
    }
  ],
  "nullable": false
}
typeName Returns the typeName associated with transactionTypeId 'USA_wire'. Yes {
  "title":
"TheM.remittance.validator.USA_wire.typeName"
,
  "type": "string",
  "description": "Returns the typeName associated
with transactionTypeId 'USA_wire'.",
  "examples": [
    "USA wire"
  ],
  "default": "USA wire",
  "nullable": false
}
validationMessage Returns the validationMessage that results after TheM.remittance.validator.USA_wire.isValid('remittanceName') is called. No {
  "title":
"TheM.remittance.validator.USA_wire.validatio
nMessage",
  "type": "string",
  "description": "Returns the validationMessage
that results after
TheM.remittance.validator.USA_wire.isValid('r
emittanceName') is called.",
  "examples": [
    "Select the account your want to transfer from",
    "Select the beneficiary you want to transfer to",
    "Select the currency",
    "The beneficiary has no address",
    "Type in the amount",
    "Can not transfer money from this account to this
beneficiary",
    "Amount exceeds the balance available on the source
account"
  ],
  "default": ""
}

Property table for USA object

Property Description Required Schema
isValid A method that accepts a Remittance object instance and returns a boolean indicating if the given Remittance is valid for transactionTypeId 'USA'. Yes {
  "title":
"TheM.remittance.validator.USA.isValid",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance and returns a boolean indicating if
the given Remittance is valid for
transactionTypeId 'USA'.",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
toJSON A method that accepts a Remittance object instance, along with two additional optional fields: comment and labels. Returns a JSON formatted object that includes the AFiBeneficiaryId, amount, currency, narrativeDebit, narrativeCredit, sourceAccountId, and an extrasDebit object containing the comment and labels properties, if they were provided. Yes {
  "title":
"TheM.remittance.validator.USA.toJSON",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance, along with two additional
optional fields: comment and labels. Returns a JSON
formatted object that includes the
AFiBeneficiaryId, amount, currency,
narrativeDebit, narrativeCredit,
sourceAccountId, and an extrasDebit object
containing the comment and labels properties, if
they were provided.",
  "examples": [
    {
      "AFiBeneficiaryId": "testpgbenlxuma31jlu",
      "amount": 10.01,
      "currency": "USD",
      "narrativeDebit": "Transfer to beneficiary",
      "narrativeCredit": "Transfer from beneficiary",
      "sourceAccountId": {},
      "extrasDebit": {
        "comment": "given.comment",
        "labels": "given.labels"
      }
    }
  ],
  "nullable": false
}
typeName Returns the typeName associated with transactionTypeId 'USA'. Yes {
  "title":
"TheM.remittance.validator.USA.typeName",
  "type": "string",
  "description": "Returns the typeName associated
with transactionTypeId 'USA'.",
  "examples": [
    "Local funds transfer"
  ],
  "default": "Local funds transfer",
  "nullable": false
}
validationMessage Returns the validationMessage that results after TheM.remittance.validator.USA.isValid('remittanceName') is called. No {
  "title":
"TheM.remittance.validator.USA.validationMess
age",
  "type": "string",
  "description": "Returns the validationMessage
that results after
TheM.remittance.validator.USA.isValid('remitt
anceName') is called.",
  "examples": [
    "Select the account your want to transfer from",
    "Select the beneficiary you want to transfer to",
    "Select the currency",
    "The beneficiary has no address",
    "Type in the amount",
    "Can not transfer money from this account to this
beneficiary",
    "Amount exceeds the balance available on the source
account"
  ],
  "default": ""
}

Property table for 2 object

Property Description Required Schema
isValid A method that accepts a Remittance object instance and returns a boolean indicating if the given Remittance is valid for transactionTypeId '2'. Yes {
  "title":
"TheM.remittance.validator['2'].isValid",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance and returns a boolean indicating if
the given Remittance is valid for
transactionTypeId '2'.",
  "examples": [
    true,
    false
  ],
  "nullable": false
}
toJSON A method that accepts a Remittance object instance, along with two additional optional fields: comment and labels. Returns a JSON formatted object that includes the AFiBeneficiaryId, amount, currency, narrativeDebit, narrativeCredit, sourceAccountId, and an extrasDebit object containing the comment and labels properties, if they were provided. Yes {
  "title":
"TheM.remittance.validator['2'].toJSON",
  "type": "method",
  "description": "A method that accepts a Remittance
object instance, along with two additional
optional fields: comment and labels. Returns a JSON
formatted object that includes the
AFiBeneficiaryId, amount, currency,
narrativeDebit, narrativeCredit,
sourceAccountId, and an extrasDebit object
containing the comment and labels properties, if
they were provided.",
  "examples": [
    {
      "AFiBeneficiaryId": "testpgbenlxuma31jlu",
      "amount": 10.01,
      "currency": "USD",
      "narrativeDebit": "Transfer to beneficiary",
      "narrativeCredit": "Transfer from beneficiary",
      "sourceAccountId": {},
      "extrasDebit": {
        "comment": "given.comment",
        "labels": "given.labels"
      }
    }
  ],
  "nullable": false
}
typeName Returns the typeName associated with transactionTypeId '2'. Yes {
  "title":
"TheM.remittance.validator['2'].typeName",
  "type": "string",
  "description": "Returns the typeName associated
with transactionTypeId '2'.",
  "examples": [
    "Transfer within AmpliFi"
  ],
  "default": "Transfer within AmpliFi",
  "nullable": false
}
validationMessage Returns the validationMessage that results after TheM.remittance.validator['2'].isValid('remittanceName') is called. No {
  "title":
"TheM.remittance.validator['2'].validationMes
sage",
  "type": "string",
  "description": "Returns the validationMessage
that results after
TheM.remittance.validator['2'].isValid('remit
tanceName') is called.",
  "examples": [
    "Select the account your want to transfer from",
    "Select the beneficiary you want to transfer to",
    "Select the currency",
    "The beneficiary has no address",
    "Type in the amount",
    "Can not transfer money from this account to this
beneficiary",
    "Amount exceeds the balance available on the source
account"
  ],
  "default": ""
}

Methods

Method Name Parameter Descriptions Description Example
precheck
[
{
"title": "givenObject",
"type": "object",
"nullable": false,
"example": {
"AFiRemittanceId":
"jb17199168600718m6acjetf8ub0z
2ehhjfx9fv70c1oa3y73pmq5t8",
"amount": 10.01,
"beneficiary": {},
"currency": "USD",
"isValid": true,
"narrativeDebit": "Transfer to
beneficiary",
"other": {
"additionalProperty": "value of
additionalProperty"
},
"sourceAccount": {},
"transactionTypeId": "USA",
"validationMessage": ""
}
}
]
Takes a Remittance object instance for 'givenObject' and, if a precheck function is defined for the transactionTypeId of the givenObject, then it will perform the precheck function on the givenObject and return a boolean representing the precheck result and a validationMessage, if applicable. TheM.remittance.validator.precheck(
  {
   "AFiRemittanceId": "jb17199168600718m6acjetf8ub0z2ehhjfx9fv70c1oa3y73pmq5t8",
   "amount": 10.01,
   "beneficiary": {},
   "currency": "USD",
   "isValid": true,
   "narrativeDebit": "Transfer to beneficiary",
   "other": {
   "additionalProperty": "value of additionalProperty"
   },
   "sourceAccount": {},
   "transactionTypeId": "USA",
   "validationMessage": ""
  }
);
toJSON
[
{
"title": "givenObject",
"type": "object",
"nullable": false,
"example": {
"AFiRemittanceId":
"jb17199168600718m6acjetf8ub0z
2ehhjfx9fv70c1oa3y73pmq5t8",
"amount": 10.01,
"beneficiary": {},
"currency": "USD",
"isValid": true,
"narrativeDebit": "Transfer to
beneficiary",
"other": {
"additionalProperty": "value of
additionalProperty"
},
"sourceAccount": {},
"transactionTypeId": "USA",
"validationMessage": ""
}
}
]
Takes a Remittance object instance for 'givenObject' and calls the toJSON method defined for the applicable transactionTypeId of the Remittance object. TheM.remittance.validator.toJSON(
  {
   "AFiRemittanceId": "jb17199168600718m6acjetf8ub0z2ehhjfx9fv70c1oa3y73pmq5t8",
   "amount": 10.01,
   "beneficiary": {},
   "currency": "USD",
   "isValid": true,
   "narrativeDebit": "Transfer to beneficiary",
   "other": {
   "additionalProperty": "value of additionalProperty"
   },
   "sourceAccount": {},
   "transactionTypeId": "USA",
   "validationMessage": ""
  }
);
typeName
[
{
"title": "givenObject",
"type": "object",
"nullable": false,
"example": {
"AFiRemittanceId":
"jb17199168600718m6acjetf8ub0z
2ehhjfx9fv70c1oa3y73pmq5t8",
"amount": 10.01,
"beneficiary": {},
"currency": "USD",
"isValid": true,
"narrativeDebit": "Transfer to
beneficiary",
"other": {
"additionalProperty": "value of
additionalProperty"
},
"sourceAccount": {},
"transactionTypeId": "USA",
"validationMessage": ""
}
}
]
Takes a Remittance object instance for 'givenObject' and returns the typeName defined for the applicable transactionTypeId of the Remittance object. TheM.remittance.validator.typeName(
  {
   "AFiRemittanceId": "jb17199168600718m6acjetf8ub0z2ehhjfx9fv70c1oa3y73pmq5t8",
   "amount": 10.01,
   "beneficiary": {},
   "currency": "USD",
   "isValid": true,
   "narrativeDebit": "Transfer to beneficiary",
   "other": {
   "additionalProperty": "value of additionalProperty"
   },
   "sourceAccount": {},
   "transactionTypeId": "USA",
   "validationMessage": ""
  }
);
validate
[
{
"title": "givenObject",
"type": "object",
"nullable": false,
"example": {
"AFiRemittanceId":
"jb17199168600718m6acjetf8ub0z
2ehhjfx9fv70c1oa3y73pmq5t8",
"amount": 10.01,
"beneficiary": {},
"currency": "USD",
"isValid": true,
"narrativeDebit": "Transfer to
beneficiary",
"other": {
"additionalProperty": "value of
additionalProperty"
},
"sourceAccount": {},
"transactionTypeId": "USA",
"validationMessage": ""
}
}
]
Takes a Remittance object instance for 'givenObject' and calls the isValid method defined for the applicable transactionTypeId of the Remittance object. TheM.remittance.validator.validate(
  {
   "AFiRemittanceId": "jb17199168600718m6acjetf8ub0z2ehhjfx9fv70c1oa3y73pmq5t8",
   "amount": 10.01,
   "beneficiary": {},
   "currency": "USD",
   "isValid": true,
   "narrativeDebit": "Transfer to beneficiary",
   "other": {
   "additionalProperty": "value of additionalProperty"
   },
   "sourceAccount": {},
   "transactionTypeId": "USA",
   "validationMessage": ""
  }
);