Quick Start Guide
Discover how to set up the SDK, configure your environment, and successfully execute your first transaction.
Add Tapaya Plugin Repository
First, define the new plugin source in your mobile application's build configuration.
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://maven.pkg.github.com/tapayadot/accept-sdk-android")
credentials {
username = "consumer"
password = "REPLACE_ME"
}
}
}
}To pull the plugin inside your project, you have to generate repository password and replace it with the REPLACE_ME above.
Generate repository password
To obtain repository password, you need to register developer account in Tapaya Platform. During account setup we'll provide you your own repository password. You only need to create the token once.
Do not share the repository password
Sharing the provided repository secret is prohibited. If such sharing is detected, we will block the entire developer account. In such a scenario, please reach out to developer@tapaya.com.
Initialize Plugin
Import the Tapaya Accept SDK into your app module.
dependencies {
implementation("com.tapaya:accept:1.0.21")
}Sync your project, then initialize the terminal in your application code.
AcceptSDK.initialize(
context = applicationContext,
token = AcceptSDK.DEMO_TOKEN,
demo = true
)Customize UI (Optional)
You can brand the SDK's UI components to match your application's look and feel.
AcceptSDK.setUiConfiguration(
configuration = UiConfigurationData(
companyLogoUrl = "https://tapaya.com/logo.svg", // Link to publicly accessible SVG or PNG
companyLogoBorder = false, // Defines whether a border around the logo is needed
companyName = "tapaya s.r.o." // Your company name, typically put in the title
)
)Execute Merchant Onboarding
Before any transactions are allowed, the merchant needs to finish onboarding. Tapaya Accept SDK is configured to comply with the regulatory requirements of payment processors, banks, and regional laws.
Tapaya Accept SDK offers two ways to execute onboarding of merchant accounts:
- Express Mode: The onboarding flow is prompted from your app, and information is collected inside the Tapaya Accept SDK UI.
- API Mode: Allows you full flexibility of data collection, and only Terms & Conditions are agreed to inside the Tapaya Accept SDK UI.
Merchants must be onboarded before processing transactions. You can choose between Express Mode (SDK UI) or API Mode (Custom UI).
// Launches the full onboarding UI flow
AcceptSDK.identity.express.completeIdentityUI()Verify Payment Methods
Ensure the merchant is approved for specific payment methods.
val status = AcceptSDK.identity.loadStatus(paymentMethod: PaymentMethod.CARD)
val enabled = when(status) {
IdentityStatus.LOADING -> false
IdentityStatus.MISSING_DETAILS -> false
IdentityStatus.VERIFIED -> true
}A method will be allowed only after the payment processor has approved the merchant. If some information is missing, the onboarding must be repeated. In some cases, the payment processor might block the merchant completely, such as when selling prohibited goods.
Create Payment Transaction
To execute a transaction, call one of the pay() methods. You can provide your own paymentIntentId that
can serve as a pairing identifier within your system. During payment, you will receive status updates
inside the onStatus callback and the result inside onResult.
AcceptSDK.cardTerminal.pay(
CardPaymentIntent(
paymentIntentId = UUID.randomUUID().toString(),
amount = 15000,
currency = Currency.CZK
),
onResult = {
Log.d("result", it.toString())
},
onStatus = {
Log.d("status", it.toString())
},
onError = {
Log.d("error", it.stackTraceToString())
}
)iOS Implementation
iOS part of implementation is under development, so the SDK calls made from iOS part will be ignored.
Create .npmrc file
In project root create file called .npmrc where you will place NPM registry secret to access @tapayadot registry. Content of the file should be following.
//npm.pkg.github.com/:_authToken=REPLACE_ME
@tapayadot:registry=https://npm.pkg.github.com/Install NPM plugin
Add dependency in to the project.
npm i @tapayadot/accept-sdk-react-nativeTo pull the plugin inside your project, you have to generate NPM registry secret and replace it with the REPLACE_ME above.
Generate access password
To obtain access to NPM registry, you need to register developer account in Tapaya Platform. During account setup we'll provide you your own NPM registry secret. You only need to create the token once.
Do not share the repository password
Sharing the provided NPM registry secret is prohibited. If such sharing is detected, we will block the entire developer account. In such a scenario, please reach out to developer@tapaya.com.
Initialize Plugin
Initialize the terminal in your application code.
await AcceptSDK.initialize(token, demo)Customize UI (Optional)
You can brand the SDK's UI components to match your application's look and feel.
await AcceptSDK.setUiConfiguration(
UiConfigurationData(
"https://tapaya.com/logo.svg", // Link to publicly accessible SVG or PNG
false, // Defines whether a border around the logo is needed
"tapaya s.r.o." // Your company name, typically put in the title
)
)Execute Merchant Onboarding
Before any transactions are allowed, the merchant needs to finish onboarding. Tapaya Accept SDK is configured to comply with the regulatory requirements of payment processors, banks, and regional laws.
Tapaya Accept SDK offers two ways to execute onboarding of merchant accounts:
- Express Mode: The onboarding flow is prompted from your app, and information is collected inside the Tapaya Accept SDK UI.
- API Mode: Allows you full flexibility of data collection, and only Terms & Conditions are agreed to inside the Tapaya Accept SDK UI.
Merchants must be onboarded before processing transactions. You can choose between Express Mode (SDK UI) or API Mode (Custom UI).
// Launches the full onboarding UI flow
await AcceptSDK.identity.showExpressOnboarding()Verify Payment Methods
Ensure the merchant is approved for specific payment methods.
let status = await AcceptSDK.identity.loadStatus('card')
switch (status) {
case 'loading': false
case 'missing_details': false
case 'verified': true
}A method will be allowed only after the payment processor has approved the merchant. If some information is missing, the onboarding must be repeated. In some cases, the payment processor might block the merchant completely, such as when selling prohibited goods.
Create Payment Transaction
To execute a transaction, call one of the pay() methods. You can provide your own paymentIntentId that
can serve as a pairing identifier within your system. During payment, you will receive status updates
inside the onStatus callback and the result inside onResult.
const paymentIntent: CardPaymentIntent = {
paymentIntentId: Crypto.randomUUID(),
amount: 15000, // 150.00 Kč
currency: 'CZK',
};
const result = await AcceptSDK.payments.startCardPayment(
paymentIntent,
(s) => {
console.log(s);
},
(m, e) => {
console.log(m + ": " + e);
}
);
console.log(result);Coming Soon
iOS documentation is currently being updated. Please refer to the Android guide for general concepts or contact support for the iOS beta SDK.