Are you looking for test card numbers?

Would you like to contact support?

Point-of-sale icon

Make transactions

Add code to make transactions from your Android POS app using the Adyen POS Mobile SDK.

To enable the Adyen POS Mobile SDK for Android to handle payments, you need to add code to your Android POS app. This code starts a transaction with:

After you have added this code, payments take place as follows:

  1. Your Android POS app creates a Terminal API request that is serialized to JSON, or you receive the Terminal API payment request from your backend.
  2. You pass the Terminal API request to the Adyen POS Mobile SDK.
  3. The SDK checks if the session is still valid, and if necessary establishes a new session.
  4. The transaction starts on your mobile device. The SDK shows instructions for the customer on your mobile device.
  5. The SDK passes the Terminal API response to your POS app.

Handle a payment

In your Android POS app, add code for the following steps:

  1. If you create the Terminal API payment request in your POS app, use InPersonPayments.getInstallationId() as POIID in the MessageHeader of the payment request. (If you create the payment request in the backend, the backend uses the installationId from the /sessions response.)
  2. Create an instance of TransactionRequest using TransactionRequest.create(nexoRequest), and pass the Terminal API payment request from your POS app or backend.
    val transactionRequest = TransactionRequest.create(nexoRequest)
    For information on the structure of a Terminal API payment request, see Make a payment.
  3. Get a PaymentInterface from InPersonPayments.getPaymentInterface(paymentInterfaceType).
    Value Description
    CardReader Use the card reader.
    val paymentInterface = InPersonPayments.getPaymentInterface(CardReader)
  4. Register a listener for the PaymentResult and pass the transactionResponse to your POS app. This is the Terminal API payment response, including data you can use to generate a receipt.
    val paymentLauncher = InPersonPayments.registerForPaymentResult(this) {
        // handle transaction response here
        ...
    }
  5. Invoke InPersonPayments.performTransaction() with your transaction data, payment launcher, and authentication service.
    InPersonPayments.performTransaction(
               context = context,
               paymentInterface = paymentInterface,
               transactionRequest = transactionRequest,
               paymentLauncher = paymentLauncher,
               authenticationServiceClass = MyAuthenticationService::class.java,
           )
    The Adyen POS Mobile SDK checks for a session, starts the transaction, and shows screens on your mobile device to help the customer.

Handle a refund

There are two types of refund: referenced and unreferenced. The main difference is that a referenced refund is connected to the original payment, and an unreferenced refund isn't. That makes unreferenced refunds a bit riskier. For an overview of the differences, see Refund a payment.

Currently the Adyen POS Mobile SDK for Android supports unreferenced refunds. Support for referenced refunds will be added soon.

Refunds are usually processed asynchronously. The Terminal API response only confirms we received the request. To learn the outcome of a refund, you need to set up webhooks.

Handle an unreferenced refund

The Terminal API request for an unreferenced refund is a payment request with an additional parameter:

  • PaymentData.PaymentType: Refund

This means you can use the same code as for handling a payment. The only difference is the structure of the Terminal API payment request that you pass as the payload to the TransactionRequest.

For the structure of the Terminal API request, see Unreferenced refund.

Next steps