SDK Programming Guide
  • 5. Understanding the Debug API key and API level
  • The Debug API key is generated by the Samsung Pay Developers portal for partner app testing and debugging. The API level is used for SDK-API version control validation and management (backward compatibility).
  • 5.1 Debug API key attributes
  • The Debug API key is used for verifying a validated partner app that uses the Samsung Pay SDK to interact with the Samsung Pay app. To get a Debug API key, partners must register a new service on the Samsung Pay Developers portal. The portal then generates a Debug API key, which must be added in the manifest file.
  • The chief characteristics and properties of the Debug API key include:
    • Valid for 3 months; may be changed at Samsung’s discretion.
    • Key value may be revoked by Samsung for unresolved issues in a partner app
    • Partners can request an additional Debug API key after 90 days
    • The number of devices using the key is unlimited. However, a partner is limited to ten Samsung Accounts for testing leading to Samsung certification
    • Partners need to safeguard their spay_debug_api_key and service ID, and should not display these values in debug logs.
  • 5.2 API level attributes
  • As of SDK version 1.4, enahnced version control management has been introduced to improve backward compatibility and handle API dependency from country and Service Type. For example, if a partner integrates the latest SDK―for instance, API level 2.0 but continues to use APIs based in level 1.4―the partner app remains compatible with Samsung Pay apps supporting API level 1.4 without the necessity of upgrading the Samsung Pay app.
  • The chief characteristics and properties of the API level include:
    • Every API starting from version 1.4 will have an API level assigned
    • Javadoc provides filter by API level feature. Partners can filter available classes and APIs and define their API level when integrating Samsung Pay SDK
    • Partners need to define API level version in the metadata of the app’s AndroidManifest file. Minimum possible version is 1.4
    • Partners will be able to use the API level version defined in AndroidManifest without having to upgrade app.
  • 5.3 Using the API key and API level
  • The debug_mode and spay_sdk_api_level custom tags are mandatory for both debug mode and release mode apps.
  • As of API level 1.4, partners must define the API level version in the AndroidManifest file. Minimum possible version is 1.4.
  • 5.3.1 Debug mode
  • As shown in the snippet below, each partner app must include its API key in its manifest file with a custom tag. This allows the partner app AndroidManifest file to provide debug_mode, spay_debug_api_key and spay_sdk_api_level values as metadata.
    • Important
    • Place <meta-data> tags inside the <application> tag.
  • <application
       ......
        <meta-data
            android:name="debug_mode"
            android:value="Y" />
        <meta-data
            android:name="spay_debug_api_key"
            android:value="asdfggkndkeie17283094858" />
    
        <meta-data
            android:name="spay_sdk_api_level"
            android:value="1.8" />
        ......
    </application>
    
  • 5.3.2 Release mode
  • Shown the next snippet to validate a partner app in release mode, debug_mode tag must be set to false and spay_sdk_api_level must be specified in the metadata of the app’s AndroidManifest file.
    • Important
    • Place <meta-data> tags inside the <application> tag.
  • <application
       ......
        <meta-data
            android:name="debug_mode"
            android:value="N" />
    
        <meta-data
            android:name="spay_sdk_api_level"
            android:value="1.8" />
        ......
    </application>