Payment
EMV Core SDK Payment Management
The EMV Core SDK provides robust APIs for managing payment transactions. These APIs enable seamless integration of cashless payment functionality into applications, supporting both open- and closed-loop systems. The SDK ensures secure, efficient, and flexible payment handling while offloading complexities to the Nayax backend.
The methods available for payment management are:
The sections below describe them in more detail.
CancelTransaction
CancelTransactionThe CancelTransaction method stops the execution of an ongoing PayTransaction or PreAuthorize call. The system blocks further requests until the cancellation is accepted and confirmed.
Implementation Notes:
- Before Card Presentation: If a card has not been presented yet, the Reader poll sequence stops. The display will show "Cancelling"; the host application must then update the UI using the
ShowMessagecommand. - During Processing: If the card was already presented but processing is not finished, the system returns
CannotCancel. It may take a few seconds to receive theTransactionCompleteevent while the EMV Core waits for the online result. - After Completion: If the transaction is already finished, it returns
NoTransaction. - Undoing Success: To undo a completed transaction, use
VoidTransaction. - Declined Transactions: If
TransactionCompletereturns aDeclinestatus, there is no need to send aVoidTransactioncommand. - Events: In all scenarios, EMV Core will eventually send a
TransactionCompleteevent to finalize the state.
See the API Signature for the CancelTransaction method:
Request:
{"jsonrpc": "2.0", "method": "CancelTransaction", "id": 802}Response:
{"jsonrpc": "2.0", "result": true, "id": 802}If the card has already been presented and processed, the system will return a
CannotCancelerror.
ConfirmTransaction
ConfirmTransactionA confirmation request is the second stage of an authorization request. It is used to confirm the authorization obtained so that settlement can proceed.
API Signature
Response:
{
"jsonrpc": "2.0",
"method": "TransactionComplete",
"params": {
"status": "OK",
"errorCode": 0,
"errorDescription": "",
"transactionId": "6103587330",
"authorizationDetails": {
"AmountAuthorized": 4.5,
"AmountRequested": 4.5,
"AuthorizationCode": "AuthOK",
"PartialPan": "541333******4111",
"CardType": "MasterCard",
"IsTransactionApproved": true,
"eReceipt": "",
"Card_ID": "2025-11-25 14:35:39.140|6|3",
"Card_Balance": 0.0,
"RRN": "251125123539",
"TransactionDbID": "6103587330",
"Transaction_Referance": "6103587330",
"CardToken": "5VXkNqtUDJBxQj9p/qTGt74jWaPHlRs7xxWa1Yu0gDI=",
"Additional_Parameters": {
"SiteId": "6",
"EntryMode": "4",
"MachineAuTime": "2025-11-25T14:35:38.885",
"NayaxTransactionId": "6103587330"
}
}
},
"id": 701
}Request:
{"jsonrpc":"2.0","method":"ConfirmTransaction", "params": {"amount":450,
"fee":0, "productID":42, "transaction_Reference":"6103587330"}, "id":8}Response:
{"jsonrpc":"2.0", "result":true, "id":8}Parameters:
| Parameter | Description |
|---|---|
| id | Command ID. |
| amount | The actual amount to charge – in minor units (cents). |
| transactionReference | Transaction reference from the PSP. Use the TransactionDbID field from the TransactionComplete event. |
| productID | Optional parameter: ID of the product selected by the consumer. This number will be saved on the server and available for reports. |
| terminal_data | Optional parameter: terminal_data=(key1=value1,key2=value2). |
GetCardToken
GetCardTokenThe GetCardToken method initiates the card tokenization process, returning a card token without performing a financial transaction.
EMV Core waits for a card to be presented, reads the data, and triggers a CardTokenReceived event:
- Payment Cards: Returns a Base64 string containing the card token.
- CLP Cards (e.g., Mifare): Returns the card UID.
API Signature
Resquest:
{
"method": "GetCardToken",
"params": {
"continuous": false,
"timeout": 60
},
"id": 5820
}
Response:
{"jsonrpc": "2.0", "result": true, "id": 5820}Parameters:
| Parameter | Description |
|---|---|
| timeoutSeconds | Maximum number of seconds to wait. If no card arrives within this time – return Timeout status. Maximum value is 60 seconds. |
PreAuthorize
PreAuthorizeThis method initiates a pre-authorization transaction with a specified amount. It helps reserve funds without immediate settlement, for example, EV chargers reserve a maximum amount before actual usage. EMV Core will wait for a card to be presented to the reader, read it, and, if needed, process it with the payment service. It will then send the TransactionComplete event.
API Signature
Request:
{"jsonrpc":"2.0","method":"PreAuthorize", "params": {"amount":450,
"timeout":10, "fee":0, "productID":0, "continuous":false}, "id":801}
Response:
{"jsonrpc": "2.0", "result": true, "id": 801}
Parameters:
| Parameter | Description |
|---|---|
| amount | Amount to charge – in full units (Dollars, not cents). |
| fee | Deprecated – Not used. |
| currency | Taken from configuration since SDK v1.4. |
| productID | Optional parameter: ID of the product selected by the consumer. This number will be saved in the server and available for reports. |
| continuous | If continuous is true, then poll for card will start immediately after card transaction timeout and TransactionComplete event will be sent with status ‘PollContinuous’. |
| timeout | Maximum number of seconds to wait. If no card arrives within this time... |
Setting
productID ≠ 0indicates that the amount set inPreAuthorizeis final and will not change inConfirmTransaction. If the final amount is unknown at this stage, useproductID = 0inPreAuthorizeand set the actual product ID duringConfirmTransaction.
If the transaction is approved (the TransactionComplete event returns with status OK), the application must call the ConfirmTransaction or VoidTransaction methods to complete the workflow.
VoidTransaction
VoidTransactionThis request is used to void a transaction in two specific cases:
- Release Funds: The transaction was Pre-Authorized but not Confirmed. Voiding releases the reserved funds when the transaction will no longer occur.
- Reversal: The transaction was completed using
PayTransactionbut needs to be canceled.
API Signature
Request:
{"jsonrpc": "2.0", "method": "VoidTransaction", "params": {"transaction_Reference": "8453F02DFD33413EBA77334B696D5991"}, "id": 803}Response:
{"jsonrpc": "2.0", "result": true, "id": 803}Parameters:
| Parameter | Description |
|---|---|
| id | Command ID. |
| transactionReference | Transaction reference came from PSP with the TransactionComplete event. |
Updated 15 days ago