The Samsung Pay SDK for Android is designed exclusively for Samsung mobile devices that:
Support Samsung Pay.
Run Android Lollipop 5.1 (Android API level 22) or later.
If you are implementing the card transactions use case (managing customer's in-app payments through Samsung Pay), the Android 6.0 (M) (Android API level 23) or later is required. You need to check the device's Android version and hide the Samsung Pay button if the device version is too low:
Merchant apps using the Samsung Pay SDK for Android version 1.5 must use the getSamsungPayStatus() method. If a device is running Android Lollipop 5.1 (Android API level 22) or earlier, the method returns the SPAY_NOT SUPPORTED status code.
Merchant apps using the Samsung Pay SDK for Android version 1.4 or earlier (not recommended) must manually check the Android OS version running their app.
import android.os.Build;
// In-App payment supported on Android M or above
// Check Android version of the device
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
// Hide Samsung Pay button
}
Add the Samsung Pay SDK for Android to your project
To use the Samsung Pay SDK for Android:
If you do not have one set up already, download and install the IDE of your choice.
Starting from the Samsung Pay SDK for Android version 1.4, enhanced version control management improves backward compatibility and handles API dependency based on country and service type. For example, if you integrate the latest SDK ― for example, version 2.22 ― but continue to only use APIs based on version 1.4, your app remains compatible with the Samsung Wallet apps supporting version 1.4 without needing to upgrade the Samsung Wallet app.
The enhanced version control works as follows:
Every API starting from the Samsung Pay SDK for Android version 1.4 has an API level assigned to it, reflecting the SDK version. Set this level in the metadata section of your app’s AndroidManifest.xml file.
You can filter the Samsung Pay SDK for Android’s Javadoc reference by API level to determine your app's minimum API level based on the SDK features you are using. The minimum possible API level is 1.4.
Setting the minimum API level in your AndroidManifest.xml file allows your app to use the defined API level without having to trigger an upgrade of the Samsung Wallet app on the customer’s device.
To set the minimum API level, implement the following code snippet in your AndroidManifest.xml file:
<application>
...
<meta-data
android:name="spay_sdk_api_level"
android:value="2.22" /> // Most recent SDK version is recommended as the API level to leverage the latest APIs, but for Russia, 2.17 needs to be set instead
...
</application>
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
developer.samsung.com, .samsung.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
Samsung Electronics
.samsung.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.