@tapayadot/accept-react-native 1.1.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.
@@ -2,12 +2,20 @@ package com.tapaya.acceptsdkreactnative
2
2
 
3
3
  import android.util.Base64
4
4
  import com.google.gson.Gson
5
- import com.tapaya.accept.AcceptSDK
5
+ import com.tapaya.accept.Accept
6
6
  import com.tapaya.accept.external.IdentityData
7
+ import com.tapaya.core.model.external.AcceptEnvironment
8
+ import com.tapaya.core.model.external.AcceptUiBehavior
7
9
  import com.tapaya.core.model.external.BusinessType
8
10
  import com.tapaya.core.model.external.Currency
9
- import com.tapaya.core.model.external.exception.AcceptSDKException
11
+ import com.tapaya.core.model.external.NfcIndicator
12
+ import com.tapaya.core.model.external.NfcPosition
13
+ import com.tapaya.core.model.external.NfcZone
14
+ import com.tapaya.core.model.external.PaymentMethod
15
+ import com.tapaya.core.model.external.RefundReason
16
+ import com.tapaya.core.model.external.exception.AcceptException
10
17
  import com.tapaya.core.model.external.intent.CardChargeIntent
18
+ import com.tapaya.core.model.external.intent.CardRefundIntent
11
19
  import com.tapaya.core.model.external.intent.CertisInstantPaymentIntent
12
20
  import com.tapaya.core.model.external.intent.SepaInstantPaymentIntent
13
21
  import com.tapaya.core.model.external.result.AbstractPaymentResult
@@ -36,7 +44,7 @@ class CardPaymentIntentReactNative : Record {
36
44
  var paymentIntentId: String = ""
37
45
 
38
46
  @Field
39
- var amount: Int = 0
47
+ var amount: Long = 0L
40
48
 
41
49
  @Field
42
50
  var requestedCurrency: String = ""
@@ -71,7 +79,7 @@ class CardPaymentResultReactNative(
71
79
  @Field
72
80
  var companyCity: String = "",
73
81
  @Field
74
- var companyCountry: Int = 0,
82
+ var companyCountry: String = "",
75
83
  @Field
76
84
  var terminalId: String = "",
77
85
  @Field
@@ -83,6 +91,8 @@ class CardPaymentResultReactNative(
83
91
  @Field
84
92
  var receiptUrl: String? = null,
85
93
  @Field
94
+ var refundToken: String? = null,
95
+ @Field
86
96
  var type: String = "",
87
97
  ) : Record
88
98
 
@@ -95,12 +105,13 @@ fun CardPaymentResult.toReactNative(): CardPaymentResultReactNative {
95
105
  companyAddress1 = companyAddress1 ?: "",
96
106
  companyAddress2 = companyAddress2 ?: "",
97
107
  companyCity = companyCity ?: "",
98
- companyCountry = companyCountry ?: 0,
108
+ companyCountry = companyCountry.toCountryAlpha2(),
99
109
  terminalId = terminalId ?: "",
100
110
  authorizationCode = authorizationCode ?: "",
101
111
  brand = brand?.name ?: "",
102
112
  reason = reason?.name ?: "",
103
113
  receiptUrl = receiptUrl,
114
+ refundToken = refundToken,
104
115
  type = "card"
105
116
  )
106
117
  }
@@ -110,7 +121,7 @@ class SepaPaymentIntentReactNative : Record {
110
121
  var paymentIntentId: String = ""
111
122
 
112
123
  @Field
113
- var amount: Int = 0
124
+ var amount: Long = 0L
114
125
 
115
126
  @Field
116
127
  var requestedCurrency: String = ""
@@ -160,7 +171,7 @@ class CertisPaymentIntentReactNative : Record {
160
171
  var paymentIntentId: String = ""
161
172
 
162
173
  @Field
163
- var amount: Int = 0
174
+ var amount: Long = 0L
164
175
 
165
176
  @Field
166
177
  var requestedCurrency: String = ""
@@ -205,6 +216,26 @@ fun CertisInstantPaymentResult.toReactNative(): CertisPaymentInstantResultReactN
205
216
  )
206
217
  }
207
218
 
219
+ class RefundIntentReactNative : Record {
220
+ @Field
221
+ var paymentToken: String = ""
222
+
223
+ @Field
224
+ var refundToken: String? = null
225
+
226
+ @Field
227
+ var reason: String = "customerRequest"
228
+ }
229
+
230
+ class RefundResultReactNative(
231
+ @Field
232
+ var refundToken: String? = null,
233
+ @Field
234
+ var status: String = "",
235
+ @Field
236
+ var refundReason: String = "",
237
+ ) : Record
238
+
208
239
 
209
240
  class GradientColorsRecord : Record {
210
241
  @Field var start: String = ""
@@ -261,6 +292,122 @@ private fun String.toComposeColor(): androidx.compose.ui.graphics.Color = try {
261
292
  throw Exception("ThemeError: invalid color '$this'. Expected #RRGGBB or #AARRGGBB — ${e.message}")
262
293
  }
263
294
 
295
+ private fun Int?.toCountryAlpha2(): String = when (this) {
296
+ 8 -> "AL"
297
+ 20 -> "AD"
298
+ 40 -> "AT"
299
+ 51 -> "AM"
300
+ 56 -> "BE"
301
+ 70 -> "BA"
302
+ 100 -> "BG"
303
+ 112 -> "BY"
304
+ 191 -> "HR"
305
+ 196 -> "CY"
306
+ 203 -> "CZ"
307
+ 208 -> "DK"
308
+ 233 -> "EE"
309
+ 234 -> "FO"
310
+ 246 -> "FI"
311
+ 250 -> "FR"
312
+ 268 -> "GE"
313
+ 276 -> "DE"
314
+ 292 -> "GI"
315
+ 300 -> "GR"
316
+ 304 -> "GL"
317
+ 336 -> "VA"
318
+ 348 -> "HU"
319
+ 352 -> "IS"
320
+ 372 -> "IE"
321
+ 380 -> "IT"
322
+ 398 -> "KZ"
323
+ 417 -> "KG"
324
+ 428 -> "LV"
325
+ 438 -> "LI"
326
+ 440 -> "LT"
327
+ 442 -> "LU"
328
+ 470 -> "MT"
329
+ 492 -> "MC"
330
+ 498 -> "MD"
331
+ 499 -> "ME"
332
+ 528 -> "NL"
333
+ 578 -> "NO"
334
+ 616 -> "PL"
335
+ 620 -> "PT"
336
+ 642 -> "RO"
337
+ 643 -> "RU"
338
+ 674 -> "SM"
339
+ 688 -> "RS"
340
+ 703 -> "SK"
341
+ 705 -> "SI"
342
+ 724 -> "ES"
343
+ 752 -> "SE"
344
+ 756 -> "CH"
345
+ 792 -> "TR"
346
+ 804 -> "UA"
347
+ 807 -> "MK"
348
+ 826 -> "GB"
349
+ else -> ""
350
+ }
351
+
352
+ private fun String.toPaymentMethod(): PaymentMethod = when (this) {
353
+ "CARD" -> PaymentMethod.CARD
354
+ "SEPA" -> PaymentMethod.SEPA_INST
355
+ "CERTIS" -> PaymentMethod.CERTIS
356
+ "CRYPTO" -> PaymentMethod.CRYPTO
357
+ else -> throw IllegalArgumentException("Unknown payment method: $this")
358
+ }
359
+
360
+ private fun PaymentMethod.toJsString(): String = when (this) {
361
+ PaymentMethod.CARD -> "CARD"
362
+ PaymentMethod.SEPA_INST -> "SEPA"
363
+ PaymentMethod.CERTIS -> "CERTIS"
364
+ PaymentMethod.CRYPTO -> "CRYPTO"
365
+ }
366
+
367
+ private fun String.toRefundReason(): RefundReason = when (this) {
368
+ "customerRequest" -> RefundReason.CUSTOMER_REQUEST
369
+ "duplicate" -> RefundReason.DUPLICATE
370
+ "fraudulent" -> RefundReason.FRAUDULENT
371
+ "expiredCharge" -> RefundReason.EXPIRED_CHARGE
372
+ else -> throw IllegalArgumentException("Unknown refund reason: $this")
373
+ }
374
+
375
+ class NfcPositionRecord : Record {
376
+ @Field var xBias: Float = 0f
377
+ @Field var yBias: Float = 0f
378
+ }
379
+
380
+ class NfcZoneRecord : Record {
381
+ @Field var indicator: String = "DEFAULT"
382
+ @Field var position: NfcPositionRecord? = null
383
+
384
+ fun toNfcZone(): NfcZone {
385
+ val pos = position?.let { NfcPosition.Custom(it.xBias, it.yBias) } ?: NfcPosition.Default
386
+ return NfcZone(indicator = indicator.toNfcIndicator(), position = pos)
387
+ }
388
+ }
389
+
390
+ class AcceptUiBehaviorRecord : Record {
391
+ @Field var resultScreenDurationSeconds: Int = 10
392
+ @Field var showResultScreen: Boolean = true
393
+ @Field var nfcZone: NfcZoneRecord? = null
394
+
395
+ fun toAcceptUiBehavior(): AcceptUiBehavior = AcceptUiBehavior(
396
+ resultScreenDurationSeconds = resultScreenDurationSeconds,
397
+ showResultScreen = showResultScreen,
398
+ nfcZone = nfcZone?.toNfcZone(),
399
+ )
400
+ }
401
+
402
+ private fun String.toNfcIndicator(): NfcIndicator = when (this) {
403
+ "DEFAULT" -> NfcIndicator.DEFAULT
404
+ "ABOVE" -> NfcIndicator.ABOVE
405
+ "BELOW" -> NfcIndicator.BELOW
406
+ "FRONT" -> NfcIndicator.FRONT
407
+ "BEHIND" -> NfcIndicator.BEHIND
408
+ else -> throw IllegalArgumentException("Unknown NFC indicator: $this")
409
+ }
410
+
264
411
  class KybPrefillDataRecord : Record {
265
412
  @Field var businessType: String? = null
266
413
  @Field var countryCode: String? = null
@@ -314,17 +461,22 @@ class AcceptSdkReactNativeModule : Module() {
314
461
 
315
462
  AsyncFunction("initialize") Coroutine { demo: Boolean, theme: AcceptThemeConfigurationRecord? ->
316
463
  val context = appContext.reactContext ?: throw Exception("Context not available")
317
- AcceptSDK.initialize(context, demo, theme?.toAcceptThemeConfiguration() ?: AcceptThemeConfiguration.Default)
464
+ val environment = if (demo) AcceptEnvironment.SANDBOX else AcceptEnvironment.PRODUCTION
465
+ Accept.initialize(context, environment, theme?.toAcceptThemeConfiguration() ?: AcceptThemeConfiguration.Default)
318
466
  }
319
467
 
320
468
  AsyncFunction("setTheme") Coroutine { theme: AcceptThemeConfigurationRecord ->
321
- AcceptSDK.setThemeConfiguration(theme.toAcceptThemeConfiguration())
469
+ Accept.setThemeConfiguration(theme.toAcceptThemeConfiguration())
470
+ }
471
+
472
+ AsyncFunction("setUiBehavior") { behavior: AcceptUiBehaviorRecord ->
473
+ Accept.setUiBehavior(behavior.toAcceptUiBehavior())
322
474
  }
323
475
 
324
476
  AsyncFunction("authenticate") Coroutine { token: String ->
325
477
  return@Coroutine suspendCancellableCoroutine<Boolean> { continuation ->
326
478
  try {
327
- AcceptSDK.authenticate(
479
+ Accept.authenticate(
328
480
  token,
329
481
  onSuccess = { continuation.resume(true) },
330
482
  onError = { error -> (error as? Throwable)?.let { continuation.resumeWithException(it) } }
@@ -337,7 +489,7 @@ class AcceptSdkReactNativeModule : Module() {
337
489
 
338
490
  Function("getStatus") { ->
339
491
  try {
340
- return@Function AcceptSDK.status.name
492
+ return@Function Accept.status.name
341
493
  } catch (e: Exception) {
342
494
  throw e
343
495
  }
@@ -346,7 +498,7 @@ class AcceptSdkReactNativeModule : Module() {
346
498
  AsyncFunction("getPaymentStatus") Coroutine { paymentIntentId: String ->
347
499
  return@Coroutine suspendCancellableCoroutine<String> { continuation ->
348
500
  try {
349
- AcceptSDK.getPaymentStatus(
501
+ Accept.getPaymentStatus(
350
502
  paymentIntentId,
351
503
  { result: AbstractPaymentResult ->
352
504
  val mapped = when (result) {
@@ -358,7 +510,7 @@ class AcceptSdkReactNativeModule : Module() {
358
510
 
359
511
  continuation.resume(Gson().toJson(mapped))
360
512
  },
361
- { error: AcceptSDKException ->
513
+ { error: AcceptException ->
362
514
  (error as? Throwable)?.let { continuation.resumeWithException(it) }
363
515
  }
364
516
  )
@@ -386,7 +538,7 @@ class AcceptSdkReactNativeModule : Module() {
386
538
  AsyncFunction("logOut") Coroutine { ->
387
539
  return@Coroutine suspendCancellableCoroutine<Boolean> { continuation ->
388
540
  try {
389
- AcceptSDK.logOut {
541
+ Accept.logOut {
390
542
  continuation.resume(true)
391
543
  }
392
544
  } catch (e: Exception) {
@@ -397,20 +549,38 @@ class AcceptSdkReactNativeModule : Module() {
397
549
 
398
550
  AsyncFunction("isPaymentPending") { ->
399
551
  try {
400
- return@AsyncFunction AcceptSDK.isPaymentPending()
552
+ return@AsyncFunction Accept.isPaymentPending()
401
553
  } catch (e: Exception) {
402
554
  throw e
403
555
  }
404
556
  }
405
557
 
406
558
  AsyncFunction("presentKyb") Coroutine { prefilling: KybPrefillDataRecord? ->
407
- AcceptSDK.identity.presentKyb(prefilling?.toIdentityData())
559
+ Accept.identity.presentKyb(prefilling?.toIdentityData())
560
+ }
561
+
562
+ AsyncFunction("getOnboardingStatus") Coroutine { ->
563
+ val status = Accept.identity.getOnboardingStatus()
564
+ return@Coroutine mapOf(
565
+ "isOnboarded" to status.isOnboarded,
566
+ "paymentMethods" to status.paymentMethods.map { pm ->
567
+ mapOf(
568
+ "method" to pm.method.toJsString(),
569
+ "status" to pm.status.name,
570
+ )
571
+ },
572
+ )
573
+ }
574
+
575
+ AsyncFunction("getPaymentMethodStatus") Coroutine { method: String ->
576
+ val status = Accept.identity.getPaymentMethodStatus(method.toPaymentMethod())
577
+ return@Coroutine status.name
408
578
  }
409
579
 
410
580
  AsyncFunction("startCardPayment") Coroutine { paymentIntent: CardPaymentIntentReactNative ->
411
581
  return@Coroutine suspendCancellableCoroutine<CardPaymentResultReactNative> { continuation ->
412
582
  try {
413
- AcceptSDK.cardTerminal.process(
583
+ Accept.cardTerminal.process(
414
584
  paymentIntent.toCardInstantPaymentIntent(),
415
585
  onResult = {
416
586
  continuation.resume(it.toReactNative())
@@ -431,7 +601,7 @@ class AcceptSdkReactNativeModule : Module() {
431
601
  AsyncFunction("startSepaPayment") Coroutine { paymentIntent: SepaPaymentIntentReactNative ->
432
602
  return@Coroutine suspendCancellableCoroutine<SepaPaymentInstantResultReactNative> { continuation ->
433
603
  try {
434
- AcceptSDK.sepaTerminal.process(
604
+ Accept.sepaTerminal.process(
435
605
  paymentIntent.toSepaInstantPaymentIntent(),
436
606
  onResult = {
437
607
  continuation.resume(it.toReactNative())
@@ -452,7 +622,7 @@ class AcceptSdkReactNativeModule : Module() {
452
622
  AsyncFunction("startCertisPayment") Coroutine { paymentIntent: CertisPaymentIntentReactNative ->
453
623
  return@Coroutine suspendCancellableCoroutine<CertisPaymentInstantResultReactNative> { continuation ->
454
624
  try {
455
- AcceptSDK.certisTerminal.process(
625
+ Accept.certisTerminal.process(
456
626
  paymentIntent.toCertisInstantPaymentIntent(),
457
627
  onResult = {
458
628
  continuation.resume(it.toReactNative())
@@ -470,6 +640,57 @@ class AcceptSdkReactNativeModule : Module() {
470
640
  }
471
641
  }
472
642
 
643
+ AsyncFunction("refund") Coroutine { intent: RefundIntentReactNative ->
644
+ return@Coroutine suspendCancellableCoroutine<RefundResultReactNative> { continuation ->
645
+ try {
646
+ val refundIntent = CardRefundIntent(
647
+ sourcePaymentToken = intent.paymentToken,
648
+ refundReason = intent.reason.toRefundReason(),
649
+ refundToken = intent.refundToken,
650
+ )
651
+ Accept.cardTerminal.process(
652
+ refundIntent,
653
+ onResult = { result ->
654
+ continuation.resume(
655
+ RefundResultReactNative(
656
+ refundToken = result.refundToken,
657
+ status = result.status.name.lowercase(),
658
+ refundReason = intent.reason,
659
+ )
660
+ )
661
+ },
662
+ onStatus = { /* refund flow emits no UI status */ },
663
+ onError = { error ->
664
+ continuation.resumeWithException(error as Throwable)
665
+ }
666
+ )
667
+ } catch (e: Exception) {
668
+ continuation.resumeWithException(e)
669
+ }
670
+ }
671
+ }
672
+
673
+ AsyncFunction("cancelActivePayment") { ->
674
+ if (!Accept.isPaymentPending()) {
675
+ throw Exception("NoActivePayment")
676
+ }
677
+ Accept.cardTerminal.reset()
678
+ Accept.sepaTerminal.reset()
679
+ Accept.certisTerminal.reset()
680
+ }
681
+
682
+ AsyncFunction("enableDemoMode") { ->
683
+ Accept.enableDemoMode()
684
+ }
685
+
686
+ AsyncFunction("disableDemoMode") { ->
687
+ Accept.disableDemoMode()
688
+ }
689
+
690
+ AsyncFunction("isDemoMode") { ->
691
+ Accept.isDemoMode()
692
+ }
693
+
473
694
  AsyncFunction("pairWithCompanionApp") Coroutine { ->
474
695
  // Not available on Android
475
696
  }
@@ -484,7 +705,7 @@ class AcceptSdkReactNativeModule : Module() {
484
705
 
485
706
  }
486
707
 
487
- private fun AcceptSDKException.toReactNative(): Map<String, String> {
708
+ private fun AcceptException.toReactNative(): Map<String, String> {
488
709
  return mapOf(
489
710
  "message" to ((this as Throwable).message ?: ""),
490
711
  "exception" to ((this as Throwable).cause?.stackTraceToString() ?: "")
@@ -37,20 +37,50 @@ export type AcceptThemeConfiguration = {
37
37
  colors?: AcceptColorTheme;
38
38
  images?: AcceptImageTheme;
39
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
+ };
40
72
  /** Current authentication/initialization state of the SDK. */
41
73
  export type SdkStatus = 'IDLE' | 'INITIALIZED' | 'LOGGED_IN';
42
- /** Supported settlement and requested currencies. */
43
- export type Currency = 'CZK' | 'EUR' | 'GBP';
44
74
  /** Intent for initiating a card (tap-to-pay) payment. */
45
75
  export type CardPaymentIntent = {
46
76
  /** Unique payment intent identifier obtained from your backend. */
47
77
  paymentIntentId: string;
48
78
  /** Amount in the smallest currency unit (e.g. hellers for CZK, cents for EUR). */
49
79
  amount: number;
50
- /** Currency the customer is charged in. */
51
- requestedCurrency: Currency;
52
- /** Currency funds settle in. Defaults to `requestedCurrency` when omitted. */
53
- settlementCurrency?: Currency;
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;
54
84
  };
55
85
  /** Intent for initiating a SEPA Instant bank transfer payment. */
56
86
  export type SepaPaymentIntent = {
@@ -58,10 +88,10 @@ export type SepaPaymentIntent = {
58
88
  paymentIntentId: string;
59
89
  /** Amount in the smallest currency unit. */
60
90
  amount: number;
61
- /** Currency the customer is charged in. */
62
- requestedCurrency: Currency;
63
- /** Currency funds settle in. Defaults to `requestedCurrency` when omitted. */
64
- settlementCurrency?: Currency;
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;
65
95
  };
66
96
  /** Intent for initiating a Certis Instant bank transfer payment. */
67
97
  export type CertisPaymentIntent = {
@@ -69,10 +99,10 @@ export type CertisPaymentIntent = {
69
99
  paymentIntentId: string;
70
100
  /** Amount in the smallest currency unit. */
71
101
  amount: number;
72
- /** Currency the customer is charged in. */
73
- requestedCurrency: Currency;
74
- /** Currency funds settle in. Defaults to `requestedCurrency` when omitted. */
75
- settlementCurrency?: Currency;
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;
76
106
  };
77
107
  /** Result of a completed card payment. */
78
108
  export type CardPaymentResult = {
@@ -85,7 +115,8 @@ export type CardPaymentResult = {
85
115
  companyAddress1?: string;
86
116
  companyAddress2?: string;
87
117
  companyCity?: string;
88
- companyCountry?: number;
118
+ /** ISO 3166-1 alpha-2 country code (e.g. `CZ`, `SK`, `GB`). */
119
+ companyCountry?: string;
89
120
  terminalId?: string;
90
121
  authorizationCode?: string;
91
122
  /** Card brand (e.g. `VISA`, `MASTERCARD`). */
@@ -94,6 +125,8 @@ export type CardPaymentResult = {
94
125
  reason?: string;
95
126
  /** URL to the digital receipt for this transaction. */
96
127
  receiptUrl?: string;
128
+ /** Server-issued token identifying a refund applied to this payment. Present when this card payment was refunded. */
129
+ refundToken?: string;
97
130
  };
98
131
  /** Intermediate status updates emitted during a card payment flow. */
99
132
  export type CardPaymentStatus = 'pending' | 'approved' | 'declined' | 'refunded' | 'aborted';
@@ -151,6 +184,65 @@ export type KybPrefillData = {
151
184
  productDescription?: string;
152
185
  supportPhone?: string;
153
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
+ };
154
246
  export type AcceptSdkReactNativeModuleEvents = {
155
247
  onCardPaymentStatusChange: (status: Map<string, string>) => void;
156
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,+CAA+C;AAC/C,MAAM,MAAM,cAAc,GAAG;IAC3B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;CACb,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,yBAAyB,CAAC,EAAE,cAAc,CAAC;CAC5C,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,WAAW,EAA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B,6BAA6B;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,yBAAyB,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACjE,yBAAyB,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACjE,2BAA2B,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACnE,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC3D,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC3D,wBAAwB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CAC9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AcceptSdkReactNative.types.js","sourceRoot":"","sources":["../src/AcceptSdkReactNative.types.ts"],"names":[],"mappings":"","sourcesContent":["/** Start and end hex colors for a gradient. */\nexport type GradientColors = {\n /** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n start: string;\n /** Hex color string. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n end: string;\n}\n\n/**\n * Custom color palette. All four base colors are required when providing colors —\n * they replace the entire color theme, not individual tokens.\n */\nexport type AcceptColorTheme = {\n /** Primary accent color. 6-digit `#RRGGBB` or 8-digit `#AARRGGBB` (alpha first). */\n accent: string;\n error: string;\n warning: string;\n success: string;\n brandGradientColors?: GradientColors;\n brandSubtleGradientColors?: GradientColors;\n}\n\n/**\n * Custom image assets. All three slots are required when providing images —\n * provide all or omit the `images` key entirely to use SDK defaults.\n */\nexport type AcceptImageTheme = {\n /** Square logo used on branded screens. Base64-encoded PNG or JPEG. */\n brandLogo: string;\n /** Logo shown in toolbar / navigation bar. Base64-encoded PNG or JPEG. */\n toolbarLogo: string;\n /** Solid (monochrome) logo variant. Base64-encoded PNG or JPEG. */\n solidLogo: string;\n}\n\n/**\n * UI theme overrides. Omit `colors` and/or `images` to keep SDK defaults for those slots.\n */\nexport type AcceptThemeConfiguration = {\n colors?: AcceptColorTheme;\n images?: AcceptImageTheme;\n}\n\n/** 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
+ {"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"]}