Integrate POS with RS232
You can integrate POS with RS232 solution to initiate transactions from your Window/Linux computer.
Configure your OS
Perform the following steps to configure your Windows/Linux OS:
- Install Newland driver provided with the SDK kit.
- Connect N910 to windows/Linux machine.
- In app>settings, use the serial communication button to open/close the port.
- Create the transaction request data in JSON format as shown in the sample code snippet below.
{βamountβ:β1000β,β paymentTypeβ:βSaleβ,βmerchantRefNoβ:β1234567890β}
Initiate the transaction from OS
- Read the sent data from the Windows/Linux OS by using the
readData()
function as shown in the code snippet below.
PaymentInitialization paymentInitialization = new PaymentInitialization(MainActivity.this,
serialHandler); paymentInitialization.readData(DeviceCommunicationMode.SERIALCOMMUNICATION);
- After reading the data successfully, PayU POS SDK will prompt to insert/swipe/tap the card and enter the pin (if required), and completes the transaction.
- Once the transaction is completed, the response will be sent in JSON format.
Request parameters
Parameters | Description | Example |
---|---|---|
amountmandatory | String The transaction amount. | 2500 |
paymentTypemandatory | String The type of the transaction.Supported payment modes are as follows: Sale- For a sale transaction. EMI- For a EMI transaction. Void- For a void transaction. PreAuth- For a preAuth transaction. SaleComplete- For a preAuthComplete transaction. | Sale |
merchantRefNomandatory | String Merchant Invoice Reference Number or pass current date time stamp. [Max upto 40 characters ] | 123456 |
Watch Out!
Make sure you select the correct communication port else, the SDK will throw error, such as, Data read failed.
See shared response payload to learn about the relevant RESPONSE PARAMETERS.
Updated 2 months ago