SDK Programming Guide
  • Setting up your development environment
  • Android Studio is the recommended integrated development environment (IDE) because it offers some of the fastest tools available for building apps, including the IntelliJ code editor and a flexible Gradle-based build system.

  • 2.1 System requirements
  • The Samsung Pay SDK is designed exclusively for Samsung mobile devices supporting Samsung Pay and running Android Lollipop 5.1 (Android API level 22) or later versions of the Android OS.
  • For In-App Payments, the Samsung Pay SDK requires Android 6.0 (M) (Android API level 23) or later versions of the Android OS.
    • Note
    • As of SDK version 1.5, if the device has Android Lollipop 5.1 (Android API level 22) or earlier versions, the getSamsungPayStatus() API method returns an SPAY_NOT SUPPORTED status code. Merchant apps still using SDK 1.4 or earlier must check the Android version running their app.
  • The following snippet can be used to determine the OS version running on a device and whether or not to display the Samsung Pay button in the partner app.
  • Import android.os.Build;
    // In-App payment supported on Android M or above for Stripe merchants
    // Check Android version of the device
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
    	// Hide Samsung Pay button
    }
    
  • 2.2 Prerequisites
  • The following actions must be taken before using the Samsung Pay SDK:
    1. If not already part of your environment, download and install the IDE.
    2. Download the Samsung Pay SDK from the Samsung Pay Developers portal.
      The SDK package comes with the following directory structure:
      Folder Contents
      Docs Javadoc – API reference documentation
      Libs samsungpay.jar – SDK Java Archive file; contains the Samsung Pay APIs that will be used the partner app
      Samples Sample apps
    3. Configure your IDE to integrate the Samsung Pay SDK with the partner app.
      1. a)  Add the samsungpay.jar to the libs folder of your Android project.
      2. b)  Go to Gradle Scripts > build.gradle and enter these dependencies:
        dependencies {
            compile files('libs/samsungpay.jar')
        }
        
      3. c)  Import the package into your code.
        import com.samsung.android.sdk.samsungpay.v2;