@tapayadot/accept-react-native 1.0.0 → 1.1.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 CHANGED
@@ -56,6 +56,40 @@ await AcceptSDK.initialize(/* demo: */ false);
56
56
  await AcceptSDK.authenticate('your-merchant-token');
57
57
  ```
58
58
 
59
+ ### UI Theming
60
+
61
+ Customize colors and logos at initialization or any time after:
62
+
63
+ ```ts
64
+ import AcceptSDK, { type AcceptThemeConfiguration } from '@tapayadot/accept-react-native';
65
+ import { assetToBase64 } from '@tapayadot/accept-react-native/utils';
66
+
67
+ const theme: AcceptThemeConfiguration = {
68
+ colors: {
69
+ accent: '#FF8400',
70
+ error: '#E6282B',
71
+ warning: '#FF8000',
72
+ success: '#228800',
73
+ brandGradientColors: { start: '#FF8400', end: '#9A94E9' },
74
+ },
75
+ images: {
76
+ brandLogo: await assetToBase64(require('./assets/brand-logo.png')),
77
+ toolbarLogo: await assetToBase64(require('./assets/toolbar-logo.png')),
78
+ solidLogo: await assetToBase64(require('./assets/solid-logo.png')),
79
+ },
80
+ };
81
+
82
+ // Pass at initialization
83
+ await AcceptSDK.initialize(false, theme);
84
+
85
+ // Or apply after initialization
86
+ await AcceptSDK.setTheme(theme);
87
+ ```
88
+
89
+ Omit `colors` or `images` to keep SDK defaults for that slot. Images must be PNG or JPEG — SVG is not supported.
90
+
91
+ > `assetToBase64` requires `expo-asset` and `expo-file-system`. Both are included in managed Expo projects. Bare React Native users must install them manually.
92
+
59
93
  ### Request Location Permission
60
94
 
61
95
  Required before processing card payments (Tap-to-Pay):
@@ -182,7 +216,8 @@ if (!installed) {
182
216
 
183
217
  | Method | Description |
184
218
  |---|---|
185
- | `initialize(demo?)` | Initialize the SDK. Pass `true` for sandbox mode. |
219
+ | `initialize(demo?, theme?)` | Initialize the SDK. Pass `true` for sandbox mode. Optionally provide a UI theme. |
220
+ | `setTheme(theme)` | Apply a UI theme after initialization. |
186
221
  | `authenticate(token)` | Authenticate with a merchant JWT token. |
187
222
  | `getStatus()` | Returns `'IDLE' \| 'INITIALIZED' \| 'LOGGED_IN'`. |
188
223
  | `getPaymentStatus(paymentIntentId)` | Retrieve the result of a previous payment. |
@@ -226,13 +261,36 @@ type CardPaymentResult = {
226
261
  terminalId?: string
227
262
  companyName?: string
228
263
  reason?: string
264
+ receiptUrl?: string
229
265
  }
230
266
 
231
267
  type SepaPaymentIntent = { paymentIntentId: string; amount: number; requestedCurrency: Currency; settlementCurrency?: Currency }
232
- type SepaPaymentResult = { status: 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined'; postponed: boolean; receivedAt: string; receivedFromIban: string }
268
+ type SepaPaymentResult = { status: 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined'; postponed: boolean; receivedAt: string; receivedFromIban: string; receiptUrl?: string }
233
269
 
234
270
  type CertisPaymentIntent = { paymentIntentId: string; amount: number; requestedCurrency: Currency; settlementCurrency?: Currency }
235
- type CertisPaymentResult = { status: 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined'; postponed: boolean; receivedAt: string; receivedFromIban: string }
271
+ type CertisPaymentResult = { status: 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined'; postponed: boolean; receivedAt: string; receivedFromIban: string; receiptUrl?: string }
272
+
273
+ type GradientColors = { start: string; end: string }
274
+
275
+ type AcceptColorTheme = {
276
+ accent: string // #RRGGBB or #AARRGGBB
277
+ error: string
278
+ warning: string
279
+ success: string
280
+ brandGradientColors?: GradientColors
281
+ brandSubtleGradientColors?: GradientColors
282
+ }
283
+
284
+ type AcceptImageTheme = {
285
+ brandLogo: string // base64 PNG/JPEG
286
+ toolbarLogo: string
287
+ solidLogo: string
288
+ }
289
+
290
+ type AcceptThemeConfiguration = {
291
+ colors?: AcceptColorTheme
292
+ images?: AcceptImageTheme
293
+ }
236
294
 
237
295
  type KybPrefillData = {
238
296
  businessType?: 'individual' | 'company' | 'nonProfit' | 'governmentEntity'
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'com.tapaya.acceptsdkreactnative'
4
- version = '0.1.0'
4
+ version = '1.1.0'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -35,7 +35,7 @@ android {
35
35
  namespace "com.tapaya.acceptsdkreactnative"
36
36
  defaultConfig {
37
37
  versionCode 1
38
- versionName "0.1.0"
38
+ versionName "1.1.0"
39
39
  }
40
40
  lintOptions {
41
41
  abortOnError false
@@ -43,7 +43,8 @@ android {
43
43
  }
44
44
 
45
45
  dependencies {
46
- implementation 'com.tapaya:accept:1.0.29'
46
+ implementation 'com.tapaya:accept:1.1.0'
47
47
  implementation 'com.google.code.gson:gson:2.13.2'
48
48
  implementation 'androidx.appcompat:appcompat:1.7.1'
49
+ implementation 'androidx.compose.ui:ui:1.8.2'
49
50
  }
@@ -1,5 +1,6 @@
1
1
  package com.tapaya.acceptsdkreactnative
2
2
 
3
+ import android.util.Base64
3
4
  import com.google.gson.Gson
4
5
  import com.tapaya.accept.AcceptSDK
5
6
  import com.tapaya.accept.external.IdentityData
@@ -13,6 +14,12 @@ import com.tapaya.core.model.external.result.AbstractPaymentResult
13
14
  import com.tapaya.core.model.external.result.CardPaymentResult
14
15
  import com.tapaya.core.model.external.result.CertisInstantPaymentResult
15
16
  import com.tapaya.core.model.external.result.SepaInstantPaymentResult
17
+ import com.tapaya.core.ui.theme.AcceptColorTheme
18
+ import com.tapaya.core.ui.theme.AcceptImageSource
19
+ import com.tapaya.core.ui.theme.AcceptImageTheme
20
+ import com.tapaya.core.ui.theme.AcceptThemeConfiguration
21
+ import com.tapaya.core.ui.theme.AcceptThemeSource
22
+ import com.tapaya.core.ui.theme.GradientColors
16
23
  import expo.modules.interfaces.permissions.PermissionsStatus
17
24
  import expo.modules.kotlin.functions.Coroutine
18
25
  import expo.modules.kotlin.modules.Module
@@ -74,6 +81,8 @@ class CardPaymentResultReactNative(
74
81
  @Field
75
82
  var reason: String = "",
76
83
  @Field
84
+ var receiptUrl: String? = null,
85
+ @Field
77
86
  var type: String = "",
78
87
  ) : Record
79
88
 
@@ -91,6 +100,7 @@ fun CardPaymentResult.toReactNative(): CardPaymentResultReactNative {
91
100
  authorizationCode = authorizationCode ?: "",
92
101
  brand = brand?.name ?: "",
93
102
  reason = reason?.name ?: "",
103
+ receiptUrl = receiptUrl,
94
104
  type = "card"
95
105
  )
96
106
  }
@@ -129,6 +139,8 @@ class SepaPaymentInstantResultReactNative(
129
139
  @Field
130
140
  var receivedFromIban: String = "",
131
141
  @Field
142
+ var receiptUrl: String? = null,
143
+ @Field
132
144
  var type: String = "",
133
145
  ) : Record
134
146
 
@@ -138,6 +150,7 @@ fun SepaInstantPaymentResult.toReactNative(): SepaPaymentInstantResultReactNativ
138
150
  postponed = postponed,
139
151
  receivedAt = receivedAt.toString(),
140
152
  receivedFromIban = receivedFromIban ?: "",
153
+ receiptUrl = receiptUrl,
141
154
  type = "sepa"
142
155
  )
143
156
  }
@@ -176,6 +189,8 @@ class CertisPaymentInstantResultReactNative(
176
189
  @Field
177
190
  var receivedFromIban: String = "",
178
191
  @Field
192
+ var receiptUrl: String? = null,
193
+ @Field
179
194
  var type: String = "",
180
195
  ) : Record
181
196
 
@@ -185,11 +200,67 @@ fun CertisInstantPaymentResult.toReactNative(): CertisPaymentInstantResultReactN
185
200
  postponed = postponed,
186
201
  receivedAt = receivedAt.toString(),
187
202
  receivedFromIban = receivedFromIban ?: "",
203
+ receiptUrl = receiptUrl,
188
204
  type = "certis"
189
205
  )
190
206
  }
191
207
 
192
208
 
209
+ class GradientColorsRecord : Record {
210
+ @Field var start: String = ""
211
+ @Field var end: String = ""
212
+ }
213
+
214
+ class AcceptColorThemeRecord : Record {
215
+ @Field var accent: String = ""
216
+ @Field var error: String = ""
217
+ @Field var warning: String = ""
218
+ @Field var success: String = ""
219
+ @Field var brandGradientColors: GradientColorsRecord? = null
220
+ @Field var brandSubtleGradientColors: GradientColorsRecord? = null
221
+
222
+ fun toAcceptColorTheme(): AcceptColorTheme = AcceptColorTheme(
223
+ accent = accent.toComposeColor(),
224
+ error = error.toComposeColor(),
225
+ warning = warning.toComposeColor(),
226
+ success = success.toComposeColor(),
227
+ brandGradientColors = brandGradientColors?.let { GradientColors(it.start.toComposeColor(), it.end.toComposeColor()) },
228
+ brandSubtleGradientColors = brandSubtleGradientColors?.let { GradientColors(it.start.toComposeColor(), it.end.toComposeColor()) },
229
+ )
230
+ }
231
+
232
+ class AcceptImageThemeRecord : Record {
233
+ @Field var brandLogo: String = ""
234
+ @Field var toolbarLogo: String = ""
235
+ @Field var solidLogo: String = ""
236
+
237
+ fun toAcceptImageTheme(): AcceptImageTheme = try {
238
+ AcceptImageTheme(
239
+ brandLogo = AcceptImageSource.Data(Base64.decode(brandLogo, Base64.DEFAULT)),
240
+ toolbarLogo = AcceptImageSource.Data(Base64.decode(toolbarLogo, Base64.DEFAULT)),
241
+ solidLogo = AcceptImageSource.Data(Base64.decode(solidLogo, Base64.DEFAULT)),
242
+ )
243
+ } catch (e: IllegalArgumentException) {
244
+ throw Exception("ThemeError: invalid base64 image data — ${e.message}")
245
+ }
246
+ }
247
+
248
+ class AcceptThemeConfigurationRecord : Record {
249
+ @Field var colors: AcceptColorThemeRecord? = null
250
+ @Field var images: AcceptImageThemeRecord? = null
251
+
252
+ fun toAcceptThemeConfiguration(): AcceptThemeConfiguration = AcceptThemeConfiguration(
253
+ colors = colors?.let { AcceptThemeSource.Local(it.toAcceptColorTheme()) } ?: AcceptThemeSource.Default,
254
+ images = images?.let { AcceptThemeSource.Local(it.toAcceptImageTheme()) } ?: AcceptThemeSource.Default,
255
+ )
256
+ }
257
+
258
+ private fun String.toComposeColor(): androidx.compose.ui.graphics.Color = try {
259
+ androidx.compose.ui.graphics.Color(android.graphics.Color.parseColor(this))
260
+ } catch (e: IllegalArgumentException) {
261
+ throw Exception("ThemeError: invalid color '$this'. Expected #RRGGBB or #AARRGGBB — ${e.message}")
262
+ }
263
+
193
264
  class KybPrefillDataRecord : Record {
194
265
  @Field var businessType: String? = null
195
266
  @Field var countryCode: String? = null
@@ -241,9 +312,13 @@ class AcceptSdkReactNativeModule : Module() {
241
312
  "onCertisPaymentException",
242
313
  )
243
314
 
244
- AsyncFunction("initialize") Coroutine { demo: Boolean ->
315
+ AsyncFunction("initialize") Coroutine { demo: Boolean, theme: AcceptThemeConfigurationRecord? ->
245
316
  val context = appContext.reactContext ?: throw Exception("Context not available")
246
- AcceptSDK.initialize(context, demo)
317
+ AcceptSDK.initialize(context, demo, theme?.toAcceptThemeConfiguration() ?: AcceptThemeConfiguration.Default)
318
+ }
319
+
320
+ AsyncFunction("setTheme") Coroutine { theme: AcceptThemeConfigurationRecord ->
321
+ AcceptSDK.setThemeConfiguration(theme.toAcceptThemeConfiguration())
247
322
  }
248
323
 
249
324
  AsyncFunction("authenticate") Coroutine { token: String ->
@@ -1,3 +1,42 @@
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
+ };
1
40
  /** Current authentication/initialization state of the SDK. */
2
41
  export type SdkStatus = 'IDLE' | 'INITIALIZED' | 'LOGGED_IN';
3
42
  /** Supported settlement and requested currencies. */
@@ -53,6 +92,8 @@ export type CardPaymentResult = {
53
92
  brand?: string;
54
93
  /** Decline or abort reason when status is not `approved`. */
55
94
  reason?: string;
95
+ /** URL to the digital receipt for this transaction. */
96
+ receiptUrl?: string;
56
97
  };
57
98
  /** Intermediate status updates emitted during a card payment flow. */
58
99
  export type CardPaymentStatus = 'pending' | 'approved' | 'declined' | 'refunded' | 'aborted';
@@ -66,6 +107,8 @@ export type SepaPaymentResult = {
66
107
  receivedAt: string;
67
108
  /** IBAN the funds were received from. */
68
109
  receivedFromIban: string;
110
+ /** URL to the digital receipt for this transaction. */
111
+ receiptUrl?: string;
69
112
  };
70
113
  /** Intermediate status updates emitted during a SEPA Instant payment flow. */
71
114
  export type SepaInstantPaymentStatus = 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined';
@@ -79,6 +122,8 @@ export type CertisPaymentResult = {
79
122
  receivedAt: string;
80
123
  /** IBAN the funds were received from. */
81
124
  receivedFromIban: string;
125
+ /** URL to the digital receipt for this transaction. */
126
+ receiptUrl?: string;
82
127
  };
83
128
  /** Intermediate status updates emitted during a Certis Instant payment flow. */
84
129
  export type CertisInstantPaymentStatus = 'pending' | 'verified' | 'aborted' | 'refunded' | 'declined';
@@ -1 +1 @@
1
- {"version":3,"file":"AcceptSdkReactNative.types.d.ts","sourceRoot":"","sources":["../src/AcceptSdkReactNative.types.ts"],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C;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,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":["/** 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/** 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 /** URL to the digital receipt for this transaction. */\n receiptUrl?: 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\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,8 @@
1
1
  import { NativeModule } from 'expo';
2
- import { CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents } from './AcceptSdkReactNative.types';
2
+ import { AcceptThemeConfiguration, CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents } from './AcceptSdkReactNative.types';
3
3
  declare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNativeModuleEvents> {
4
- initialize(demo: boolean): Promise<boolean>;
4
+ initialize(demo: boolean, theme?: AcceptThemeConfiguration): Promise<void>;
5
+ setTheme(theme: AcceptThemeConfiguration): Promise<void>;
5
6
  authenticate(token: string): Promise<boolean>;
6
7
  getStatus(): Promise<'IDLE' | 'INITIALIZED' | 'LOGGED_IN'>;
7
8
  getPaymentStatus(paymentIntentId: string): Promise<string>;
@@ -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;AAEtN,OAAO,OAAO,0BAA2B,SAAQ,YAAY,CAAC,gCAAgC,CAAC;IAC7F,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAC3C,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAC7C,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,aAAa,GAAG,WAAW,CAAC;IAC1D,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1D,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAC1B,yBAAyB,IAAI,OAAO,CAAC,OAAO,CAAC;IAC7C,UAAU,CAAC,UAAU,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IACtD,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IACpC,gBAAgB,CAAC,aAAa,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAC9E,gBAAgB,CAAC,aAAa,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAC9E,kBAAkB,CAAC,aAAa,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,C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AAC;IAC9E,gBAAgB,CAAC,aAAa,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAC9E,kBAAkB,CAAC,aAAa,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IACpF,oBAAoB;IACpB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAErC,oBAAoB;IACpB,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC;IAE3C,oBAAoB;IACpB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;CAC1C;;AAGD,wBAAuF"}
@@ -1 +1 @@
1
- {"version":3,"file":"AcceptSdkReactNativeModule.js","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AA0BzD,yDAAyD;AACzD,eAAe,mBAAmB,CAA6B,sBAAsB,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents } from './AcceptSdkReactNative.types';\n\ndeclare class AcceptSdkReactNativeModule extends NativeModule<AcceptSdkReactNativeModuleEvents> {\n initialize(demo: boolean): Promise<boolean>;\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 /** @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"]}
1
+ {"version":3,"file":"AcceptSdkReactNativeModule.js","sourceRoot":"","sources":["../src/AcceptSdkReactNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AA2BzD,yDAAyD;AACzD,eAAe,mBAAmB,CAA6B,sBAAsB,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { AcceptThemeConfiguration, CardPaymentIntent, CardPaymentResult, SepaPaymentIntent, SepaPaymentResult, CertisPaymentIntent, CertisPaymentResult, KybPrefillData, AcceptSdkReactNativeModuleEvents } 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 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 /** @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,17 @@
1
- import { type CardPaymentResult, type SepaPaymentResult, type CertisPaymentResult, type CardPaymentIntent, type CertisPaymentIntent, type SepaPaymentIntent, type KybPrefillData, type SdkStatus, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus, Currency } from './AcceptSdkReactNative.types';
2
- export type { CardPaymentResult, SepaPaymentResult, CertisPaymentResult, CardPaymentIntent, SepaPaymentIntent, CertisPaymentIntent, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus, SdkStatus, KybPrefillData, };
1
+ import { type AcceptThemeConfiguration, type AcceptColorTheme, type AcceptImageTheme, type GradientColors, type CardPaymentResult, type SepaPaymentResult, type CertisPaymentResult, type CardPaymentIntent, type CertisPaymentIntent, type SepaPaymentIntent, type KybPrefillData, type SdkStatus, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus, Currency } from './AcceptSdkReactNative.types';
2
+ export type { AcceptThemeConfiguration, AcceptColorTheme, AcceptImageTheme, GradientColors, CardPaymentResult, SepaPaymentResult, CertisPaymentResult, CardPaymentIntent, SepaPaymentIntent, CertisPaymentIntent, CardPaymentStatus, SepaInstantPaymentStatus, CertisInstantPaymentStatus, SdkStatus, KybPrefillData, };
3
3
  export { Currency };
4
4
  /**
5
5
  * Initializes the SDK. Must be called before any other method.
6
6
  * @param demo - If `true`, connects to the sandbox environment. Defaults to `false` (production).
7
+ * @param theme - Optional UI theme overrides applied at startup.
7
8
  */
8
- export declare const initialize: (demo?: boolean) => Promise<void>;
9
+ export declare const initialize: (demo?: boolean, theme?: AcceptThemeConfiguration) => Promise<void>;
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 declare const setTheme: (theme: AcceptThemeConfiguration) => Promise<void>;
9
15
  /**
10
16
  * Authenticates a merchant session using a token obtained from your backend.
11
17
  * Call after {@link initialize}.
@@ -93,7 +99,8 @@ export declare const payments: {
93
99
  startCertisPayment: (paymentIntent: CertisPaymentIntent, statusCallback: (status: CertisInstantPaymentStatus) => void, errorCallback: (message: string, exception: string) => void) => Promise<CertisPaymentResult>;
94
100
  };
95
101
  declare const AcceptSDK: {
96
- initialize: (demo?: boolean) => Promise<void>;
102
+ initialize: (demo?: boolean, theme?: AcceptThemeConfiguration) => Promise<void>;
103
+ setTheme: (theme: AcceptThemeConfiguration) => Promise<void>;
97
104
  authenticate: (token: string) => Promise<void>;
98
105
  getStatus: () => Promise<SdkStatus>;
99
106
  getPaymentStatus: (paymentIntentId: string) => Promise<CardPaymentResult | SepaPaymentResult | CertisPaymentResult>;
@@ -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,EAC1B,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAGtC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,0BAA0B,EAC1B,SAAS,EACT,cAAc,GACf,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAM,OAAe,KAAG,OAAO,CAAC,IAAI,CAE9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OAAO,CAAC,IAAI,CAExD,CAAC;AAEF;;;;;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IAAI,CAAC;qCAQM,OAAO,CAAC,OAAO,CAAC;gCAQrB,OAAO,CAAC,IAAI,CAAC;mCAQV,OAAO,CAAC,OAAO,CAAC;oCASf,OAAO,CAAC,IAAI,CAAC;;QAMvD;;;;WAIG;kCACuB,cAAc,KAAG,OAAO,CAAC,IAAI,CAAC;;;QAOxD;;;;;;;WAOG;0CAEc,iBAAiB,kBAChB,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,iBACpC,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,KAC1D,OAAO,CAAC,iBAAiB,CAAC;QAsB7B;;;;;;;WAOG;0CAEc,iBAAiB,kBAChB,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,iBAC3C,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,KAC1D,OAAO,CAAC,iBAAiB,CAAC;QAsB7B;;;;;;;WAOG;4CAEc,mBAAmB,kBAClB,CAAC,MAAM,EAAE,0BAA0B,KAAK,IAAI,iBAC7C,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,KAC1D,OAAO,CAAC,mBAAmB,CAAC;;CAoChC,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/build/index.js CHANGED
@@ -2,9 +2,17 @@ import 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).then(() => Promise.resolve(undefined));
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);
8
16
  };
9
17
  /**
10
18
  * Authenticates a merchant session using a token obtained from your backend.
@@ -165,6 +173,7 @@ export const payments = {
165
173
  };
166
174
  const AcceptSDK = {
167
175
  initialize,
176
+ setTheme,
168
177
  authenticate,
169
178
  getStatus,
170
179
  getPaymentStatus,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAkBhE;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAgB,KAAK,EAAiB,EAAE;IACjE,OAAO,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AACtF,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAiB,EAAE;IAC3D,OAAO,oBAAoB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AACzF,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,GAAuB,EAAE;IAChD,OAAO,oBAAoB,CAAC,SAAS,EAAE,CAAC;AAC1C,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,eAAuB,EAAwE,EAAE;IAChI,IAAI,GAAG,GAAG,oBAAoB,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAEjE,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACpB,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE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BAAuB;IACvB,wBAAwB;IACxB,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n type CardPaymentResult,\n type SepaPaymentResult,\n type CertisPaymentResult,\n type CardPaymentIntent,\n type CertisPaymentIntent,\n type SepaPaymentIntent,\n type KybPrefillData,\n type SdkStatus,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n Currency,\n} from './AcceptSdkReactNative.types';\nimport AcceptSdkReactNative from './AcceptSdkReactNativeModule';\n\nexport type {\n CardPaymentResult,\n SepaPaymentResult,\n CertisPaymentResult,\n CardPaymentIntent,\n SepaPaymentIntent,\n CertisPaymentIntent,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n SdkStatus,\n KybPrefillData,\n};\n\nexport { Currency };\n\n/**\n * Initializes the SDK. Must be called before any other method.\n * @param demo - If `true`, connects to the sandbox environment. Defaults to `false` (production).\n */\nexport const initialize = (demo: boolean = false): Promise<void> => {\n return AcceptSdkReactNative.initialize(demo).then(() => Promise.resolve(undefined));\n};\n\n/**\n * Authenticates a merchant session using a token obtained from your backend.\n * Call after {@link initialize}.\n * @param token - Merchant authentication token.\n * @throws If authentication fails (invalid token, network error, etc.).\n */\nexport const authenticate = (token: string): Promise<void> => {\n return AcceptSdkReactNative.authenticate(token).then(() => Promise.resolve(undefined));\n};\n\n/**\n * Returns the current SDK status.\n * - `IDLE` — not initialized\n * - `INITIALIZED` — initialized, not authenticated\n * - `LOGGED_IN` — authenticated and ready\n */\nexport const getStatus = (): Promise<SdkStatus> => {\n return AcceptSdkReactNative.getStatus();\n};\n\n/**\n * Fetches the current status and details of a payment by its intent ID.\n * @param paymentIntentId - The payment intent identifier.\n * @returns The payment result typed to the appropriate payment method.\n * @throws If the payment intent is not found or the request fails.\n */\nexport const getPaymentStatus = (paymentIntentId: string): Promise<CardPaymentResult | SepaPaymentResult | CertisPaymentResult> => {\n let obj = AcceptSdkReactNative.getPaymentStatus(paymentIntentId);\n\n return obj.then((o) => {\n let r = JSON.parse(o);\n\n switch (r.type) {\n case \"card\":\n return r as CardPaymentResult;\n case \"certis\":\n return r as CertisPaymentResult;\n case \"sepa\":\n return r as SepaPaymentResult;\n default:\n throw new Error(\"Unknown payment result\");\n }\n });\n};\n\n/**\n * Logs out the current merchant session.\n * The SDK remains initialized — call {@link authenticate} again to sign in a different merchant.\n */\nexport const logOut = (): Promise<void> => {\n return AcceptSdkReactNative.logOut().then(() => Promise.resolve(undefined));\n};\n\n/**\n * Requests fine and coarse location permissions required for card (tap-to-pay) payments.\n * @returns `true` if all location permissions were granted.\n */\nexport const requestLocationPermission = (): Promise<boolean> => {\n return AcceptSdkReactNative.requestLocationPermission();\n};\n\n/**\n * Pairs the merchant app with the Tapaya companion app via deep link.\n * @platform ios\n */\nexport const pairWithCompanionApp = (): Promise<void> => {\n return AcceptSdkReactNative.pairWithCompanionApp();\n};\n\n/**\n * Returns whether the Tapaya companion app is installed on the device.\n * @platform ios\n */\nexport const isCompanionAppInstalled = (): Promise<boolean> => {\n return AcceptSdkReactNative.isCompanionAppInstalled();\n};\n\n/**\n * Presents the App Store product page sheet for the Tapaya companion app.\n * Use this to prompt the user to install the companion app when {@link isCompanionAppInstalled} returns `false`.\n * @platform ios\n */\nexport const presentCompanionAppSheet = (): Promise<void> => {\n return AcceptSdkReactNative.presentCompanionAppSheet();\n};\n\n/** Identity and onboarding methods. */\nexport const identity = {\n /**\n * Presents the KYB (Know Your Business) onboarding flow.\n * Fire-and-forget — resolves as soon as the flow is presented.\n * @param prefilling - Optional data to pre-populate the onboarding form.\n */\n presentKyb: (prefilling?: KybPrefillData): Promise<void> => {\n return AcceptSdkReactNative.presentKyb(prefilling);\n },\n};\n\n/** Payment methods for card and bank transfer terminals. */\nexport const payments = {\n /**\n * Starts a card (tap-to-pay) payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCardPayment: async (\n paymentIntent: CardPaymentIntent,\n statusCallback: (status: CardPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CardPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCardPaymentStatusChange', (status: any) => {\n statusCallback(status.data as CardPaymentStatus)})\n\n AcceptSdkReactNative.addListener('onCardPaymentException', (map: any) => {\n errorCallback(map.message, map.exception)})\n\n let result = AcceptSdkReactNative.startCardPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a SEPA Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startSepaPayment: async (\n paymentIntent: SepaPaymentIntent,\n statusCallback: (status: SepaInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<SepaPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onSepaPaymentStatusChange', (status: any) =>\n statusCallback(status.data as SepaInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onSepaPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startSepaPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a Certis Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCertisPayment: async (\n paymentIntent: CertisPaymentIntent,\n statusCallback: (status: CertisInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CertisPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCertisPaymentStatusChange', (status: any) =>\n statusCallback(status.data as CertisInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onCertisPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startCertisPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n};\n\nconst AcceptSDK = {\n initialize,\n authenticate,\n getStatus,\n getPaymentStatus,\n logOut,\n requestLocationPermission,\n pairWithCompanionApp,\n isCompanionAppInstalled,\n presentCompanionAppSheet,\n identity,\n payments,\n};\n\nexport default AcceptSDK;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkBA,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAsBhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAgB,KAAK,EAAE,KAAgC,EAAiB,EAAE;IACnG,OAAO,oBAAoB,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAA+B,EAAiB,EAAE;IACzE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAiB,EA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AAC,MAAW,EAAE,EAAE,CAChG,cAAc,CAAC,MAAM,CAAC,IAAkC,CAAC,CAAC,CAAA;QAE5D,oBAAoB,CAAC,WAAW,CAAC,0BAA0B,EAAE,CAAC,GAAQ,EAAE,EAAE,CACxE,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA;QAE5C,IAAI,MAAM,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;QAEpE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;YACf,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAC;AAEF,MAAM,SAAS,GAAG;IAChB,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,gBAAgB;IAChB,MAAM;IACN,yBAAyB;IACzB,oBAAoB;IACpB,uBAAuB;IACvB,wBAAwB;IACxB,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n type AcceptThemeConfiguration,\n type AcceptColorTheme,\n type AcceptImageTheme,\n type GradientColors,\n type CardPaymentResult,\n type SepaPaymentResult,\n type CertisPaymentResult,\n type CardPaymentIntent,\n type CertisPaymentIntent,\n type SepaPaymentIntent,\n type KybPrefillData,\n type SdkStatus,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n Currency,\n} from './AcceptSdkReactNative.types';\nimport AcceptSdkReactNative from './AcceptSdkReactNativeModule';\n\nexport type {\n AcceptThemeConfiguration,\n AcceptColorTheme,\n AcceptImageTheme,\n GradientColors,\n CardPaymentResult,\n SepaPaymentResult,\n CertisPaymentResult,\n CardPaymentIntent,\n SepaPaymentIntent,\n CertisPaymentIntent,\n CardPaymentStatus,\n SepaInstantPaymentStatus,\n CertisInstantPaymentStatus,\n SdkStatus,\n KybPrefillData,\n};\n\nexport { Currency };\n\n/**\n * Initializes the SDK. Must be called before any other method.\n * @param demo - If `true`, connects to the sandbox environment. Defaults to `false` (production).\n * @param theme - Optional UI theme overrides applied at startup.\n */\nexport const initialize = (demo: boolean = false, theme?: AcceptThemeConfiguration): Promise<void> => {\n return AcceptSdkReactNative.initialize(demo, theme);\n};\n\n/**\n * Applies a UI theme after initialization. Can be called any time after {@link initialize}.\n * @param theme - UI theme overrides. Omit `colors` or `images` to keep SDK defaults for those slots.\n */\nexport const setTheme = (theme: AcceptThemeConfiguration): Promise<void> => {\n return AcceptSdkReactNative.setTheme(theme);\n};\n\n/**\n * Authenticates a merchant session using a token obtained from your backend.\n * Call after {@link initialize}.\n * @param token - Merchant authentication token.\n * @throws If authentication fails (invalid token, network error, etc.).\n */\nexport const authenticate = (token: string): Promise<void> => {\n return AcceptSdkReactNative.authenticate(token).then(() => Promise.resolve(undefined));\n};\n\n/**\n * Returns the current SDK status.\n * - `IDLE` — not initialized\n * - `INITIALIZED` — initialized, not authenticated\n * - `LOGGED_IN` — authenticated and ready\n */\nexport const getStatus = (): Promise<SdkStatus> => {\n return AcceptSdkReactNative.getStatus();\n};\n\n/**\n * Fetches the current status and details of a payment by its intent ID.\n * @param paymentIntentId - The payment intent identifier.\n * @returns The payment result typed to the appropriate payment method.\n * @throws If the payment intent is not found or the request fails.\n */\nexport const getPaymentStatus = (paymentIntentId: string): Promise<CardPaymentResult | SepaPaymentResult | CertisPaymentResult> => {\n let obj = AcceptSdkReactNative.getPaymentStatus(paymentIntentId);\n\n return obj.then((o) => {\n let r = JSON.parse(o);\n\n switch (r.type) {\n case \"card\":\n return r as CardPaymentResult;\n case \"certis\":\n return r as CertisPaymentResult;\n case \"sepa\":\n return r as SepaPaymentResult;\n default:\n throw new Error(\"Unknown payment result\");\n }\n });\n};\n\n/**\n * Logs out the current merchant session.\n * The SDK remains initialized — call {@link authenticate} again to sign in a different merchant.\n */\nexport const logOut = (): Promise<void> => {\n return AcceptSdkReactNative.logOut().then(() => Promise.resolve(undefined));\n};\n\n/**\n * Requests fine and coarse location permissions required for card (tap-to-pay) payments.\n * @returns `true` if all location permissions were granted.\n */\nexport const requestLocationPermission = (): Promise<boolean> => {\n return AcceptSdkReactNative.requestLocationPermission();\n};\n\n/**\n * Pairs the merchant app with the Tapaya companion app via deep link.\n * @platform ios\n */\nexport const pairWithCompanionApp = (): Promise<void> => {\n return AcceptSdkReactNative.pairWithCompanionApp();\n};\n\n/**\n * Returns whether the Tapaya companion app is installed on the device.\n * @platform ios\n */\nexport const isCompanionAppInstalled = (): Promise<boolean> => {\n return AcceptSdkReactNative.isCompanionAppInstalled();\n};\n\n/**\n * Presents the App Store product page sheet for the Tapaya companion app.\n * Use this to prompt the user to install the companion app when {@link isCompanionAppInstalled} returns `false`.\n * @platform ios\n */\nexport const presentCompanionAppSheet = (): Promise<void> => {\n return AcceptSdkReactNative.presentCompanionAppSheet();\n};\n\n/** Identity and onboarding methods. */\nexport const identity = {\n /**\n * Presents the KYB (Know Your Business) onboarding flow.\n * Fire-and-forget — resolves as soon as the flow is presented.\n * @param prefilling - Optional data to pre-populate the onboarding form.\n */\n presentKyb: (prefilling?: KybPrefillData): Promise<void> => {\n return AcceptSdkReactNative.presentKyb(prefilling);\n },\n};\n\n/** Payment methods for card and bank transfer terminals. */\nexport const payments = {\n /**\n * Starts a card (tap-to-pay) payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCardPayment: async (\n paymentIntent: CardPaymentIntent,\n statusCallback: (status: CardPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CardPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCardPaymentStatusChange', (status: any) => {\n statusCallback(status.data as CardPaymentStatus)})\n\n AcceptSdkReactNative.addListener('onCardPaymentException', (map: any) => {\n errorCallback(map.message, map.exception)})\n\n let result = AcceptSdkReactNative.startCardPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a SEPA Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startSepaPayment: async (\n paymentIntent: SepaPaymentIntent,\n statusCallback: (status: SepaInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<SepaPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onSepaPaymentStatusChange', (status: any) =>\n statusCallback(status.data as SepaInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onSepaPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startSepaPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n\n /**\n * Starts a Certis Instant bank transfer payment flow.\n * Resolves with the final result when the payment completes or fails.\n * @param paymentIntent - Payment details.\n * @param statusCallback - Called with intermediate status updates during the payment flow.\n * @param errorCallback - Called with error details if the terminal encounters an exception.\n * @throws If a payment is already in progress, or if the payment flow fails critically.\n */\n startCertisPayment: async (\n paymentIntent: CertisPaymentIntent,\n statusCallback: (status: CertisInstantPaymentStatus) => void,\n errorCallback: (message: string, exception: string) => void,\n ): Promise<CertisPaymentResult> => {\n let isPaymentPending = await AcceptSdkReactNative.isPaymentPending();\n\n if (isPaymentPending) {\n throw Error(\"Payment is already pending, cancel payment first.\")\n }\n\n let eventStatus = AcceptSdkReactNative.addListener('onCertisPaymentStatusChange', (status: any) =>\n statusCallback(status.data as CertisInstantPaymentStatus))\n\n AcceptSdkReactNative.addListener('onCertisPaymentException', (map: any) =>\n errorCallback(map.message, map.exception))\n\n let result = AcceptSdkReactNative.startCertisPayment(paymentIntent);\n\n result.then(() => {\n eventStatus.remove();\n });\n\n return result\n },\n};\n\nconst AcceptSDK = {\n initialize,\n setTheme,\n authenticate,\n getStatus,\n getPaymentStatus,\n logOut,\n requestLocationPermission,\n pairWithCompanionApp,\n isCompanionAppInstalled,\n presentCompanionAppSheet,\n identity,\n payments,\n};\n\nexport default AcceptSDK;\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Resolves a React Native asset reference (from `require('./image.png')`) to a base64 string.
3
+ *
4
+ * Requires `expo-asset` and `expo-file-system` to be installed. Both are included in
5
+ * managed Expo projects by default. Bare React Native consumers must install them manually.
6
+ *
7
+ * @param source - Asset reference returned by `require('./image.png')`.
8
+ * @returns Base64-encoded image data.
9
+ */
10
+ export declare function assetToBase64(source: number): Promise<string>;
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAUnE"}
package/build/utils.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Resolves a React Native asset reference (from `require('./image.png')`) to a base64 string.
3
+ *
4
+ * Requires `expo-asset` and `expo-file-system` to be installed. Both are included in
5
+ * managed Expo projects by default. Bare React Native consumers must install them manually.
6
+ *
7
+ * @param source - Asset reference returned by `require('./image.png')`.
8
+ * @returns Base64-encoded image data.
9
+ */
10
+ export async function assetToBase64(source) {
11
+ // Dynamic imports so the SDK core has no hard dependency on these packages.
12
+ const { Asset } = await import('expo-asset');
13
+ const { File } = await import('expo-file-system');
14
+ const asset = Asset.fromModule(source);
15
+ await asset.downloadAsync();
16
+ const uri = asset.localUri ?? asset.uri;
17
+ if (!uri)
18
+ throw new Error(`assetToBase64: could not resolve URI for asset ${source}`);
19
+ return new File(uri).base64();
20
+ }
21
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAChD,4EAA4E;IAC5E,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAElD,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC;IACxC,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;IACtF,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAChC,CAAC","sourcesContent":["/**\n * Resolves a React Native asset reference (from `require('./image.png')`) to a base64 string.\n *\n * Requires `expo-asset` and `expo-file-system` to be installed. Both are included in\n * managed Expo projects by default. Bare React Native consumers must install them manually.\n *\n * @param source - Asset reference returned by `require('./image.png')`.\n * @returns Base64-encoded image data.\n */\nexport async function assetToBase64(source: number): Promise<string> {\n // Dynamic imports so the SDK core has no hard dependency on these packages.\n const { Asset } = await import('expo-asset');\n const { File } = await import('expo-file-system');\n\n const asset = Asset.fromModule(source);\n await asset.downloadAsync();\n const uri = asset.localUri ?? asset.uri;\n if (!uri) throw new Error(`assetToBase64: could not resolve URI for asset ${source}`);\n return new File(uri).base64();\n}\n"]}
@@ -1,6 +1,8 @@
1
1
  import AcceptSDK
2
2
  import CoreLocation
3
3
  import ExpoModulesCore
4
+ import SwiftUI
5
+ import UIKit
4
6
 
5
7
  // MARK: - Records
6
8
 
@@ -37,6 +39,7 @@ final class CardPaymentResultRecord: Record {
37
39
  @Field var authorizationCode: String? = nil
38
40
  @Field var brand: String? = nil
39
41
  @Field var reason: String? = nil
42
+ @Field var receiptUrl: String? = nil
40
43
  }
41
44
 
42
45
  final class BankTransferPaymentResultRecord: Record {
@@ -44,6 +47,32 @@ final class BankTransferPaymentResultRecord: Record {
44
47
  @Field var postponed: Bool = false
45
48
  @Field var receivedAt: String? = nil
46
49
  @Field var receivedFromIban: String? = nil
50
+ @Field var receiptUrl: String? = nil
51
+ }
52
+
53
+ final class GradientColorsRecord: Record {
54
+ @Field var start: String = ""
55
+ @Field var end: String = ""
56
+ }
57
+
58
+ final class AcceptColorThemeRecord: Record {
59
+ @Field var accent: String = ""
60
+ @Field var error: String = ""
61
+ @Field var warning: String = ""
62
+ @Field var success: String = ""
63
+ @Field var brandGradientColors: GradientColorsRecord? = nil
64
+ @Field var brandSubtleGradientColors: GradientColorsRecord? = nil
65
+ }
66
+
67
+ final class AcceptImageThemeRecord: Record {
68
+ @Field var brandLogo: String = ""
69
+ @Field var toolbarLogo: String = ""
70
+ @Field var solidLogo: String = ""
71
+ }
72
+
73
+ final class AcceptThemeConfigurationRecord: Record {
74
+ @Field var colors: AcceptColorThemeRecord? = nil
75
+ @Field var images: AcceptImageThemeRecord? = nil
47
76
  }
48
77
 
49
78
  final class KybPrefillDataRecord: Record {
@@ -98,13 +127,21 @@ public class AcceptSdkReactNativeModule: Module {
98
127
  public func definition() -> ModuleDefinition {
99
128
  Name("AcceptSdkReactNative")
100
129
 
101
- AsyncFunction("initialize") { (demo: Bool) async throws in
130
+ AsyncFunction("initialize") { (demo: Bool, theme: AcceptThemeConfigurationRecord?) async throws in
102
131
  do {
103
- try await Accept.initialize(environment: demo ? .sandbox : .production)
132
+ let themeConfig = try theme?.toAcceptThemeConfiguration() ?? .default
133
+ try await Accept.initialize(environment: demo ? .sandbox : .production, theme: themeConfig)
134
+ } catch let error as AcceptSDKError {
135
+ throw Exception(name: "AcceptSDKError", description: error.localizedDescription)
136
+ }
137
+ }
138
+
139
+ AsyncFunction("setTheme") { (theme: AcceptThemeConfigurationRecord) async throws in
140
+ do {
141
+ try await Accept.setTheme(try theme.toAcceptThemeConfiguration())
104
142
  } catch let error as AcceptSDKError {
105
143
  throw Exception(name: "AcceptSDKError", description: error.localizedDescription)
106
144
  }
107
- return true
108
145
  }
109
146
 
110
147
  AsyncFunction("authenticate") { (token: String) async throws in
@@ -211,6 +248,69 @@ public class AcceptSdkReactNativeModule: Module {
211
248
  }
212
249
  }
213
250
 
251
+ // MARK: - Theme conversion
252
+
253
+ private extension AcceptThemeConfigurationRecord {
254
+ func toAcceptThemeConfiguration() throws -> AcceptThemeConfiguration {
255
+ var config = AcceptThemeConfiguration()
256
+ if let colorsRecord = colors {
257
+ config.colors = .local(try colorsRecord.toAcceptColorTheme())
258
+ }
259
+ if let imagesRecord = images {
260
+ config.images = .local(try imagesRecord.toAcceptImageTheme())
261
+ }
262
+ return config
263
+ }
264
+ }
265
+
266
+ private extension AcceptColorThemeRecord {
267
+ func toAcceptColorTheme() throws -> AcceptColorTheme {
268
+ AcceptColorTheme(
269
+ accent: try color(fromHex: accent),
270
+ error: try color(fromHex: error),
271
+ warning: try color(fromHex: warning),
272
+ success: try color(fromHex: success),
273
+ brandGradientColors: try brandGradientColors.map { GradientColors(start: try color(fromHex: $0.start), end: try color(fromHex: $0.end)) },
274
+ brandSubtleGradientColors: try brandSubtleGradientColors.map { GradientColors(start: try color(fromHex: $0.start), end: try color(fromHex: $0.end)) }
275
+ )
276
+ }
277
+ }
278
+
279
+ private extension AcceptImageThemeRecord {
280
+ func toAcceptImageTheme() throws -> AcceptImageTheme {
281
+ guard
282
+ let brandLogoData = Data(base64Encoded: brandLogo),
283
+ let brandLogoImage = UIImage(data: brandLogoData),
284
+ let toolbarLogoData = Data(base64Encoded: toolbarLogo),
285
+ let toolbarLogoImage = UIImage(data: toolbarLogoData),
286
+ let solidLogoData = Data(base64Encoded: solidLogo),
287
+ let solidLogoImage = UIImage(data: solidLogoData)
288
+ else {
289
+ throw Exception(name: "ThemeError", description: "Invalid base64 image data in AcceptImageTheme")
290
+ }
291
+ return AcceptImageTheme(brandLogo: brandLogoImage, toolbarLogo: toolbarLogoImage, solidLogo: solidLogoImage)
292
+ }
293
+ }
294
+
295
+ private func color(fromHex input: String) throws -> Color {
296
+ let hex = input.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
297
+ guard hex.count == 3 || hex.count == 6 || hex.count == 8 else {
298
+ throw Exception(name: "ThemeError", description: "Invalid hex color '\(input)'. Expected #RRGGBB or #AARRGGBB.")
299
+ }
300
+ var int: UInt64 = 0
301
+ guard Scanner(string: hex).scanHexInt64(&int) else {
302
+ throw Exception(name: "ThemeError", description: "Invalid hex color '\(input)'.")
303
+ }
304
+ let a, r, g, b: UInt64
305
+ switch hex.count {
306
+ case 3: (a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
307
+ case 6: (a, r, g, b) = (255, int >> 16, int >> 8 & 0xFF, int & 0xFF)
308
+ case 8: (a, r, g, b) = (int >> 24, int >> 16 & 0xFF, int >> 8 & 0xFF, int & 0xFF)
309
+ default: fatalError()
310
+ }
311
+ return Color(.sRGB, red: Double(r) / 255, green: Double(g) / 255, blue: Double(b) / 255, opacity: Double(a) / 255)
312
+ }
313
+
214
314
  // MARK: - Info result serialization
215
315
 
216
316
  private struct CardInfoResult: Encodable {
@@ -226,6 +326,7 @@ private struct CardInfoResult: Encodable {
226
326
  let authorizationCode: String
227
327
  let brand: String
228
328
  let reason: String
329
+ let receiptUrl: String?
229
330
  let type: String
230
331
  }
231
332
 
@@ -234,6 +335,7 @@ private struct BankTransferInfoResult: Encodable {
234
335
  let postponed: Bool
235
336
  let receivedAt: String
236
337
  let receivedFromIban: String
338
+ let receiptUrl: String?
237
339
  let type: String
238
340
  }
239
341
 
@@ -260,6 +362,7 @@ private enum InfoResultSerializer {
260
362
  authorizationCode: cardStatus.details?.authorizationCode ?? "",
261
363
  brand: cardStatus.details?.brand.rawValue.uppercased() ?? "",
262
364
  reason: cardStatus.details?.issuerDeclineReason?.rawValue ?? "",
365
+ receiptUrl: cardStatus.receiptUrl?.absoluteString,
263
366
  type: "card"
264
367
  ))
265
368
 
@@ -272,6 +375,7 @@ private enum InfoResultSerializer {
272
375
  postponed: bankStatus.details?.postponed ?? false,
273
376
  receivedAt: bankStatus.processedAt.map { ISO8601DateFormatter().string(from: $0) } ?? "",
274
377
  receivedFromIban: bankStatus.details?.bankAccountNumber ?? "",
378
+ receiptUrl: bankStatus.receiptUrl?.absoluteString,
275
379
  type: "sepa"
276
380
  ))
277
381
 
@@ -284,6 +388,7 @@ private enum InfoResultSerializer {
284
388
  postponed: bankStatus.details?.postponed ?? false,
285
389
  receivedAt: bankStatus.processedAt.map { ISO8601DateFormatter().string(from: $0) } ?? "",
286
390
  receivedFromIban: bankStatus.details?.bankAccountNumber ?? "",
391
+ receiptUrl: bankStatus.receiptUrl?.absoluteString,
287
392
  type: "certis"
288
393
  ))
289
394
 
@@ -390,6 +495,7 @@ private extension AcceptPaymentOutcome where Result == CardPaymentStatus {
390
495
  record.authorizationCode = status.details?.authorizationCode
391
496
  record.brand = status.details?.brand.rawValue.uppercased()
392
497
  record.reason = status.details?.issuerDeclineReason?.rawValue
498
+ record.receiptUrl = status.receiptUrl?.absoluteString
393
499
  }
394
500
  return record
395
501
  }
@@ -406,6 +512,7 @@ private extension AcceptPaymentOutcome where Result == BankTransferPaymentStatus
406
512
  record.postponed = status.details?.postponed ?? false
407
513
  record.receivedAt = status.processedAt.map { ISO8601DateFormatter().string(from: $0) }
408
514
  record.receivedFromIban = status.details?.bankAccountNumber
515
+ record.receiptUrl = status.receiptUrl?.absoluteString
409
516
  }
410
517
  return record
411
518
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapayadot/accept-react-native",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Accept SDK for React Native/Expo",
5
5
  "keywords": [
6
6
  "react-native",
@@ -37,7 +37,15 @@
37
37
  "import": "./build/index.js",
38
38
  "require": "./build/index.js",
39
39
  "default": "./build/index.js"
40
- }
40
+ },
41
+ "./utils": {
42
+ "types": "./build/utils.d.ts",
43
+ "import": "./build/utils.js",
44
+ "require": "./build/utils.js",
45
+ "default": "./build/utils.js"
46
+ },
47
+ "./app.plugin": "./app.plugin.js",
48
+ "./app.plugin.js": "./app.plugin.js"
41
49
  },
42
50
  "files": [
43
51
  "build",
@@ -68,9 +76,19 @@
68
76
  },
69
77
  "peerDependencies": {
70
78
  "expo": "*",
79
+ "expo-asset": "*",
80
+ "expo-file-system": "*",
71
81
  "react": "*",
72
82
  "react-native": "*"
73
83
  },
84
+ "peerDependenciesMeta": {
85
+ "expo-asset": {
86
+ "optional": true
87
+ },
88
+ "expo-file-system": {
89
+ "optional": true
90
+ }
91
+ },
74
92
  "devDependencies": {
75
93
  "@expo/npm-proofread": "1.0.1",
76
94
  "@react-native-community/cli": "20.1.3",
@@ -23,8 +23,8 @@ function withAcceptSdkIos(config) {
23
23
  isa: "XCRemoteSwiftPackageReference",
24
24
  repositoryURL: `"${ACCEPT_SDK_IOS_REPO}"`,
25
25
  requirement: {
26
- kind: "branch",
27
- branch: "master",
26
+ kind: "exactVersion",
27
+ version: "1.1.2",
28
28
  },
29
29
  };
30
30
 
@@ -65,11 +65,6 @@ module.exports = function withMyModule(config) {
65
65
  {
66
66
  android: {
67
67
  minSdkVersion: 30,
68
- extraMavenRepos: [
69
- {
70
- url: "https://maven.pkg.github.com/tapayadot/accept-sdk-android",
71
- },
72
- ],
73
68
  },
74
69
  },
75
70
  ],