@stripe/stripe-react-native 0.65.1 → 0.66.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.
Files changed (79) hide show
  1. package/android/detekt/detekt-baseline.xml +0 -10
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +51 -57
  4. package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementEvent.kt +26 -0
  5. package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementView.kt +129 -16
  6. package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementViewManager.kt +17 -0
  7. package/android/src/main/java/com/reactnativestripesdk/EventEmitterCompat.kt +4 -0
  8. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +8 -19
  9. package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +1 -0
  10. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +95 -26
  11. package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +1 -0
  12. package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +2 -16
  13. package/android/src/main/java/com/reactnativestripesdk/utils/CheckoutMappers.kt +59 -33
  14. package/android/src/main/java/com/reactnativestripesdk/utils/DefaultActivityLifecycleCallbacks.kt +41 -0
  15. package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +17 -3
  16. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +5 -1
  17. package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +116 -0
  18. package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +109 -1
  19. package/android/src/test/java/com/reactnativestripesdk/DrawableLoadingTest.kt +6 -2
  20. package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +107 -0
  21. package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutMappersTest.kt +39 -30
  22. package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutTestFixtures.java +8 -0
  23. package/ios/CurrencySelectorElementManager.m +7 -0
  24. package/ios/CurrencySelectorElementView.swift +142 -7
  25. package/ios/EmbeddedPaymentElementView.swift +1 -1
  26. package/ios/Mappers+Checkout.swift +251 -107
  27. package/ios/Mappers.swift +90 -2
  28. package/ios/NewArch/StripeCurrencySelectorElementComponentView.mm +14 -0
  29. package/ios/OldArch/StripeSdkEventEmitterCompat.h +1 -0
  30. package/ios/OldArch/StripeSdkEventEmitterCompat.m +6 -0
  31. package/ios/PaymentOptionDisplayData+ReactNative.swift +1 -1
  32. package/ios/PaymentSheetAppearance.swift +1 -1
  33. package/ios/StripeOnrampSdk.mm +19 -0
  34. package/ios/StripeSdk.mm +17 -4
  35. package/ios/StripeSdkEmitter.swift +1 -0
  36. package/ios/StripeSdkImpl+Checkout.swift +75 -23
  37. package/ios/StripeSdkImpl+CustomerSheet.swift +1 -1
  38. package/ios/StripeSdkImpl+Embedded.swift +1 -1
  39. package/ios/StripeSdkImpl+PaymentSheet.swift +1 -1
  40. package/ios/StripeSdkImpl.swift +88 -8
  41. package/lib/commonjs/components/PaymentMethodMessagingElement.js +1 -1
  42. package/lib/commonjs/components/PaymentMethodMessagingElement.js.map +1 -1
  43. package/lib/commonjs/hooks/useCheckout.js +1 -1
  44. package/lib/commonjs/hooks/useCheckout.js.map +1 -1
  45. package/lib/commonjs/hooks/useOnramp.js +1 -1
  46. package/lib/commonjs/hooks/useOnramp.js.map +1 -1
  47. package/lib/commonjs/specs/NativeOnrampSdkModule.js.map +1 -1
  48. package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
  49. package/lib/module/components/PaymentMethodMessagingElement.js +1 -1
  50. package/lib/module/components/PaymentMethodMessagingElement.js.map +1 -1
  51. package/lib/module/hooks/useCheckout.js +1 -1
  52. package/lib/module/hooks/useCheckout.js.map +1 -1
  53. package/lib/module/hooks/useOnramp.js +1 -1
  54. package/lib/module/hooks/useOnramp.js.map +1 -1
  55. package/lib/module/specs/NativeOnrampSdkModule.js.map +1 -1
  56. package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
  57. package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts +1 -1
  58. package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts.map +1 -1
  59. package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -1
  60. package/lib/typescript/src/hooks/useOnramp.d.ts +22 -0
  61. package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
  62. package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +3 -0
  63. package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -1
  64. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +2 -1
  65. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
  66. package/lib/typescript/src/types/Checkout.d.ts +266 -84
  67. package/lib/typescript/src/types/Checkout.d.ts.map +1 -1
  68. package/lib/typescript/src/types/Onramp.d.ts +94 -0
  69. package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
  70. package/package.json +3 -2
  71. package/src/components/PaymentMethodMessagingElement.tsx +54 -52
  72. package/src/hooks/useCheckout.tsx +20 -4
  73. package/src/hooks/useOnramp.tsx +44 -0
  74. package/src/specs/NativeOnrampSdkModule.ts +5 -0
  75. package/src/specs/NativeStripeSdkModule.ts +8 -1
  76. package/src/types/Checkout.ts +289 -84
  77. package/src/types/Onramp.ts +109 -0
  78. package/stripe-react-native.podspec +1 -1
  79. package/ios/CurrencySelectorElementManager.swift +0 -12
@@ -67,16 +67,81 @@ export namespace Checkout {
67
67
  session: Session;
68
68
  };
69
69
 
70
+ /**
71
+ * A Stripe Checkout Session.
72
+ * @checkoutSessionsPreview
73
+ * @internal
74
+ */
75
+ export interface Session {
76
+ /** Unique identifier for this checkout session. */
77
+ id: string;
78
+ /** The business name as configured in your Stripe account. */
79
+ businessName?: string;
80
+ /** Three-letter ISO 4217 currency code in lowercase (e.g. `"usd"`). */
81
+ currency?: string;
82
+ /** Currency options available when adaptive pricing is active. */
83
+ currencyOptions: CurrencyOption[];
84
+ /** The aggregate amounts calculated per discount for all line items. */
85
+ discountAmounts: DiscountAmount[];
86
+ /** The customer's email address, if available. */
87
+ email?: string;
88
+ /** The line items the customer is purchasing. */
89
+ lineItems: LineItem[];
90
+ /** Indicates whether this session was created in live mode. */
91
+ livemode: boolean;
92
+ /** The factor used to convert between minor and major currency units. */
93
+ minorUnitsAmountDivisor?: number;
94
+ /** The selected shipping option, if any. */
95
+ shipping?: SelectedShipping;
96
+ /** The shipping address set via `updateShippingAddress`, if any. */
97
+ shippingAddress?: ContactAddress;
98
+ /** The shipping rate options available for this session. */
99
+ shippingOptions: ShippingOption[];
100
+ /** The current session status, if available. */
101
+ status?: Status;
102
+ /** Tax computation status and aggregated tax amounts. */
103
+ tax: Tax;
104
+ /** Tax and discount details for the computed total amount. */
105
+ total?: Total;
106
+ /** The billing address set via `updateBillingAddress`, if any. */
107
+ billingAddress?: ContactAddress;
108
+ }
109
+
110
+ /**
111
+ * The mode of a checkout session.
112
+ *
113
+ * - `unknown` - A mode not recognized by this version of the SDK.
114
+ * - `payment` - Accept one-time payments.
115
+ * - `setup` - Save payment details to charge later.
116
+ * - `subscription` - Set up fixed-price subscriptions.
117
+ * @checkoutSessionsPreview
118
+ * @internal
119
+ */
120
+ export type Mode = 'unknown' | 'payment' | 'setup' | 'subscription';
121
+
70
122
  /**
71
123
  * The status of a checkout session.
124
+ * @checkoutSessionsPreview
125
+ * @internal
126
+ */
127
+ export interface Status {
128
+ /** The lifecycle status of the session. */
129
+ type: StatusType;
130
+ /** The payment status. Only meaningful when type is `complete`. */
131
+ paymentStatus?: PaymentStatus;
132
+ }
133
+
134
+ /**
135
+ * The lifecycle status of a checkout session.
72
136
  *
73
137
  * - `unknown` - A status not recognized by this version of the SDK.
74
138
  * - `open` - The checkout session is still in progress.
75
139
  * - `complete` - The checkout session is complete.
76
140
  * - `expired` - The checkout session has expired.
141
+ * @checkoutSessionsPreview
77
142
  * @internal
78
143
  */
79
- export type Status = 'unknown' | 'open' | 'complete' | 'expired';
144
+ export type StatusType = 'unknown' | 'open' | 'complete' | 'expired';
80
145
 
81
146
  /**
82
147
  * The payment status of a checkout session.
@@ -85,6 +150,7 @@ export namespace Checkout {
85
150
  * - `paid` - The payment funds are available in your account.
86
151
  * - `unpaid` - The payment funds are not yet available in your account.
87
152
  * - `noPaymentRequired` - No payment is currently required for the session.
153
+ * @checkoutSessionsPreview
88
154
  * @internal
89
155
  */
90
156
  export type PaymentStatus =
@@ -94,61 +160,102 @@ export namespace Checkout {
94
160
  | 'noPaymentRequired';
95
161
 
96
162
  /**
97
- * A read-only snapshot of a Stripe Checkout Session.
163
+ * A monetary amount with both a localized display string and a value in
164
+ * the smallest currency unit (e.g. cents).
165
+ * @checkoutSessionsPreview
98
166
  * @internal
99
167
  */
100
- export interface Session {
101
- /** Unique identifier for this checkout session. */
102
- id: string;
103
- /** The current session state, if available. */
104
- status?: Status;
105
- /** The payment status for this checkout session. */
106
- paymentStatus: PaymentStatus;
107
- /** Three-letter ISO 4217 currency code in lowercase (e.g. `"usd"`). */
108
- currency?: string;
109
- /** Indicates whether this session was created in live mode. */
110
- livemode: boolean;
111
- /** A summary of monetary totals for this session, if available. */
112
- totals?: Totals;
113
- /** The line items purchased by the customer. */
114
- lineItems: LineItem[];
115
- /** The shipping rate options available for this session. */
116
- shippingOptions: ShippingOption[];
117
- /** The discounts applied to this session. */
118
- discounts: Discount[];
119
- /** The Stripe customer ID attached to this session, if any. */
120
- customerId?: string;
121
- /** The customer's email address, if available. */
122
- customerEmail?: string;
123
- /** The billing address set via `updateBillingAddress`, if any. */
124
- billingAddress?: AddressUpdate;
125
- /** The shipping address set via `updateShippingAddress`, if any. */
126
- shippingAddress?: AddressUpdate;
168
+ export interface Amount {
169
+ /** Localized, formatted string including currency symbol (e.g. `"$10.00"`). */
170
+ amount: string;
171
+ /** Value in the smallest currency unit (e.g. cents for USD). */
172
+ minorUnitsAmount: number;
173
+ }
174
+
175
+ /**
176
+ * A monetary amount supporting sub-minor-unit precision.
177
+ *
178
+ * Use this for sub-cent pricing (e.g. usage-based billing) where rounding
179
+ * to the nearest minor unit would lose precision.
180
+ * @checkoutSessionsPreview
181
+ * @internal
182
+ */
183
+ export interface DecimalAmount {
184
+ /** Localized, formatted string including currency symbol. */
185
+ amount: string;
186
+ /** Value in the smallest currency unit, with decimal precision. */
187
+ minorUnitsAmount: number;
188
+ }
189
+
190
+ /**
191
+ * Tax and discount details for the computed total amount of a checkout session.
192
+ * @checkoutSessionsPreview
193
+ * @internal
194
+ */
195
+ export interface Total {
196
+ /** Total of all line items, excluding tax, discounts, and shipping. */
197
+ subtotal: Amount;
198
+ /** Sum of all exclusive tax amounts. */
199
+ taxExclusive: Amount;
200
+ /** Sum of all inclusive tax amounts. */
201
+ taxInclusive: Amount;
202
+ /** Sum of all shipping amounts. */
203
+ shippingRate: Amount;
204
+ /** Sum of all discounts. A positive number reduces the amount to be paid. */
205
+ discount: Amount;
206
+ /** Grand total, including discounts and tax. */
207
+ total: Amount;
208
+ /** Amount of customer credit balance applied to the payment. */
209
+ appliedBalance: Amount;
210
+ /** When `true`, no payment is collected and the amount is added to the next invoice. */
211
+ balanceAppliedToNextInvoice: boolean;
127
212
  }
128
213
 
129
214
  /**
130
- * Monetary totals for a checkout session.
215
+ * Tax computation status and aggregated tax amounts for a checkout session.
216
+ * @checkoutSessionsPreview
217
+ * @internal
218
+ */
219
+ export interface Tax {
220
+ /** The current tax computation status. */
221
+ status: TaxStatus;
222
+ /** Per-tax-rate amounts, or undefined if tax has not been computed. */
223
+ taxAmounts?: TaxAmount[];
224
+ }
225
+
226
+ /**
227
+ * The tax computation status of a checkout session.
131
228
  *
132
- * All amounts are in the smallest currency unit (e.g. cents for USD).
133
- * @internal
134
- */
135
- export interface Totals {
136
- /** The subtotal amount before discounts, shipping, and tax. */
137
- subtotal: number;
138
- /** The final total after discounts, shipping, and tax. */
139
- total: number;
140
- /** The amount currently due from the customer. */
141
- due: number;
142
- /** The total discount amount applied to the session. */
143
- discount: number;
144
- /** The total shipping amount. */
145
- shipping: number;
146
- /** The total tax amount applied to the session. */
147
- tax: number;
229
+ * - `unknown` - A status not recognized by this version of the SDK.
230
+ * - `ready` - Tax is computed and the session is ready for confirmation.
231
+ * - `requiresShippingAddress` - A shipping address is needed to calculate tax.
232
+ * - `requiresBillingAddress` - A billing address is needed to calculate tax.
233
+ * @checkoutSessionsPreview
234
+ * @internal
235
+ */
236
+ export type TaxStatus =
237
+ | 'unknown'
238
+ | 'ready'
239
+ | 'requiresShippingAddress'
240
+ | 'requiresBillingAddress';
241
+
242
+ /**
243
+ * A tax amount calculated for a line item, shipping option, or aggregate session total.
244
+ * @checkoutSessionsPreview
245
+ * @internal
246
+ */
247
+ export interface TaxAmount {
248
+ /** The tax amount. */
249
+ amount: Amount;
250
+ /** Whether this tax is inclusive (already in subtotal) or exclusive (added on top). */
251
+ inclusive: boolean;
252
+ /** A user-facing description (e.g. `"Sales Tax"` or `"VAT 20%"`). */
253
+ displayName: string;
148
254
  }
149
255
 
150
256
  /**
151
257
  * A line item in a checkout session.
258
+ * @checkoutSessionsPreview
152
259
  * @internal
153
260
  */
154
261
  export interface LineItem {
@@ -156,78 +263,172 @@ export namespace Checkout {
156
263
  id: string;
157
264
  /** The display name shown for this line item. */
158
265
  name: string;
159
- /** The quantity for this line item. */
266
+ /** An optional, merchant-supplied description. */
267
+ description?: string;
268
+ /** Image URLs configured on the underlying product. */
269
+ images: string[];
270
+ /** The quantity of items being purchased. */
160
271
  quantity: number;
161
- /** The per-unit price in the smallest currency unit. */
162
- unitAmount: number;
163
- /** Three-letter ISO 4217 currency code in lowercase. */
164
- currency: string;
272
+ /** The cost of a single unit. */
273
+ unitAmount?: Amount;
274
+ /** The unit amount with sub-cent precision. */
275
+ unitAmountDecimal?: DecimalAmount;
276
+ /** Total before any discounts or exclusive taxes. */
277
+ subtotal?: Amount;
278
+ /** Total discount amount for this line item. */
279
+ discount?: Amount;
280
+ /** Total exclusive tax for this line item. */
281
+ taxExclusive?: Amount;
282
+ /** Total inclusive tax for this line item. */
283
+ taxInclusive?: Amount;
284
+ /** Final total for this line item, including discounts and tax. */
285
+ total?: Amount;
286
+ /** Per-discount breakdown for this line item. */
287
+ discountAmounts: DiscountAmount[];
288
+ /** Per-tax-rate breakdown for this line item. */
289
+ taxAmounts: TaxAmount[];
290
+ /** Configuration for adjustable quantity, if enabled. */
291
+ adjustableQuantity?: AdjustableQuantity;
292
+ }
293
+
294
+ /**
295
+ * Configuration for a customer-adjustable line item quantity.
296
+ * @checkoutSessionsPreview
297
+ * @internal
298
+ */
299
+ export interface AdjustableQuantity {
300
+ /** The minimum quantity the customer can purchase. */
301
+ minimum: number;
302
+ /** The maximum quantity the customer can purchase. */
303
+ maximum: number;
165
304
  }
166
305
 
167
306
  /**
168
307
  * A shipping option available in a checkout session.
308
+ * @checkoutSessionsPreview
169
309
  * @internal
170
310
  */
171
311
  export interface ShippingOption {
172
312
  /** The shipping rate identifier. */
173
313
  id: string;
174
314
  /** The display name shown to the customer. */
175
- displayName: string;
176
- /** The shipping amount in the smallest currency unit. */
177
- amount: number;
315
+ displayName?: string;
316
+ /** The shipping cost. */
317
+ amount: Amount;
178
318
  /** Three-letter ISO 4217 currency code in lowercase. */
179
319
  currency: string;
180
- /** The estimated delivery window shown to the customer, if available. */
181
- deliveryEstimate?: string;
320
+ /** The estimated delivery window, if available. */
321
+ deliveryEstimate?: DeliveryEstimate;
322
+ }
323
+
324
+ /**
325
+ * The estimated delivery range for a shipping option.
326
+ * @checkoutSessionsPreview
327
+ * @internal
328
+ */
329
+ export interface DeliveryEstimate {
330
+ /** The lower bound of the delivery estimate. */
331
+ minimum?: DeliveryEstimateBound;
332
+ /** The upper bound of the delivery estimate. */
333
+ maximum?: DeliveryEstimateBound;
182
334
  }
183
335
 
184
336
  /**
185
- * A discount applied to a checkout session.
337
+ * A bound (minimum or maximum) of a delivery estimate.
338
+ * @checkoutSessionsPreview
186
339
  * @internal
187
340
  */
188
- export interface Discount {
189
- /** The coupon associated with this discount. */
190
- coupon: Coupon;
341
+ export interface DeliveryEstimateBound {
342
+ /** The unit of time. */
343
+ unit: DeliveryEstimateUnit;
344
+ /** The number of units. */
345
+ value: number;
346
+ }
347
+
348
+ /**
349
+ * The unit of time for a delivery estimate.
350
+ * @checkoutSessionsPreview
351
+ * @internal
352
+ */
353
+ export type DeliveryEstimateUnit =
354
+ | 'unknown'
355
+ | 'hour'
356
+ | 'day'
357
+ | 'businessDay'
358
+ | 'week'
359
+ | 'month';
360
+
361
+ /**
362
+ * The shipping option selected for a checkout session, plus any computed
363
+ * shipping tax.
364
+ * @checkoutSessionsPreview
365
+ * @internal
366
+ */
367
+ export interface SelectedShipping {
368
+ /** The selected shipping option. */
369
+ shippingOption: ShippingOption;
370
+ /** Tax amounts calculated for the shipping cost. */
371
+ taxAmounts: TaxAmount[];
372
+ }
373
+
374
+ /**
375
+ * A discount applied to a checkout session or line item.
376
+ * @checkoutSessionsPreview
377
+ * @internal
378
+ */
379
+ export interface DiscountAmount {
380
+ /** The discount amount. A positive number reduces the amount to be paid. */
381
+ amount: Amount;
382
+ /** A user-facing description of the discount. */
383
+ displayName: string;
191
384
  /** The promotion code used to apply this discount, if any. */
192
385
  promotionCode?: string;
193
- /** The discount amount in the smallest currency unit. */
194
- amount: number;
195
386
  }
196
387
 
197
388
  /**
198
- * A coupon associated with a checkout discount.
389
+ * A currency option available on a checkout session when adaptive pricing
390
+ * is active.
391
+ * @checkoutSessionsPreview
199
392
  * @internal
200
393
  */
201
- export interface Coupon {
202
- /** The coupon identifier. */
203
- id: string;
204
- /** The display name of the coupon, if one exists. */
205
- name?: string;
206
- /** The percentage off, if this is a percentage-based coupon. */
207
- percentOff?: number;
208
- /** The fixed amount off, in the smallest currency unit, if applicable. */
209
- amountOff?: number;
394
+ export interface CurrencyOption {
395
+ /** The total amount in this currency. */
396
+ amount: Amount;
397
+ /** Three-letter ISO 4217 currency code in lowercase. */
398
+ currency: string;
399
+ /** Conversion details, present only for the customer's local currency. */
400
+ currencyConversion?: CurrencyConversion;
210
401
  }
211
402
 
212
403
  /**
213
- * A locally stored address override for checkout.
214
- *
215
- * Address updates are merged into PaymentSheet configuration and may also be
216
- * sent to Stripe when tax calculation depends on the billing or shipping
217
- * address.
404
+ * Currency conversion details for an adaptive-pricing currency option.
405
+ * @checkoutSessionsPreview
218
406
  * @internal
219
407
  */
220
- export interface AddressUpdate {
408
+ export interface CurrencyConversion {
409
+ /** The exchange rate used to convert source to customer currency. */
410
+ fxRate: string;
411
+ /** The merchant's original currency (three-letter ISO 4217 code). */
412
+ sourceCurrency: string;
413
+ }
414
+
415
+ /**
416
+ * A contact address containing a name, phone, and postal address.
417
+ * @checkoutSessionsPreview
418
+ * @internal
419
+ */
420
+ export interface ContactAddress {
221
421
  /** The customer's or recipient's name, if provided. */
222
422
  name?: string;
223
423
  /** The customer's or recipient's phone number, if provided. */
224
424
  phone?: string;
225
- /** The postal address to use for the update. */
425
+ /** The postal address. */
226
426
  address: Address;
227
427
  }
228
428
 
229
429
  /**
230
430
  * A postal address used for billing, shipping, or tax updates.
431
+ * @checkoutSessionsPreview
231
432
  * @internal
232
433
  */
233
434
  export interface Address {
@@ -366,12 +567,16 @@ export interface Checkout {
366
567
  updateTaxId(type: string, value: string): Promise<void>;
367
568
 
368
569
  /**
369
- * Refreshes the session by fetching the latest copy from Stripe.
570
+ * Runs an async operation that updates the Checkout Session on your server,
571
+ * then automatically refreshes the local session state.
572
+ *
573
+ * Call your server inside `serverUpdate` to modify the Checkout Session.
574
+ * A 20-second timeout is enforced by the native SDK.
370
575
  *
371
- * Call this after making server-side changes to the Checkout Session
372
- * so the local state stays in sync.
373
- * - Throws: `CheckoutError` if refreshing the session fails.
576
+ * @param serverUpdate - An async function that calls your server to update the session.
577
+ * - Throws: `CheckoutError` if the operation times out or fails.
578
+ * @checkoutSessionsPreview
374
579
  * @internal
375
580
  */
376
- refresh(): Promise<void>;
581
+ runServerUpdate(serverUpdate: () => Promise<void>): Promise<void>;
377
582
  }
@@ -199,8 +199,117 @@ export type KycInfo = {
199
199
  dateOfBirth?: DateOfBirth;
200
200
  /** Customer’s address, if collected. */
201
201
  address?: Address;
202
+ /** Two-letter ISO 3166-1 alpha-2 code for the country where the customer was born. */
203
+ birthCountry?: string;
204
+ /** City where the customer was born. */
205
+ birthCity?: string;
206
+ /** Two-letter ISO 3166-1 alpha-2 codes for the customer's nationalities. */
207
+ nationalities?: string[];
202
208
  };
203
209
 
210
+ /**
211
+ * The type of compliance identifier required or submitted for regulatory compliance.
212
+ */
213
+ export type ComplianceIdentifierType = string;
214
+
215
+ /**
216
+ * The regulation requiring a compliance identifier.
217
+ */
218
+ export type ComplianceRegulation = 'eu_carf' | 'eu_mica';
219
+
220
+ /**
221
+ * A compliance identifier collected for MiCA or CRS/CARF compliance.
222
+ */
223
+ export type ComplianceIdentifier = {
224
+ /** The type of identifier provided. */
225
+ type: ComplianceIdentifierType;
226
+ /** The identifier value. */
227
+ value: string;
228
+ };
229
+
230
+ /**
231
+ * A compliance identifier the customer still needs to provide.
232
+ */
233
+ export type ComplianceIdentifierRequirement = {
234
+ /** The type of identifier required. */
235
+ type: ComplianceIdentifierType;
236
+ /** The regulation requiring this identifier. */
237
+ regulation: ComplianceRegulation;
238
+ };
239
+
240
+ /**
241
+ * A group describing alternative identifier types that may satisfy a requirement.
242
+ */
243
+ export type ComplianceIdentifierAlternativeGroup = {
244
+ /** The original identifier types required. */
245
+ originalMissingIdentifiers: ComplianceIdentifierType[];
246
+ /** Alternative identifier types that may satisfy the original requirement. */
247
+ alternativeMissingIdentifiers: ComplianceIdentifierType[];
248
+ };
249
+
250
+ /**
251
+ * The compliance identifiers a customer still needs to provide.
252
+ */
253
+ export type ComplianceIdentifierRequirements = {
254
+ /** Required identifier types and the regulations requiring them. */
255
+ identifiers: ComplianceIdentifierRequirement[];
256
+ /** Alternative identifier groups that may satisfy one or more requirements. */
257
+ alternatives: ComplianceIdentifierAlternativeGroup[];
258
+ };
259
+
260
+ /**
261
+ * Result of retrieving missing compliance identifiers.
262
+ */
263
+ export type RetrieveMissingIdentifiersResult =
264
+ | (ComplianceIdentifierRequirements & {
265
+ error?: undefined;
266
+ })
267
+ | {
268
+ identifiers?: undefined;
269
+ alternatives?: undefined;
270
+ /** Present if retrieval failed with an error. */
271
+ error: StripeError<OnrampError>;
272
+ };
273
+
274
+ /**
275
+ * Result of submitting compliance identifiers for MiCA and CRS/CARF compliance.
276
+ */
277
+ export type SubmitIdentifiersResult =
278
+ | {
279
+ /** Whether all required identifiers were accepted. */
280
+ valid: boolean;
281
+ /** Any identifiers that still need to be collected. */
282
+ identifiers: ComplianceIdentifierRequirement[];
283
+ /** Alternative identifier groups that may satisfy one or more requirements. */
284
+ alternatives: ComplianceIdentifierAlternativeGroup[];
285
+ /** Submitted identifier types whose values were invalid. */
286
+ invalidIdentifiers: ComplianceIdentifierType[];
287
+ error?: undefined;
288
+ }
289
+ | {
290
+ valid?: undefined;
291
+ identifiers?: undefined;
292
+ alternatives?: undefined;
293
+ invalidIdentifiers?: undefined;
294
+ /** Present if submission failed with an error. */
295
+ error: StripeError<OnrampError>;
296
+ };
297
+
298
+ /**
299
+ * Result of presenting the CRS/CARF declaration.
300
+ */
301
+ export type CRSCARFDeclarationResult =
302
+ | {
303
+ /** The customer accepted the declaration. */
304
+ status: 'Confirmed';
305
+ error?: undefined;
306
+ }
307
+ | {
308
+ status?: undefined;
309
+ /** Present if the declaration failed or was cancelled. */
310
+ error: StripeError<OnrampError>;
311
+ };
312
+
204
313
  /**
205
314
  * Result of KYC verification.
206
315
  */
@@ -2,7 +2,7 @@ require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
  # Keep stripe_version in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/stripe-identity-react-native.podspec
5
- stripe_version = '~> 25.12.0'
5
+ stripe_version = '~> 25.15.0'
6
6
 
7
7
  fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
8
8
 
@@ -1,12 +0,0 @@
1
- import Foundation
2
-
3
- @objc(StripeCurrencySelectorElementManager)
4
- class StripeCurrencySelectorElementManager: RCTViewManager {
5
- override static func requiresMainQueueSetup() -> Bool {
6
- return true
7
- }
8
-
9
- override func view() -> UIView! {
10
- return StripeCurrencySelectorElementContainerView(frame: .zero)
11
- }
12
- }