Skip to main content
The startPayment method is the primary entry point for initiating a payment flow within your application using the Nayax eCom SDK. The method internally handles the calls to validateMerchant and initialize (the Nayax eCom API calls, not the SDK initialization). This means that you do not need to explicitly make these API calls before initiating a payment. The SDK will do the following:
  • Perform the necessary validateMerchant call to authenticate the transaction securely.
  • Execute the initialize call to set up the payment session with Nayax servers and the billing provider.
  • Trigger the Drop-In UI for the user to complete the payment.
This allows you to focus on providing the PaymentData and handling the payment results, while the SDK takes care of the communication and security protocols.

Payment Data

The startPayment method requires a PaymentData object that encapsulates all the necessary details for the transaction.
Key parameters include:
You generate both of these values yourself:
  • validationKey (Android) / validateMerchantTranId (iOS/Flutter) is the same field, named differently per platform. Pass a freshly generated UUID for every startPayment() call. The SDK uses it to authenticate the session with Nayax.
  • merchantRequestId is your own reference ID for the transaction. Nayax returns it in webhook notifications, so use a value that lets you match the webhook back to the correct order or record in your system.

Initiate a Sale Payment (Android)

The following example shows how to construct a PaymentData object for a standard sale transaction and pass it to startPayment():
Kotlin

See Also

Payment Callbacks

Handle the SDK’s payment result callbacks for Android and iOS.

Drop-in UI

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