startPaymentmethod 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
validateMerchantcall to authenticate the transaction securely. - Execute the
initializecall 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.
PaymentData and handling the payment results, while the SDK takes care of the communication and security protocols.
Payment Data
ThestartPayment method requires a PaymentData object that encapsulates all the necessary details for the transaction.
| Parameter | Type | Description |
|---|---|---|
merchantTranId | String | A unique transaction identifier generated by the merchant’s system to track the request. |
actorId | String | The unique identifier for the actor/entity initiating the transaction. |
amount | Double (Android/iOS), or equivalent numeric type | The requested transaction amount in minor units (e.g., 15.00 for $15.00). |
currencyCode | String (Alpha-3 format, e.g., “USD”, “EUR”, “ILS”) | The currency of the transaction, adhering to ISO 4217 standards. |
countryCode | String (2 or 3 letters, e.g., “US”, “GB”, “IL”) | The country code where the cardholder is located, typically following ISO 3166. |
machineId | String | The Machine ID as defined and saved in the Nayax Backoffice, received as part of the onboarding process. |
requestType | Integer | Specifies the desired transaction type. Common values include: 0: Sale (Authorization + automatic Capture), 1: Auth (Authorization only), 2: Capture (for pre-authorized transactions). (Refer to the full API documentation for a comprehensive list ofrequestType values, including void, refund, incremental auth, etc.) |
sessionExpiration | String (ISO8601 format, e.g., "2023-11-23T12:25:28Z") (Optional) | The session expiry date. If not provided, the default is typically 1 hour. |
entryMode | Integer (Optional) | Indicates the cardholder entry mode (e.g., COF for Card On File, ECOM for E-Commerce, MIT for Merchant Initiated Transaction, CIT for Customer Initiated Transaction). Default is ECOM. |
tokenModel | Integer (Conditional) | If entryMode is COF, indicates the token model (e.g., subscription, top-up, Stored.card). Token Type Behavior: A token’s type (subscription/COF/top-up) is set during its initial creation and stored in our system. If a subsequent Charge Token request includes a different token type parameter, it is ignored. The system always uses the original token type from the initialization request, regardless of what is provided in later charge requests. |
showSaveCardConsent | Boolean (Conditional) | If entryMode is COF, determines whether the “Ask for Consent” question appears on the payment page for saving card details. Important: Cardholder approval is mandatory for a valid Nayax token. This parameter is strictly for credit card-only flows; if other payment methods are available, the transaction will be automatically declined. |
cardHolderInfo | Object containing cardHolderUniqIdand cardholderEmail (Optional) | Provides cardholder details, especially relevant for tokenized transactions. |