Skip to main content
When you call paymentForm.init(...), Flex It allows you to capture three callback functions. The most important result for front responseCallback(response).
Here. responseCallback(response) as the main entrance of the result at front. The JSON That you get there reuses the same structure of API of Authorisation - ecommerce for the method of payment chosen within Flex.

Callbacks available

responseCallback

It runs when the process gets to a business result and gives you the JSON response.

trackingCallback

It runs for every flow event, as a method change, clicks or user advance within the form.

Failed

It runs after a technical error occurs during the load or performance of the component.

Example of implementation

How to interpret responseCallback

The field response.payment_method indicates what reference to PayIn you have to use to interpret the JSON response returned by Flex.
Do not use response.meta.status.code as an approved or refused payer. That code indicates only the result of the service processing or if the response was generated correctly. To validate the payment result, check response.transaction.state and confirms from backend with Consultation or Notificationswith the method of payment.
The object response following the contract of API from Authorisation with Card.If your flow uses Redirect or 3DS authentication outside the same screen, complete this reading with Considerations for Redirect methods.
trackingCallback and onErrorCallback for technical faults. No one replaces the business logic you have to build up about responseCallback and backend confirmation.

API of Authorisation - ecommerce

Main reference of the response contract that Flex Reuse responseCallback.

API Consultation

Valids from backend the final status of the operation before closing the order.

Notifications S2S

Use this channel if your integration also confirms backend results using notifications.