Get Started
Follow these steps to set up Samsung Pay with .
Set up REST Compliant Communications
Set up your payment processing system to be REST compliant. If you have not set up secure communications between your client and server using either JSON Web Token (JWT) or HTTP signature messaging, see Getting Started with REST.
Register with Samsung Pay
Create a profile by completing the merchant application on the Samsung Pay Partner Portal.
After your merchant application is approved, you receive a unique partner ID. Include this ID in your application.
Using the Samsung Pay Partner Portal, upload the CSR file.
Enter an application name and a package name. When you associate the CSR file with the application, Samsung generates a product ID.
Create login details for application developers on the Samsung Pay Partner Portal.
Download and integrate the Samsung Pay SDK into your application.
The SDK contains:
- A Javadoc
- The Samsung Pay SDK files samsungpay.jar and sdk-v1.0.0.jar
- A sample app
- The branding guide
- Image files
Register a Samsung account ID and request a debug-api-key file using the Samsung Pay Partner Portal. The Samsung account ID, the debug-api-key, and the product ID are used to validate your application so that you can use the Samsung Pay SDK for testing.
Submit your application for approval using the Samsung Pay Partner Portal. Upload the final version of the Android Application Package (APK) file using the Samsung Pay Partner Portal, and include screenshots of your checkout page displaying the Samsung Pay logo.
Register with Cybersource
Log in to the to create your Certificate Signing Request (CSR) files.
- Create a CSR file for test transactions: Business Center Test
- Create a CSR file for production transactions: Business Center Production
- Create a CSR file for test transactions: Test
- Create a CSR file for production transactions: Production
- Create a CSR file for test transactions: Test
- Create a CSR file for production transactions: Production
Create a CSR file for test transactions:
Create a CSR file for production transactions:
After logging in, complete these steps:
On the left navigation pane, click the Payment Configuration icon.
Click Digital Payment Solutions. The Digital Payments page opens.
Click Configure. The Samsung Pay Registration panel opens.
Enter your Samsung partner ID.
Click Generate New CSR.
To download your CSR, click the Download icon next to the key.
Follow your browser's instructions to save and open the file.
Complete the enrollment process by submitting your CSR to Samsung.
Create a Samsung Pay Project
You use Android Studio to create a new Android Studio project, which is required to integrate the Samsung SDK.
Download Android Studio from https://developer.android.com/studio/index.html.
Open Android Studio and click Start a new Android Studio project.
In the New Project settings menu, enter the name of your application and the company domain.
To change the package name, click Edit. By default, Android Studio sets the last element of the project's package name to the name of your application.
Click Next.
In the Target Android Devices settings menu, choose the required API levels.
Click Next.
Choose the required activity and click Finish.
Integrate the Samsung Pay SDK
Add the samsungpay.jar and sdk-v1.0.0.jar files to the libs folder of your Android project.
Choose Gradle Scripts > build.gradle and enter these dependencies:
dependencies { compile files('libs/samsungpay.jar') compile files('libs/sdk-v1.0.0.jar')}- Import the package:
import com.samsung.android.sdk.samsungpay.*; Use Your API Key
The API key is used to verify that your app (in debug mode or release mode) can use the Samsung Pay SDK APIs with the Samsung Pay application. To get the API key, you must create a debug-api-key file and include it in the manifest file.
To use the API key, include it in the manifest file with a custom tag. This enables the merchant app android manifest file to provide the DebugMode, spay_debug_api_key values as metadata.
<meta-data android:name="debug_mode" android:value="Y" /><meta-data android:name="spay_debug_api_key" android:value="asdfggkndkeie17283094858" /><meta-data android:name="debug_mode" android:value="N" />Initialize Samsung Pay in Your App
You must initialize the SSamsungPay class to verify that your application is eligible for Samsung Pay and to display the Samsung Pay button to the customer (refer to branding guidelines).
The SSamsungPay class provides these API methods:
initialize()—initializes the Samsung Pay SDK and verifies eligibility for Samsung Pay, including the device, software, and business area.getVersionCode()—retrieves the version number of the Samsung Pay SDK as an integer.getVersionName()—retrieves the version name of the Samsung Pay SDK as a string.
After the initialize() API method request is successful, display the Samsung Pay button to the customer.
If the initialize() API method request fails, the method displays one of these errors:
SsdkUnsupportedException—the device is not a Samsung device or does not support the Samsung Pay package.NullPointerException—the context passed is null.
SSamsungPay spay = new SSamsungPay();try { spay.initialize(mContext);} catch (SsdkUnsupportedException e1) { e1.printStackTrace(); pay_button.setVisibility(View.INVISIBLE);}Initiate a Payment
You are required to use a specific transaction request structure and required fields to initiate a payment.
These fields are required for initiating a payment; include these fields in the PaymentInfo class:
| Field | Description |
|---|---|
| Merchant Name | The merchant name as it appears on the payment sheet of Samsung Pay and the customer's bank statement. |
| Amount | — |
| Payment Protocol | 3-D Secure. |
| Permitted Card Brands | Specify the card brands that are supported such as American Express, JCB, Mastercard, or Visa. |
| Merchant ID | — |
| Order Number | — |
| Shipping Address | This field is required if SEND_SHIPPING or NEED_BILLING_AND_SEND_SHIPPING is set for AddressVisibilityOption. |
| Address Visibility Option | — |
| Card Holder Name | — |
| Recurring Option | — |
private PaymentInfo makeTransactionDetails() {// Supported card brandsArrayList<CardInfo.Brand> brandList = new ArrayList<CardInfo.Brand>();if (visaBrand.isChecked())brandList.add(CardInfo.Brand.VISA);if (mcBrand.isChecked())brandList.add(CardInfo.Brand.Mastercard);if (amexBrand.isChecked())brandList.add(CardInfo.Brand.AMERICANEXPRESS);// Basic payment informationPaymentInfo paymentReq = new PaymentInfo.Builder().setMerchantId("merchantID").setMerchantName("Test").setAmount(getAmount()).setShippingAddress(getShippingAddressInfo()).setOrderNumber(orderNoView.getText().toString()).setPaymentProtocol(PaymentProtocol.PROTOCOL_3DS).setAddressInPaymentSheet(AddressInPaymentSheet.DO_NOT_SHOW).setAllowedCardBrands(brandList) .setRecurringEnabled(isRecurring).setCardHolderNameEnabled(isCardHolderNameRequired).build();return paymentReq;}// Add shipping address detailsprivate Address getShippingAddressInfo() {Address address = new Address.Builder().setAddressee(name.getText().toString()).setAddressLine1(addLine1.getText().toString()).setAddressLine2(addline2.getText().toString()).setCity(city.getText().toString()).setState(state.getText().toString()).setCountryCode(country.getSelectedItem().toString()).setPostalCode(zip.getText().toString()).build(); return address;}// Add amount details private Amount getAmount() {Amount amount = new Amount.Builder().setCurrencyCode(currencyType.getSelectedItem().toString()).setItemTotalPrice(productPrice.getText().toString()).setShippingPrice(shippingPrice.getText().toString()).setTax(taxPrice.getText().toString()).setTotalPrice(totalAmount.getText().toString()).build();return amount;}Request Payment from Samsung Pay
Use the
startSamsungPay()API method in thePaymentManagerclass. ThePaymentManagerclass includes these API methods:startSamsungPay()—requests to initiate payment with Samsung Pay.updateAmount()—updates the transaction amount if shipping address or card information is updated by Samsung Pay.updateAmountFailed()—returns an error code when the new amount cannot be updated because of a wrong address.
Request the
startSamsungPay()API method and include this data:PaymentInfo—contains payment information.PID—the product ID created in the Samsung Pay Partner Portal.StatusListener—the result of the payment request is delivered toStatusListener. This listener should be registered before you call thestartSamsungPay()API method.
When you request the
startSamsungPay()API method, the Samsung Pay online payment sheet is displayed on your application. The customer selects a registered card for payment and can also update the billing and shipping address.The payment reply is delivered as one of these events to
StatusListener:onSuccess()—this event is requested when Samsung Pay confirms the payment. It includesencryptedPaymentCredentialinJSONformat:- method: Payment protocol: 3-D Secure.
- merchant_ref: Merchant reference code.
- billing_address.street: Number, street name.
- billing_address.state_province: Two-letter state code.
- billing_address.zip_postal_code: Five-character zip code.
- billing_address.city: City name.
- billing_address.county: Two-letter country code.
- 3ds.type:
Sfor Samsung Pay. Encrypted. - 3ds.version: Current version
100. Encrypted. - 3ds.data: Base64-encoded payment data. Encrypted.
Refer to the Samsung Pay developer website for information on how to decrypt the encrypted payment credential.
onFailure()—this event is requested when the transaction fails. It returns an error code and error message.
public void onPayButtonClicked(View v) { // Call startSamsungPay() method of PaymentManager class. // To create a transaction request, see makeTransactionDetails() in the // "Transaction Request Structure" example above. try { mPaymentManager.startSamsungPay(makeTransactionDetails(), "YOUR_PRODUCT_ID", mStatusListener); } catch (NullPointerException e) { e.printStackTrace(); }}private PaymentManager.StatusListener mStatusListener = newPaymentManager.StatusListener() { @Override public void onFailure(int errCode, String msg) { Log.d(TAG, "onFailed: " + msg); } @Override public void onSuccess(PaymentInfo arg0, String result) { Log.d(TAG, "onSuccess"); }};Next Steps
After completing the Samsung Pay setup, proceed to:
- Authorizations: Decryption or Authorizations: Merchant Decryption — submit an authorization request using the payment credential received from Samsung Pay.
Thanks for your feedback!
Last published: September 29, 2026