@tapayadot/accept-react-native
v1.1.0
Published
Accept SDK for React Native/Expo
Readme

React Native / Expo SDK for integrating Tapaya Accept payment processing into your app.
Installation
npm install @tapayadot/accept-react-nativeExpo plugin
Add the plugin to your app.json. The plugin automatically configures the native Android Maven repository and iOS Swift Package Manager dependency:
{
"expo": {
"plugins": ["@tapayadot/accept-react-native"]
}
}Then run:
npx expo prebuildAndroid
The Android SDK is distributed via GitHub Packages. The Expo plugin configures the Maven repository automatically during prebuild.
iOS
The iOS SDK is resolved via Swift Package Manager during prebuild / pod install. No additional configuration is required.
Requirements
- React Native 0.74+ / Expo SDK 51+
- iOS 26+
- Android API 30+
Usage
Setup
import AcceptSDK from '@tapayadot/accept-react-native';
// Initialize once at app launch
await AcceptSDK.initialize(/* demo: */ false);
// Authenticate with your merchant token
await AcceptSDK.authenticate('your-merchant-token');UI Theming
Customize colors and logos at initialization or any time after:
import AcceptSDK, { type AcceptThemeConfiguration } from '@tapayadot/accept-react-native';
import { assetToBase64 } from '@tapayadot/accept-react-native/utils';
const theme: AcceptThemeConfiguration = {
colors: {
accent: '#FF8400',
error: '#E6282B',
warning: '#FF8000',
success: '#228800',
brandGradientColors: { start: '#FF8400', end: '#9A94E9' },
},
images: {
brandLogo: await assetToBase64(require('./assets/brand-logo.png')),
toolbarLogo: await assetToBase64(require('./assets/toolbar-logo.png')),
solidLogo: await assetToBase64(require('./assets/solid-logo.png')),
},
};
// Pass at initialization
await AcceptSDK.initialize(false, theme);
// Or apply after initialization
await AcceptSDK.setTheme(theme);Omit colors or images to keep SDK defaults for that slot. Images must be PNG or JPEG — SVG is not supported.
assetToBase64requiresexpo-assetandexpo-file-system. Both are included in managed Expo projects. Bare React Native users must install them manually.
Request Location Permission
Required before processing card payments (Tap-to-Pay):
await AcceptSDK.requestLocationPermission();Card Payment (Tap-to-Pay)
import AcceptSDK, { CardPaymentIntent } from '@tapayadot/accept-react-native';
const intent: CardPaymentIntent = {
paymentIntentId: 'pi_xxx',
amount: 1500,
requestedCurrency: 'CZK',
settlementCurrency: 'EUR',
};
const result = await AcceptSDK.payments.startCardPayment(
intent,
(status) => console.log('Status update:', status),
(message, exception) => console.error('Error:', message, exception),
);
switch (result.status) {
case 'approved':
console.log('Approved:', result.authorizationCode);
break;
case 'declined':
console.log('Declined:', result.reason);
break;
}SEPA Instant Credit Transfer
const result = await AcceptSDK.payments.startSepaPayment(
{
paymentIntentId: 'pi_xxx',
amount: 1000,
requestedCurrency: 'EUR',
settlementCurrency: 'EUR',
},
(status) => console.log('Status update:', status),
(message, exception) => console.error('Error:', message, exception),
);
if (result.status === 'verified') {
console.log('Received from:', result.receivedFromIban);
}Certis (Czech Instant Transfer)
const result = await AcceptSDK.payments.startCertisPayment(
{
paymentIntentId: 'pi_xxx',
amount: 10000,
requestedCurrency: 'CZK',
settlementCurrency: 'CZK',
},
(status) => console.log('Status update:', status),
(message, exception) => console.error('Error:', message, exception),
);KYB Onboarding
// Check if onboarding is needed before launching the KYB flow
await AcceptSDK.identity.presentKyb({
businessType: 'company',
legalName: 'Acme s.r.o.',
businessEmail: '[email protected]',
countryCode: 'CZ',
registrationNumber: '12345678',
vatNumber: 'CZ12345678',
addressLine1: 'Václavské náměstí 1',
city: 'Praha',
postalCode: '11000',
bankAccountIban: 'CZ...',
businessUrl: 'https://acme.com',
productDescription: 'SaaS platform',
supportPhone: '+420123456789',
});Session Management
// Check current SDK status
const status = await AcceptSDK.getStatus(); // 'IDLE' | 'INITIALIZED' | 'LOGGED_IN'
// Query the result of a previous payment
const result = await AcceptSDK.getPaymentStatus('pi_xxx');
// Log out
await AcceptSDK.logOut();Companion App (iOS only)
The Tapaya companion app is required for card payments on iOS:
const installed = await AcceptSDK.isCompanionAppInstalled();
if (!installed) {
// Prompt user to install via App Store sheet
await AcceptSDK.presentCompanionAppSheet();
} else {
// Pair with the companion app
await AcceptSDK.pairWithCompanionApp();
}API Reference
Top-level
| Method | Description |
|---|---|
| initialize(demo?, theme?) | Initialize the SDK. Pass true for sandbox mode. Optionally provide a UI theme. |
| setTheme(theme) | Apply a UI theme after initialization. |
| authenticate(token) | Authenticate with a merchant JWT token. |
| getStatus() | Returns 'IDLE' \| 'INITIALIZED' \| 'LOGGED_IN'. |
| getPaymentStatus(paymentIntentId) | Retrieve the result of a previous payment. |
| logOut() | End the current merchant session. |
| requestLocationPermission() | Request location permission (required for card payments). |
| isCompanionAppInstalled() | iOS only. Check if the Tapaya companion app is installed. |
| presentCompanionAppSheet() | iOS only. Show App Store sheet for companion app. |
| pairWithCompanionApp() | iOS only. Pair with the installed companion app. |
AcceptSDK.payments
| Method | Description |
|---|---|
| startCardPayment(intent, onStatus, onError) | Start a card/Tap-to-Pay payment. |
| startSepaPayment(intent, onStatus, onError) | Start a SEPA Instant payment. |
| startCertisPayment(intent, onStatus, onError) | Start a Certis Instant payment. |
AcceptSDK.identity
| Method | Description |
|---|---|
| presentKyb(prefilling?) | Launch the KYB onboarding UI with optional prefill data. |
Types
type Currency = 'CZK' | 'EUR' | 'GBP'
type CardPaymentIntent = {
paymentIntentId: string
amount: number // smallest currency unit (e.g. hellers)
requestedCurrency: Currency
settlementCurrency?: Currency
}
type CardPaymentResult = {
status: 'pending' | 'approved' | 'declined' | 'refunded' | 'aborted'
last4?: string
brand?: string
authorizationCode?: string
terminalId?: string
companyName?: string
reason?: string
receiptUrl?: string
}
type SepaPaymentIntent = { paymentIntentId: string; amount: number; requestedCurrency: Currency; settlementCurrency?: Currency }
type SepaPaymentResult = { status: 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined'; postponed: boolean; receivedAt: string; receivedFromIban: string; receiptUrl?: string }
type CertisPaymentIntent = { paymentIntentId: string; amount: number; requestedCurrency: Currency; settlementCurrency?: Currency }
type CertisPaymentResult = { status: 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined'; postponed: boolean; receivedAt: string; receivedFromIban: string; receiptUrl?: string }
type GradientColors = { start: string; end: string }
type AcceptColorTheme = {
accent: string // #RRGGBB or #AARRGGBB
error: string
warning: string
success: string
brandGradientColors?: GradientColors
brandSubtleGradientColors?: GradientColors
}
type AcceptImageTheme = {
brandLogo: string // base64 PNG/JPEG
toolbarLogo: string
solidLogo: string
}
type AcceptThemeConfiguration = {
colors?: AcceptColorTheme
images?: AcceptImageTheme
}
type KybPrefillData = {
businessType?: 'individual' | 'company' | 'nonProfit' | 'governmentEntity'
countryCode?: string
registrationNumber?: string
vatNumber?: string
legalName?: string
addressLine1?: string
addressLine2?: string
city?: string
postalCode?: string
merchantCategoryCode?: number
businessEmail?: string
bankAccountIban?: string
businessUrl?: string
productDescription?: string
supportPhone?: string
}Documentation
Full documentation is available at docs.tapaya.com.
License
Licensed under the Apache License, Version 2.0.
