Search

Are you looking for test card numbers?

Would you like to contact support?

Payment-method icon

Samsung Pay for API only

Accept Samsung Pay payments with your existing API-only integration.

Accept Samsung Pay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Before you begin

These instructions explain how to add Samsung Pay to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before you can accept Samsung Pay payments in an Android app, you'll need to:

  1. Make sure that you have set up your back end implementation for making API requests.
  2. Add Samsung Pay in your test Customer Area.
  3. Request for a CSR from Adyen.
  4. Sign up for a Samsung Pay Developer account.
  5. Set Adyen as your payment gateway.
  6. Integrate the Samsung Pay SDK.

Build your payment form for Samsung Pay

Check if the Samsung Pay app is available in the shopper's device, and then show Samsung Pay as an available payment method.

We provide logos for Samsung Pay which you can use on your payment form. For more information, refer to Downloading logos.

You can also submit a /paymentMethods request specifying:

In the response, you receive paymentMethod.type: samsungpay.

Make a payment

When the shopper selects to pay with Samsung Pay:

  1. Get the tokenized payment information from the Samsung Pay SDK. For more information, see Samsung Pay SDK Programming Guide under Resources.

  2. From your server, make a /payments request providing:

    • paymentMethod.type: samsungpay
    • samsungpay.token: The payload you received from the Samsung Pay SDK response.
    curl https://checkout-test.adyen.com/v51/payments \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
      "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
      "reference":"YOUR_ORDER_NUMBER",
      "amount":{
        "currency":"EUR",
        "value":1000
      },
      "paymentMethod":{
        "type":"samsungpay",
        "{hint:Payload from Samsung Pay SDK response}samsungpay.token{/hint}":"eyJyZXN1bHRDb2RlIjoiMC=..."
      }
    }'
    # Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen::Client.new
    adyen.api_key = "YOUR_X-API-KEY"
     
    response = adyen.checkout.payments({
      :amount => {
        :currency => "EUR",
        :value => 1000
      },
      :reference => "YOUR_ORDER_NUMBER",
      :paymentMethod => {
        :type => "samsungpay",
        :samsungpay.token => "eyJyZXN1bHRDb2RlIjoiMC=..."
      },
      :merchantAccount => "YOUR_MERCHANT_ACCOUNT"
    })
    // Set YOUR_X-API-KEY with the API key from the Customer Area.
    // Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments.
        Client client = new Client("YOUR_X-API-KEY", Environment.TEST);
        Checkout checkout = new Checkout(client);
    
        PaymentsRequest paymentsRequest = new PaymentsRequest();
    
        String merchantAccount = "YOUR_MERCHANT_ACCOUNT";
        paymentsRequest.setMerchantAccount(merchantAccount);
    
        Amount amount = new Amount();
        amount.setCurrency("EUR");
        amount.setValue(15000L);
        paymentsRequest.setAmount(amount);
    
        DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();
        paymentMethodDetails.setType("samsungpay");
        paymentsRequest.setPaymentMethod(paymentMethodDetails);
    
        paymentsRequest.putAdditionalDataItem("samsungpay.token","eyJyZXN1bHRDb2RlIjoiMC=...");
    
        paymentsRequest.setReference("YOUR_ORDER_NUMBER");
    
        PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    $client = new \Adyen\Client();
    $client->setXApiKey("YOUR_X-API-KEY");
    $service = new \Adyen\Service\Checkout($client);
    
    $params = array(
      "amount" => array(
        "currency" => "EUR",
        "value" => 1000
      ),
      "reference" => "YOUR_ORDER_NUMBER",
      "paymentMethod" => array(
        "type" => "samsungpay",
        "samsungpay.token" => "eyJyZXN1bHRDb2RlIjoiMC=..."
      ),
      "merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
    );
    $result = $service->payments($params);
    #Set your X-API-KEY with the API key from the Customer Area.
    adyen = Adyen.Adyen()
    adyen.client.xapikey = 'YOUR_X-API-KEY'
    
    result = adyen.checkout.payments({
       'amount': {
          'value': 1000,
          'currency': 'EUR'
       },
       'reference': 'YOUR_ORDER_NUMBER',
       'paymentMethod': {
          'type': 'samsungpay',
          'samsungpay.token' => 'eyJyZXN1bHRDb2RlIjoiMC=...'
       },
       'merchantAccount': 'YOUR_MERCHANT_ACCOUNT'
    })
    // Set your X-API-KEY with the API key from the Customer Area.
    var client = new Client ("YOUR_X-API-KEY", Environment.Test);
    var checkout = new Checkout(client);
    
    var amount = new Model.Checkout.Amount("EUR", 1000);
    var details = new Model.Checkout.DefaultPaymentMethodDetails{
      Type = "samsungpay"
    };
    var additionalData = new Model.Checkout.AdditionalData("samsungpay.token","eyJyZXN1bHRDb2RlIjoiMC=...")
    
    var paymentsRequest = new Model.Checkout.PaymentRequest
    {
      Reference = "YOUR_ORDER_NUMBER",
      Amount = amount,
      MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
      PaymentMethod = details,
      AdditionalData = additionalData
    };
    
    var paymentResponse = checkout.Payments(paymentsRequest);
    // Set your X-API-KEY with the API key from the Customer Area.
    const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
    const config = new Config();
    // Set your X-API-KEY with the API key from the Customer Area.
    config.apiKey = '[API_KEY]';
    config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]';
    const client = new Client({ config });
    client.setEnvironment("TEST");
    const checkout = new CheckoutAPI(client);
    checkout.payments({
        amount: { currency: "EUR", value: 1000 },
        paymentMethod: {
            type: 'samsungpay',
            samsungpay.token: 'eyJyZXN1bHRDb2RlIjoiMC=...'
        },
        reference: 'YOUR_ORDER_NUMBER',
        merchantAccount: config.merchantAccount
    }).then(res => res);

    The /payments response contains:

    • resultCode
    {
        "pspReference": "882573482151437A",
        "resultCode": "Authorised",
        "merchantReference": "YOUR_ORDER_NUMBER"
    }

Present the payment result

Use the resultCode that you received in the /payments response to present the payment result to your shopper.

The resultCode values you can receive for Samsung Pay are:

resultCode Description Action to take
Authorised The payment was successful. Inform the shopper that the payment has been successful.
Error There was an error when the payment was being processed. Inform the shopper that there was an error processing their payment. The response contains a refusalReason, indicating the cause of the error.
Refused The payment was refused by the shopper's bank. Ask the shopper to try the payment again using a different payment method.

Test and go live

Samsung Pay will provide guidelines for testing. For more information, go to Samsung Pay Developers, select Getting Started > Create Services.

You can check the status of a Samsung Pay test payment in your Customer Area > Transactions > Payments.

Before you can accept live Samsung Pay payments, you need to submit a request for Samsung Pay in your live Customer Area.

See also