Event Listeners
Subscribe to events
Method
Behaviour
Subscribing to an event for lifecycle of window
const fz = new FatZebra({
username: "MerchantXYZ"
});
// Handle errors related to general errors. For example, client-side validations.
fz.on('fz.validation.error', function(event) {
// ...
});
// Handle errors related to payment processing. HPP only.
fz.on('fz.payment.error', function(event) {
// prompt error to customer
console.log('payment errors: ' + JSON.stringify(event.detail.errors));
});
// Handle successful payment processing. HPP only.
fz.on('fz.payment.success', function(event) {
console.log('payment data: ' + JSON.stringify(event.detail.data));
});Unsubscribing from an event
Subscribing to onOnce event
Last updated