@stripe/stripe-react-native 0.25.0 → 0.26.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/CHANGELOG.md +13 -1
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +26 -16
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +2 -0
- package/ios/Mappers.swift +2 -0
- package/ios/PaymentMethodFactory.swift +24 -0
- package/ios/StripeSdk.swift +2 -5
- package/lib/commonjs/types/PaymentIntent.js.map +1 -1
- package/lib/commonjs/types/PaymentMethod.js.map +1 -1
- package/lib/commonjs/types/SetupIntent.js.map +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/module/types/PaymentMethod.js.map +1 -1
- package/lib/module/types/SetupIntent.js.map +1 -1
- package/lib/typescript/src/functions.d.ts +1 -1
- package/lib/typescript/src/hooks/useConfirmPayment.d.ts +1 -1
- package/lib/typescript/src/hooks/useStripe.d.ts +1 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts +190 -2
- package/lib/typescript/src/types/PaymentMethod.d.ts +7 -1
- package/lib/typescript/src/types/SetupIntent.d.ts +3 -3
- package/package.json +2 -1
- package/src/types/PaymentIntent.ts +227 -3
- package/src/types/PaymentMethod.ts +9 -1
- package/src/types/SetupIntent.ts +7 -20
- package/stripe-react-native.podspec +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.26.0 - 2023-03-16
|
|
6
|
+
|
|
7
|
+
### New Features
|
|
8
|
+
|
|
9
|
+
- Added support for PayPal and CashApp to PaymentSheet, `confirmPayment`, and `confirmSetupIntent`. [#1331](https://github.com/stripe/stripe-react-native/pull/1331)
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
- Compatible with v0.1.4 of `@stripe/stripe-identity-react-native`. [8fa8a7a](https://github.com/stripe/stripe-react-native/commit/8fa8a7a0595a31d7422af6bbe26d696ba5e211f7)
|
|
14
|
+
|
|
5
15
|
## 0.25.0 - 2023-02-27
|
|
6
16
|
|
|
7
17
|
### New Features
|
|
@@ -39,7 +49,7 @@
|
|
|
39
49
|
- Added the `request` field to `initPaymentSheet()`'s, `confirmPlatformPayPayment()`'s, and `confirmPlatformPaySetupIntent`'s `applePay` params. Use this to support different types of payment requests, like `RecurringPaymentRequest`, `AutomaticReloadPaymentRequest`, and `MultiMerchantRequest`.[#1248](https://github.com/stripe/stripe-react-native/pull/1248)
|
|
40
50
|
- Added an `options` argument to `presentPaymentSheet` which includes a `timeout` property. [#1287](https://github.com/stripe/stripe-react-native/pull/1287)
|
|
41
51
|
|
|
42
|
-
## 0.23.3 - 2023-02-07
|
|
52
|
+
## 0.23.3 - 2023-02-07 (📌 Expo SDK 48)
|
|
43
53
|
|
|
44
54
|
### Fixes
|
|
45
55
|
|
|
@@ -53,6 +63,8 @@
|
|
|
53
63
|
|
|
54
64
|
## 0.23.1 - 2023-01-25
|
|
55
65
|
|
|
66
|
+
> **Note**: This version pulls in a new version of `stripe-android` that now requires v1.8.0 of the Kotlin Gradle plugin. [Refer to this issue for a limited workaround](https://github.com/stripe/stripe-react-native/issues/1294#issuecomment-1426150258).
|
|
67
|
+
|
|
56
68
|
### Fixes
|
|
57
69
|
|
|
58
70
|
- Fixed an issue with `confirmPlatformPaySetupIntent` on iOS. [#1266](https://github.com/stripe/stripe-react-native/pull/1266)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
StripeSdk_kotlinVersion=1.8.0
|
|
2
|
-
StripeSdk_stripeVersion=[20.
|
|
2
|
+
StripeSdk_stripeVersion=[20.20.0, 20.22.0[
|
|
@@ -37,6 +37,7 @@ class PaymentMethodCreateParamsFactory(
|
|
|
37
37
|
PaymentMethod.Type.USBankAccount -> createUSBankAccountParams(paymentMethodData)
|
|
38
38
|
PaymentMethod.Type.PayPal -> createPayPalParams()
|
|
39
39
|
PaymentMethod.Type.Affirm -> createAffirmParams()
|
|
40
|
+
PaymentMethod.Type.CashAppPay -> createCashAppParams()
|
|
40
41
|
else -> {
|
|
41
42
|
throw Exception("This paymentMethodType is not supported yet")
|
|
42
43
|
}
|
|
@@ -202,13 +203,17 @@ class PaymentMethodCreateParamsFactory(
|
|
|
202
203
|
return PaymentMethodCreateParams.createAffirm(billingDetailsParams)
|
|
203
204
|
}
|
|
204
205
|
|
|
206
|
+
@Throws(PaymentMethodCreateParamsException::class)
|
|
207
|
+
private fun createCashAppParams(): PaymentMethodCreateParams {
|
|
208
|
+
return PaymentMethodCreateParams.createCashAppPay(billingDetailsParams)
|
|
209
|
+
}
|
|
210
|
+
|
|
205
211
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
206
212
|
fun createParams(clientSecret: String, paymentMethodType: PaymentMethod.Type?, isPaymentIntent: Boolean): ConfirmStripeIntentParams {
|
|
207
213
|
try {
|
|
208
214
|
return when (paymentMethodType) {
|
|
209
215
|
PaymentMethod.Type.Card -> createCardStripeIntentParams(clientSecret, isPaymentIntent)
|
|
210
216
|
PaymentMethod.Type.USBankAccount -> createUSBankAccountStripeIntentParams(clientSecret, isPaymentIntent)
|
|
211
|
-
PaymentMethod.Type.PayPal -> createPayPalStripeIntentParams(clientSecret, isPaymentIntent)
|
|
212
217
|
PaymentMethod.Type.Affirm -> createAffirmStripeIntentParams(clientSecret, isPaymentIntent)
|
|
213
218
|
PaymentMethod.Type.Ideal,
|
|
214
219
|
PaymentMethod.Type.Alipay,
|
|
@@ -223,7 +228,9 @@ class PaymentMethodCreateParamsFactory(
|
|
|
223
228
|
PaymentMethod.Type.Fpx,
|
|
224
229
|
PaymentMethod.Type.AfterpayClearpay,
|
|
225
230
|
PaymentMethod.Type.AuBecsDebit,
|
|
226
|
-
PaymentMethod.Type.Klarna
|
|
231
|
+
PaymentMethod.Type.Klarna,
|
|
232
|
+
PaymentMethod.Type.PayPal,
|
|
233
|
+
PaymentMethod.Type.CashAppPay -> {
|
|
227
234
|
val params = createPaymentMethodParams(paymentMethodType)
|
|
228
235
|
|
|
229
236
|
return if (isPaymentIntent) {
|
|
@@ -232,11 +239,13 @@ class PaymentMethodCreateParamsFactory(
|
|
|
232
239
|
paymentMethodCreateParams = params,
|
|
233
240
|
clientSecret = clientSecret,
|
|
234
241
|
setupFutureUsage = mapToPaymentIntentFutureUsage(getValOr(options, "setupFutureUsage")),
|
|
242
|
+
mandateData = buildMandateDataParams()
|
|
235
243
|
)
|
|
236
244
|
} else {
|
|
237
245
|
ConfirmSetupIntentParams.create(
|
|
238
246
|
paymentMethodCreateParams = params,
|
|
239
247
|
clientSecret = clientSecret,
|
|
248
|
+
mandateData = buildMandateDataParams()
|
|
240
249
|
)
|
|
241
250
|
}
|
|
242
251
|
}
|
|
@@ -339,20 +348,6 @@ class PaymentMethodCreateParamsFactory(
|
|
|
339
348
|
}
|
|
340
349
|
}
|
|
341
350
|
|
|
342
|
-
@Throws(PaymentMethodCreateParamsException::class)
|
|
343
|
-
private fun createPayPalStripeIntentParams(clientSecret: String, isPaymentIntent: Boolean): ConfirmStripeIntentParams {
|
|
344
|
-
if (!isPaymentIntent) {
|
|
345
|
-
throw PaymentMethodCreateParamsException("PayPal is not yet supported through SetupIntents.")
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
val params = createPayPalParams()
|
|
349
|
-
|
|
350
|
-
return ConfirmPaymentIntentParams.createWithPaymentMethodCreateParams(
|
|
351
|
-
paymentMethodCreateParams = params,
|
|
352
|
-
clientSecret = clientSecret,
|
|
353
|
-
)
|
|
354
|
-
}
|
|
355
|
-
|
|
356
351
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
357
352
|
private fun createAffirmStripeIntentParams(clientSecret: String, isPaymentIntent: Boolean): ConfirmStripeIntentParams {
|
|
358
353
|
if (!isPaymentIntent) {
|
|
@@ -366,6 +361,7 @@ class PaymentMethodCreateParamsFactory(
|
|
|
366
361
|
paymentMethodCreateParams = params,
|
|
367
362
|
clientSecret = clientSecret,
|
|
368
363
|
setupFutureUsage = mapToPaymentIntentFutureUsage(getValOr(options, "setupFutureUsage")),
|
|
364
|
+
mandateData = buildMandateDataParams()
|
|
369
365
|
)
|
|
370
366
|
}
|
|
371
367
|
|
|
@@ -401,6 +397,20 @@ class PaymentMethodCreateParamsFactory(
|
|
|
401
397
|
null
|
|
402
398
|
)
|
|
403
399
|
}
|
|
400
|
+
|
|
401
|
+
private fun buildMandateDataParams(): MandateDataParams? {
|
|
402
|
+
getMapOrNull(paymentMethodData, "mandateData")?.let { mandateData ->
|
|
403
|
+
getMapOrNull(mandateData, "customerAcceptance")?.let { customerAcceptance ->
|
|
404
|
+
getMapOrNull(customerAcceptance, "online")?.let { onlineParams ->
|
|
405
|
+
return MandateDataParams(MandateDataParams.Type.Online(
|
|
406
|
+
ipAddress = getValOr(onlineParams, "ipAddress", "") ?: "",
|
|
407
|
+
userAgent = getValOr(onlineParams, "userAgent", "") ?: "",
|
|
408
|
+
))
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
return null
|
|
413
|
+
}
|
|
404
414
|
}
|
|
405
415
|
|
|
406
416
|
class PaymentMethodCreateParamsException(message: String) : Exception(message)
|
|
@@ -123,6 +123,7 @@ internal fun mapPaymentMethodType(type: PaymentMethod.Type?): String {
|
|
|
123
123
|
PaymentMethod.Type.USBankAccount -> "USBankAccount"
|
|
124
124
|
PaymentMethod.Type.PayPal -> "PayPal"
|
|
125
125
|
PaymentMethod.Type.Affirm -> "Affirm"
|
|
126
|
+
PaymentMethod.Type.CashAppPay -> "CashApp"
|
|
126
127
|
else -> "Unknown"
|
|
127
128
|
}
|
|
128
129
|
}
|
|
@@ -152,6 +153,7 @@ internal fun mapToPaymentMethodType(type: String?): PaymentMethod.Type? {
|
|
|
152
153
|
"USBankAccount" -> PaymentMethod.Type.USBankAccount
|
|
153
154
|
"PayPal" -> PaymentMethod.Type.PayPal
|
|
154
155
|
"Affirm" -> PaymentMethod.Type.Affirm
|
|
156
|
+
"CashApp" -> PaymentMethod.Type.CashAppPay
|
|
155
157
|
else -> null
|
|
156
158
|
}
|
|
157
159
|
}
|
package/ios/Mappers.swift
CHANGED
|
@@ -292,6 +292,7 @@ class Mappers {
|
|
|
292
292
|
case STPPaymentMethodType.USBankAccount: return "USBankAccount"
|
|
293
293
|
case STPPaymentMethodType.payPal: return "PayPal"
|
|
294
294
|
case STPPaymentMethodType.affirm: return "Affirm"
|
|
295
|
+
case STPPaymentMethodType.cashApp: return "CashApp"
|
|
295
296
|
case STPPaymentMethodType.unknown: return "Unknown"
|
|
296
297
|
default: return "Unknown"
|
|
297
298
|
}
|
|
@@ -322,6 +323,7 @@ class Mappers {
|
|
|
322
323
|
case "USBankAccount": return STPPaymentMethodType.USBankAccount
|
|
323
324
|
case "PayPal": return STPPaymentMethodType.payPal
|
|
324
325
|
case "Affirm": return STPPaymentMethodType.affirm
|
|
326
|
+
case "CashApp": return STPPaymentMethodType.cashApp
|
|
325
327
|
default: return STPPaymentMethodType.unknown
|
|
326
328
|
}
|
|
327
329
|
}
|
|
@@ -55,6 +55,8 @@ class PaymentMethodFactory {
|
|
|
55
55
|
return try createPayPalPaymentMethodParams()
|
|
56
56
|
case STPPaymentMethodType.affirm:
|
|
57
57
|
return try createAffirmPaymentMethodParams()
|
|
58
|
+
case STPPaymentMethodType.cashApp:
|
|
59
|
+
return try createCashAppPaymentMethodParams()
|
|
58
60
|
// case STPPaymentMethodType.weChatPay:
|
|
59
61
|
// return try createWeChatPayPaymentMethodParams()
|
|
60
62
|
default:
|
|
@@ -106,6 +108,8 @@ class PaymentMethodFactory {
|
|
|
106
108
|
return nil
|
|
107
109
|
case STPPaymentMethodType.affirm:
|
|
108
110
|
return nil
|
|
111
|
+
case STPPaymentMethodType.cashApp:
|
|
112
|
+
return nil
|
|
109
113
|
default:
|
|
110
114
|
throw PaymentMethodError.paymentNotSupported
|
|
111
115
|
}
|
|
@@ -369,6 +373,26 @@ class PaymentMethodFactory {
|
|
|
369
373
|
let params = STPPaymentMethodAffirmParams()
|
|
370
374
|
return STPPaymentMethodParams(affirm: params, metadata: nil)
|
|
371
375
|
}
|
|
376
|
+
|
|
377
|
+
private func createCashAppPaymentMethodParams() throws -> STPPaymentMethodParams {
|
|
378
|
+
let params = STPPaymentMethodCashAppParams()
|
|
379
|
+
return STPPaymentMethodParams(cashApp: params, billingDetails: billingDetailsParams, metadata: nil)
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
func createMandateData() -> STPMandateDataParams? {
|
|
383
|
+
if let mandateParams = paymentMethodData?["mandateData"] as? NSDictionary {
|
|
384
|
+
if let customerAcceptanceParams = mandateParams["customerAcceptance"] as? NSDictionary {
|
|
385
|
+
let mandate = STPMandateDataParams.init(customerAcceptance: STPMandateCustomerAcceptanceParams.init())
|
|
386
|
+
|
|
387
|
+
mandate.customerAcceptance.type = .online
|
|
388
|
+
if let onlineParams = customerAcceptanceParams["online"] as? NSDictionary {
|
|
389
|
+
mandate.customerAcceptance.onlineParams = .init(ipAddress: onlineParams["ipAddress"] as? String ?? "", userAgent: onlineParams["userAgent"] as? String ?? "")
|
|
390
|
+
}
|
|
391
|
+
return mandate
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return nil
|
|
395
|
+
}
|
|
372
396
|
}
|
|
373
397
|
|
|
374
398
|
enum PaymentMethodError: Error {
|
package/ios/StripeSdk.swift
CHANGED
|
@@ -240,11 +240,6 @@ class StripeSdk: RCTEventEmitter, STPBankSelectionViewControllerDelegate, UIAdap
|
|
|
240
240
|
return
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
if (paymentMethodType == .payPal) {
|
|
244
|
-
resolve(Errors.createError(ErrorType.Failed, "PayPal is not yet supported through SetupIntents."))
|
|
245
|
-
return
|
|
246
|
-
}
|
|
247
|
-
|
|
248
243
|
var err: NSDictionary? = nil
|
|
249
244
|
let setupIntentParams: STPSetupIntentConfirmParams = {
|
|
250
245
|
// If payment method data is not supplied, assume payment method was attached through via collectBankAccount
|
|
@@ -260,6 +255,7 @@ class StripeSdk: RCTEventEmitter, STPBankSelectionViewControllerDelegate, UIAdap
|
|
|
260
255
|
do {
|
|
261
256
|
let paymentMethodParams = try factory.createParams(paymentMethodType: paymentMethodType)
|
|
262
257
|
parameters.paymentMethodParams = paymentMethodParams
|
|
258
|
+
parameters.mandateData = factory.createMandateData()
|
|
263
259
|
} catch {
|
|
264
260
|
err = Errors.createError(ErrorType.Failed, error as NSError?)
|
|
265
261
|
}
|
|
@@ -881,6 +877,7 @@ class StripeSdk: RCTEventEmitter, STPBankSelectionViewControllerDelegate, UIAdap
|
|
|
881
877
|
let paymentMethodOptions = try factory.createOptions(paymentMethodType: paymentMethodType)
|
|
882
878
|
parameters.paymentMethodParams = paymentMethodParams
|
|
883
879
|
parameters.paymentMethodOptions = paymentMethodOptions
|
|
880
|
+
parameters.mandateData = factory.createMandateData()
|
|
884
881
|
} catch {
|
|
885
882
|
err = Errors.createError(ErrorType.Failed, error as NSError?)
|
|
886
883
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\
|
|
1
|
+
{"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address, BillingDetails } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nimport type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type { BankAcccountHolderType, BankAcccountType } from './Token';\nexport interface Result {\n id: string;\n amount: number;\n /** The UNIX timestamp (in milliseconds) of the date this PaymentIntent was created. */\n created: string;\n currency: string;\n status: Status;\n description: string | null;\n receiptEmail: string | null;\n canceledAt: string | null;\n clientSecret: string;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string;\n paymentMethod: PaymentMethodResult | null;\n captureMethod: 'Automatic' | 'Manual';\n confirmationMethod: 'Automatic' | 'Manual';\n lastPaymentError: LastPaymentError | null;\n shipping: ShippingDetails | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmOptions = PaymentMethod.ConfirmOptions;\n\nexport type LastPaymentError = StripeError<string> & {\n paymentMethod: PaymentMethodResult;\n};\n\nexport type FutureUsage = 'OffSession' | 'OnSession';\n\nexport interface ShippingDetails {\n address: Required<Address>;\n name: string;\n carrier: string;\n phone: string;\n trackingNumber: string;\n}\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n RequiresCapture = 'RequiresCapture',\n Unknown = 'Unknown',\n}\n\nexport type MandateData = {\n customerAcceptance: {\n online: {\n ipAddress: string;\n userAgent: string;\n };\n };\n};\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean; mandateData?: MandateData };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n paymentMethodData?: {\n mandateData?: MandateData;\n };\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: BillingDetails;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails; mandateData?: MandateData };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: BillingDetails;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n mandateData?: MandateData;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n mandateData?: MandateData;\n };\n};\n"],"mappings":"kFAmEYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,sCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {
|
|
1
|
+
{"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {\n LastPaymentError,\n ConfirmParams as PaymentIntentConfirmParams,\n ConfirmOptions as PaymentIntentConfirmOptions,\n} from './PaymentIntent';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nexport interface Result {\n id: string;\n clientSecret: string;\n lastSetupError: LastPaymentError | null;\n /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */\n created: string | null;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string | null;\n paymentMethod: PaymentMethod.Result | null;\n status: Status;\n paymentMethodTypes: Type[];\n usage: FutureUsage;\n description: string | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams = PaymentIntentConfirmParams;\n\nexport type ConfirmOptions = PaymentIntentConfirmOptions;\n\nexport type FutureUsage =\n | 'Unknown'\n | 'None'\n | 'OnSession'\n | 'OffSession'\n | 'OneTime';\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFAoCYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\
|
|
1
|
+
{"version":3,"names":["Status"],"sources":["PaymentIntent.ts"],"sourcesContent":["import type { StripeError } from '.';\nimport type { Address, BillingDetails } from './Common';\nimport type { Result as PaymentMethodResult } from './PaymentMethod';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nimport type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type { BankAcccountHolderType, BankAcccountType } from './Token';\nexport interface Result {\n id: string;\n amount: number;\n /** The UNIX timestamp (in milliseconds) of the date this PaymentIntent was created. */\n created: string;\n currency: string;\n status: Status;\n description: string | null;\n receiptEmail: string | null;\n canceledAt: string | null;\n clientSecret: string;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string;\n paymentMethod: PaymentMethodResult | null;\n captureMethod: 'Automatic' | 'Manual';\n confirmationMethod: 'Automatic' | 'Manual';\n lastPaymentError: LastPaymentError | null;\n shipping: ShippingDetails | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmOptions = PaymentMethod.ConfirmOptions;\n\nexport type LastPaymentError = StripeError<string> & {\n paymentMethod: PaymentMethodResult;\n};\n\nexport type FutureUsage = 'OffSession' | 'OnSession';\n\nexport interface ShippingDetails {\n address: Required<Address>;\n name: string;\n carrier: string;\n phone: string;\n trackingNumber: string;\n}\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n RequiresCapture = 'RequiresCapture',\n Unknown = 'Unknown',\n}\n\nexport type MandateData = {\n customerAcceptance: {\n online: {\n ipAddress: string;\n userAgent: string;\n };\n };\n};\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean; mandateData?: MandateData };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n paymentMethodData?: {\n mandateData?: MandateData;\n };\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: BillingDetails;\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails; mandateData?: MandateData };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: BillingDetails;\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n mandateData?: MandateData;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n mandateData?: MandateData;\n };\n};\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n mandateData?: MandateData;\n };\n};\n"],"mappings":"kFAmEYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,sCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["PaymentMethod.ts"],"sourcesContent":["import type { FormDetails } from './components/AuBECSDebitFormComponent';\nimport type {\n CardBrand,\n BankAcccountHolderType,\n BankAcccountType,\n} from './Token';\nimport type { FutureUsage } from './PaymentIntent';\nimport type { Address, BillingDetails } from './Common';\n\nexport interface Result {\n id: string;\n liveMode: boolean;\n customerId: string;\n billingDetails: BillingDetails;\n paymentMethodType: Type;\n AuBecsDebit: AuBecsDebitResult;\n BacsDebit: BacsDebitResult;\n Card: CardResult;\n Fpx: FpxResult;\n Ideal: IdealResult;\n SepaDebit: SepaDebitResult;\n Sofort: SofortResult;\n Upi: UpiResult;\n USBankAccount: USBankAccountResult;\n}\n\nexport type CreateParams =\n | CardParams\n | IdealParams\n | OxxoParams\n | P24Params\n | AlipayParams\n | GiropayParams\n | SepaParams\n | EpsParams\n | AuBecsDebitParams\n | SofortParams\n | GrabPayParams\n | FPXParams\n | AfterpayClearpayParams\n | KlarnaParams\n // | WeChatPayParams\n | BancontactParams\n | USBankAccountParams\n | PayPalParams\n | AffirmParams\n | CashAppParams;\n\nexport type ConfirmParams = CreateParams;\n\nexport type CreateOptions = {\n setupFutureUsage?: FutureUsage;\n};\n\nexport type ConfirmOptions = CreateOptions;\n\nexport type ShippingDetails = BillingDetails;\n\nexport type CardParams =\n | {\n paymentMethodType: 'Card';\n paymentMethodData?: {\n token?: string;\n billingDetails?: BillingDetails;\n };\n }\n | {\n paymentMethodType: 'Card';\n paymentMethodData: {\n paymentMethodId: string;\n cvc?: string;\n billingDetails?: BillingDetails;\n };\n };\n\nexport interface IdealParams {\n paymentMethodType: 'Ideal';\n paymentMethodData?: {\n bankName?: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface FPXParams {\n paymentMethodType: 'Fpx';\n paymentMethodData?: { testOfflineBank?: boolean };\n}\n\nexport interface AlipayParams {\n paymentMethodType: 'Alipay';\n}\n\nexport interface OxxoParams {\n paymentMethodType: 'Oxxo';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SofortParams {\n paymentMethodType: 'Sofort';\n paymentMethodData: {\n country: string;\n billingDetails: BillingDetails;\n };\n}\nexport interface GrabPayParams {\n paymentMethodType: 'GrabPay';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface BancontactParams {\n paymentMethodType: 'Bancontact';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface SepaParams {\n paymentMethodType: 'SepaDebit';\n paymentMethodData: {\n iban: string;\n billingDetails: BillingDetails;\n };\n}\n\nexport interface GiropayParams {\n paymentMethodType: 'Giropay';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface AfterpayClearpayParams {\n paymentMethodType: 'AfterpayClearpay';\n paymentMethodData: {\n shippingDetails: ShippingDetails;\n billingDetails: BillingDetails;\n };\n}\n\nexport type KlarnaParams = {\n paymentMethodType: 'Klarna';\n paymentMethodData: {\n billingDetails: Pick<Required<BillingDetails>, 'email'> & {\n address: Pick<Required<Address>, 'country'>;\n } & BillingDetails;\n shippingDetails?: ShippingDetails;\n };\n};\n\nexport interface EpsParams {\n paymentMethodType: 'Eps';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface P24Params {\n paymentMethodType: 'P24';\n paymentMethodData: {\n billingDetails: BillingDetails;\n };\n}\n\nexport interface WeChatPayParams {\n paymentMethodType: 'WeChatPay';\n paymentMethodData: {\n appId: string;\n billingDetails?: BillingDetails;\n };\n}\n\nexport interface AuBecsDebitParams {\n paymentMethodType: 'AuBecsDebit';\n paymentMethodData: { formDetails: FormDetails };\n}\n\nexport type AffirmParams = {\n paymentMethodType: 'Affirm';\n paymentMethodData?: {\n /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */\n shippingDetails?: ShippingDetails;\n billingDetails?: BillingDetails;\n };\n};\n\n/**\n * If paymentMethodData is null, it is assumed that the bank account details have already been attached\n * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.\n */\nexport type USBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData?: {\n billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;\n accountNumber: string;\n routingNumber: string;\n /** Defaults to Individual */\n accountHolderType?: BankAcccountHolderType;\n /** Defaults to Checking */\n accountType?: BankAcccountType;\n };\n};\n\nexport type PayPalParams = {\n paymentMethodType: 'PayPal';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport type CashAppParams = {\n paymentMethodType: 'CashApp';\n paymentMethodData?: {\n billingDetails?: BillingDetails;\n };\n};\n\nexport interface AuBecsDebitResult {\n fingerprint?: string;\n last4?: string;\n bsbNumber?: string;\n}\n\nexport interface BacsDebitResult {\n sortCode?: string;\n last4?: string;\n fingerprint?: string;\n}\n\nexport interface CardResult {\n brand?: CardBrand;\n country?: string;\n expYear?: number;\n expMonth?: number;\n fingerprint?: string;\n funding?: string;\n last4?: string;\n preferredNetwork?: string;\n availableNetworks?: Array<string>;\n}\n\nexport interface FpxResult {\n bank?: string;\n}\n\nexport interface IdealResult {\n bankIdentifierCode?: string;\n bank?: string;\n}\n\nexport interface SepaDebitResult {\n bankCode?: string;\n country?: string;\n fingerprint?: string;\n last4?: string;\n}\n\nexport interface SofortResult {\n country?: string;\n}\n\nexport interface UpiResult {\n vpa?: string;\n}\n\nexport type USBankAccountResult = {\n routingNumber?: string;\n accountHolderType?: BankAcccountHolderType;\n accountType?: BankAcccountType;\n last4?: string;\n bankName?: string;\n linkedAccount?: string;\n fingerprint?: string;\n preferredNetwork?: string;\n supportedNetworks?: string[];\n};\n\nexport type Type =\n | 'AfterpayClearpay'\n | 'Card'\n | 'Alipay'\n | 'GrabPay'\n | 'Ideal'\n | 'Fpx'\n | 'CardPresent'\n | 'SepaDebit'\n | 'AuBecsDebit'\n | 'BacsDebit'\n | 'Giropay'\n | 'P24'\n | 'Eps'\n | 'Bancontact'\n | 'Oxxo'\n | 'Sofort'\n | 'Upi'\n | 'USBankAccount'\n | 'PayPal'\n | 'Unknown';\n\nexport type CollectBankAccountParams = {\n paymentMethodType: 'USBankAccount';\n paymentMethodData: {\n billingDetails: {\n name: string;\n email?: string;\n };\n };\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {
|
|
1
|
+
{"version":3,"names":["Status"],"sources":["SetupIntent.ts"],"sourcesContent":["import type { Type } from './PaymentMethod';\nimport type {\n LastPaymentError,\n ConfirmParams as PaymentIntentConfirmParams,\n ConfirmOptions as PaymentIntentConfirmOptions,\n} from './PaymentIntent';\nimport type { NextAction } from './NextAction';\nimport type * as PaymentMethod from './PaymentMethod';\nexport interface Result {\n id: string;\n clientSecret: string;\n lastSetupError: LastPaymentError | null;\n /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */\n created: string | null;\n livemode: boolean;\n /** @deprecated Use paymentMethod.id instead. */\n paymentMethodId: string | null;\n paymentMethod: PaymentMethod.Result | null;\n status: Status;\n paymentMethodTypes: Type[];\n usage: FutureUsage;\n description: string | null;\n nextAction: NextAction | null;\n}\n\nexport type ConfirmParams = PaymentIntentConfirmParams;\n\nexport type ConfirmOptions = PaymentIntentConfirmOptions;\n\nexport type FutureUsage =\n | 'Unknown'\n | 'None'\n | 'OnSession'\n | 'OffSession'\n | 'OneTime';\n\nexport enum Status {\n Succeeded = 'Succeeded',\n RequiresPaymentMethod = 'RequiresPaymentMethod',\n RequiresConfirmation = 'RequiresConfirmation',\n Canceled = 'Canceled',\n Processing = 'Processing',\n RequiresAction = 'RequiresAction',\n Unknown = 'Unknown',\n}\n"],"mappings":"kFAoCYA,OAAM,iCAANA,MAAM,EAANA,MAAM,0BAANA,MAAM,kDAANA,MAAM,gDAANA,MAAM,wBAANA,MAAM,4BAANA,MAAM,oCAANA,MAAM,yBAANA,MAAM,kBAANA,MAAM"}
|
|
@@ -11,7 +11,7 @@ export declare const retrieveSetupIntent: (clientSecret: string) => Promise<Retr
|
|
|
11
11
|
* @param {object=} options An optional object that contains options for this payment method.
|
|
12
12
|
* @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.
|
|
13
13
|
*/
|
|
14
|
-
export declare const confirmPayment: (paymentIntentClientSecret: string, params?:
|
|
14
|
+
export declare const confirmPayment: (paymentIntentClientSecret: string, params?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
|
|
15
15
|
/** @deprecated Use `isPlatformPaySupported` instead. */
|
|
16
16
|
export declare const isApplePaySupported: () => Promise<boolean>;
|
|
17
17
|
/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */
|
|
@@ -3,6 +3,6 @@ import type { PaymentIntent } from '../types';
|
|
|
3
3
|
* useConfirmPayment hook
|
|
4
4
|
*/
|
|
5
5
|
export declare function useConfirmPayment(): {
|
|
6
|
-
confirmPayment: (paymentIntentClientSecret: string, data?:
|
|
6
|
+
confirmPayment: (paymentIntentClientSecret: string, data?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<import("../types").ConfirmPaymentResult>;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
};
|
|
@@ -5,7 +5,7 @@ import type { PaymentMethod, PaymentIntent, ApplePay, PaymentSheet, CreatePaymen
|
|
|
5
5
|
export declare function useStripe(): {
|
|
6
6
|
retrievePaymentIntent: (clientSecret: string) => Promise<RetrievePaymentIntentResult>;
|
|
7
7
|
retrieveSetupIntent: (clientSecret: string) => Promise<RetrieveSetupIntentResult>;
|
|
8
|
-
confirmPayment: (paymentIntentClientSecret: string, data?:
|
|
8
|
+
confirmPayment: (paymentIntentClientSecret: string, data?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
|
|
9
9
|
createPaymentMethod: (data: PaymentMethod.CreateParams, options?: PaymentMethod.CreateOptions) => Promise<CreatePaymentMethodResult>;
|
|
10
10
|
handleNextAction: (paymentIntentClientSecret: string, returnURL?: string | undefined) => Promise<HandleNextActionResult>;
|
|
11
11
|
isApplePaySupported: boolean | null;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { StripeError } from '.';
|
|
2
|
-
import type { Address } from './Common';
|
|
2
|
+
import type { Address, BillingDetails } from './Common';
|
|
3
3
|
import type { Result as PaymentMethodResult } from './PaymentMethod';
|
|
4
4
|
import type { NextAction } from './NextAction';
|
|
5
5
|
import type * as PaymentMethod from './PaymentMethod';
|
|
6
|
+
import type { FormDetails } from './components/AuBECSDebitFormComponent';
|
|
7
|
+
import type { BankAcccountHolderType, BankAcccountType } from './Token';
|
|
6
8
|
export interface Result {
|
|
7
9
|
id: string;
|
|
8
10
|
amount: number;
|
|
@@ -24,7 +26,7 @@ export interface Result {
|
|
|
24
26
|
shipping: ShippingDetails | null;
|
|
25
27
|
nextAction: NextAction | null;
|
|
26
28
|
}
|
|
27
|
-
export declare type ConfirmParams =
|
|
29
|
+
export declare type ConfirmParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams | CashAppParams;
|
|
28
30
|
export declare type ConfirmOptions = PaymentMethod.ConfirmOptions;
|
|
29
31
|
export declare type LastPaymentError = StripeError<string> & {
|
|
30
32
|
paymentMethod: PaymentMethodResult;
|
|
@@ -47,3 +49,189 @@ export declare enum Status {
|
|
|
47
49
|
RequiresCapture = "RequiresCapture",
|
|
48
50
|
Unknown = "Unknown"
|
|
49
51
|
}
|
|
52
|
+
export declare type MandateData = {
|
|
53
|
+
customerAcceptance: {
|
|
54
|
+
online: {
|
|
55
|
+
ipAddress: string;
|
|
56
|
+
userAgent: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare type CardParams = {
|
|
61
|
+
paymentMethodType: 'Card';
|
|
62
|
+
paymentMethodData?: {
|
|
63
|
+
token?: string;
|
|
64
|
+
billingDetails?: BillingDetails;
|
|
65
|
+
mandateData?: MandateData;
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
paymentMethodType: 'Card';
|
|
69
|
+
paymentMethodData: {
|
|
70
|
+
paymentMethodId: string;
|
|
71
|
+
cvc?: string;
|
|
72
|
+
billingDetails?: BillingDetails;
|
|
73
|
+
mandateData?: MandateData;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export interface IdealParams {
|
|
77
|
+
paymentMethodType: 'Ideal';
|
|
78
|
+
paymentMethodData?: {
|
|
79
|
+
bankName?: string;
|
|
80
|
+
billingDetails?: BillingDetails;
|
|
81
|
+
mandateData?: MandateData;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface FPXParams {
|
|
85
|
+
paymentMethodType: 'Fpx';
|
|
86
|
+
paymentMethodData?: {
|
|
87
|
+
testOfflineBank?: boolean;
|
|
88
|
+
mandateData?: MandateData;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export interface AlipayParams {
|
|
92
|
+
paymentMethodType: 'Alipay';
|
|
93
|
+
paymentMethodData?: {
|
|
94
|
+
mandateData?: MandateData;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface OxxoParams {
|
|
98
|
+
paymentMethodType: 'Oxxo';
|
|
99
|
+
paymentMethodData: {
|
|
100
|
+
billingDetails: BillingDetails;
|
|
101
|
+
mandateData?: MandateData;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export interface SofortParams {
|
|
105
|
+
paymentMethodType: 'Sofort';
|
|
106
|
+
paymentMethodData: {
|
|
107
|
+
country: string;
|
|
108
|
+
billingDetails: BillingDetails;
|
|
109
|
+
mandateData?: MandateData;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface GrabPayParams {
|
|
113
|
+
paymentMethodType: 'GrabPay';
|
|
114
|
+
paymentMethodData?: {
|
|
115
|
+
billingDetails?: BillingDetails;
|
|
116
|
+
mandateData?: MandateData;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export interface BancontactParams {
|
|
120
|
+
paymentMethodType: 'Bancontact';
|
|
121
|
+
paymentMethodData: {
|
|
122
|
+
billingDetails: BillingDetails;
|
|
123
|
+
mandateData?: MandateData;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface SepaParams {
|
|
127
|
+
paymentMethodType: 'SepaDebit';
|
|
128
|
+
paymentMethodData: {
|
|
129
|
+
iban: string;
|
|
130
|
+
billingDetails: BillingDetails;
|
|
131
|
+
mandateData?: MandateData;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export interface GiropayParams {
|
|
135
|
+
paymentMethodType: 'Giropay';
|
|
136
|
+
paymentMethodData: {
|
|
137
|
+
billingDetails: BillingDetails;
|
|
138
|
+
mandateData?: MandateData;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export interface AfterpayClearpayParams {
|
|
142
|
+
paymentMethodType: 'AfterpayClearpay';
|
|
143
|
+
paymentMethodData: {
|
|
144
|
+
shippingDetails: BillingDetails;
|
|
145
|
+
billingDetails: BillingDetails;
|
|
146
|
+
mandateData?: MandateData;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
export declare type KlarnaParams = {
|
|
150
|
+
paymentMethodType: 'Klarna';
|
|
151
|
+
paymentMethodData: {
|
|
152
|
+
billingDetails: Pick<Required<BillingDetails>, 'email'> & {
|
|
153
|
+
address: Pick<Required<Address>, 'country'>;
|
|
154
|
+
} & BillingDetails;
|
|
155
|
+
shippingDetails?: BillingDetails;
|
|
156
|
+
mandateData?: MandateData;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
export interface EpsParams {
|
|
160
|
+
paymentMethodType: 'Eps';
|
|
161
|
+
paymentMethodData: {
|
|
162
|
+
billingDetails: BillingDetails;
|
|
163
|
+
mandateData?: MandateData;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export interface P24Params {
|
|
167
|
+
paymentMethodType: 'P24';
|
|
168
|
+
paymentMethodData: {
|
|
169
|
+
billingDetails: BillingDetails;
|
|
170
|
+
mandateData?: MandateData;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export interface WeChatPayParams {
|
|
174
|
+
paymentMethodType: 'WeChatPay';
|
|
175
|
+
paymentMethodData: {
|
|
176
|
+
appId: string;
|
|
177
|
+
billingDetails?: BillingDetails;
|
|
178
|
+
mandateData?: MandateData;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
export interface AuBecsDebitParams {
|
|
182
|
+
paymentMethodType: 'AuBecsDebit';
|
|
183
|
+
paymentMethodData: {
|
|
184
|
+
formDetails: FormDetails;
|
|
185
|
+
mandateData?: MandateData;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export declare type AffirmParams = {
|
|
189
|
+
paymentMethodType: 'Affirm';
|
|
190
|
+
paymentMethodData?: {
|
|
191
|
+
/** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */
|
|
192
|
+
shippingDetails?: BillingDetails;
|
|
193
|
+
billingDetails?: BillingDetails;
|
|
194
|
+
mandateData?: MandateData;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* If paymentMethodData is null, it is assumed that the bank account details have already been attached
|
|
199
|
+
* via `collectBankAccountForPayment` or `collectBankAccountForSetup`.
|
|
200
|
+
*/
|
|
201
|
+
export declare type USBankAccountParams = {
|
|
202
|
+
paymentMethodType: 'USBankAccount';
|
|
203
|
+
paymentMethodData?: {
|
|
204
|
+
billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;
|
|
205
|
+
accountNumber: string;
|
|
206
|
+
routingNumber: string;
|
|
207
|
+
/** Defaults to Individual */
|
|
208
|
+
accountHolderType?: BankAcccountHolderType;
|
|
209
|
+
/** Defaults to Checking */
|
|
210
|
+
accountType?: BankAcccountType;
|
|
211
|
+
mandateData?: MandateData;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
export declare type PayPalParams = {
|
|
215
|
+
paymentMethodType: 'PayPal';
|
|
216
|
+
paymentMethodData?: {
|
|
217
|
+
billingDetails?: BillingDetails;
|
|
218
|
+
mandateData?: MandateData;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
export declare type CashAppParams = {
|
|
222
|
+
paymentMethodType: 'CashApp';
|
|
223
|
+
paymentMethodData?: {
|
|
224
|
+
billingDetails?: BillingDetails;
|
|
225
|
+
mandateData?: MandateData;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
export declare type CollectBankAccountParams = {
|
|
229
|
+
paymentMethodType: 'USBankAccount';
|
|
230
|
+
paymentMethodData: {
|
|
231
|
+
billingDetails: {
|
|
232
|
+
name: string;
|
|
233
|
+
email?: string;
|
|
234
|
+
};
|
|
235
|
+
mandateData?: MandateData;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
@@ -18,7 +18,7 @@ export interface Result {
|
|
|
18
18
|
Upi: UpiResult;
|
|
19
19
|
USBankAccount: USBankAccountResult;
|
|
20
20
|
}
|
|
21
|
-
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams;
|
|
21
|
+
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams | CashAppParams;
|
|
22
22
|
export declare type ConfirmParams = CreateParams;
|
|
23
23
|
export declare type CreateOptions = {
|
|
24
24
|
setupFutureUsage?: FutureUsage;
|
|
@@ -164,6 +164,12 @@ export declare type PayPalParams = {
|
|
|
164
164
|
billingDetails?: BillingDetails;
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
|
+
export declare type CashAppParams = {
|
|
168
|
+
paymentMethodType: 'CashApp';
|
|
169
|
+
paymentMethodData?: {
|
|
170
|
+
billingDetails?: BillingDetails;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
167
173
|
export interface AuBecsDebitResult {
|
|
168
174
|
fingerprint?: string;
|
|
169
175
|
last4?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Type } from './PaymentMethod';
|
|
2
|
-
import type { LastPaymentError } from './PaymentIntent';
|
|
2
|
+
import type { LastPaymentError, ConfirmParams as PaymentIntentConfirmParams, ConfirmOptions as PaymentIntentConfirmOptions } from './PaymentIntent';
|
|
3
3
|
import type { NextAction } from './NextAction';
|
|
4
4
|
import type * as PaymentMethod from './PaymentMethod';
|
|
5
5
|
export interface Result {
|
|
@@ -18,8 +18,8 @@ export interface Result {
|
|
|
18
18
|
description: string | null;
|
|
19
19
|
nextAction: NextAction | null;
|
|
20
20
|
}
|
|
21
|
-
export declare type ConfirmParams =
|
|
22
|
-
export declare type ConfirmOptions =
|
|
21
|
+
export declare type ConfirmParams = PaymentIntentConfirmParams;
|
|
22
|
+
export declare type ConfirmOptions = PaymentIntentConfirmOptions;
|
|
23
23
|
export declare type FutureUsage = 'Unknown' | 'None' | 'OnSession' | 'OffSession' | 'OneTime';
|
|
24
24
|
export declare enum Status {
|
|
25
25
|
Succeeded = "Succeeded",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"release": "./scripts/publish",
|
|
17
17
|
"example": "yarn --cwd example",
|
|
18
18
|
"pods": "cd example && npx pod-install --quiet",
|
|
19
|
+
"update-pods": "cd example/ios && pod update Stripe StripeApplePay StripeFinancialConnections StripePayments StripePaymentSheet StripePaymentsUI StripeCore StripeUICore",
|
|
19
20
|
"bootstrap": "yarn example && yarn && yarn pods",
|
|
20
21
|
"bootstrap-no-pods": "yarn example && yarn",
|
|
21
22
|
"docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { StripeError } from '.';
|
|
2
|
-
import type { Address } from './Common';
|
|
2
|
+
import type { Address, BillingDetails } from './Common';
|
|
3
3
|
import type { Result as PaymentMethodResult } from './PaymentMethod';
|
|
4
4
|
import type { NextAction } from './NextAction';
|
|
5
5
|
import type * as PaymentMethod from './PaymentMethod';
|
|
6
|
-
|
|
6
|
+
import type { FormDetails } from './components/AuBECSDebitFormComponent';
|
|
7
|
+
import type { BankAcccountHolderType, BankAcccountType } from './Token';
|
|
7
8
|
export interface Result {
|
|
8
9
|
id: string;
|
|
9
10
|
amount: number;
|
|
@@ -26,7 +27,27 @@ export interface Result {
|
|
|
26
27
|
nextAction: NextAction | null;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export type ConfirmParams =
|
|
30
|
+
export type ConfirmParams =
|
|
31
|
+
| CardParams
|
|
32
|
+
| IdealParams
|
|
33
|
+
| OxxoParams
|
|
34
|
+
| P24Params
|
|
35
|
+
| AlipayParams
|
|
36
|
+
| GiropayParams
|
|
37
|
+
| SepaParams
|
|
38
|
+
| EpsParams
|
|
39
|
+
| AuBecsDebitParams
|
|
40
|
+
| SofortParams
|
|
41
|
+
| GrabPayParams
|
|
42
|
+
| FPXParams
|
|
43
|
+
| AfterpayClearpayParams
|
|
44
|
+
| KlarnaParams
|
|
45
|
+
// | WeChatPayParams
|
|
46
|
+
| BancontactParams
|
|
47
|
+
| USBankAccountParams
|
|
48
|
+
| PayPalParams
|
|
49
|
+
| AffirmParams
|
|
50
|
+
| CashAppParams;
|
|
30
51
|
|
|
31
52
|
export type ConfirmOptions = PaymentMethod.ConfirmOptions;
|
|
32
53
|
|
|
@@ -54,3 +75,206 @@ export enum Status {
|
|
|
54
75
|
RequiresCapture = 'RequiresCapture',
|
|
55
76
|
Unknown = 'Unknown',
|
|
56
77
|
}
|
|
78
|
+
|
|
79
|
+
export type MandateData = {
|
|
80
|
+
customerAcceptance: {
|
|
81
|
+
online: {
|
|
82
|
+
ipAddress: string;
|
|
83
|
+
userAgent: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type CardParams =
|
|
89
|
+
| {
|
|
90
|
+
paymentMethodType: 'Card';
|
|
91
|
+
paymentMethodData?: {
|
|
92
|
+
token?: string;
|
|
93
|
+
billingDetails?: BillingDetails;
|
|
94
|
+
mandateData?: MandateData;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
| {
|
|
98
|
+
paymentMethodType: 'Card';
|
|
99
|
+
paymentMethodData: {
|
|
100
|
+
paymentMethodId: string;
|
|
101
|
+
cvc?: string;
|
|
102
|
+
billingDetails?: BillingDetails;
|
|
103
|
+
mandateData?: MandateData;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export interface IdealParams {
|
|
108
|
+
paymentMethodType: 'Ideal';
|
|
109
|
+
paymentMethodData?: {
|
|
110
|
+
bankName?: string;
|
|
111
|
+
billingDetails?: BillingDetails;
|
|
112
|
+
mandateData?: MandateData;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface FPXParams {
|
|
117
|
+
paymentMethodType: 'Fpx';
|
|
118
|
+
paymentMethodData?: { testOfflineBank?: boolean; mandateData?: MandateData };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface AlipayParams {
|
|
122
|
+
paymentMethodType: 'Alipay';
|
|
123
|
+
paymentMethodData?: {
|
|
124
|
+
mandateData?: MandateData;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface OxxoParams {
|
|
129
|
+
paymentMethodType: 'Oxxo';
|
|
130
|
+
paymentMethodData: {
|
|
131
|
+
billingDetails: BillingDetails;
|
|
132
|
+
mandateData?: MandateData;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface SofortParams {
|
|
137
|
+
paymentMethodType: 'Sofort';
|
|
138
|
+
paymentMethodData: {
|
|
139
|
+
country: string;
|
|
140
|
+
billingDetails: BillingDetails;
|
|
141
|
+
mandateData?: MandateData;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
export interface GrabPayParams {
|
|
145
|
+
paymentMethodType: 'GrabPay';
|
|
146
|
+
paymentMethodData?: {
|
|
147
|
+
billingDetails?: BillingDetails;
|
|
148
|
+
mandateData?: MandateData;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface BancontactParams {
|
|
153
|
+
paymentMethodType: 'Bancontact';
|
|
154
|
+
paymentMethodData: {
|
|
155
|
+
billingDetails: BillingDetails;
|
|
156
|
+
mandateData?: MandateData;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface SepaParams {
|
|
161
|
+
paymentMethodType: 'SepaDebit';
|
|
162
|
+
paymentMethodData: {
|
|
163
|
+
iban: string;
|
|
164
|
+
billingDetails: BillingDetails;
|
|
165
|
+
mandateData?: MandateData;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface GiropayParams {
|
|
170
|
+
paymentMethodType: 'Giropay';
|
|
171
|
+
paymentMethodData: {
|
|
172
|
+
billingDetails: BillingDetails;
|
|
173
|
+
mandateData?: MandateData;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface AfterpayClearpayParams {
|
|
178
|
+
paymentMethodType: 'AfterpayClearpay';
|
|
179
|
+
paymentMethodData: {
|
|
180
|
+
shippingDetails: BillingDetails;
|
|
181
|
+
billingDetails: BillingDetails;
|
|
182
|
+
mandateData?: MandateData;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type KlarnaParams = {
|
|
187
|
+
paymentMethodType: 'Klarna';
|
|
188
|
+
paymentMethodData: {
|
|
189
|
+
billingDetails: Pick<Required<BillingDetails>, 'email'> & {
|
|
190
|
+
address: Pick<Required<Address>, 'country'>;
|
|
191
|
+
} & BillingDetails;
|
|
192
|
+
shippingDetails?: BillingDetails;
|
|
193
|
+
mandateData?: MandateData;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export interface EpsParams {
|
|
198
|
+
paymentMethodType: 'Eps';
|
|
199
|
+
paymentMethodData: {
|
|
200
|
+
billingDetails: BillingDetails;
|
|
201
|
+
mandateData?: MandateData;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface P24Params {
|
|
206
|
+
paymentMethodType: 'P24';
|
|
207
|
+
paymentMethodData: {
|
|
208
|
+
billingDetails: BillingDetails;
|
|
209
|
+
mandateData?: MandateData;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface WeChatPayParams {
|
|
214
|
+
paymentMethodType: 'WeChatPay';
|
|
215
|
+
paymentMethodData: {
|
|
216
|
+
appId: string;
|
|
217
|
+
billingDetails?: BillingDetails;
|
|
218
|
+
mandateData?: MandateData;
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface AuBecsDebitParams {
|
|
223
|
+
paymentMethodType: 'AuBecsDebit';
|
|
224
|
+
paymentMethodData: { formDetails: FormDetails; mandateData?: MandateData };
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export type AffirmParams = {
|
|
228
|
+
paymentMethodType: 'Affirm';
|
|
229
|
+
paymentMethodData?: {
|
|
230
|
+
/** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */
|
|
231
|
+
shippingDetails?: BillingDetails;
|
|
232
|
+
billingDetails?: BillingDetails;
|
|
233
|
+
mandateData?: MandateData;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* If paymentMethodData is null, it is assumed that the bank account details have already been attached
|
|
239
|
+
* via `collectBankAccountForPayment` or `collectBankAccountForSetup`.
|
|
240
|
+
*/
|
|
241
|
+
export type USBankAccountParams = {
|
|
242
|
+
paymentMethodType: 'USBankAccount';
|
|
243
|
+
paymentMethodData?: {
|
|
244
|
+
billingDetails: Pick<Required<BillingDetails>, 'name'> & BillingDetails;
|
|
245
|
+
accountNumber: string;
|
|
246
|
+
routingNumber: string;
|
|
247
|
+
/** Defaults to Individual */
|
|
248
|
+
accountHolderType?: BankAcccountHolderType;
|
|
249
|
+
/** Defaults to Checking */
|
|
250
|
+
accountType?: BankAcccountType;
|
|
251
|
+
mandateData?: MandateData;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export type PayPalParams = {
|
|
256
|
+
paymentMethodType: 'PayPal';
|
|
257
|
+
paymentMethodData?: {
|
|
258
|
+
billingDetails?: BillingDetails;
|
|
259
|
+
mandateData?: MandateData;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export type CashAppParams = {
|
|
264
|
+
paymentMethodType: 'CashApp';
|
|
265
|
+
paymentMethodData?: {
|
|
266
|
+
billingDetails?: BillingDetails;
|
|
267
|
+
mandateData?: MandateData;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export type CollectBankAccountParams = {
|
|
272
|
+
paymentMethodType: 'USBankAccount';
|
|
273
|
+
paymentMethodData: {
|
|
274
|
+
billingDetails: {
|
|
275
|
+
name: string;
|
|
276
|
+
email?: string;
|
|
277
|
+
};
|
|
278
|
+
mandateData?: MandateData;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
@@ -43,7 +43,8 @@ export type CreateParams =
|
|
|
43
43
|
| BancontactParams
|
|
44
44
|
| USBankAccountParams
|
|
45
45
|
| PayPalParams
|
|
46
|
-
| AffirmParams
|
|
46
|
+
| AffirmParams
|
|
47
|
+
| CashAppParams;
|
|
47
48
|
|
|
48
49
|
export type ConfirmParams = CreateParams;
|
|
49
50
|
|
|
@@ -210,6 +211,13 @@ export type PayPalParams = {
|
|
|
210
211
|
};
|
|
211
212
|
};
|
|
212
213
|
|
|
214
|
+
export type CashAppParams = {
|
|
215
|
+
paymentMethodType: 'CashApp';
|
|
216
|
+
paymentMethodData?: {
|
|
217
|
+
billingDetails?: BillingDetails;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
|
|
213
221
|
export interface AuBecsDebitResult {
|
|
214
222
|
fingerprint?: string;
|
|
215
223
|
last4?: string;
|
package/src/types/SetupIntent.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Type } from './PaymentMethod';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
LastPaymentError,
|
|
4
|
+
ConfirmParams as PaymentIntentConfirmParams,
|
|
5
|
+
ConfirmOptions as PaymentIntentConfirmOptions,
|
|
6
|
+
} from './PaymentIntent';
|
|
3
7
|
import type { NextAction } from './NextAction';
|
|
4
8
|
import type * as PaymentMethod from './PaymentMethod';
|
|
5
9
|
export interface Result {
|
|
@@ -19,26 +23,9 @@ export interface Result {
|
|
|
19
23
|
nextAction: NextAction | null;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
export type ConfirmParams =
|
|
23
|
-
| PaymentMethod.CardParams
|
|
24
|
-
| PaymentMethod.IdealParams
|
|
25
|
-
| PaymentMethod.OxxoParams
|
|
26
|
-
| PaymentMethod.P24Params
|
|
27
|
-
| PaymentMethod.AlipayParams
|
|
28
|
-
| PaymentMethod.GiropayParams
|
|
29
|
-
| PaymentMethod.SepaParams
|
|
30
|
-
| PaymentMethod.EpsParams
|
|
31
|
-
| PaymentMethod.AuBecsDebitParams
|
|
32
|
-
| PaymentMethod.SofortParams
|
|
33
|
-
| PaymentMethod.GrabPayParams
|
|
34
|
-
| PaymentMethod.FPXParams
|
|
35
|
-
| PaymentMethod.AfterpayClearpayParams
|
|
36
|
-
| PaymentMethod.KlarnaParams
|
|
37
|
-
| PaymentMethod.BancontactParams
|
|
38
|
-
| PaymentMethod.USBankAccountParams;
|
|
39
|
-
// TODO: Change the above back to PaymentMethod.CreateParams when PayPal is supported through SetupIntents
|
|
26
|
+
export type ConfirmParams = PaymentIntentConfirmParams;
|
|
40
27
|
|
|
41
|
-
export type ConfirmOptions =
|
|
28
|
+
export type ConfirmOptions = PaymentIntentConfirmOptions;
|
|
42
29
|
|
|
43
30
|
export type FutureUsage =
|
|
44
31
|
| 'Unknown'
|