Event

Description

Applicable Methods

fz.payment.success

Emitted when payment is processed successfully.

renderPaymentsPage

fz.payment.error

Emitted when a payment transaction failed.

renderPaymentsPage

fz.payment.success data payload

{
  "message": "Payment successful.",
  "data": {
    "transactionId": "40057-P-F7R7M9Q6",
    "responseCode": "00",
    "message": "Approved",
    "amount": 100,
    "currency": "AUD",
    "reference": "sgc99pycds20i97q",
    "cardNumber": "400000XXXXXX1091",
    "cardHolder": "XXX",
    "cardExpiry": "2023-12-31",
    "cardType": "VISA",
    "verification": "0aa8154b8cf0fe4168af0e3d0d752d10"
  }
}

It is recommended that you verify the returned data against the calculated verification (see below) before consumption.

fz.payment.error data payload

{
  "message": "Refer to Card Issuer",
  "data": {
    "transactionId": "40057-P-F7R7M9Q6",
    "responseCode": "05",
    "message": "Declined",
    "amount": 100,
    "currency": "AUD",
    "reference": "sgc99pycds20i97q",
    "cardNumber": "400000XXXXXX1091",
    "cardHolder": "XXX",
    "cardExpiry": "2023-12-31",
    "cardType": "VISA",
    "verification": "0aa8154b8cf0fe4168af0e3d0d752d10"
  }
}

Transaction Data

Attribute

Type

Description

transactionId

string

Payment transaction id

responseCode

string

message

string

amount

number

amount in subunit.
e.g. AUB $10.25 -> 1025

currency

string

currency code. e.g. AUD

reference

string

payment reference or invoice #.

cardNumber

string

masked card number

cardHolder

string

card holder name

cardExpiry

string

card expiry date.
yyyy-mm-dd

cardType

string

card type.
e.g. VISA, MasterCard, etc

verification

string

calculated verification hash.

Verification hash calculation

values = [transactionId]:[responseCode]:[message]:[amount]:[currency]:[reference]:[cardNumber]:[cardHolder]:[cardExpiry]:[cardType]

shared_secret =

verification = MD5(values, shared_secret)

For example:

values = "40057-P-F7R7M9Q6","00":"Declined": 100 :"AUD":"sgc99pycds20i97q":"400000XXXXXX1091":"XXX":"2023-12-31":"VISA":"0aa8154b8cf0fe4168af0e3d0d752d10"

shared_secret = "123"

verification = MD5(values, shared_secret)