A standalone kit for handling SamsungPay
Screen.Recording.2023-10-23.at.1.50.41.PM.mov
To use the SDK the following requirements must be met:
- Android Studio 2022.3.1 or newer
- Android SDK Tools 33 or newer
- Android Platform Version: API 33: Android 13 revision 7 or later
- **Android targetSdkVersion: 33
JitPack is a novel package repository for JVM and Android projects. It builds Git projects on demand and provides you with ready-to-use artifacts (jar, aar).
To integrate TapSamsungPaySDK into your project add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}Step 2. Add the dependency
dependencies {
implementation 'com.github.Tap-Payments:TapSamsungPayKit:0.0.'
}You can always use the example keys within our example app, but we do recommend you to head to our onboarding page. You will need to register your package name to get your Tap Key that you will need to activate our TapSamsungPaySDK.
For those, who would like to use PayButton.
- Place PayButton.
- Assign its TapDataConfiguration and TapSamsungPayDelegate.
- Implement TapDataConfiguration and TapSamsungPayDelegate.
-
Ask for the CSR from Tap team.
-
From your SamsungPay Developer account: a. Go to ServiceManagement

b. Click on create Service , fill up the details

c. Once everything is done service will appear as below

d. Now you will find the service id generated use this to pass to the TapSDK

First of all, TapSamsungPaySDK should be set up. To set it up, add the following lines of code somewhere in your project and make sure they will be called before any usage of TapSamsungPaySDK.
Below is the list of properties in tapGooglePaySDK class you can manipulate. Make sure you do the setup before any usage of the SDK.
Kotlin: Here we need to make a Top level declaration
private lateinit var tapConfiguration: TapConfigurationTapSamsungPaySDK should be set up. To set it up, add the following lines of code somewhere in your project and make sure they will be called before any usage of tapGoooglePaySDK.
Kotlin:
/**
* Required step.
* Configure SDK with your choice from the given list.
*/
private fun initConfigurations() {
tapConfiguration =
TapConfiguration.Builder()
.setOperator(
Operator.Builder()
.setPublicKey("pk_test_XXXXXXXXXX")
.setHashString("XXXXXXX")
.build()
)
.setMerchant(
Merchant.Builder().setId("Merchant Id associated with Tap ")
.setGatwayId("tappayments").build())
.setOrders(
OrderDetail.Builder().setAmount( "0.2".toDouble()).setCurrency( "USD")//**Required**//
.setShipping(Shipping("tester"), "0.1").toDouble().setTax(Tax( "test"), "0.1".toDouble()) //Optional
.setOrderNumber( "AMZ333") //**Optional**//
.build()
)
.setScope(Scope.SAMSUNG_TOKEN or Scope.TAP_TOKEN)
Acceptance(
supportedSchemes = mutableListOf(SupportedSchemes.VISA.name,SupportedSchemes.MASTERCARD.name,SupportedSchemes.AMERICAN_EXPRESS.name),
)
.setTapCustomer(getTapCustomer()) //**Required**//
.setTapInterface(
TapInterface(
Language.EN.name,
Edges.curved,
ThemeMode.DARK, ColorStyle.colored.name)
) //Optional
.setPackageName("Package Id registered with samsungpay")//**Required**//
.setServiceId("Service id generated from samsungpay portal")//**Required**//
.build()
}
Pass the above data to TapConfigurations as below:
TapConfiguration.configureSamsungPayWithTapConfiguration(tapConfiguration, this)TapConfiguration is the main interface for library from you application
| Property | Type | Description |
|---|---|---|
| tapSamsungPayDelegate | Activity | Activity. it is used to notify Merchant application with all SDK Events |
| Property | Type |
|---|---|
| setCurrency | Set the transaction currency associated to your account. currency must be of type TapCurrency("currency_iso_code"). i.e new TapCurrency("USD") |
| setOrders | Set details related to transaction the amount currency , shipping , taxes etc |
| setGatewayId | Gateway id required to use TAP as PSP . Here it is tappayments |
| setGatewayMerchantID | MerchantID available with TAP |
SDK open Interfaces available for implementation through Merchant Project:
- TapSamsungPayDelegate
fun onError(error: String?)
fun onSamsungPayToken(token: String)
fun onReady(readyStatus: String)
fun onTapToken(token: Token)
fun onCancel()SDK open Enums available for implementation through Merchant Project:
enum class Scope {
TAP_TOKEN,
SAMSUNG_TOKEN
}
enum class ColorStyle {
colored,
monochrome
}
enum class ThemeMode {
DARK,
LIGHT,
}
enum class Language {
EN,
AR,
}
enum class SupportedSchemes {
AMERICAN_EXPRESS,
MASTERCARD,
VISA,
}
enum class SDKMODE {
SANDBOX,
PRODUCTION,
}
enum class Edges {
flat,
curved
}TapSamsungPay Delegate is an interface which you may want to implement to receive payment status updates and update your user interface accordingly when payment window closes. Below are listed down all available callbacks:
Notifies the receiver that samsungpay token has succeed.
Kotlin:
- fun onSamsungPayToken(token:String)token: Successful Token object.
Notifies the receiver that token generated for TAP .
Kotlin:
- fun onTapToken(token: Token)token: Token object from TAP.
<a name=failed_callback">
Notifies the receiver that failed.
Kotlin:
- fun onError(error: String?)error: Failure object.
Notifies the receiver is ready.
Kotlin:
- fun onReady(readyStatus: String)