@tapayadot/accept-react-native 1.0.0 → 1.2.0
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/README.md +199 -28
- package/android/build.gradle +4 -3
- package/android/src/main/java/com/tapaya/acceptsdkreactnative/AcceptSdkReactNativeModule.kt +316 -20
- package/build/AcceptSdkReactNative.types.d.ts +152 -15
- package/build/AcceptSdkReactNative.types.d.ts.map +1 -1
- package/build/AcceptSdkReactNative.types.js.map +1 -1
- package/build/AcceptSdkReactNativeModule.d.ts +12 -2
- package/build/AcceptSdkReactNativeModule.d.ts.map +1 -1
- package/build/AcceptSdkReactNativeModule.js.map +1 -1
- package/build/index.d.ts +103 -7
- package/build/index.d.ts.map +1 -1
- package/build/index.js +81 -4
- package/build/index.js.map +1 -1
- package/build/utils.d.ts +11 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +21 -0
- package/build/utils.js.map +1 -0
- package/ios/AcceptSdkReactNativeModule.swift +373 -40
- package/package.json +22 -7
- package/plugin/withCustomRepoModule.js +2 -7
|
@@ -1,17 +1,86 @@
|
|
|
1
|
+
/** Start and end hex colors for a gradient. */
|
|
2
|
+
export type GradientColors = {
|
|
3
|
+
/** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */
|
|
4
|
+
start: string;
|
|
5
|
+
/** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */
|
|
6
|
+
end: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Custom color palette. All four base colors are required when providing colors —
|
|
10
|
+
* they replace the entire color theme, not individual tokens.
|
|
11
|
+
*/
|
|
12
|
+
export type AcceptColorTheme = {
|
|
13
|
+
/** Primary accent color. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */
|
|
14
|
+
accent: string;
|
|
15
|
+
error: string;
|
|
16
|
+
warning: string;
|
|
17
|
+
success: string;
|
|
18
|
+
brandGradientColors?: GradientColors;
|
|
19
|
+
brandSubtleGradientColors?: GradientColors;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Custom image assets. All three slots are required when providing images —
|
|
23
|
+
* provide all or omit the `images` key entirely to use SDK defaults.
|
|
24
|
+
*/
|
|
25
|
+
export type AcceptImageTheme = {
|
|
26
|
+
/** Square logo used on branded screens. Base64-encoded PNG or JPEG. */
|
|
27
|
+
brandLogo: string;
|
|
28
|
+
/** Logo shown in toolbar / navigation bar. Base64-encoded PNG or JPEG. */
|
|
29
|
+
toolbarLogo: string;
|
|
30
|
+
/** Solid (monochrome) logo variant. Base64-encoded PNG or JPEG. */
|
|
31
|
+
solidLogo: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* UI theme overrides. Omit `colors` and/or `images` to keep SDK defaults for those slots.
|
|
35
|
+
*/
|
|
36
|
+
export type AcceptThemeConfiguration = {
|
|
37
|
+
colors?: AcceptColorTheme;
|
|
38
|
+
images?: AcceptImageTheme;
|
|
39
|
+
};
|
|
40
|
+
/** Where the NFC indicator is drawn relative to the tap zone. */
|
|
41
|
+
export type NfcIndicator = 'DEFAULT' | 'ABOVE' | 'BELOW' | 'FRONT' | 'BEHIND';
|
|
42
|
+
/**
|
|
43
|
+
* Position of the NFC tap zone on screen. Omit `position` from {@link NfcZone} to let the
|
|
44
|
+
* underlying terminal pick. Provide `{ xBias, yBias }` (each in `0..1`) for a manual position.
|
|
45
|
+
*/
|
|
46
|
+
export type NfcPosition = {
|
|
47
|
+
/** Horizontal bias (0.0 = left, 1.0 = right). */
|
|
48
|
+
xBias: number;
|
|
49
|
+
/** Vertical bias (0.0 = top, 1.0 = bottom). */
|
|
50
|
+
yBias: number;
|
|
51
|
+
};
|
|
52
|
+
/** Overrides the Tap-to-Pay NFC zone shown over the card payment flow. */
|
|
53
|
+
export type NfcZone = {
|
|
54
|
+
indicator: NfcIndicator;
|
|
55
|
+
/** Omit to let the underlying terminal pick the position. */
|
|
56
|
+
position?: NfcPosition;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Configures SDK-owned UI behavior around a transaction.
|
|
60
|
+
*
|
|
61
|
+
* @property resultScreenDurationSeconds How long the post-transaction result screen stays on
|
|
62
|
+
* screen before auto-closing. Ignored when `showResultScreen` is `false`. Defaults to `10`.
|
|
63
|
+
* @property showResultScreen Whether the SDK shows its own result screen after a transaction
|
|
64
|
+
* completes. Defaults to `true`.
|
|
65
|
+
* @property nfcZone Overrides the Tap-to-Pay NFC indicator and tap zone position.
|
|
66
|
+
*/
|
|
67
|
+
export type AcceptUiBehavior = {
|
|
68
|
+
resultScreenDurationSeconds?: number;
|
|
69
|
+
showResultScreen?: boolean;
|
|
70
|
+
nfcZone?: NfcZone;
|
|
71
|
+
};
|
|
1
72
|
/** Current authentication/initialization state of the SDK. */
|
|
2
73
|
export type SdkStatus = 'IDLE' | 'INITIALIZED' | 'LOGGED_IN';
|
|
3
|
-
/** Supported settlement and requested currencies. */
|
|
4
|
-
export type Currency = 'CZK' | 'EUR' | 'GBP';
|
|
5
74
|
/** Intent for initiating a card (tap-to-pay) payment. */
|
|
6
75
|
export type CardPaymentIntent = {
|
|
7
76
|
/** Unique payment intent identifier obtained from your backend. */
|
|
8
77
|
paymentIntentId: string;
|
|
9
78
|
/** Amount in the smallest currency unit (e.g. hellers for CZK, cents for EUR). */
|
|
10
79
|
amount: number;
|
|
11
|
-
/**
|
|
12
|
-
requestedCurrency:
|
|
13
|
-
/**
|
|
14
|
-
settlementCurrency?:
|
|
80
|
+
/** ISO 4217 alpha-3 currency code the customer is charged in. */
|
|
81
|
+
requestedCurrency: string;
|
|
82
|
+
/** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */
|
|
83
|
+
settlementCurrency?: string;
|
|
15
84
|
};
|
|
16
85
|
/** Intent for initiating a SEPA Instant bank transfer payment. */
|
|
17
86
|
export type SepaPaymentIntent = {
|
|
@@ -19,10 +88,10 @@ export type SepaPaymentIntent = {
|
|
|
19
88
|
paymentIntentId: string;
|
|
20
89
|
/** Amount in the smallest currency unit. */
|
|
21
90
|
amount: number;
|
|
22
|
-
/**
|
|
23
|
-
requestedCurrency:
|
|
24
|
-
/**
|
|
25
|
-
settlementCurrency?:
|
|
91
|
+
/** ISO 4217 alpha-3 currency code the customer is charged in. */
|
|
92
|
+
requestedCurrency: string;
|
|
93
|
+
/** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */
|
|
94
|
+
settlementCurrency?: string;
|
|
26
95
|
};
|
|
27
96
|
/** Intent for initiating a Certis Instant bank transfer payment. */
|
|
28
97
|
export type CertisPaymentIntent = {
|
|
@@ -30,10 +99,10 @@ export type CertisPaymentIntent = {
|
|
|
30
99
|
paymentIntentId: string;
|
|
31
100
|
/** Amount in the smallest currency unit. */
|
|
32
101
|
amount: number;
|
|
33
|
-
/**
|
|
34
|
-
requestedCurrency:
|
|
35
|
-
/**
|
|
36
|
-
settlementCurrency?:
|
|
102
|
+
/** ISO 4217 alpha-3 currency code the customer is charged in. */
|
|
103
|
+
requestedCurrency: string;
|
|
104
|
+
/** ISO 4217 alpha-3 currency code funds settle in. Defaults to `requestedCurrency` when omitted. */
|
|
105
|
+
settlementCurrency?: string;
|
|
37
106
|
};
|
|
38
107
|
/** Result of a completed card payment. */
|
|
39
108
|
export type CardPaymentResult = {
|
|
@@ -46,13 +115,18 @@ export type CardPaymentResult = {
|
|
|
46
115
|
companyAddress1?: string;
|
|
47
116
|
companyAddress2?: string;
|
|
48
117
|
companyCity?: string;
|
|
49
|
-
|
|
118
|
+
/** ISO 3166-1 alpha-2 country code (e.g. `CZ`, `SK`, `GB`). */
|
|
119
|
+
companyCountry?: string;
|
|
50
120
|
terminalId?: string;
|
|
51
121
|
authorizationCode?: string;
|
|
52
122
|
/** Card brand (e.g. `VISA`, `MASTERCARD`). */
|
|
53
123
|
brand?: string;
|
|
54
124
|
/** Decline or abort reason when status is not `approved`. */
|
|
55
125
|
reason?: string;
|
|
126
|
+
/** URL to the digital receipt for this transaction. */
|
|
127
|
+
receiptUrl?: string;
|
|
128
|
+
/** Server-issued token identifying a refund applied to this payment. Present when this card payment was refunded. */
|
|
129
|
+
refundToken?: string;
|
|
56
130
|
};
|
|
57
131
|
/** Intermediate status updates emitted during a card payment flow. */
|
|
58
132
|
export type CardPaymentStatus = 'pending' | 'approved' | 'declined' | 'refunded' | 'aborted';
|
|
@@ -66,6 +140,8 @@ export type SepaPaymentResult = {
|
|
|
66
140
|
receivedAt: string;
|
|
67
141
|
/** IBAN the funds were received from. */
|
|
68
142
|
receivedFromIban: string;
|
|
143
|
+
/** URL to the digital receipt for this transaction. */
|
|
144
|
+
receiptUrl?: string;
|
|
69
145
|
};
|
|
70
146
|
/** Intermediate status updates emitted during a SEPA Instant payment flow. */
|
|
71
147
|
export type SepaInstantPaymentStatus = 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined';
|
|
@@ -79,6 +155,8 @@ export type CertisPaymentResult = {
|
|
|
79
155
|
receivedAt: string;
|
|
80
156
|
/** IBAN the funds were received from. */
|
|
81
157
|
receivedFromIban: string;
|
|
158
|
+
/** URL to the digital receipt for this transaction. */
|
|
159
|
+
receiptUrl?: string;
|
|
82
160
|
};
|
|
83
161
|
/** Intermediate status updates emitted during a Certis Instant payment flow. */
|
|
84
162
|
export type CertisInstantPaymentStatus = 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined';
|
|
@@ -106,6 +184,65 @@ export type KybPrefillData = {
|
|
|
106
184
|
productDescription?: string;
|
|
107
185
|
supportPhone?: string;
|
|
108
186
|
};
|
|
187
|
+
/** Supported payment methods for onboarding status queries. */
|
|
188
|
+
export type PaymentMethod = 'CARD' | 'SEPA' | 'CERTIS' | 'CRYPTO';
|
|
189
|
+
/** Onboarding state for a single payment method. */
|
|
190
|
+
export type PaymentMethodStatus = 'NOT_STARTED' | 'PENDING' | 'ACTIVE' | 'ATTENTION_NEEDED' | 'ACTION_REQUIRED' | 'BLOCKED';
|
|
191
|
+
/** Per-method onboarding status entry. */
|
|
192
|
+
export type AcceptPaymentMethodStatus = {
|
|
193
|
+
method: PaymentMethod;
|
|
194
|
+
status: PaymentMethodStatus;
|
|
195
|
+
};
|
|
196
|
+
/** Aggregate onboarding status for the authenticated merchant. */
|
|
197
|
+
export type AcceptOnboardingStatus = {
|
|
198
|
+
/** `true` when the merchant has completed onboarding for at least one payment method. */
|
|
199
|
+
isOnboarded: boolean;
|
|
200
|
+
/** Per-method onboarding status entries. */
|
|
201
|
+
paymentMethods: AcceptPaymentMethodStatus[];
|
|
202
|
+
};
|
|
203
|
+
/** Reason a card refund is issued. */
|
|
204
|
+
export type RefundReason = 'customerRequest' | 'duplicate' | 'fraudulent' | 'expiredCharge';
|
|
205
|
+
/** Final state of a refund transaction. */
|
|
206
|
+
export type TransactionStatus = 'pending' | 'success' | 'cancelled' | 'refunded' | 'failed' | 'actionNeeded';
|
|
207
|
+
/** Arguments for {@link payments.refund}. */
|
|
208
|
+
export type RefundIntent = {
|
|
209
|
+
/** Token of the source payment to refund. Accepts the server payment UUID or the original charge's `paymentIntentId`. */
|
|
210
|
+
paymentToken: string;
|
|
211
|
+
/** Optional client-provided idempotency token. Pass the same value across retries to avoid duplicate refunds. */
|
|
212
|
+
refundToken?: string;
|
|
213
|
+
/** Reason for the refund. */
|
|
214
|
+
reason: RefundReason;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Result of a refund request.
|
|
218
|
+
*
|
|
219
|
+
* On iOS this is fully populated. On Android only `status` and `refundToken` are populated —
|
|
220
|
+
* call {@link getPaymentStatus} on the source payment for richer state.
|
|
221
|
+
*/
|
|
222
|
+
export type RefundResult = {
|
|
223
|
+
/** Server-generated refund token. May be undefined on Android. */
|
|
224
|
+
refundToken?: string;
|
|
225
|
+
/** Status of the refund transaction. */
|
|
226
|
+
status: TransactionStatus;
|
|
227
|
+
/** Payment method of the original transaction. iOS only. */
|
|
228
|
+
paymentMethod?: PaymentMethod;
|
|
229
|
+
/** Refund amount in the smallest unit of the requested currency. iOS only. */
|
|
230
|
+
requestedAmount?: number;
|
|
231
|
+
/** ISO 4217 alpha-3 code of the requested currency. iOS only. */
|
|
232
|
+
requestedCurrency?: string;
|
|
233
|
+
/** Refund amount in the smallest unit of the settlement currency. iOS only. */
|
|
234
|
+
settlementAmount?: number;
|
|
235
|
+
/** ISO 4217 alpha-3 code of the settlement currency. iOS only. */
|
|
236
|
+
settlementCurrency?: string;
|
|
237
|
+
/** Conversion rate from requested currency to settlement currency. iOS only. */
|
|
238
|
+
fxRate?: number;
|
|
239
|
+
/** Reason for the refund. */
|
|
240
|
+
refundReason: RefundReason;
|
|
241
|
+
/** ISO 8601 UTC timestamp when the refund was initiated. iOS only. */
|
|
242
|
+
createdAt?: string;
|
|
243
|
+
/** ISO 8601 UTC timestamp when the refund was processed. iOS only. */
|
|
244
|
+
processedAt?: string;
|
|
245
|
+
};
|
|
109
246
|
export type AcceptSdkReactNativeModuleEvents = {
|
|
110
247
|
onCardPaymentStatusChange: (status: Map<string, string>) => void;
|
|
111
248
|
onSepaPaymentStatusChange: (status: Map<string, string>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptSdkReactNative.types.d.ts","sourceRoot":"","sources":["../src/AcceptSdkReactNative.types.ts"],"names":[],"mappings":"AAAA,
|
|
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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D,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":["/** Current authentication/initialization state of the SDK. */\nexport type SdkStatus = 'IDLE' | 'INITIALIZED' | 'LOGGED_IN'\n\n/** Supported settlement and requested currencies. */\nexport type Currency = 'CZK' | 'EUR' | 'GBP'\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 /** Currency the customer is charged in. */\n requestedCurrency: Currency;\n /** Currency funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: Currency;\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 /** Currency the customer is charged in. */\n requestedCurrency: Currency;\n /** Currency funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: Currency;\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 /** Currency the customer is charged in. */\n requestedCurrency: Currency;\n /** Currency funds settle in. Defaults to `requestedCurrency` when omitted. */\n settlementCurrency?: Currency;\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 companyCountry?: number;\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}\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}\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}\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\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 */\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,7 +1,10 @@
|
|
|
1
1
|
import { NativeModule } from 'expo';
|
|
2
|
-
import { CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents } from './AcceptSdkReactNative.types';
|
|
2
|
+
import { AcceptThemeConfiguration, AcceptUiBehavior, CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents, AcceptOnboardingStatus, PaymentMethod, PaymentMethodStatus, RefundIntent, RefundResult } from './AcceptSdkReactNative.types';
|
|
3
3
|
declare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNativeModuleEvents> {
|
|
4
|
-
initialize(demo: boolean): Promise<
|
|
4
|
+
initialize(demo: boolean, theme?: AcceptThemeConfiguration): Promise<void>;
|
|
5
|
+
setTheme(theme: AcceptThemeConfiguration): Promise<void>;
|
|
6
|
+
/** @platform android */
|
|
7
|
+
setUiBehavior(behavior: AcceptUiBehavior): Promise<void>;
|
|
5
8
|
authenticate(token: string): Promise<boolean>;
|
|
6
9
|
getStatus(): Promise<'IDLE' | 'INITIALIZED' | 'LOGGED_IN'>;
|
|
7
10
|
getPaymentStatus(paymentIntentId: string): Promise<string>;
|
|
@@ -12,6 +15,13 @@ declare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNati
|
|
|
12
15
|
startCardPayment(paymentIntent: CardPaymentIntent): Promise<CardPaymentResult>;
|
|
13
16
|
startSepaPayment(paymentIntent: SepaPaymentIntent): Promise<SepaPaymentResult>;
|
|
14
17
|
startCertisPayment(paymentIntent: CertisPaymentIntent): Promise<CertisPaymentResult>;
|
|
18
|
+
refund(intent: RefundIntent): Promise<RefundResult>;
|
|
19
|
+
cancelActivePayment(): Promise<void>;
|
|
20
|
+
enableDemoMode(): Promise<void>;
|
|
21
|
+
disableDemoMode(): Promise<void>;
|
|
22
|
+
isDemoMode(): Promise<boolean>;
|
|
23
|
+
getOnboardingStatus(): Promise<AcceptOnboardingStatus>;
|
|
24
|
+
getPaymentMethodStatus(method: PaymentMethod): Promise<PaymentMethodStatus>;
|
|
15
25
|
/** @platform ios */
|
|
16
26
|
pairWithCompanionApp(): Promise<void>;
|
|
17
27
|
/** @platform ios */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceptSdkReactNativeModule.d.ts","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,cAAc,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"AcceptSdkReactNativeModule.d.ts","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,cAAc,EAAE,gCAAgC,EAAE,sBAAsB,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE1V,OAAO,OAAO,0BAA2B,SAAQ,YAAY,CAAC,gCAAgC,CAAC;IAC7F,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1E,QAAQ,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IACxD,wBAAwB;IACxB,aAAa,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IACxD,YAAY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ceptSdkReactNativeModule.js","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AcceptSdkReactNativeModule.js","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAoCzD,yDAAyD;AACzD,eAAe,mBAAmB,CAA6B,sBAAsB,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { AcceptThemeConfiguration, AcceptUiBehavior, CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents, AcceptOnboardingStatus, PaymentMethod, PaymentMethodStatus, RefundIntent, RefundResult } from './AcceptSdkReactNative.types';\n\ndeclare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNativeModuleEvents> {\n initialize(demo: boolean, theme?: AcceptThemeConfiguration): Promise<void>;\n setTheme(theme: AcceptThemeConfiguration): Promise<void>;\n /** @platform android */\n setUiBehavior(behavior: AcceptUiBehavior): Promise<void>;\n authenticate(token: string): Promise<boolean>;\n getStatus(): Promise<'IDLE' | 'INITIALIZED' | 'LOGGED_IN'>;\n getPaymentStatus(paymentIntentId: string): Promise<string>;\n logOut(): Promise<boolean>;\n requestLocationPermission(): Promise<boolean>;\n presentKyb(prefilling?: KybPrefillData): Promise<void>;\n isPaymentPending(): Promise<boolean>;\n startCardPayment(paymentIntent: CardPaymentIntent): Promise<CardPaymentResult>;\n startSepaPayment(paymentIntent: SepaPaymentIntent): Promise<SepaPaymentResult>;\n startCertisPayment(paymentIntent: CertisPaymentIntent): Promise<CertisPaymentResult>;\n refund(intent: RefundIntent): Promise<RefundResult>;\n cancelActivePayment(): Promise<void>;\n enableDemoMode(): Promise<void>;\n disableDemoMode(): Promise<void>;\n isDemoMode(): Promise<boolean>;\n getOnboardingStatus(): Promise<AcceptOnboardingStatus>;\n getPaymentMethodStatus(method: PaymentMethod): Promise<PaymentMethodStatus>;\n /** @platform ios */\n pairWithCompanionApp(): Promise<void>;\n\n /** @platform ios */\n isCompanionAppInstalled(): Promise<boolean>;\n\n /** @platform ios */\n presentCompanionAppSheet(): Promise<void>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<AcceptSdkReactNativeModule>('AcceptSdkReactNative');\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import { type CardPaymentResult, type SepaPaymentResult, type CertisPaymentResult, type CardPaymentIntent, type CertisPaymentIntent, type SepaPaymentIntent, type KybPrefillData, type SdkStatus, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus
|
|
2
|
-
export type { CardPaymentResult, SepaPaymentResult, CertisPaymentResult, CardPaymentIntent, SepaPaymentIntent, CertisPaymentIntent, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus, SdkStatus, KybPrefillData, };
|
|
3
|
-
export { Currency };
|
|
1
|
+
import { type AcceptThemeConfiguration, type AcceptColorTheme, type AcceptImageTheme, type AcceptUiBehavior, type NfcIndicator, type NfcPosition, type NfcZone, type GradientColors, type CardPaymentResult, type SepaPaymentResult, type CertisPaymentResult, type CardPaymentIntent, type CertisPaymentIntent, type SepaPaymentIntent, type KybPrefillData, type SdkStatus, type AcceptOnboardingStatus, type AcceptPaymentMethodStatus, type PaymentMethod, type PaymentMethodStatus, type RefundIntent, type RefundResult, type RefundReason, type TransactionStatus, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus } from './AcceptSdkReactNative.types';
|
|
2
|
+
export type { AcceptThemeConfiguration, AcceptColorTheme, AcceptImageTheme, AcceptUiBehavior, NfcIndicator, NfcPosition, NfcZone, GradientColors, CardPaymentResult, SepaPaymentResult, CertisPaymentResult, CardPaymentIntent, SepaPaymentIntent, CertisPaymentIntent, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus, SdkStatus, KybPrefillData, AcceptOnboardingStatus, AcceptPaymentMethodStatus, PaymentMethod, PaymentMethodStatus, RefundIntent, RefundResult, RefundReason, TransactionStatus, };
|
|
4
3
|
/**
|
|
5
4
|
* Initializes the SDK. Must be called before any other method.
|
|
6
5
|
* @param demo - If `true`, connects to the sandbox environment. Defaults to `false` (production).
|
|
6
|
+
* @param theme - Optional UI theme overrides applied at startup.
|
|
7
7
|
*/
|
|
8
|
-
export declare const initialize: (demo?: boolean) => Promise<void>;
|
|
8
|
+
export declare const initialize: (demo?: boolean, theme?: AcceptThemeConfiguration) => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Applies a UI theme after initialization. Can be called any time after {@link initialize}.
|
|
11
|
+
* @param theme - UI theme overrides. Omit `colors` or `images` to keep SDK defaults for those slots.
|
|
12
|
+
*/
|
|
13
|
+
export declare const setTheme: (theme: AcceptThemeConfiguration) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Configures SDK-owned UI behavior around a transaction —
|
|
16
|
+
* result-screen visibility/duration and Tap-to-Pay NFC zone overrides.
|
|
17
|
+
* No-op on iOS.
|
|
18
|
+
* @platform android
|
|
19
|
+
*/
|
|
20
|
+
export declare const setUiBehavior: (behavior: AcceptUiBehavior) => Promise<void>;
|
|
9
21
|
/**
|
|
10
22
|
* Authenticates a merchant session using a token obtained from your backend.
|
|
11
23
|
* Call after {@link initialize}.
|
|
@@ -61,6 +73,17 @@ export declare const identity: {
|
|
|
61
73
|
* @param prefilling - Optional data to pre-populate the onboarding form.
|
|
62
74
|
*/
|
|
63
75
|
presentKyb: (prefilling?: KybPrefillData) => Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Returns the merchant's aggregate onboarding status and per-method statuses.
|
|
78
|
+
* Requires an authenticated session.
|
|
79
|
+
*/
|
|
80
|
+
getOnboardingStatus: () => Promise<AcceptOnboardingStatus>;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the onboarding status for a single payment method.
|
|
83
|
+
* Requires an authenticated session.
|
|
84
|
+
* @param method - The payment method to query.
|
|
85
|
+
*/
|
|
86
|
+
getPaymentMethodStatus: (method: PaymentMethod) => Promise<PaymentMethodStatus>;
|
|
64
87
|
};
|
|
65
88
|
/** Payment methods for card and bank transfer terminals. */
|
|
66
89
|
export declare const payments: {
|
|
@@ -91,9 +114,43 @@ export declare const payments: {
|
|
|
91
114
|
* @throws If a payment is already in progress, or if the payment flow fails critically.
|
|
92
115
|
*/
|
|
93
116
|
startCertisPayment: (paymentIntent: CertisPaymentIntent, statusCallback: (status: CertisInstantPaymentStatus) => void, errorCallback: (message: string, exception: string) => void) => Promise<CertisPaymentResult>;
|
|
117
|
+
/**
|
|
118
|
+
* Refunds a previously completed card payment.
|
|
119
|
+
*
|
|
120
|
+
* Runs headlessly — no UI is shown.
|
|
121
|
+
* @param intent - Refund details.
|
|
122
|
+
* @returns The refund result. On iOS, fully populated. On Android, only `status` and `refundReason` are guaranteed —
|
|
123
|
+
* call {@link getPaymentStatus} on the source payment for richer state.
|
|
124
|
+
* @throws If the source payment is not found, the refund is in conflict (already refunded, wrong state),
|
|
125
|
+
* or the SDK is not initialized / authenticated.
|
|
126
|
+
*/
|
|
127
|
+
refund: (intent: RefundIntent) => Promise<RefundResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Cancels the currently active payment flow.
|
|
130
|
+
*
|
|
131
|
+
* Dismisses any payment UI and — if still pending — cancels the transaction server-side.
|
|
132
|
+
* The in-flight `startCardPayment` / `startSepaPayment` / `startCertisPayment` promise resolves
|
|
133
|
+
* to an aborted result.
|
|
134
|
+
* @throws If no payment flow is currently in progress.
|
|
135
|
+
*/
|
|
136
|
+
cancelActivePayment: () => Promise<void>;
|
|
94
137
|
};
|
|
95
|
-
|
|
96
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Demo mode toggles. When enabled, payment flows bypass real terminals and return
|
|
140
|
+
* synthetic results — useful for development and screenshots.
|
|
141
|
+
*/
|
|
142
|
+
export declare const demo: {
|
|
143
|
+
/** Enables demo mode. Subsequent payments will be simulated. */
|
|
144
|
+
enable: () => Promise<void>;
|
|
145
|
+
/** Disables demo mode and returns to real terminal flows. */
|
|
146
|
+
disable: () => Promise<void>;
|
|
147
|
+
/** Returns whether demo mode is currently enabled. */
|
|
148
|
+
isEnabled: () => Promise<boolean>;
|
|
149
|
+
};
|
|
150
|
+
declare const Accept: {
|
|
151
|
+
initialize: (demo?: boolean, theme?: AcceptThemeConfiguration) => Promise<void>;
|
|
152
|
+
setTheme: (theme: AcceptThemeConfiguration) => Promise<void>;
|
|
153
|
+
setUiBehavior: (behavior: AcceptUiBehavior) => Promise<void>;
|
|
97
154
|
authenticate: (token: string) => Promise<void>;
|
|
98
155
|
getStatus: () => Promise<SdkStatus>;
|
|
99
156
|
getPaymentStatus: (paymentIntentId: string) => Promise<CardPaymentResult | SepaPaymentResult | CertisPaymentResult>;
|
|
@@ -109,6 +166,17 @@ declare const AcceptSDK: {
|
|
|
109
166
|
* @param prefilling - Optional data to pre-populate the onboarding form.
|
|
110
167
|
*/
|
|
111
168
|
presentKyb: (prefilling?: KybPrefillData) => Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Returns the merchant's aggregate onboarding status and per-method statuses.
|
|
171
|
+
* Requires an authenticated session.
|
|
172
|
+
*/
|
|
173
|
+
getOnboardingStatus: () => Promise<AcceptOnboardingStatus>;
|
|
174
|
+
/**
|
|
175
|
+
* Returns the onboarding status for a single payment method.
|
|
176
|
+
* Requires an authenticated session.
|
|
177
|
+
* @param method - The payment method to query.
|
|
178
|
+
*/
|
|
179
|
+
getPaymentMethodStatus: (method: PaymentMethod) => Promise<PaymentMethodStatus>;
|
|
112
180
|
};
|
|
113
181
|
payments: {
|
|
114
182
|
/**
|
|
@@ -138,7 +206,35 @@ declare const AcceptSDK: {
|
|
|
138
206
|
* @throws If a payment is already in progress, or if the payment flow fails critically.
|
|
139
207
|
*/
|
|
140
208
|
startCertisPayment: (paymentIntent: CertisPaymentIntent, statusCallback: (status: CertisInstantPaymentStatus) => void, errorCallback: (message: string, exception: string) => void) => Promise<CertisPaymentResult>;
|
|
209
|
+
/**
|
|
210
|
+
* Refunds a previously completed card payment.
|
|
211
|
+
*
|
|
212
|
+
* Runs headlessly — no UI is shown.
|
|
213
|
+
* @param intent - Refund details.
|
|
214
|
+
* @returns The refund result. On iOS, fully populated. On Android, only `status` and `refundReason` are guaranteed —
|
|
215
|
+
* call {@link getPaymentStatus} on the source payment for richer state.
|
|
216
|
+
* @throws If the source payment is not found, the refund is in conflict (already refunded, wrong state),
|
|
217
|
+
* or the SDK is not initialized / authenticated.
|
|
218
|
+
*/
|
|
219
|
+
refund: (intent: RefundIntent) => Promise<RefundResult>;
|
|
220
|
+
/**
|
|
221
|
+
* Cancels the currently active payment flow.
|
|
222
|
+
*
|
|
223
|
+
* Dismisses any payment UI and — if still pending — cancels the transaction server-side.
|
|
224
|
+
* The in-flight `startCardPayment` / `startSepaPayment` / `startCertisPayment` promise resolves
|
|
225
|
+
* to an aborted result.
|
|
226
|
+
* @throws If no payment flow is currently in progress.
|
|
227
|
+
*/
|
|
228
|
+
cancelActivePayment: () => Promise<void>;
|
|
229
|
+
};
|
|
230
|
+
demo: {
|
|
231
|
+
/** Enables demo mode. Subsequent payments will be simulated. */
|
|
232
|
+
enable: () => Promise<void>;
|
|
233
|
+
/** Disables demo mode and returns to real terminal flows. */
|
|
234
|
+
disable: () => Promise<void>;
|
|
235
|
+
/** Returns whether demo mode is currently enabled. */
|
|
236
|
+
isEnabled: () => Promise<boolean>;
|
|
141
237
|
};
|
|
142
238
|
};
|
|
143
|
-
export default
|
|
239
|
+
export default Accept;
|
|
144
240
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAGtC,YAAY,EACV,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,OAAO,EACP,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,iBAAiB,GAClB,CAAC;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AcceptSdkReactNative from './AcceptSdkReactNativeModule';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes the SDK. Must be called before any other method.
|
|
4
4
|
* @param demo - If `true`, connects to the sandbox environment. Defaults to `false` (production).
|
|
5
|
+
* @param theme - Optional UI theme overrides applied at startup.
|
|
5
6
|
*/
|
|
6
|
-
export const initialize = (demo = false) => {
|
|
7
|
-
return AcceptSdkReactNative.initialize(demo
|
|
7
|
+
export const initialize = (demo = false, theme) => {
|
|
8
|
+
return AcceptSdkReactNative.initialize(demo, theme);
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Applies a UI theme after initialization. Can be called any time after {@link initialize}.
|
|
12
|
+
* @param theme - UI theme overrides. Omit `colors` or `images` to keep SDK defaults for those slots.
|
|
13
|
+
*/
|
|
14
|
+
export const setTheme = (theme) => {
|
|
15
|
+
return AcceptSdkReactNative.setTheme(theme);
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Configures SDK-owned UI behavior around a transaction —
|
|
19
|
+
* result-screen visibility/duration and Tap-to-Pay NFC zone overrides.
|
|
20
|
+
* No-op on iOS.
|
|
21
|
+
* @platform android
|
|
22
|
+
*/
|
|
23
|
+
export const setUiBehavior = (behavior) => {
|
|
24
|
+
return AcceptSdkReactNative.setUiBehavior(behavior);
|
|
8
25
|
};
|
|
9
26
|
/**
|
|
10
27
|
* Authenticates a merchant session using a token obtained from your backend.
|
|
@@ -92,6 +109,21 @@ export const identity = {
|
|
|
92
109
|
presentKyb: (prefilling) => {
|
|
93
110
|
return AcceptSdkReactNative.presentKyb(prefilling);
|
|
94
111
|
},
|
|
112
|
+
/**
|
|
113
|
+
* Returns the merchant's aggregate onboarding status and per-method statuses.
|
|
114
|
+
* Requires an authenticated session.
|
|
115
|
+
*/
|
|
116
|
+
getOnboardingStatus: () => {
|
|
117
|
+
return AcceptSdkReactNative.getOnboardingStatus();
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Returns the onboarding status for a single payment method.
|
|
121
|
+
* Requires an authenticated session.
|
|
122
|
+
* @param method - The payment method to query.
|
|
123
|
+
*/
|
|
124
|
+
getPaymentMethodStatus: (method) => {
|
|
125
|
+
return AcceptSdkReactNative.getPaymentMethodStatus(method);
|
|
126
|
+
},
|
|
95
127
|
};
|
|
96
128
|
/** Payment methods for card and bank transfer terminals. */
|
|
97
129
|
export const payments = {
|
|
@@ -162,9 +194,53 @@ export const payments = {
|
|
|
162
194
|
});
|
|
163
195
|
return result;
|
|
164
196
|
},
|
|
197
|
+
/**
|
|
198
|
+
* Refunds a previously completed card payment.
|
|
199
|
+
*
|
|
200
|
+
* Runs headlessly — no UI is shown.
|
|
201
|
+
* @param intent - Refund details.
|
|
202
|
+
* @returns The refund result. On iOS, fully populated. On Android, only `status` and `refundReason` are guaranteed —
|
|
203
|
+
* call {@link getPaymentStatus} on the source payment for richer state.
|
|
204
|
+
* @throws If the source payment is not found, the refund is in conflict (already refunded, wrong state),
|
|
205
|
+
* or the SDK is not initialized / authenticated.
|
|
206
|
+
*/
|
|
207
|
+
refund: (intent) => {
|
|
208
|
+
return AcceptSdkReactNative.refund(intent);
|
|
209
|
+
},
|
|
210
|
+
/**
|
|
211
|
+
* Cancels the currently active payment flow.
|
|
212
|
+
*
|
|
213
|
+
* Dismisses any payment UI and — if still pending — cancels the transaction server-side.
|
|
214
|
+
* The in-flight `startCardPayment` / `startSepaPayment` / `startCertisPayment` promise resolves
|
|
215
|
+
* to an aborted result.
|
|
216
|
+
* @throws If no payment flow is currently in progress.
|
|
217
|
+
*/
|
|
218
|
+
cancelActivePayment: () => {
|
|
219
|
+
return AcceptSdkReactNative.cancelActivePayment();
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Demo mode toggles. When enabled, payment flows bypass real terminals and return
|
|
224
|
+
* synthetic results — useful for development and screenshots.
|
|
225
|
+
*/
|
|
226
|
+
export const demo = {
|
|
227
|
+
/** Enables demo mode. Subsequent payments will be simulated. */
|
|
228
|
+
enable: () => {
|
|
229
|
+
return AcceptSdkReactNative.enableDemoMode();
|
|
230
|
+
},
|
|
231
|
+
/** Disables demo mode and returns to real terminal flows. */
|
|
232
|
+
disable: () => {
|
|
233
|
+
return AcceptSdkReactNative.disableDemoMode();
|
|
234
|
+
},
|
|
235
|
+
/** Returns whether demo mode is currently enabled. */
|
|
236
|
+
isEnabled: () => {
|
|
237
|
+
return AcceptSdkReactNative.isDemoMode();
|
|
238
|
+
},
|
|
165
239
|
};
|
|
166
|
-
const
|
|
240
|
+
const Accept = {
|
|
167
241
|
initialize,
|
|
242
|
+
setTheme,
|
|
243
|
+
setUiBehavior,
|
|
168
244
|
authenticate,
|
|
169
245
|
getStatus,
|
|
170
246
|
getPaymentStatus,
|
|
@@ -175,6 +251,7 @@ const AcceptSDK = {
|
|
|
175
251
|
presentCompanionAppSheet,
|
|
176
252
|
identity,
|
|
177
253
|
payments,
|
|
254
|
+
demo,
|
|
178
255
|
};
|
|
179
|
-
export default
|
|
256
|
+
export default Accept;
|
|
180
257
|
//# sourceMappingURL=index.js.map
|