Skip to main content

Payment Confirmation

In order to verify whether all fields are valid, either valid event handler can be used for each field or areAllFieldsValid() function can be called upon submission. Once the form is submitted, instance.pay() function has to be called (3DS verification will be handled as part of the payment confirmation flow). The function returns a promise. In case of a successfully processed payment, the promise resolves to a successful response:

{
"status": "PROCESSED"
}

In case there is an FX conversion that will be applied, FX conversion notification has to be shown to the payer. The promise resolves to:

{
"status": "FX_CONVERSION_NOTIFICATION",
"fxRate": "1.08201138",
"processingAmount": "46.21",
"processingCurrency": "EUR"
}

Here is an example FX conversion notification based on the above response:

FX conversion notification

After the payer is notified, pay function should be called with an additional argument:

instance.pay({
"fxConversionAccepted": true
});

In case of failure, the promise is rejected with an error response (see Exception Handling section for more details). Here is an example of payment confirmation:

instance.pay()
.then((paymentResponse) => { /* Handle successful payment */ })
.catch((errorResponse) => { /* Handle payment failure */ });