Tapaya
Getting StartedQuick Start Guide

Quick Start Guide

Discover how to set up the SDK, configure your environment, and successfully execute your first transaction.

Add Dependency

The SDK is published to Maven Central. Add the dependency to your app module.

build.gradle.kts
dependencies {
    implementation("com.tapaya:accept:1.1.0")
}

Sync your project, then initialize and authenticate in your application code.

MyApplication.kt
// Step 1 — Initialize (once, in Application.onCreate)
AcceptSDK.initialize(context = this, demo = true)

// Step 2 — Authenticate (after initialization)
AcceptSDK.authenticate(
    token = AcceptSDK.DEMO_TOKEN,
    onSuccess = { /* ready to use */ },
    onError = { e -> /* handle error */ }
)

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.

Onboarding

Merchants must complete KYB onboarding before processing transactions. You can optionally prefill known business data to reduce friction.

// Launch KYB onboarding UI
AcceptSDK.identity.presentKyb()

// Optionally prefill known fields
AcceptSDK.identity.presentKyb(
    data = IdentityData(
        businessType = BusinessType.COMPANY,
        countryCode = "CZ",
        legalName = "My Company s.r.o.",
        registrationNumber = "12345678",
        businessEmail = "jan@example.com",
        // ... other fields
    )
)

Verify Payment Methods

Ensure the merchant is approved for specific payment methods.

val status = AcceptSDK.identity.loadStatus(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.

Payment

AcceptSDK.cardTerminal.process(
    CardPaymentIntent(
        paymentIntentId = UUID.randomUUID().toString(),
        amount = 15000,
        requestedCurrency = Currency.CZK
    ),
    onResult = {
        Log.d("result", it.toString())
    },
    onStatus = {
        Log.d("status", it.toString())
    },
    onError = {
        Log.d("error", it.stackTraceToString())
    }
)

Install NPM Package

Add the dependency to your project.

npm i @tapayadot/accept-react-native@1.1.0

Register the plugin in your app.json.

app.json
"plugins": [
    [
        "@tapayadot/accept-react-native"
    ]
]

Before first Expo run

Run npx expo prebuild --clean to generate the native bindings before building your app.

Initialize Plugin

Pass true to initialize for the demo/testing environment.

// set true for testing environment
await AcceptSDK.initialize(true)

Authenticate Merchant

Obtain a merchant token from your backend and authenticate.

const merchantToken = await myBackend.login()
await AcceptSDK.authenticate(merchantToken)

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.

Onboarding

Merchants must be onboarded before processing transactions. Call presentKyb() to launch the SDK's onboarding UI. You can optionally prefill known business data to reduce friction.

import AcceptSDK, { KybPrefillData } from '@tapayadot/accept-react-native';

// Launch onboarding UI
await AcceptSDK.identity.presentKyb()

// Optionally prefill known fields
const prefill: KybPrefillData = {
    businessType: 'company',
    countryCode: 'CZ',
    legalName: 'My Company s.r.o.',
    registrationNumber: '12345678',
}
await AcceptSDK.identity.presentKyb(prefill)

Create Payment Transaction

Companion App Required (iOS)

On iOS, card payments require the Tapaya Accept companion app to be installed. Use AcceptSDK.isCompanionAppInstalled() to check, and AcceptSDK.presentCompanionAppSheet() to prompt installation if needed.

To execute a transaction, call one of the payment methods on AcceptSDK.payments. Provide your own paymentIntentId as a unique identifier. Status updates arrive via the statusCallback and errors via errorCallback.

Payment Flow

const paymentIntent: CardPaymentIntent = {
    paymentIntentId: Crypto.randomUUID(),
    amount: 15000, // 150.00 Kč
    requestedCurrency: 'CZK',
};

const result = await AcceptSDK.payments.startCardPayment(
    paymentIntent,
    (s) => {
        console.log(s);
    },
    (m, e) => {
        console.log(m + ": " + e);
    }
);

console.log(result);

Add Tapaya Accept SDK

In Xcode, go to File → Add Package Dependencies and enter the repository URL. Add the AcceptSDK product to your target.

Package.swift (alternative)
dependencies: [
    .package(url: "https://github.com/tapayadot/accept-ios.git", from: "1.1.2")
],
targets: [
    .target(name: "MyApp", dependencies: [
        .product(name: "AcceptSDK", package: "accept-ios")
    ])
]

Configure Info.plist

Add two entries to your app's Info.plist.

The first allows the SDK to detect the Tapaya Accept companion app. The second registers your app's callback URL scheme for deep link returns (replace myapp with your scheme).

Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>tapaya-accept</string>
</array>
<key>AcceptCallbackScheme</key>
<string>myapp</string>

Then forward inbound URLs to the SDK:

MyApp.swift
.onOpenURL { url in
    Accept.handle(url: url)
}

Initialize SDK

Call initialize() once at app launch before using any other SDK method.

MyApp.swift
try await Accept.initialize(demo: true) // false in production

Authenticate Merchant

Obtain a merchant token from your backend and authenticate.

let merchantToken = myBackend.login()
try await Accept.authenticate(merchantToken: merchantToken)

Pair Companion App

The Tapaya Accept companion app is required for card payments. Check if it is installed and pair, or show the App Store install sheet.

Companion App

if await Accept.isCompanionAppInstalled() {
    try await Accept.pairWithCompanionApp()
} else {
    try await Accept.presentCompanionAppSheet()
}

Execute Merchant Onboarding

Before any transactions are allowed, the merchant needs to complete KYB (Know Your Business) onboarding. The SDK presents a guided form that collects and submits the required information.

iOS Onboarding

let result = try await Accept.presentKyb()

switch result {
case .submitted:
    // KYB form submitted — await processor approval
case .cancelled:
    // Merchant dismissed without submitting
case .failed:
    // Submission failed
}

You can prefill known fields to reduce friction:

let prefill = KybPrefillData(
    businessType: .company,
    countryCode: "CZ",
    legalName: "My Company s.r.o."
)
let result = try await Accept.presentKyb(prefilling: prefill)

Create Payment Transaction

Companion App Required

Card payments require the Tapaya Accept companion app to be installed on the device. Use Accept.isCompanionAppInstalled() to check, and Accept.presentCompanionAppSheet() to prompt installation if needed. See the Pair Companion App step above.

Request location permission, then call Accept.pay(_:) with the appropriate intent. All amounts are in the smallest currency unit (e.g. 1000 = 10.00 CZK).

Payment Flow

try await Accept.requestLocationPermission()

let intent = AcceptCardPaymentIntent(
    amount: 15000, // 150.00 CZK
    requestedCurrency: .czk,
    settlementCurrency: .czk
)

let outcome = try await Accept.pay(intent)

switch outcome {
case .completed(let status):
    print("Paid: \(status.paymentToken), status: \(status.status)")
case .canceled:
    print("User cancelled")
}