@tapayadot/accept-react-native 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/tapaya/acceptsdkreactnative/AcceptSdkReactNativeModule.kt +16 -4
- package/build/AcceptSdkReactNative.types.d.ts +5 -0
- package/build/AcceptSdkReactNative.types.d.ts.map +1 -1
- package/build/AcceptSdkReactNative.types.js.map +1 -1
- package/ios/AcceptSdkReactNativeModule.swift +4 -0
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@ package com.tapaya.acceptsdkreactnative
|
|
|
3
3
|
import android.util.Base64
|
|
4
4
|
import com.google.gson.Gson
|
|
5
5
|
import com.tapaya.accept.Accept
|
|
6
|
+
import com.tapaya.accept.AcceptDemoApi
|
|
6
7
|
import com.tapaya.accept.external.IdentityData
|
|
7
8
|
import com.tapaya.core.model.external.AcceptEnvironment
|
|
8
9
|
import com.tapaya.core.model.external.AcceptUiBehavior
|
|
@@ -277,13 +278,23 @@ class AcceptImageThemeRecord : Record {
|
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
class AcceptThemeConfigurationRecord : Record {
|
|
281
|
+
@Field var themeId: String? = null
|
|
280
282
|
@Field var colors: AcceptColorThemeRecord? = null
|
|
281
283
|
@Field var images: AcceptImageThemeRecord? = null
|
|
282
284
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
@OptIn(AcceptDemoApi::class)
|
|
286
|
+
fun toAcceptThemeConfiguration(): AcceptThemeConfiguration {
|
|
287
|
+
themeId?.let { id ->
|
|
288
|
+
return AcceptThemeConfiguration(
|
|
289
|
+
colors = AcceptThemeSource.ById(id),
|
|
290
|
+
images = AcceptThemeSource.ById(id),
|
|
291
|
+
)
|
|
292
|
+
}
|
|
293
|
+
return AcceptThemeConfiguration(
|
|
294
|
+
colors = colors?.let { AcceptThemeSource.Local(it.toAcceptColorTheme()) } ?: AcceptThemeSource.Default,
|
|
295
|
+
images = images?.let { AcceptThemeSource.Local(it.toAcceptImageTheme()) } ?: AcceptThemeSource.Default,
|
|
296
|
+
)
|
|
297
|
+
}
|
|
287
298
|
}
|
|
288
299
|
|
|
289
300
|
private fun String.toComposeColor(): androidx.compose.ui.graphics.Color = try {
|
|
@@ -467,6 +478,7 @@ class AcceptSdkReactNativeModule : Module() {
|
|
|
467
478
|
|
|
468
479
|
AsyncFunction("setTheme") Coroutine { theme: AcceptThemeConfigurationRecord ->
|
|
469
480
|
Accept.setThemeConfiguration(theme.toAcceptThemeConfiguration())
|
|
481
|
+
return@Coroutine
|
|
470
482
|
}
|
|
471
483
|
|
|
472
484
|
AsyncFunction("setUiBehavior") { behavior: AcceptUiBehaviorRecord ->
|
|
@@ -32,8 +32,13 @@ export type AcceptImageTheme = {
|
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
34
|
* UI theme overrides. Omit `colors` and/or `images` to keep SDK defaults for those slots.
|
|
35
|
+
*
|
|
36
|
+
* When `themeId` is set, the SDK loads a built-in preset theme (colors + images) by ID and
|
|
37
|
+
* ignores `colors`/`images`. Unknown IDs fall back to SDK defaults. Demo only.
|
|
35
38
|
*/
|
|
36
39
|
export type AcceptThemeConfiguration = {
|
|
40
|
+
/** Preset theme ID. When set, overrides `colors` and `images`. Demo only. */
|
|
41
|
+
themeId?: string;
|
|
37
42
|
colors?: AcceptColorTheme;
|
|
38
43
|
images?: AcceptImageTheme;
|
|
39
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptSdkReactNative.types.d.ts","sourceRoot":"","sources":["../src/AcceptSdkReactNative.types.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,MAAM,MAAM,cAAc,GAAG;IAC3B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;CACb,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,yBAAyB,CAAC,EAAE,cAAc,CAAC;CAC5C,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;CACnB,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"AcceptSdkReactNative.types.d.ts","sourceRoot":"","sources":["../src/AcceptSdkReactNative.types.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,MAAM,MAAM,cAAc,GAAG;IAC3B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;CACb,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,yBAAyB,CAAC,EAAE,cAAc,CAAC;CAC5C,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;CACnB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,M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zB,iEAAiE;IACjE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,yBAAyB,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACjE,yBAAyB,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACjE,2BAA2B,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACnE,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC3D,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC3D,wBAAwB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CAC9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptSdkReactNative.types.js","sourceRoot":"","sources":["../src/AcceptSdkReactNative.types.ts"],"names":[],"mappings":"","sourcesContent":["/** Start and end hex colors for a gradient. */\nexport type GradientColors = {\n /** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n start: string;\n /** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n end: string;\n}\n\n/**\n * Custom color palette. All four base colors are required when providing colors —\n * they replace the entire color theme, not individual tokens.\n */\nexport type AcceptColorTheme = {\n /** Primary accent color. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n accent: string;\n error: string;\n warning: string;\n success: string;\n brandGradientColors?: GradientColors;\n brandSubtleGradientColors?: GradientColors;\n}\n\n/**\n * Custom image assets. All three slots are required when providing images —\n * provide all or omit the `images` key entirely to use SDK defaults.\n */\nexport type AcceptImageTheme = {\n /** Square logo used on branded screens. Base64-encoded PNG or JPEG. */\n brandLogo: string;\n /** Logo shown in toolbar / navigation bar. Base64-encoded PNG or JPEG. */\n toolbarLogo: string;\n /** Solid (monochrome) logo variant. Base64-encoded PNG or JPEG. */\n solidLogo: string;\n}\n\n/**\n * UI theme overrides. Omit `colors` and/or `images` to keep SDK defaults for those slots.\n */\nexport type AcceptThemeConfiguration = {\n colors?: AcceptColorTheme;\n images?: AcceptImageTheme;\n}\n\n/** Where the NFC indicator is drawn relative to the tap zone. */\nexport type NfcIndicator = 'DEFAULT' | 'ABOVE' | 'BELOW' | 'FRONT' | 'BEHIND';\n\n/**\n * Position of the NFC tap zone on screen. Omit `position` from {@link NfcZone} to let the\n * underlying terminal pick. Provide `{ xBias, yBias }` (each in `0..1`) for a manual position.\n */\nexport type NfcPosition = {\n /** Horizontal bias (0.0 = left, 1.0 = right). */\n xBias: number;\n /** Vertical bias (0.0 = top, 1.0 = bottom). */\n yBias: number;\n}\n\n/** Overrides the Tap-to-Pay NFC zone shown over the card payment flow. */\nexport type NfcZone = {\n indicator: NfcIndicator;\n /** Omit to let the underlying terminal pick the position. */\n position?: NfcPosition;\n}\n\n/**\n * Configures SDK-owned UI behavior around a transaction.\n *\n * @property resultScreenDurationSeconds How long the post-transaction result screen stays on\n * screen before auto-closing. Ignored when `showResultScreen` is `false`. Defaults to `10`.\n * @property showResultScreen Whether the SDK shows its own result screen after a transaction\n * completes. Defaults to `true`.\n * @property nfcZone Overrides the Tap-to-Pay NFC indicator and tap zone position.\n */\nexport type AcceptUiBehavior = {\n resultScreenDurationSeconds?: number;\n showResultScreen?: boolean;\n nfcZone?: NfcZone;\n}\n\n/** Current authentication/initialization state of the SDK. */\nexport type SdkStatus = 'IDLE' | 'INITIALIZED' | 'LOGGED_IN'\n\n/** Intent for initiating a card (tap-to-pay) payment. */\nexport type CardPaymentIntent = {\n /** Unique payment intent identifier obtained from your backend. */\n paymentIntentId: string;\n /** Amount in the smallest currency unit (e.g. hellers for CZK, cents for EUR). */\n amount: number;\n /** ISO 4217 alpha-3 currency code the customer is charged in. */\n requestedCurrency: string;\n /** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: string;\n}\n\n/** Intent for initiating a SEPA Instant bank transfer payment. */\nexport type SepaPaymentIntent = {\n /** Unique payment intent identifier obtained from your backend. */\n paymentIntentId: string;\n /** Amount in the smallest currency unit. */\n amount: number;\n /** ISO 4217 alpha-3 currency code the customer is charged in. */\n requestedCurrency: string;\n /** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: string;\n}\n\n/** Intent for initiating a Certis Instant bank transfer payment. */\nexport type CertisPaymentIntent = {\n /** Unique payment intent identifier obtained from your backend. */\n paymentIntentId: string;\n /** Amount in the smallest currency unit. */\n amount: number;\n /** ISO 4217 alpha-3 currency code the customer is charged in. */\n requestedCurrency: string;\n /** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: string;\n}\n\n/** Result of a completed card payment. */\nexport type CardPaymentResult = {\n /** Final payment status. */\n status: CardPaymentStatus;\n /** Last 4 digits of the card number. */\n last4?: string;\n /** Merchant company name. */\n companyName?: string;\n companyAddress1?: string;\n companyAddress2?: string;\n companyCity?: string;\n /** ISO 3166-1 alpha-2 country code (e.g. `CZ`, `SK`, `GB`). */\n companyCountry?: string;\n terminalId?: string;\n authorizationCode?: string;\n /** Card brand (e.g. `VISA`, `MASTERCARD`). */\n brand?: string;\n /** Decline or abort reason when status is not `approved`. */\n reason?: string;\n /** URL to the digital receipt for this transaction. */\n receiptUrl?: string;\n /** Server-issued token identifying a refund applied to this payment. Present when this card payment was refunded. */\n refundToken?: string;\n}\n\n/** Intermediate status updates emitted during a card payment flow. */\nexport type CardPaymentStatus =\n 'pending' |\n 'approved' |\n 'declined' |\n 'refunded' |\n 'aborted'\n\n/** Result of a completed SEPA Instant payment. */\nexport type SepaPaymentResult = {\n /** Final payment status. */\n status: SepaInstantPaymentStatus;\n /** Whether the payment was postponed for later processing. */\n postponed: boolean;\n /** ISO 8601 timestamp of when funds were received. */\n receivedAt: string;\n /** IBAN the funds were received from. */\n receivedFromIban: string;\n /** URL to the digital receipt for this transaction. */\n receiptUrl?: string;\n}\n\n/** Intermediate status updates emitted during a SEPA Instant payment flow. */\nexport type SepaInstantPaymentStatus =\n 'pending' |\n 'verified' |\n 'aborted' |\n 'refunded' |\n 'declined'\n\n/** Result of a completed Certis Instant payment. */\nexport type CertisPaymentResult = {\n /** Final payment status. */\n status: CertisInstantPaymentStatus;\n /** Whether the payment was postponed for later processing. */\n postponed: boolean;\n /** ISO 8601 timestamp of when funds were received. */\n receivedAt: string;\n /** IBAN the funds were received from. */\n receivedFromIban: string;\n /** URL to the digital receipt for this transaction. */\n receiptUrl?: string;\n}\n\n/** Intermediate status updates emitted during a Certis Instant payment flow. */\nexport type CertisInstantPaymentStatus =\n 'pending' |\n 'verified' |\n 'aborted' |\n 'refunded' |\n 'declined'\n\n/** Optional prefill data for the KYB onboarding flow. All fields are optional. */\nexport type KybPrefillData = {\n /** Legal structure of the business. */\n businessType?: 'individual' | 'company' | 'nonProfit' | 'governmentEntity';\n /** ISO 3166-1 alpha-2 country code (e.g. `\"CZ\"`, `\"DE\"`). */\n countryCode?: string;\n /** Company registration / identification number. */\n registrationNumber?: string;\n vatNumber?: string;\n /** Legal company name. */\n legalName?: string;\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n postalCode?: string;\n /** 4-digit Merchant Category Code (MCC). */\n merchantCategoryCode?: number;\n businessEmail?: string;\n /** IBAN for payout settlement. */\n bankAccountIban?: string;\n businessUrl?: string;\n productDescription?: string;\n supportPhone?: string;\n}\n\n/** Supported payment methods for onboarding status queries. */\nexport type PaymentMethod = 'CARD' | 'SEPA' | 'CERTIS' | 'CRYPTO';\n\n/** Onboarding state for a single payment method. */\nexport type PaymentMethodStatus =\n | 'NOT_STARTED'\n | 'PENDING'\n | 'ACTIVE'\n | 'ATTENTION_NEEDED'\n | 'ACTION_REQUIRED'\n | 'BLOCKED';\n\n/** Per-method onboarding status entry. */\nexport type AcceptPaymentMethodStatus = {\n method: PaymentMethod;\n status: PaymentMethodStatus;\n}\n\n/** Aggregate onboarding status for the authenticated merchant. */\nexport type AcceptOnboardingStatus = {\n /** `true` when the merchant has completed onboarding for at least one payment method. */\n isOnboarded: boolean;\n /** Per-method onboarding status entries. */\n paymentMethods: AcceptPaymentMethodStatus[];\n}\n\n/** Reason a card refund is issued. */\nexport type RefundReason =\n | 'customerRequest'\n | 'duplicate'\n | 'fraudulent'\n | 'expiredCharge';\n\n/** Final state of a refund transaction. */\nexport type TransactionStatus =\n | 'pending'\n | 'success'\n | 'cancelled'\n | 'refunded'\n | 'failed'\n | 'actionNeeded';\n\n/** Arguments for {@link payments.refund}. */\nexport type RefundIntent = {\n /** Token of the source payment to refund. Accepts the server payment UUID or the original charge's `paymentIntentId`. */\n paymentToken: string;\n /** Optional client-provided idempotency token. Pass the same value across retries to avoid duplicate refunds. */\n refundToken?: string;\n /** Reason for the refund. */\n reason: RefundReason;\n}\n\n/**\n * Result of a refund request.\n *\n * On iOS this is fully populated. On Android only `status` and `refundToken` are populated —\n * call {@link getPaymentStatus} on the source payment for richer state.\n */\nexport type RefundResult = {\n /** Server-generated refund token. May be undefined on Android. */\n refundToken?: string;\n /** Status of the refund transaction. */\n status: TransactionStatus;\n /** Payment method of the original transaction. iOS only. */\n paymentMethod?: PaymentMethod;\n /** Refund amount in the smallest unit of the requested currency. iOS only. */\n requestedAmount?: number;\n /** ISO 4217 alpha-3 code of the requested currency. iOS only. */\n requestedCurrency?: string;\n /** Refund amount in the smallest unit of the settlement currency. iOS only. */\n settlementAmount?: number;\n /** ISO 4217 alpha-3 code of the settlement currency. iOS only. */\n settlementCurrency?: string;\n /** Conversion rate from requested currency to settlement currency. iOS only. */\n fxRate?: number;\n /** Reason for the refund. */\n refundReason: RefundReason;\n /** ISO 8601 UTC timestamp when the refund was initiated. iOS only. */\n createdAt?: string;\n /** ISO 8601 UTC timestamp when the refund was processed. iOS only. */\n processedAt?: string;\n}\n\nexport type AcceptSdkReactNativeModuleEvents = {\n onCardPaymentStatusChange: (status: Map<string, string>) => void;\n onSepaPaymentStatusChange: (status: Map<string, string>) => void;\n onCertisPaymentStatusChange: (status: Map<string, string>) => void;\n onCardPaymentException: (map: Map<string, string>) => void;\n onSepaPaymentException: (map: Map<string, string>) => void;\n onCertisPaymentException: (map: Map<string, string>) => void;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"AcceptSdkReactNative.types.js","sourceRoot":"","sources":["../src/AcceptSdkReactNative.types.ts"],"names":[],"mappings":"","sourcesContent":["/** Start and end hex colors for a gradient. */\nexport type GradientColors = {\n /** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n start: string;\n /** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n end: string;\n}\n\n/**\n * Custom color palette. All four base colors are required when providing colors —\n * they replace the entire color theme, not individual tokens.\n */\nexport type AcceptColorTheme = {\n /** Primary accent color. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n accent: string;\n error: string;\n warning: string;\n success: string;\n brandGradientColors?: GradientColors;\n brandSubtleGradientColors?: GradientColors;\n}\n\n/**\n * Custom image assets. All three slots are required when providing images —\n * provide all or omit the `images` key entirely to use SDK defaults.\n */\nexport type AcceptImageTheme = {\n /** Square logo used on branded screens. Base64-encoded PNG or JPEG. */\n brandLogo: string;\n /** Logo shown in toolbar / navigation bar. Base64-encoded PNG or JPEG. */\n toolbarLogo: string;\n /** Solid (monochrome) logo variant. Base64-encoded PNG or JPEG. */\n solidLogo: string;\n}\n\n/**\n * UI theme overrides. Omit `colors` and/or `images` to keep SDK defaults for those slots.\n *\n * When `themeId` is set, the SDK loads a built-in preset theme (colors + images) by ID and\n * ignores `colors`/`images`. Unknown IDs fall back to SDK defaults. Demo only.\n */\nexport type AcceptThemeConfiguration = {\n /** Preset theme ID. When set, overrides `colors` and `images`. Demo only. */\n themeId?: string;\n colors?: AcceptColorTheme;\n images?: AcceptImageTheme;\n}\n\n/** Where the NFC indicator is drawn relative to the tap zone. */\nexport type NfcIndicator = 'DEFAULT' | 'ABOVE' | 'BELOW' | 'FRONT' | 'BEHIND';\n\n/**\n * Position of the NFC tap zone on screen. Omit `position` from {@link NfcZone} to let the\n * underlying terminal pick. Provide `{ xBias, yBias }` (each in `0..1`) for a manual position.\n */\nexport type NfcPosition = {\n /** Horizontal bias (0.0 = left, 1.0 = right). */\n xBias: number;\n /** Vertical bias (0.0 = top, 1.0 = bottom). */\n yBias: number;\n}\n\n/** Overrides the Tap-to-Pay NFC zone shown over the card payment flow. */\nexport type NfcZone = {\n indicator: NfcIndicator;\n /** Omit to let the underlying terminal pick the position. */\n position?: NfcPosition;\n}\n\n/**\n * Configures SDK-owned UI behavior around a transaction.\n *\n * @property resultScreenDurationSeconds How long the post-transaction result screen stays on\n * screen before auto-closing. Ignored when `showResultScreen` is `false`. Defaults to `10`.\n * @property showResultScreen Whether the SDK shows its own result screen after a transaction\n * completes. Defaults to `true`.\n * @property nfcZone Overrides the Tap-to-Pay NFC indicator and tap zone position.\n */\nexport type AcceptUiBehavior = {\n resultScreenDurationSeconds?: number;\n showResultScreen?: boolean;\n nfcZone?: NfcZone;\n}\n\n/** Current authentication/initialization state of the SDK. */\nexport type SdkStatus = 'IDLE' | 'INITIALIZED' | 'LOGGED_IN'\n\n/** Intent for initiating a card (tap-to-pay) payment. */\nexport type CardPaymentIntent = {\n /** Unique payment intent identifier obtained from your backend. */\n paymentIntentId: string;\n /** Amount in the smallest currency unit (e.g. hellers for CZK, cents for EUR). */\n amount: number;\n /** ISO 4217 alpha-3 currency code the customer is charged in. */\n requestedCurrency: string;\n /** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: string;\n}\n\n/** Intent for initiating a SEPA Instant bank transfer payment. */\nexport type SepaPaymentIntent = {\n /** Unique payment intent identifier obtained from your backend. */\n paymentIntentId: string;\n /** Amount in the smallest currency unit. */\n amount: number;\n /** ISO 4217 alpha-3 currency code the customer is charged in. */\n requestedCurrency: string;\n /** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: string;\n}\n\n/** Intent for initiating a Certis Instant bank transfer payment. */\nexport type CertisPaymentIntent = {\n /** Unique payment intent identifier obtained from your backend. */\n paymentIntentId: string;\n /** Amount in the smallest currency unit. */\n amount: number;\n /** ISO 4217 alpha-3 currency code the customer is charged in. */\n requestedCurrency: string;\n /** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: string;\n}\n\n/** Result of a completed card payment. */\nexport type CardPaymentResult = {\n /** Final payment status. */\n status: CardPaymentStatus;\n /** Last 4 digits of the card number. */\n last4?: string;\n /** Merchant company name. */\n companyName?: string;\n companyAddress1?: string;\n companyAddress2?: string;\n companyCity?: string;\n /** ISO 3166-1 alpha-2 country code (e.g. `CZ`, `SK`, `GB`). */\n companyCountry?: string;\n terminalId?: string;\n authorizationCode?: string;\n /** Card brand (e.g. `VISA`, `MASTERCARD`). */\n brand?: string;\n /** Decline or abort reason when status is not `approved`. */\n reason?: string;\n /** URL to the digital receipt for this transaction. */\n receiptUrl?: string;\n /** Server-issued token identifying a refund applied to this payment. Present when this card payment was refunded. */\n refundToken?: string;\n}\n\n/** Intermediate status updates emitted during a card payment flow. */\nexport type CardPaymentStatus =\n 'pending' |\n 'approved' |\n 'declined' |\n 'refunded' |\n 'aborted'\n\n/** Result of a completed SEPA Instant payment. */\nexport type SepaPaymentResult = {\n /** Final payment status. */\n status: SepaInstantPaymentStatus;\n /** Whether the payment was postponed for later processing. */\n postponed: boolean;\n /** ISO 8601 timestamp of when funds were received. */\n receivedAt: string;\n /** IBAN the funds were received from. */\n receivedFromIban: string;\n /** URL to the digital receipt for this transaction. */\n receiptUrl?: string;\n}\n\n/** Intermediate status updates emitted during a SEPA Instant payment flow. */\nexport type SepaInstantPaymentStatus =\n 'pending' |\n 'verified' |\n 'aborted' |\n 'refunded' |\n 'declined'\n\n/** Result of a completed Certis Instant payment. */\nexport type CertisPaymentResult = {\n /** Final payment status. */\n status: CertisInstantPaymentStatus;\n /** Whether the payment was postponed for later processing. */\n postponed: boolean;\n /** ISO 8601 timestamp of when funds were received. */\n receivedAt: string;\n /** IBAN the funds were received from. */\n receivedFromIban: string;\n /** URL to the digital receipt for this transaction. */\n receiptUrl?: string;\n}\n\n/** Intermediate status updates emitted during a Certis Instant payment flow. */\nexport type CertisInstantPaymentStatus =\n 'pending' |\n 'verified' |\n 'aborted' |\n 'refunded' |\n 'declined'\n\n/** Optional prefill data for the KYB onboarding flow. All fields are optional. */\nexport type KybPrefillData = {\n /** Legal structure of the business. */\n businessType?: 'individual' | 'company' | 'nonProfit' | 'governmentEntity';\n /** ISO 3166-1 alpha-2 country code (e.g. `\"CZ\"`, `\"DE\"`). */\n countryCode?: string;\n /** Company registration / identification number. */\n registrationNumber?: string;\n vatNumber?: string;\n /** Legal company name. */\n legalName?: string;\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n postalCode?: string;\n /** 4-digit Merchant Category Code (MCC). */\n merchantCategoryCode?: number;\n businessEmail?: string;\n /** IBAN for payout settlement. */\n bankAccountIban?: string;\n businessUrl?: string;\n productDescription?: string;\n supportPhone?: string;\n}\n\n/** Supported payment methods for onboarding status queries. */\nexport type PaymentMethod = 'CARD' | 'SEPA' | 'CERTIS' | 'CRYPTO';\n\n/** Onboarding state for a single payment method. */\nexport type PaymentMethodStatus =\n | 'NOT_STARTED'\n | 'PENDING'\n | 'ACTIVE'\n | 'ATTENTION_NEEDED'\n | 'ACTION_REQUIRED'\n | 'BLOCKED';\n\n/** Per-method onboarding status entry. */\nexport type AcceptPaymentMethodStatus = {\n method: PaymentMethod;\n status: PaymentMethodStatus;\n}\n\n/** Aggregate onboarding status for the authenticated merchant. */\nexport type AcceptOnboardingStatus = {\n /** `true` when the merchant has completed onboarding for at least one payment method. */\n isOnboarded: boolean;\n /** Per-method onboarding status entries. */\n paymentMethods: AcceptPaymentMethodStatus[];\n}\n\n/** Reason a card refund is issued. */\nexport type RefundReason =\n | 'customerRequest'\n | 'duplicate'\n | 'fraudulent'\n | 'expiredCharge';\n\n/** Final state of a refund transaction. */\nexport type TransactionStatus =\n | 'pending'\n | 'success'\n | 'cancelled'\n | 'refunded'\n | 'failed'\n | 'actionNeeded';\n\n/** Arguments for {@link payments.refund}. */\nexport type RefundIntent = {\n /** Token of the source payment to refund. Accepts the server payment UUID or the original charge's `paymentIntentId`. */\n paymentToken: string;\n /** Optional client-provided idempotency token. Pass the same value across retries to avoid duplicate refunds. */\n refundToken?: string;\n /** Reason for the refund. */\n reason: RefundReason;\n}\n\n/**\n * Result of a refund request.\n *\n * On iOS this is fully populated. On Android only `status` and `refundToken` are populated —\n * call {@link getPaymentStatus} on the source payment for richer state.\n */\nexport type RefundResult = {\n /** Server-generated refund token. May be undefined on Android. */\n refundToken?: string;\n /** Status of the refund transaction. */\n status: TransactionStatus;\n /** Payment method of the original transaction. iOS only. */\n paymentMethod?: PaymentMethod;\n /** Refund amount in the smallest unit of the requested currency. iOS only. */\n requestedAmount?: number;\n /** ISO 4217 alpha-3 code of the requested currency. iOS only. */\n requestedCurrency?: string;\n /** Refund amount in the smallest unit of the settlement currency. iOS only. */\n settlementAmount?: number;\n /** ISO 4217 alpha-3 code of the settlement currency. iOS only. */\n settlementCurrency?: string;\n /** Conversion rate from requested currency to settlement currency. iOS only. */\n fxRate?: number;\n /** Reason for the refund. */\n refundReason: RefundReason;\n /** ISO 8601 UTC timestamp when the refund was initiated. iOS only. */\n createdAt?: string;\n /** ISO 8601 UTC timestamp when the refund was processed. iOS only. */\n processedAt?: string;\n}\n\nexport type AcceptSdkReactNativeModuleEvents = {\n onCardPaymentStatusChange: (status: Map<string, string>) => void;\n onSepaPaymentStatusChange: (status: Map<string, string>) => void;\n onCertisPaymentStatusChange: (status: Map<string, string>) => void;\n onCardPaymentException: (map: Map<string, string>) => void;\n onSepaPaymentException: (map: Map<string, string>) => void;\n onCertisPaymentException: (map: Map<string, string>) => void;\n};\n"]}
|
|
@@ -92,6 +92,7 @@ final class AcceptImageThemeRecord: Record {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
final class AcceptThemeConfigurationRecord: Record {
|
|
95
|
+
@Field var themeId: String? = nil
|
|
95
96
|
@Field var colors: AcceptColorThemeRecord? = nil
|
|
96
97
|
@Field var images: AcceptImageThemeRecord? = nil
|
|
97
98
|
}
|
|
@@ -336,6 +337,9 @@ public class AcceptSdkReactNativeModule: Module {
|
|
|
336
337
|
|
|
337
338
|
private extension AcceptThemeConfigurationRecord {
|
|
338
339
|
func toAcceptThemeConfiguration() throws -> AcceptThemeConfiguration {
|
|
340
|
+
if let id = themeId {
|
|
341
|
+
return .byId(id)
|
|
342
|
+
}
|
|
339
343
|
var config = AcceptThemeConfiguration()
|
|
340
344
|
if let colorsRecord = colors {
|
|
341
345
|
config.colors = .local(try colorsRecord.toAcceptColorTheme())
|
package/package.json
CHANGED