Validation

Error messages can be produced when incorrect data is passed to JS SDK methods

EventDescriptionApplicable Methods
fz.validation.errorClient-side validation errors occurred while calling fatzebra.js methods.verifyCard, renderPaymentsPage, checkout

Examples of validation errors include:

Required fields

Calling fz.renderPaymentsPage without specifying an amount like this:

fz.renderPaymentsPage({
  containerId: 'fz-paynow',
  version: 3,
  paymentIntent: {
    payment: {
      currency: "AUD",
      reference: "ABCD1234",
    }
  },
  verification: 'verification-hash-goes-here'
});

Will give you a validation error:

{
  errors: [
    "/paymentIntent/payment/amount is required",
    ...
  ],
  data: null
}

Data type invalid

Similarly, providing an invalid value for fields:

fz.renderPaymentsPage({
  containerId: 'fz-paynow',
  version: 3,
  paymentIntent: {
    payment: {
      amount: "100 dollarydoos",
      currency: "AUD",
      reference: "ABCD1234",
    }
  },
  verification: 'verification-hash-goes-here'
});

Will also produce a validation message:

{
  errors: [
    "/paymentIntent/payment/amount should be an integer",
    ...
  ],
  data: null
}