Skip to main content
The SDK provides a callback interface that delivers the transaction’s final status.
  • PaymentResultCallback for Android.
  • PaymentResult for iOS.
This page will explore these callbacks in more detail, explaining their result methods and data structures.

Payment Callback

See the code block below for an example of the callback interface.
It includes three callback methods to handle the payment result:
  • Successful Transaction (onPaymentComplete / .complete): This indicates that the payment process was completed, and the billing provider approved the transaction.
  • Transaction Failure (onPaymentFail / .fail): This signifies that the transaction failed due to an issue originating from the Drop-In UI or the billing provider’s side, but not a general SDK error.
  • General Error (onError / .error): This indicates that a more general error occurred during the transaction process, which might be related to the SDK’s internal state, network issues, or authentication problems.
By implementing these callback mechanisms, your application can provide a robust and user-friendly payment experience, responding dynamically to all possible transaction outcomes.

Result Data Structures

The callback will return a data structure containing information related to the payment, depending on its outcome. See the sections below.

PaymentCompleteData

The PaymentCompleteData data structure is received when a payment is successful and contains the following information:

PaymentFailData

The PaymentFailData data structure is received when a payment fails and contains the following information:

Error Types

The SDK provides several error types to help diagnose issues during a transaction. You can find them in the table below:

See Also

Initiate Payments

Call startPayment to launch a payment flow with the Nayax eCom SDK.

Drop-in UI

Display a pre-configured list of payment methods anywhere on your site.