@stripe/stripe-react-native 0.19.0 → 0.20.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 +33 -5
- package/README.md +2 -2
- package/android/build.gradle +1 -2
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +6 -3
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +22 -7
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +7 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +2 -0
- package/ios/ApplePayUtils.swift +1 -1
- package/ios/CardFieldView.swift +3 -3
- package/ios/FinancialConnections.swift +23 -22
- package/ios/Mappers.swift +10 -2
- package/ios/PaymentMethodFactory.swift +6 -7
- package/ios/PaymentSheetAppearance.swift +5 -5
- package/ios/StripeSdk.m +5 -0
- package/ios/StripeSdk.swift +68 -26
- package/jest/mock.js +2 -0
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/types/FinancialConnections.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/usePaymentSheet.js +1 -1
- package/lib/module/hooks/usePaymentSheet.js.map +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/types/FinancialConnections.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +1 -0
- package/lib/typescript/src/functions.d.ts +6 -0
- package/lib/typescript/src/hooks/usePaymentSheet.d.ts +6 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +6 -0
- package/lib/typescript/src/types/FinancialConnections.d.ts +2 -2
- package/lib/typescript/src/types/PaymentMethod.d.ts +2 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts +17 -0
- package/package.json +1 -1
- package/src/NativeStripeSdk.tsx +1 -0
- package/src/functions.ts +9 -0
- package/src/hooks/usePaymentSheet.tsx +14 -0
- package/src/hooks/useStripe.tsx +11 -0
- package/src/types/FinancialConnections.ts +4 -4
- package/src/types/PaymentMethod.ts +2 -0
- package/src/types/PaymentSheet.ts +19 -0
- package/stripe-react-native.podspec +6 -2
- package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +0 -13
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/modules/android.iml +0 -18
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -22
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +0 -27
package/ios/StripeSdk.swift
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import PassKit
|
|
2
2
|
import Stripe
|
|
3
|
+
import StripePaymentSheet
|
|
3
4
|
import StripeFinancialConnections
|
|
4
5
|
|
|
5
6
|
@objc(StripeSdk)
|
|
@@ -59,6 +60,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
59
60
|
self.urlScheme = urlScheme
|
|
60
61
|
|
|
61
62
|
STPAPIClient.shared.publishableKey = publishableKey
|
|
63
|
+
StripeAPI.defaultPublishableKey = publishableKey
|
|
62
64
|
STPAPIClient.shared.stripeAccount = stripeAccountId
|
|
63
65
|
|
|
64
66
|
let name = RCTConvert.nsString(appInfo["name"]) ?? ""
|
|
@@ -76,6 +78,8 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
76
78
|
rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
77
79
|
var configuration = PaymentSheet.Configuration()
|
|
78
80
|
self.paymentSheetFlowController = nil
|
|
81
|
+
|
|
82
|
+
configuration.primaryButtonLabel = params["primaryButtonLabel"] as? String
|
|
79
83
|
|
|
80
84
|
if let appearanceParams = params["appearance"] as? NSDictionary {
|
|
81
85
|
do {
|
|
@@ -218,6 +222,13 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
218
222
|
}
|
|
219
223
|
}
|
|
220
224
|
}
|
|
225
|
+
|
|
226
|
+
@objc(resetPaymentSheetCustomer:rejecter:)
|
|
227
|
+
func resetPaymentSheetCustomer(resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
228
|
+
rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
229
|
+
PaymentSheet.resetCustomer()
|
|
230
|
+
resolve(nil)
|
|
231
|
+
}
|
|
221
232
|
|
|
222
233
|
@objc(presentPaymentSheet:rejecter:)
|
|
223
234
|
func presentPaymentSheet(resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -298,12 +309,17 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
298
309
|
return STPSetupIntentConfirmParams(clientSecret: setupIntentClientSecret, paymentMethodType: .USBankAccount)
|
|
299
310
|
} else {
|
|
300
311
|
let parameters = STPSetupIntentConfirmParams(clientSecret: setupIntentClientSecret)
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
312
|
+
|
|
313
|
+
if let paymentMethodId = paymentMethodData?["paymentMethodId"] as? String {
|
|
314
|
+
parameters.paymentMethodID = paymentMethodId
|
|
315
|
+
} else {
|
|
316
|
+
let factory = PaymentMethodFactory.init(paymentMethodData: paymentMethodData, options: options, cardFieldView: cardFieldView, cardFormView: cardFormView)
|
|
317
|
+
do {
|
|
318
|
+
let paymentMethodParams = try factory.createParams(paymentMethodType: paymentMethodType)
|
|
319
|
+
parameters.paymentMethodParams = paymentMethodParams
|
|
320
|
+
} catch {
|
|
321
|
+
err = Errors.createError(ErrorType.Failed, error as NSError?)
|
|
322
|
+
}
|
|
307
323
|
}
|
|
308
324
|
|
|
309
325
|
return parameters
|
|
@@ -348,7 +364,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
348
364
|
resolve(Errors.createError(ErrorType.Failed, "You can use this method only after either onDidSetShippingMethod or onDidSetShippingContact events emitted"))
|
|
349
365
|
return
|
|
350
366
|
}
|
|
351
|
-
|
|
367
|
+
|
|
352
368
|
var paymentSummaryItems : [PKPaymentSummaryItem] = []
|
|
353
369
|
do {
|
|
354
370
|
paymentSummaryItems = try ApplePayUtils.buildPaymentSummaryItems(items: summaryItems as? [[String : Any]])
|
|
@@ -356,7 +372,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
356
372
|
resolve(Errors.createError(ErrorType.Failed, error.localizedDescription))
|
|
357
373
|
return
|
|
358
374
|
}
|
|
359
|
-
|
|
375
|
+
|
|
360
376
|
var shippingAddressErrors: [Error] = []
|
|
361
377
|
for item in errorAddressFields {
|
|
362
378
|
let field = item["field"] as! String
|
|
@@ -660,17 +676,22 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
660
676
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
661
677
|
rejecter reject: @escaping RCTPromiseRejectBlock
|
|
662
678
|
) -> Void {
|
|
663
|
-
|
|
679
|
+
let address = params["address"] as? NSDictionary
|
|
680
|
+
let cardSourceParams = STPCardParams()
|
|
681
|
+
if let params = cardFieldView?.cardParams as? STPPaymentMethodParams {
|
|
682
|
+
cardSourceParams.number = params.card!.number
|
|
683
|
+
cardSourceParams.cvc = params.card!.cvc
|
|
684
|
+
cardSourceParams.expMonth = UInt(truncating: params.card!.expMonth ?? 0)
|
|
685
|
+
cardSourceParams.expYear = UInt(truncating: params.card!.expYear ?? 0)
|
|
686
|
+
} else if let params = cardFormView?.cardParams as? STPPaymentMethodCardParams {
|
|
687
|
+
cardSourceParams.number = params.number
|
|
688
|
+
cardSourceParams.cvc = params.cvc
|
|
689
|
+
cardSourceParams.expMonth = UInt(truncating: params.expMonth ?? 0)
|
|
690
|
+
cardSourceParams.expYear = UInt(truncating: params.expYear ?? 0)
|
|
691
|
+
} else {
|
|
664
692
|
resolve(Errors.createError(ErrorType.Failed, "Card details not complete"))
|
|
665
693
|
return
|
|
666
694
|
}
|
|
667
|
-
|
|
668
|
-
let address = params["address"] as? NSDictionary
|
|
669
|
-
let cardSourceParams = STPCardParams()
|
|
670
|
-
cardSourceParams.number = cardParams.number
|
|
671
|
-
cardSourceParams.cvc = cardParams.cvc
|
|
672
|
-
cardSourceParams.expMonth = UInt(truncating: cardParams.expMonth ?? 0)
|
|
673
|
-
cardSourceParams.expYear = UInt(truncating: cardParams.expYear ?? 0)
|
|
674
695
|
cardSourceParams.address = Mappers.mapToAddress(address: address)
|
|
675
696
|
cardSourceParams.name = params["name"] as? String
|
|
676
697
|
cardSourceParams.currency = params["currency"] as? String
|
|
@@ -746,10 +767,18 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
746
767
|
email: billingDetails["email"] as? String
|
|
747
768
|
)
|
|
748
769
|
|
|
770
|
+
let connectionsReturnURL: String?
|
|
771
|
+
if let urlScheme = urlScheme {
|
|
772
|
+
connectionsReturnURL = Mappers.mapToFinancialConnectionsReturnURL(urlScheme: urlScheme)
|
|
773
|
+
} else {
|
|
774
|
+
connectionsReturnURL = nil
|
|
775
|
+
}
|
|
776
|
+
|
|
749
777
|
if (isPaymentIntent) {
|
|
750
778
|
DispatchQueue.main.async {
|
|
751
779
|
STPBankAccountCollector().collectBankAccountForPayment(
|
|
752
780
|
clientSecret: clientSecret as String,
|
|
781
|
+
returnURL: connectionsReturnURL,
|
|
753
782
|
params: collectParams,
|
|
754
783
|
from: findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController())
|
|
755
784
|
) { intent, error in
|
|
@@ -775,6 +804,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
775
804
|
DispatchQueue.main.async {
|
|
776
805
|
STPBankAccountCollector().collectBankAccountForSetup(
|
|
777
806
|
clientSecret: clientSecret as String,
|
|
807
|
+
returnURL: connectionsReturnURL,
|
|
778
808
|
params: collectParams,
|
|
779
809
|
from: findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController())
|
|
780
810
|
) { intent, error in
|
|
@@ -816,7 +846,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
816
846
|
resolve(missingPaymentMethodError)
|
|
817
847
|
return
|
|
818
848
|
}
|
|
819
|
-
|
|
849
|
+
|
|
820
850
|
if (paymentMethodType == .FPX) {
|
|
821
851
|
let testOfflineBank = paymentMethodData?["testOfflineBank"] as? Bool
|
|
822
852
|
if (testOfflineBank == false || testOfflineBank == nil) {
|
|
@@ -833,7 +863,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
833
863
|
STPPaymentHandler.shared().confirmPayment(paymentIntentParams, with: self, completion: onCompleteConfirmPayment)
|
|
834
864
|
}
|
|
835
865
|
}
|
|
836
|
-
|
|
866
|
+
|
|
837
867
|
func getPaymentMethodType(
|
|
838
868
|
params: NSDictionary?
|
|
839
869
|
) -> (NSDictionary?, STPPaymentMethodType?) {
|
|
@@ -863,7 +893,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
863
893
|
return STPPaymentIntentParams(clientSecret: paymentIntentClientSecret, paymentMethodType: .USBankAccount)
|
|
864
894
|
} else {
|
|
865
895
|
guard let paymentMethodType = paymentMethodType else { return STPPaymentIntentParams(clientSecret: paymentIntentClientSecret) }
|
|
866
|
-
|
|
896
|
+
|
|
867
897
|
let paymentMethodId = paymentMethodData?["paymentMethodId"] as? String
|
|
868
898
|
let parameters = STPPaymentIntentParams(clientSecret: paymentIntentClientSecret)
|
|
869
899
|
|
|
@@ -1009,7 +1039,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
1009
1039
|
}
|
|
1010
1040
|
}
|
|
1011
1041
|
}
|
|
1012
|
-
|
|
1042
|
+
|
|
1013
1043
|
@objc(canAddCardToWallet:resolver:rejecter:)
|
|
1014
1044
|
func canAddCardToWallet(
|
|
1015
1045
|
params: NSDictionary,
|
|
@@ -1028,7 +1058,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
1028
1058
|
"details": ["status": status?.rawValue],
|
|
1029
1059
|
])
|
|
1030
1060
|
}
|
|
1031
|
-
|
|
1061
|
+
|
|
1032
1062
|
@objc(isCardInWallet:resolver:rejecter:)
|
|
1033
1063
|
func isCardInWallet(
|
|
1034
1064
|
params: NSDictionary,
|
|
@@ -1041,7 +1071,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
1041
1071
|
}
|
|
1042
1072
|
resolve(["isInWallet": PushProvisioningUtils.passExistsWith(last4: last4)])
|
|
1043
1073
|
}
|
|
1044
|
-
|
|
1074
|
+
|
|
1045
1075
|
@objc(collectBankAccountToken:resolver:rejecter:)
|
|
1046
1076
|
func collectBankAccountToken(
|
|
1047
1077
|
clientSecret: String,
|
|
@@ -1052,9 +1082,15 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
1052
1082
|
resolve(Errors.MISSING_INIT_ERROR)
|
|
1053
1083
|
return
|
|
1054
1084
|
}
|
|
1055
|
-
|
|
1085
|
+
let returnURL: String?
|
|
1086
|
+
if let urlScheme = urlScheme {
|
|
1087
|
+
returnURL = Mappers.mapToFinancialConnectionsReturnURL(urlScheme: urlScheme)
|
|
1088
|
+
} else {
|
|
1089
|
+
returnURL = nil
|
|
1090
|
+
}
|
|
1091
|
+
FinancialConnections.presentForToken(withClientSecret: clientSecret, returnURL: returnURL, resolve: resolve)
|
|
1056
1092
|
}
|
|
1057
|
-
|
|
1093
|
+
|
|
1058
1094
|
@objc(collectFinancialConnectionsAccounts:resolver:rejecter:)
|
|
1059
1095
|
func collectFinancialConnectionsAccounts(
|
|
1060
1096
|
clientSecret: String,
|
|
@@ -1065,9 +1101,15 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
|
|
|
1065
1101
|
resolve(Errors.MISSING_INIT_ERROR)
|
|
1066
1102
|
return
|
|
1067
1103
|
}
|
|
1068
|
-
|
|
1104
|
+
let returnURL: String?
|
|
1105
|
+
if let urlScheme = urlScheme {
|
|
1106
|
+
returnURL = Mappers.mapToFinancialConnectionsReturnURL(urlScheme: urlScheme)
|
|
1107
|
+
} else {
|
|
1108
|
+
returnURL = nil
|
|
1109
|
+
}
|
|
1110
|
+
FinancialConnections.present(withClientSecret: clientSecret, returnURL: returnURL, resolve: resolve)
|
|
1069
1111
|
}
|
|
1070
|
-
|
|
1112
|
+
|
|
1071
1113
|
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
|
|
1072
1114
|
confirmPaymentResolver?(Errors.createError(ErrorType.Canceled, "FPX Payment has been canceled"))
|
|
1073
1115
|
}
|
package/jest/mock.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-undef */
|
|
2
2
|
|
|
3
3
|
const mockFunctions = {
|
|
4
|
+
initStripe: jest.fn(async () => ({})),
|
|
4
5
|
createPaymentMethod: jest.fn(async () => ({
|
|
5
6
|
paymentMethod: {},
|
|
6
7
|
error: null,
|
|
@@ -59,6 +60,7 @@ const mockFunctions = {
|
|
|
59
60
|
confirmPaymentSheetPayment: jest.fn(async () => ({
|
|
60
61
|
error: null,
|
|
61
62
|
})),
|
|
63
|
+
resetPaymentSheetCustomer: jest.fn(async () => null),
|
|
62
64
|
initGooglePay: jest.fn(async () => ({
|
|
63
65
|
error: null,
|
|
64
66
|
})),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,
|
|
1
|
+
{"version":3,"sources":["NativeStripeSdk.tsx"],"names":["StripeSdk","NativeModules"],"mappings":"gFAAA,yCA8GA,GAAQA,CAAAA,SAAR,CAAsBC,0BAAtB,CAAQD,SAAR,C,aAEeA,S","sourcesContent":["import { NativeModules } from 'react-native';\nimport type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n SetupIntent,\n InitialiseParams,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n ApplePayResult,\n CreateTokenResult,\n GooglePayInitResult,\n PayWithGooglePayResult,\n CreateGooglePayPaymentMethodResult,\n GooglePay,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\n\ntype NativeStripeSdkType = {\n initialise(params: InitialiseParams): Promise<void>;\n createPaymentMethod(\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions\n ): Promise<CreatePaymentMethodResult>;\n handleNextAction(\n paymentIntentClientSecret: string,\n returnURL?: string | null\n ): Promise<HandleNextActionResult>;\n confirmPayment(\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options?: PaymentIntent.ConfirmOptions\n ): Promise<ConfirmPaymentResult>;\n isApplePaySupported(): Promise<boolean>;\n presentApplePay(params: ApplePay.PresentParams): Promise<ApplePayResult>;\n confirmApplePayPayment(clientSecret: string): Promise<void>;\n updateApplePaySummaryItems(\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }>\n ): Promise<void>;\n confirmSetupIntent(\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions\n ): Promise<ConfirmSetupIntentResult>;\n retrievePaymentIntent(\n clientSecret: string\n ): Promise<RetrievePaymentIntentResult>;\n retrieveSetupIntent(clientSecret: string): Promise<RetrieveSetupIntentResult>;\n initPaymentSheet(\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult>;\n presentPaymentSheet(): Promise<PresentPaymentSheetResult>;\n confirmPaymentSheetPayment(): Promise<ConfirmPaymentSheetPaymentResult>;\n createTokenForCVCUpdate(cvc: string): Promise<CreateTokenForCVCUpdateResult>;\n handleURLCallback(url: string): Promise<boolean>;\n createToken(params: Token.CreateParams): Promise<CreateTokenResult>;\n isGooglePaySupported(params: GooglePay.IsSupportedParams): Promise<boolean>;\n initGooglePay(params: GooglePay.InitParams): Promise<GooglePayInitResult>;\n presentGooglePay(\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult>;\n createGooglePayPaymentMethod(\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult>;\n openApplePaySetup(): Promise<OpenApplePaySetupResult>;\n verifyMicrodeposits(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n collectBankAccount(\n isPaymentIntent: boolean,\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;\n getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };\n canAddCardToWallet(\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult>;\n isCardInWallet(params: {\n cardLastFour: string;\n }): Promise<IsCardInWalletResult>;\n collectBankAccountToken(\n clientSecret: string\n ): Promise<FinancialConnections.TokenResult>;\n collectFinancialConnectionsAccounts(\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult>;\n resetPaymentSheetCustomer(): Promise<null>;\n};\n\nconst { StripeSdk } = NativeModules;\n\nexport default StripeSdk as NativeStripeSdkType;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openApplePaySetup=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.createTokenForCVCUpdate=exports.createToken=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPaymentSheetPayment=exports.confirmPayment=exports.confirmApplePayPayment=exports.collectFinancialConnectionsAccounts=exports.collectBankAccountToken=exports.collectBankAccountForSetup=exports.collectBankAccountForPayment=exports.canAddCardToWallet=exports.Constants=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _helpers=require("./helpers");var _Errors=require("./types/Errors");var _NativeStripeSdk=_interopRequireDefault(require("./NativeStripeSdk"));var _types=require("./types");var _reactNative=require("react-native");var APPLE_PAY_NOT_SUPPORTED_MESSAGE='Apple pay is not supported on this device';var createPaymentMethod=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.createPaymentMethod(params,options),paymentMethod=_yield$NativeStripeSd.paymentMethod,error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPaymentMethod(_x){return _ref.apply(this,arguments);};}();exports.createPaymentMethod=createPaymentMethod;var createToken=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){var _params$country;if(params.type==='BankAccount'&&((_params$country=params.country)==null?void 0:_params$country.toLowerCase())==='us'&&!params.routingNumber){return{error:_Errors.MissingRoutingNumber};}try{var _yield$NativeStripeSd2=yield _NativeStripeSdk.default.createToken(params),token=_yield$NativeStripeSd2.token,error=_yield$NativeStripeSd2.error;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createToken(_x2){return _ref2.apply(this,arguments);};}();exports.createToken=createToken;var retrievePaymentIntent=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd3=yield _NativeStripeSdk.default.retrievePaymentIntent(clientSecret),paymentIntent=_yield$NativeStripeSd3.paymentIntent,error=_yield$NativeStripeSd3.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function retrievePaymentIntent(_x3){return _ref3.apply(this,arguments);};}();exports.retrievePaymentIntent=retrievePaymentIntent;var retrieveSetupIntent=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd4=yield _NativeStripeSdk.default.retrieveSetupIntent(clientSecret),setupIntent=_yield$NativeStripeSd4.setupIntent,error=_yield$NativeStripeSd4.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function retrieveSetupIntent(_x4){return _ref4.apply(this,arguments);};}();exports.retrieveSetupIntent=retrieveSetupIntent;var confirmPayment=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd5=yield _NativeStripeSdk.default.confirmPayment(paymentIntentClientSecret,params,options),paymentIntent=_yield$NativeStripeSd5.paymentIntent,error=_yield$NativeStripeSd5.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPayment(_x5,_x6){return _ref5.apply(this,arguments);};}();exports.confirmPayment=confirmPayment;var isApplePaySupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return _helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());});return function isApplePaySupported(){return _ref6.apply(this,arguments);};}();exports.isApplePaySupported=isApplePaySupported;var presentApplePay=function(){var _ref7=(0,_asyncToGenerator2.default)(function*(params){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{var _yield$NativeStripeSd6=yield _NativeStripeSdk.default.presentApplePay(params),paymentMethod=_yield$NativeStripeSd6.paymentMethod,error=_yield$NativeStripeSd6.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function presentApplePay(_x7){return _ref7.apply(this,arguments);};}();exports.presentApplePay=presentApplePay;var updateApplePaySummaryItems=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.updateApplePaySummaryItems(summaryItems,errorAddressFields);return{};}catch(error){return{error:error};}});return function updateApplePaySummaryItems(_x8){return _ref8.apply(this,arguments);};}();exports.updateApplePaySummaryItems=updateApplePaySummaryItems;var confirmApplePayPayment=function(){var _ref9=(0,_asyncToGenerator2.default)(function*(clientSecret){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.confirmApplePayPayment(clientSecret);return{};}catch(error){return{error:error};}});return function confirmApplePayPayment(_x9){return _ref9.apply(this,arguments);};}();exports.confirmApplePayPayment=confirmApplePayPayment;var handleNextAction=function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){try{var _ref11=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret),paymentIntent=_ref11.paymentIntent,error=_ref11.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextAction(_x10,_x11){return _ref10.apply(this,arguments);};}();exports.handleNextAction=handleNextAction;var confirmSetupIntent=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd7=yield _NativeStripeSdk.default.confirmSetupIntent(paymentIntentClientSecret,params,options),setupIntent=_yield$NativeStripeSd7.setupIntent,error=_yield$NativeStripeSd7.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmSetupIntent(_x12,_x13){return _ref12.apply(this,arguments);};}();exports.confirmSetupIntent=confirmSetupIntent;var createTokenForCVCUpdate=function(){var _ref13=(0,_asyncToGenerator2.default)(function*(cvc){try{var _yield$NativeStripeSd8=yield _NativeStripeSdk.default.createTokenForCVCUpdate(cvc),tokenId=_yield$NativeStripeSd8.tokenId,error=_yield$NativeStripeSd8.error;if(error){return{error:error};}return{tokenId:tokenId};}catch(error){return{error:error};}});return function createTokenForCVCUpdate(_x14){return _ref13.apply(this,arguments);};}();exports.createTokenForCVCUpdate=createTokenForCVCUpdate;var handleURLCallback=function(){var _ref14=(0,_asyncToGenerator2.default)(function*(url){var stripeHandled=yield _NativeStripeSdk.default.handleURLCallback(url);return stripeHandled;});return function handleURLCallback(_x15){return _ref14.apply(this,arguments);};}();exports.handleURLCallback=handleURLCallback;var verifyMicrodepositsForPayment=function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref16=yield _NativeStripeSdk.default.verifyMicrodeposits(true,clientSecret,params),paymentIntent=_ref16.paymentIntent,error=_ref16.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForPayment(_x16,_x17){return _ref15.apply(this,arguments);};}();exports.verifyMicrodepositsForPayment=verifyMicrodepositsForPayment;var verifyMicrodepositsForSetup=function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref18=yield _NativeStripeSdk.default.verifyMicrodeposits(false,clientSecret,params),setupIntent=_ref18.setupIntent,error=_ref18.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForSetup(_x18,_x19){return _ref17.apply(this,arguments);};}();exports.verifyMicrodepositsForSetup=verifyMicrodepositsForSetup;var initPaymentSheet=function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.initPaymentSheet(params),paymentOption=_yield$NativeStripeSd9.paymentOption,error=_yield$NativeStripeSd9.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function initPaymentSheet(_x20){return _ref19.apply(this,arguments);};}();exports.initPaymentSheet=initPaymentSheet;var presentPaymentSheet=function(){var _ref20=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd10=yield _NativeStripeSdk.default.presentPaymentSheet(),paymentOption=_yield$NativeStripeSd10.paymentOption,error=_yield$NativeStripeSd10.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function presentPaymentSheet(){return _ref20.apply(this,arguments);};}();exports.presentPaymentSheet=presentPaymentSheet;var confirmPaymentSheetPayment=function(){var _ref21=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd11=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd11.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function confirmPaymentSheetPayment(){return _ref21.apply(this,arguments);};}();exports.confirmPaymentSheetPayment=confirmPaymentSheetPayment;var isGooglePaySupported=function(){var _ref22=(0,_asyncToGenerator2.default)(function*(params){return _helpers.isAndroid&&(yield _NativeStripeSdk.default.isGooglePaySupported(params!=null?params:{}));});return function isGooglePaySupported(_x21){return _ref22.apply(this,arguments);};}();exports.isGooglePaySupported=isGooglePaySupported;var initGooglePay=function(){var _ref23=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd12=yield _NativeStripeSdk.default.initGooglePay(params),error=_yield$NativeStripeSd12.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initGooglePay(_x22){return _ref23.apply(this,arguments);};}();exports.initGooglePay=initGooglePay;var presentGooglePay=function(){var _ref24=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd13=yield _NativeStripeSdk.default.presentGooglePay(params),error=_yield$NativeStripeSd13.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function presentGooglePay(_x23){return _ref24.apply(this,arguments);};}();exports.presentGooglePay=presentGooglePay;var createGooglePayPaymentMethod=function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd14=yield _NativeStripeSdk.default.createGooglePayPaymentMethod(params),error=_yield$NativeStripeSd14.error,paymentMethod=_yield$NativeStripeSd14.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createGooglePayPaymentMethod(_x24){return _ref25.apply(this,arguments);};}();exports.createGooglePayPaymentMethod=createGooglePayPaymentMethod;var openApplePaySetup=function(){var _ref26=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd15=yield _NativeStripeSdk.default.openApplePaySetup(),error=_yield$NativeStripeSd15.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function openApplePaySetup(){return _ref26.apply(this,arguments);};}();exports.openApplePaySetup=openApplePaySetup;var collectBankAccountForPayment=function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref28=yield _NativeStripeSdk.default.collectBankAccount(true,clientSecret,params),paymentIntent=_ref28.paymentIntent,error=_ref28.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForPayment(_x25,_x26){return _ref27.apply(this,arguments);};}();exports.collectBankAccountForPayment=collectBankAccountForPayment;var collectBankAccountForSetup=function(){var _ref29=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref30=yield _NativeStripeSdk.default.collectBankAccount(false,clientSecret,params),setupIntent=_ref30.setupIntent,error=_ref30.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForSetup(_x27,_x28){return _ref29.apply(this,arguments);};}();exports.collectBankAccountForSetup=collectBankAccountForSetup;var collectBankAccountToken=function(){var _ref31=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd16=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd16.session,token=_yield$NativeStripeSd16.token,error=_yield$NativeStripeSd16.error;if(error){return{error:error};}return{session:session,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountToken(_x29){return _ref31.apply(this,arguments);};}();exports.collectBankAccountToken=collectBankAccountToken;var collectFinancialConnectionsAccounts=function(){var _ref32=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd17=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd17.session,error=_yield$NativeStripeSd17.error;if(error){return{error:error};}return{session:session};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectFinancialConnectionsAccounts(_x30){return _ref32.apply(this,arguments);};}();exports.collectFinancialConnectionsAccounts=collectFinancialConnectionsAccounts;var canAddCardToWallet=function(){var _ref33=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd18=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd18.canAddCard,details=_yield$NativeStripeSd18.details,error=_yield$NativeStripeSd18.error;if(error){return{error:error};}return{canAddCard:canAddCard,details:details};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function canAddCardToWallet(_x31){return _ref33.apply(this,arguments);};}();exports.canAddCardToWallet=canAddCardToWallet;var isCardInWallet=function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd19=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd19.isInWallet,token=_yield$NativeStripeSd19.token,error=_yield$NativeStripeSd19.error;if(error){return{error:error};}return{isInWallet:isInWallet,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function isCardInWallet(_x32){return _ref34.apply(this,arguments);};}();exports.isCardInWallet=isCardInWallet;var Constants=_NativeStripeSdk.default.getConstants();exports.Constants=Constants;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.resetPaymentSheetCustomer=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openApplePaySetup=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.createTokenForCVCUpdate=exports.createToken=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPaymentSheetPayment=exports.confirmPayment=exports.confirmApplePayPayment=exports.collectFinancialConnectionsAccounts=exports.collectBankAccountToken=exports.collectBankAccountForSetup=exports.collectBankAccountForPayment=exports.canAddCardToWallet=exports.Constants=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _helpers=require("./helpers");var _Errors=require("./types/Errors");var _NativeStripeSdk=_interopRequireDefault(require("./NativeStripeSdk"));var _types=require("./types");var _reactNative=require("react-native");var APPLE_PAY_NOT_SUPPORTED_MESSAGE='Apple pay is not supported on this device';var createPaymentMethod=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};try{var _yield$NativeStripeSd=yield _NativeStripeSdk.default.createPaymentMethod(params,options),paymentMethod=_yield$NativeStripeSd.paymentMethod,error=_yield$NativeStripeSd.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPaymentMethod(_x){return _ref.apply(this,arguments);};}();exports.createPaymentMethod=createPaymentMethod;var createToken=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){var _params$country;if(params.type==='BankAccount'&&((_params$country=params.country)==null?void 0:_params$country.toLowerCase())==='us'&&!params.routingNumber){return{error:_Errors.MissingRoutingNumber};}try{var _yield$NativeStripeSd2=yield _NativeStripeSdk.default.createToken(params),token=_yield$NativeStripeSd2.token,error=_yield$NativeStripeSd2.error;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createToken(_x2){return _ref2.apply(this,arguments);};}();exports.createToken=createToken;var retrievePaymentIntent=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd3=yield _NativeStripeSdk.default.retrievePaymentIntent(clientSecret),paymentIntent=_yield$NativeStripeSd3.paymentIntent,error=_yield$NativeStripeSd3.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function retrievePaymentIntent(_x3){return _ref3.apply(this,arguments);};}();exports.retrievePaymentIntent=retrievePaymentIntent;var retrieveSetupIntent=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd4=yield _NativeStripeSdk.default.retrieveSetupIntent(clientSecret),setupIntent=_yield$NativeStripeSd4.setupIntent,error=_yield$NativeStripeSd4.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function retrieveSetupIntent(_x4){return _ref4.apply(this,arguments);};}();exports.retrieveSetupIntent=retrieveSetupIntent;var confirmPayment=function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd5=yield _NativeStripeSdk.default.confirmPayment(paymentIntentClientSecret,params,options),paymentIntent=_yield$NativeStripeSd5.paymentIntent,error=_yield$NativeStripeSd5.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPayment(_x5,_x6){return _ref5.apply(this,arguments);};}();exports.confirmPayment=confirmPayment;var isApplePaySupported=function(){var _ref6=(0,_asyncToGenerator2.default)(function*(){return _helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());});return function isApplePaySupported(){return _ref6.apply(this,arguments);};}();exports.isApplePaySupported=isApplePaySupported;var presentApplePay=function(){var _ref7=(0,_asyncToGenerator2.default)(function*(params){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{var _yield$NativeStripeSd6=yield _NativeStripeSdk.default.presentApplePay(params),paymentMethod=_yield$NativeStripeSd6.paymentMethod,error=_yield$NativeStripeSd6.error;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function presentApplePay(_x7){return _ref7.apply(this,arguments);};}();exports.presentApplePay=presentApplePay;var updateApplePaySummaryItems=function(){var _ref8=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.updateApplePaySummaryItems(summaryItems,errorAddressFields);return{};}catch(error){return{error:error};}});return function updateApplePaySummaryItems(_x8){return _ref8.apply(this,arguments);};}();exports.updateApplePaySummaryItems=updateApplePaySummaryItems;var confirmApplePayPayment=function(){var _ref9=(0,_asyncToGenerator2.default)(function*(clientSecret){if(!(yield _NativeStripeSdk.default.isApplePaySupported())){return{error:{code:_types.ApplePayError.Canceled,message:APPLE_PAY_NOT_SUPPORTED_MESSAGE}};}try{yield _NativeStripeSdk.default.confirmApplePayPayment(clientSecret);return{};}catch(error){return{error:error};}});return function confirmApplePayPayment(_x9){return _ref9.apply(this,arguments);};}();exports.confirmApplePayPayment=confirmApplePayPayment;var handleNextAction=function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){try{var _ref11=_reactNative.Platform.OS==='ios'?yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret,returnURL!=null?returnURL:null):yield _NativeStripeSdk.default.handleNextAction(paymentIntentClientSecret),paymentIntent=_ref11.paymentIntent,error=_ref11.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function handleNextAction(_x10,_x11){return _ref10.apply(this,arguments);};}();exports.handleNextAction=handleNextAction;var confirmSetupIntent=function(){var _ref12=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,params){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};try{var _yield$NativeStripeSd7=yield _NativeStripeSdk.default.confirmSetupIntent(paymentIntentClientSecret,params,options),setupIntent=_yield$NativeStripeSd7.setupIntent,error=_yield$NativeStripeSd7.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmSetupIntent(_x12,_x13){return _ref12.apply(this,arguments);};}();exports.confirmSetupIntent=confirmSetupIntent;var createTokenForCVCUpdate=function(){var _ref13=(0,_asyncToGenerator2.default)(function*(cvc){try{var _yield$NativeStripeSd8=yield _NativeStripeSdk.default.createTokenForCVCUpdate(cvc),tokenId=_yield$NativeStripeSd8.tokenId,error=_yield$NativeStripeSd8.error;if(error){return{error:error};}return{tokenId:tokenId};}catch(error){return{error:error};}});return function createTokenForCVCUpdate(_x14){return _ref13.apply(this,arguments);};}();exports.createTokenForCVCUpdate=createTokenForCVCUpdate;var handleURLCallback=function(){var _ref14=(0,_asyncToGenerator2.default)(function*(url){var stripeHandled=yield _NativeStripeSdk.default.handleURLCallback(url);return stripeHandled;});return function handleURLCallback(_x15){return _ref14.apply(this,arguments);};}();exports.handleURLCallback=handleURLCallback;var verifyMicrodepositsForPayment=function(){var _ref15=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref16=yield _NativeStripeSdk.default.verifyMicrodeposits(true,clientSecret,params),paymentIntent=_ref16.paymentIntent,error=_ref16.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForPayment(_x16,_x17){return _ref15.apply(this,arguments);};}();exports.verifyMicrodepositsForPayment=verifyMicrodepositsForPayment;var verifyMicrodepositsForSetup=function(){var _ref17=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref18=yield _NativeStripeSdk.default.verifyMicrodeposits(false,clientSecret,params),setupIntent=_ref18.setupIntent,error=_ref18.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function verifyMicrodepositsForSetup(_x18,_x19){return _ref17.apply(this,arguments);};}();exports.verifyMicrodepositsForSetup=verifyMicrodepositsForSetup;var initPaymentSheet=function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.initPaymentSheet(params),paymentOption=_yield$NativeStripeSd9.paymentOption,error=_yield$NativeStripeSd9.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function initPaymentSheet(_x20){return _ref19.apply(this,arguments);};}();exports.initPaymentSheet=initPaymentSheet;var presentPaymentSheet=function(){var _ref20=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd10=yield _NativeStripeSdk.default.presentPaymentSheet(),paymentOption=_yield$NativeStripeSd10.paymentOption,error=_yield$NativeStripeSd10.error;if(error){return{error:error};}return{paymentOption:paymentOption};}catch(error){return{error:error};}});return function presentPaymentSheet(){return _ref20.apply(this,arguments);};}();exports.presentPaymentSheet=presentPaymentSheet;var confirmPaymentSheetPayment=function(){var _ref21=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd11=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd11.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function confirmPaymentSheetPayment(){return _ref21.apply(this,arguments);};}();exports.confirmPaymentSheetPayment=confirmPaymentSheetPayment;var resetPaymentSheetCustomer=function(){var _ref22=(0,_asyncToGenerator2.default)(function*(){return yield _NativeStripeSdk.default.resetPaymentSheetCustomer();});return function resetPaymentSheetCustomer(){return _ref22.apply(this,arguments);};}();exports.resetPaymentSheetCustomer=resetPaymentSheetCustomer;var isGooglePaySupported=function(){var _ref23=(0,_asyncToGenerator2.default)(function*(params){return _helpers.isAndroid&&(yield _NativeStripeSdk.default.isGooglePaySupported(params!=null?params:{}));});return function isGooglePaySupported(_x21){return _ref23.apply(this,arguments);};}();exports.isGooglePaySupported=isGooglePaySupported;var initGooglePay=function(){var _ref24=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd12=yield _NativeStripeSdk.default.initGooglePay(params),error=_yield$NativeStripeSd12.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function initGooglePay(_x22){return _ref24.apply(this,arguments);};}();exports.initGooglePay=initGooglePay;var presentGooglePay=function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd13=yield _NativeStripeSdk.default.presentGooglePay(params),error=_yield$NativeStripeSd13.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function presentGooglePay(_x23){return _ref25.apply(this,arguments);};}();exports.presentGooglePay=presentGooglePay;var createGooglePayPaymentMethod=function(){var _ref26=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd14=yield _NativeStripeSdk.default.createGooglePayPaymentMethod(params),error=_yield$NativeStripeSd14.error,paymentMethod=_yield$NativeStripeSd14.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createGooglePayPaymentMethod(_x24){return _ref26.apply(this,arguments);};}();exports.createGooglePayPaymentMethod=createGooglePayPaymentMethod;var openApplePaySetup=function(){var _ref27=(0,_asyncToGenerator2.default)(function*(){try{var _yield$NativeStripeSd15=yield _NativeStripeSdk.default.openApplePaySetup(),error=_yield$NativeStripeSd15.error;if(error){return{error:error};}return{};}catch(error){return{error:error};}});return function openApplePaySetup(){return _ref27.apply(this,arguments);};}();exports.openApplePaySetup=openApplePaySetup;var collectBankAccountForPayment=function(){var _ref28=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref29=yield _NativeStripeSdk.default.collectBankAccount(true,clientSecret,params),paymentIntent=_ref29.paymentIntent,error=_ref29.error;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForPayment(_x25,_x26){return _ref28.apply(this,arguments);};}();exports.collectBankAccountForPayment=collectBankAccountForPayment;var collectBankAccountForSetup=function(){var _ref30=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref31=yield _NativeStripeSdk.default.collectBankAccount(false,clientSecret,params),setupIntent=_ref31.setupIntent,error=_ref31.error;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountForSetup(_x27,_x28){return _ref30.apply(this,arguments);};}();exports.collectBankAccountForSetup=collectBankAccountForSetup;var collectBankAccountToken=function(){var _ref32=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd16=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd16.session,token=_yield$NativeStripeSd16.token,error=_yield$NativeStripeSd16.error;if(error){return{error:error};}return{session:session,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectBankAccountToken(_x29){return _ref32.apply(this,arguments);};}();exports.collectBankAccountToken=collectBankAccountToken;var collectFinancialConnectionsAccounts=function(){var _ref33=(0,_asyncToGenerator2.default)(function*(clientSecret){try{var _yield$NativeStripeSd17=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd17.session,error=_yield$NativeStripeSd17.error;if(error){return{error:error};}return{session:session};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function collectFinancialConnectionsAccounts(_x30){return _ref33.apply(this,arguments);};}();exports.collectFinancialConnectionsAccounts=collectFinancialConnectionsAccounts;var canAddCardToWallet=function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd18=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd18.canAddCard,details=_yield$NativeStripeSd18.details,error=_yield$NativeStripeSd18.error;if(error){return{error:error};}return{canAddCard:canAddCard,details:details};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function canAddCardToWallet(_x31){return _ref34.apply(this,arguments);};}();exports.canAddCardToWallet=canAddCardToWallet;var isCardInWallet=function(){var _ref35=(0,_asyncToGenerator2.default)(function*(params){try{var _yield$NativeStripeSd19=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd19.isInWallet,token=_yield$NativeStripeSd19.token,error=_yield$NativeStripeSd19.error;if(error){return{error:error};}return{isInWallet:isInWallet,token:token};}catch(error){return{error:(0,_helpers.createError)(error)};}});return function isCardInWallet(_x32){return _ref35.apply(this,arguments);};}();exports.isCardInWallet=isCardInWallet;var Constants=_NativeStripeSdk.default.getConstants();exports.Constants=Constants;
|
|
2
2
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["functions.ts"],"names":["APPLE_PAY_NOT_SUPPORTED_MESSAGE","createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","isApplePaySupported","isiOS","presentApplePay","code","ApplePayError","Canceled","message","updateApplePaySummaryItems","summaryItems","errorAddressFields","confirmApplePayPayment","handleNextAction","returnURL","Platform","OS","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","initPaymentSheet","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","isGooglePaySupported","isAndroid","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants"],"mappings":"+lCAAA,kCACA,sCACA,0EACA,8BAoCA,yCAEA,GAAMA,CAAAA,+BAA+B,CACnC,2CADF,CAGO,GAAMC,CAAAA,mBAAmB,oDAAG,UACjCC,MADiC,CAGM,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,GAAI,CACF,+BAAuCC,0BAAgBH,mBAAhB,CACrCC,MADqC,CAErCC,OAFqC,CAAvC,CAAQE,aAAR,uBAAQA,aAAR,CAAuBC,KAAvB,uBAAuBA,KAAvB,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLD,aAAa,CAAEA,aADV,CAAP,CAGD,CAAC,MAAOC,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACF,CAtB+B,iBAAnBL,CAAAA,mBAAmB,4CAAzB,C,gDAwBA,GAAMM,CAAAA,WAAW,qDAAG,UACzBL,MADyB,CAEM,qBAC/B,GACEA,MAAM,CAACM,IAAP,GAAgB,aAAhB,EACA,kBAAAN,MAAM,CAACO,OAAP,+BAAgBC,WAAhB,MAAkC,IADlC,EAEA,CAACR,MAAM,CAACS,aAHV,CAIE,CACA,MAAO,CACLL,KAAK,CAAEM,4BADF,CAAP,CAGD,CAED,GAAI,CACF,gCAA+BR,0BAAgBG,WAAhB,CAA4BL,MAA5B,CAA/B,CAAQW,KAAR,wBAAQA,KAAR,CAAeP,KAAf,wBAAeA,KAAf,CAEA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACLO,KAAK,CAAEA,KADF,CAAP,CAGD,C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AAYA,KAAZ,CADF,CAAP,CAGD,CACF,CArB8B,iBAAlBwD,CAAAA,kBAAkB,gDAAxB,C,8CAuBA,GAAMG,CAAAA,cAAc,sDAAG,UAAO/D,MAAP,CAEO,CACnC,GAAI,CACF,iCAA2CE,0BAAgB6D,cAAhB,CACzC/D,MADyC,CAA3C,CAAQgE,UAAR,yBAAQA,UAAR,CAAoBrD,KAApB,yBAAoBA,KAApB,CAA2BP,KAA3B,yBAA2BA,KAA3B,CAIA,GAAIA,KAAJ,CAAW,CACT,MAAO,CACLA,KAAK,CAALA,KADK,CAAP,CAGD,CACD,MAAO,CACL4D,UAAU,CAAEA,UADP,CAELrD,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CAtB0B,iBAAd2D,CAAAA,cAAc,gDAApB,C,sCAwBA,GAAME,CAAAA,SAAS,CAAG/D,yBAAgBgE,YAAhB,EAAlB,C","sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n GooglePayInitResult,\n HandleNextActionResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PayWithGooglePayResult,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\nimport { Platform } from 'react-native';\n\nconst APPLE_PAY_NOT_SUPPORTED_MESSAGE =\n 'Apple pay is not supported on this device';\n\nexport const createPaymentMethod = async (\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n): Promise<CreatePaymentMethodResult> => {\n try {\n const { paymentMethod, error } = await NativeStripeSdk.createPaymentMethod(\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createToken = async (\n params: Token.CreateParams\n): Promise<CreateTokenResult> => {\n if (\n params.type === 'BankAccount' &&\n params.country?.toLowerCase() === 'us' &&\n !params.routingNumber\n ) {\n return {\n error: MissingRoutingNumber,\n };\n }\n\n try {\n const { token, error } = await NativeStripeSdk.createToken(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrievePaymentIntent = async (\n clientSecret: string\n): Promise<RetrievePaymentIntentResult> => {\n try {\n const { paymentIntent, error } =\n await NativeStripeSdk.retrievePaymentIntent(clientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrieveSetupIntent = async (\n clientSecret: string\n): Promise<RetrieveSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.retrieveSetupIntent(\n clientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Confirm and, if necessary, authenticate a PaymentIntent.\n *\n * @param {string} paymentIntentClientSecret The client_secret of the associated [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param {object=} params An optional object that contains data related to the payment method used to confirm this payment. If no object is provided (undefined), then it is assumed that the payment method has already been [attached to the Payment Intent](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method).\n * @param {object=} options An optional object that contains options for this payment method.\n * @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.\n */\nexport const confirmPayment = async (\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n): Promise<ConfirmPaymentResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.confirmPayment(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\nexport const presentApplePay = async (\n params: ApplePay.PresentParams\n): Promise<ApplePayResult> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n const { paymentMethod, error } = await NativeStripeSdk.presentApplePay(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return { paymentMethod: paymentMethod! };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const updateApplePaySummaryItems = async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n await NativeStripeSdk.updateApplePaySummaryItems(\n summaryItems,\n errorAddressFields\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const confirmApplePayPayment = async (\n clientSecret: string\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n try {\n await NativeStripeSdk.confirmApplePayPayment(clientSecret);\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the PaymentIntent.\n * Call this method if you are using manual confirmation. See https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom\n *\n * @param {string} paymentIntentClientSecret The client secret associated with the PaymentIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextAction = async (\n paymentIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextAction(paymentIntentClientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const confirmSetupIntent = async (\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n): Promise<ConfirmSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.confirmSetupIntent(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createTokenForCVCUpdate = async (\n cvc: string\n): Promise<CreateTokenForCVCUpdateResult> => {\n try {\n const { tokenId, error } = await NativeStripeSdk.createTokenForCVCUpdate(\n cvc\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n tokenId: tokenId!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled = await NativeStripeSdk.handleURLCallback(url);\n return stripeHandled;\n};\n\nexport const verifyMicrodepositsForPayment = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n true,\n clientSecret,\n params\n )) as VerifyMicrodepositsForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const verifyMicrodepositsForSetup = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n false,\n clientSecret,\n params\n )) as VerifyMicrodepositsForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.initPaymentSheet(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet =\n async (): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } =\n await NativeStripeSdk.presentPaymentSheet();\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption: paymentOption!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\nexport const confirmPaymentSheetPayment =\n async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n try {\n const { error } = await NativeStripeSdk.confirmPaymentSheetPayment();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\nexport const isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\nexport const initGooglePay = async (\n params: GooglePay.InitParams\n): Promise<GooglePayInitResult> => {\n try {\n const { error } = await NativeStripeSdk.initGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentGooglePay = async (\n params: GooglePay.PresentParams\n): Promise<PayWithGooglePayResult> => {\n try {\n const { error } = await NativeStripeSdk.presentGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createGooglePayPaymentMethod = async (\n params: GooglePay.CreatePaymentMethodParams\n): Promise<CreateGooglePayPaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n await NativeStripeSdk.createGooglePayPaymentMethod(params);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const openApplePaySetup = async (): Promise<OpenApplePaySetupResult> => {\n try {\n const { error } = await NativeStripeSdk.openApplePaySetup();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const collectBankAccountForPayment = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.collectBankAccount(\n true,\n clientSecret,\n params\n )) as CollectBankAccountForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const collectBankAccountForSetup = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.collectBankAccount(\n false,\n clientSecret,\n params\n )) as CollectBankAccountForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectBankAccountToken in the [Add a Financial Connections Account to a US Custom Connect](https://stripe.com/docs/financial-connections/connect-payouts) account flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account for payouts.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either `session` and `token` fields, or an error field.\n */\nexport const collectBankAccountToken = async (\n clientSecret: string\n): Promise<FinancialConnections.TokenResult> => {\n try {\n const { session, token, error } =\n await NativeStripeSdk.collectBankAccountToken(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n token: token!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectFinancialConnectionsAccounts in the [Collect an account to build data-powered products](https://stripe.com/docs/financial-connections/other-data-powered-products) flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either a `session` field, or an error field.\n */\nexport const collectFinancialConnectionsAccounts = async (\n clientSecret: string\n): Promise<FinancialConnections.SessionResult> => {\n try {\n const { session, error } =\n await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const canAddCardToWallet = async (\n params: CanAddCardToWalletParams\n): Promise<CanAddCardToWalletResult> => {\n try {\n const { canAddCard, details, error } =\n await NativeStripeSdk.canAddCardToWallet(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n canAddCard: canAddCard as boolean,\n details: details,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const isCardInWallet = async (params: {\n cardLastFour: string;\n}): Promise<IsCardInWalletResult> => {\n try {\n const { isInWallet, token, error } = await NativeStripeSdk.isCardInWallet(\n params\n );\n\n if (error) {\n return {\n error,\n };\n }\n return {\n isInWallet: isInWallet as boolean,\n token: token,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const Constants = NativeStripeSdk.getConstants();\n"]}
|
|
1
|
+
{"version":3,"sources":["functions.ts"],"names":["APPLE_PAY_NOT_SUPPORTED_MESSAGE","createPaymentMethod","params","options","NativeStripeSdk","paymentMethod","error","createToken","type","country","toLowerCase","routingNumber","MissingRoutingNumber","token","retrievePaymentIntent","clientSecret","paymentIntent","retrieveSetupIntent","setupIntent","confirmPayment","paymentIntentClientSecret","isApplePaySupported","isiOS","presentApplePay","code","ApplePayError","Canceled","message","updateApplePaySummaryItems","summaryItems","errorAddressFields","confirmApplePayPayment","handleNextAction","returnURL","Platform","OS","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","initPaymentSheet","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","resetPaymentSheetCustomer","isGooglePaySupported","isAndroid","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants"],"mappings":"ioCAAA,kCACA,sCACA,0EACA,8BAoCA,yCAEA,GAAMA,CAAAA,+BAA+B,CACnC,2CADF,CAGO,GAAMC,CAAAA,mBAAmB,oDAAG,UACjCC,MADiC,CAGM,IADvCC,CAAAA,OACuC,2DADA,EACA,CACvC,GAAI,CACF,+BAAuCC,0BAAgBH,mBAAhB,CACrCC,MADqC,CAErCC,OAFqC,CAAvC,CAAQE,aAAR,uBAAQA,aAAR,CAAuBC,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AALA,KADK,CAAP,CAGD,CACD,MAAO,CACL6D,UAAU,CAAEA,UADP,CAELtD,KAAK,CAAEA,KAFF,CAAP,CAID,CAAC,MAAOP,KAAP,CAAmB,CACnB,MAAO,CACLA,KAAK,CAAE,yBAAYA,KAAZ,CADF,CAAP,CAGD,CACF,CAtB0B,iBAAd4D,CAAAA,cAAc,gDAApB,C,sCAwBA,GAAME,CAAAA,SAAS,CAAGhE,yBAAgBiE,YAAhB,EAAlB,C","sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n ConfirmPaymentResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n PaymentIntent,\n ConfirmSetupIntentResult,\n CreatePaymentMethodResult,\n CreateTokenForCVCUpdateResult,\n CreateTokenResult,\n GooglePayInitResult,\n HandleNextActionResult,\n InitPaymentSheetResult,\n PaymentMethod,\n PaymentSheet,\n PayWithGooglePayResult,\n PresentPaymentSheetResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n StripeError,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForPaymentResult,\n CollectBankAccountForSetupResult,\n IsCardInWalletResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n} from './types';\nimport { Platform } from 'react-native';\n\nconst APPLE_PAY_NOT_SUPPORTED_MESSAGE =\n 'Apple pay is not supported on this device';\n\nexport const createPaymentMethod = async (\n params: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n): Promise<CreatePaymentMethodResult> => {\n try {\n const { paymentMethod, error } = await NativeStripeSdk.createPaymentMethod(\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createToken = async (\n params: Token.CreateParams\n): Promise<CreateTokenResult> => {\n if (\n params.type === 'BankAccount' &&\n params.country?.toLowerCase() === 'us' &&\n !params.routingNumber\n ) {\n return {\n error: MissingRoutingNumber,\n };\n }\n\n try {\n const { token, error } = await NativeStripeSdk.createToken(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n token: token!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrievePaymentIntent = async (\n clientSecret: string\n): Promise<RetrievePaymentIntentResult> => {\n try {\n const { paymentIntent, error } =\n await NativeStripeSdk.retrievePaymentIntent(clientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const retrieveSetupIntent = async (\n clientSecret: string\n): Promise<RetrieveSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.retrieveSetupIntent(\n clientSecret\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * Confirm and, if necessary, authenticate a PaymentIntent.\n *\n * @param {string} paymentIntentClientSecret The client_secret of the associated [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param {object=} params An optional object that contains data related to the payment method used to confirm this payment. If no object is provided (undefined), then it is assumed that the payment method has already been [attached to the Payment Intent](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method).\n * @param {object=} options An optional object that contains options for this payment method.\n * @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.\n */\nexport const confirmPayment = async (\n paymentIntentClientSecret: string,\n params?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n): Promise<ConfirmPaymentResult> => {\n try {\n const { paymentIntent, error } = await NativeStripeSdk.confirmPayment(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\nexport const presentApplePay = async (\n params: ApplePay.PresentParams\n): Promise<ApplePayResult> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n const { paymentMethod, error } = await NativeStripeSdk.presentApplePay(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return { paymentMethod: paymentMethod! };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const updateApplePaySummaryItems = async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n\n try {\n await NativeStripeSdk.updateApplePaySummaryItems(\n summaryItems,\n errorAddressFields\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const confirmApplePayPayment = async (\n clientSecret: string\n): Promise<{ error?: StripeError<ApplePayError> }> => {\n if (!(await NativeStripeSdk.isApplePaySupported())) {\n return {\n error: {\n code: ApplePayError.Canceled,\n message: APPLE_PAY_NOT_SUPPORTED_MESSAGE,\n },\n };\n }\n try {\n await NativeStripeSdk.confirmApplePayPayment(clientSecret);\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/** Handles any nextAction required to authenticate the PaymentIntent.\n * Call this method if you are using manual confirmation. See https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=custom\n *\n * @param {string} paymentIntentClientSecret The client secret associated with the PaymentIntent.\n * @param {string=} returnURL An optional return URL so the Stripe SDK can redirect back to your app after authentication. This should match the `return_url` you specified during PaymentIntent confirmation.\n * */\nexport const handleNextAction = async (\n paymentIntentClientSecret: string,\n returnURL?: string\n): Promise<HandleNextActionResult> => {\n try {\n const { paymentIntent, error } =\n Platform.OS === 'ios'\n ? await NativeStripeSdk.handleNextAction(\n paymentIntentClientSecret,\n returnURL ?? null\n )\n : await NativeStripeSdk.handleNextAction(paymentIntentClientSecret);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const confirmSetupIntent = async (\n paymentIntentClientSecret: string,\n params: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n): Promise<ConfirmSetupIntentResult> => {\n try {\n const { setupIntent, error } = await NativeStripeSdk.confirmSetupIntent(\n paymentIntentClientSecret,\n params,\n options\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createTokenForCVCUpdate = async (\n cvc: string\n): Promise<CreateTokenForCVCUpdateResult> => {\n try {\n const { tokenId, error } = await NativeStripeSdk.createTokenForCVCUpdate(\n cvc\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n tokenId: tokenId!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const handleURLCallback = async (url: string): Promise<boolean> => {\n const stripeHandled = await NativeStripeSdk.handleURLCallback(url);\n return stripeHandled;\n};\n\nexport const verifyMicrodepositsForPayment = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n true,\n clientSecret,\n params\n )) as VerifyMicrodepositsForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const verifyMicrodepositsForSetup = async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n): Promise<VerifyMicrodepositsForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.verifyMicrodeposits(\n false,\n clientSecret,\n params\n )) as VerifyMicrodepositsForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const initPaymentSheet = async (\n params: PaymentSheet.SetupParams\n): Promise<InitPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.initPaymentSheet(\n params\n );\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet =\n async (): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } =\n await NativeStripeSdk.presentPaymentSheet();\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentOption: paymentOption!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\nexport const confirmPaymentSheetPayment =\n async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n try {\n const { error } = await NativeStripeSdk.confirmPaymentSheetPayment();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n };\n\n/**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\nexport const resetPaymentSheetCustomer = async (): Promise<null> => {\n return await NativeStripeSdk.resetPaymentSheetCustomer();\n};\n\nexport const isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\nexport const initGooglePay = async (\n params: GooglePay.InitParams\n): Promise<GooglePayInitResult> => {\n try {\n const { error } = await NativeStripeSdk.initGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentGooglePay = async (\n params: GooglePay.PresentParams\n): Promise<PayWithGooglePayResult> => {\n try {\n const { error } = await NativeStripeSdk.presentGooglePay(params);\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const createGooglePayPaymentMethod = async (\n params: GooglePay.CreatePaymentMethodParams\n): Promise<CreateGooglePayPaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n await NativeStripeSdk.createGooglePayPaymentMethod(params);\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentMethod: paymentMethod!,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const openApplePaySetup = async (): Promise<OpenApplePaySetupResult> => {\n try {\n const { error } = await NativeStripeSdk.openApplePaySetup();\n if (error) {\n return {\n error,\n };\n }\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const collectBankAccountForPayment = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForPaymentResult> => {\n try {\n const { paymentIntent, error } = (await NativeStripeSdk.collectBankAccount(\n true,\n clientSecret,\n params\n )) as CollectBankAccountForPaymentResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n paymentIntent: paymentIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const collectBankAccountForSetup = async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n): Promise<CollectBankAccountForSetupResult> => {\n try {\n const { setupIntent, error } = (await NativeStripeSdk.collectBankAccount(\n false,\n clientSecret,\n params\n )) as CollectBankAccountForSetupResult;\n\n if (error) {\n return {\n error,\n };\n }\n return {\n setupIntent: setupIntent!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectBankAccountToken in the [Add a Financial Connections Account to a US Custom Connect](https://stripe.com/docs/financial-connections/connect-payouts) account flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account for payouts.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either `session` and `token` fields, or an error field.\n */\nexport const collectBankAccountToken = async (\n clientSecret: string\n): Promise<FinancialConnections.TokenResult> => {\n try {\n const { session, token, error } =\n await NativeStripeSdk.collectBankAccountToken(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n token: token!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\n/**\n * Use collectFinancialConnectionsAccounts in the [Collect an account to build data-powered products](https://stripe.com/docs/financial-connections/other-data-powered-products) flow.\n * When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account.\n * @param {string} clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).\n * @returns A promise that resolves to an object containing either a `session` field, or an error field.\n */\nexport const collectFinancialConnectionsAccounts = async (\n clientSecret: string\n): Promise<FinancialConnections.SessionResult> => {\n try {\n const { session, error } =\n await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n session: session!,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const canAddCardToWallet = async (\n params: CanAddCardToWalletParams\n): Promise<CanAddCardToWalletResult> => {\n try {\n const { canAddCard, details, error } =\n await NativeStripeSdk.canAddCardToWallet(params);\n\n if (error) {\n return {\n error,\n };\n }\n return {\n canAddCard: canAddCard as boolean,\n details: details,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const isCardInWallet = async (params: {\n cardLastFour: string;\n}): Promise<IsCardInWalletResult> => {\n try {\n const { isInWallet, token, error } = await NativeStripeSdk.isCardInWallet(\n params\n );\n\n if (error) {\n return {\n error,\n };\n }\n return {\n isInWallet: isInWallet as boolean,\n token: token,\n };\n } catch (error: any) {\n return {\n error: createError(error),\n };\n }\n};\n\nexport const Constants = NativeStripeSdk.getConstants();\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.usePaymentSheet=usePaymentSheet;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _useStripe2=require("./useStripe");function usePaymentSheet(){var _useStripe=(0,_useStripe2.useStripe)(),initPaymentSheetNative=_useStripe.initPaymentSheet,presentPaymentSheetNative=_useStripe.presentPaymentSheet,confirmPaymentSheetPaymentNative=_useStripe.confirmPaymentSheetPayment;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var initPaymentSheet=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield initPaymentSheetNative(params);setLoading(false);return result;});return function initPaymentSheet(_x){return _ref.apply(this,arguments);};}();var presentPaymentSheet=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield presentPaymentSheetNative();setLoading(false);return result;});return function presentPaymentSheet(){return _ref2.apply(this,arguments);};}();var confirmPaymentSheetPayment=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield confirmPaymentSheetPaymentNative();setLoading(false);return result;});return function confirmPaymentSheetPayment(){return _ref3.apply(this,arguments);};}();return{loading:loading,initPaymentSheet:initPaymentSheet,presentPaymentSheet:presentPaymentSheet,confirmPaymentSheetPayment:confirmPaymentSheetPayment};}
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.usePaymentSheet=usePaymentSheet;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _useStripe2=require("./useStripe");function usePaymentSheet(){var _useStripe=(0,_useStripe2.useStripe)(),initPaymentSheetNative=_useStripe.initPaymentSheet,presentPaymentSheetNative=_useStripe.presentPaymentSheet,confirmPaymentSheetPaymentNative=_useStripe.confirmPaymentSheetPayment,resetPaymentSheetCustomerNative=_useStripe.resetPaymentSheetCustomer;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),loading=_useState2[0],setLoading=_useState2[1];var initPaymentSheet=function(){var _ref=(0,_asyncToGenerator2.default)(function*(params){setLoading(true);var result=yield initPaymentSheetNative(params);setLoading(false);return result;});return function initPaymentSheet(_x){return _ref.apply(this,arguments);};}();var presentPaymentSheet=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield presentPaymentSheetNative();setLoading(false);return result;});return function presentPaymentSheet(){return _ref2.apply(this,arguments);};}();var confirmPaymentSheetPayment=function(){var _ref3=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield confirmPaymentSheetPaymentNative();setLoading(false);return result;});return function confirmPaymentSheetPayment(){return _ref3.apply(this,arguments);};}();var resetPaymentSheetCustomer=function(){var _ref4=(0,_asyncToGenerator2.default)(function*(){setLoading(true);var result=yield resetPaymentSheetCustomerNative();setLoading(false);return result;});return function resetPaymentSheetCustomer(){return _ref4.apply(this,arguments);};}();return{loading:loading,initPaymentSheet:initPaymentSheet,presentPaymentSheet:presentPaymentSheet,confirmPaymentSheetPayment:confirmPaymentSheetPayment,resetPaymentSheetCustomer:resetPaymentSheetCustomer};}
|
|
2
2
|
//# sourceMappingURL=usePaymentSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePaymentSheet.tsx"],"names":["usePaymentSheet","initPaymentSheetNative","initPaymentSheet","presentPaymentSheetNative","presentPaymentSheet","confirmPaymentSheetPaymentNative","confirmPaymentSheetPayment","loading","setLoading","params","result"],"mappings":"kXACA,4BACA,uCAKO,QAASA,CAAAA,eAAT,EAA2B,CAChC,
|
|
1
|
+
{"version":3,"sources":["usePaymentSheet.tsx"],"names":["usePaymentSheet","initPaymentSheetNative","initPaymentSheet","presentPaymentSheetNative","presentPaymentSheet","confirmPaymentSheetPaymentNative","confirmPaymentSheetPayment","resetPaymentSheetCustomerNative","resetPaymentSheetCustomer","loading","setLoading","params","result"],"mappings":"kXACA,4BACA,uCAKO,QAASA,CAAAA,eAAT,EAA2B,CAChC,eAKI,2BALJ,CACoBC,sBADpB,YACEC,gBADF,CAEuBC,yBAFvB,YAEEC,mBAFF,CAG8BC,gCAH9B,YAGEC,0BAHF,CAI6BC,+BAJ7B,YAIEC,yBAJF,CAMA,cAA8B,oBAAS,KAAT,CAA9B,qDAAOC,OAAP,eAAgBC,UAAhB,eAEA,GAAMR,CAAAA,gBAAgB,oDAAG,UAAOS,MAAP,CAA4C,CACnED,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAASX,CAAAA,sBAAsB,CAACU,MAAD,CAA3C,CACAD,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CALqB,iBAAhBV,CAAAA,gBAAgB,4CAAtB,CAOA,GAAME,CAAAA,mBAAmB,qDAAG,WAAY,CACtCM,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAAST,CAAAA,yBAAyB,EAA9C,CACAO,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CALwB,iBAAnBR,CAAAA,mBAAmB,2CAAzB,CAOA,GAAME,CAAAA,0BAA0B,qDAAG,WAAY,CAC7CI,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAASP,CAAAA,gCAAgC,EAArD,CACAK,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CAL+B,iBAA1BN,CAAAA,0BAA0B,2CAAhC,CAOA,GAAME,CAAAA,yBAAyB,qDAAG,WAAY,CAC5CE,UAAU,CAAC,IAAD,CAAV,CACA,GAAME,CAAAA,MAAM,MAASL,CAAAA,+BAA+B,EAApD,CACAG,UAAU,CAAC,KAAD,CAAV,CACA,MAAOE,CAAAA,MAAP,CACD,CAL8B,iBAAzBJ,CAAAA,yBAAyB,2CAA/B,CAOA,MAAO,CACLC,OAAO,CAAPA,OADK,CAELP,gBAAgB,CAAhBA,gBAFK,CAGLE,mBAAmB,CAAnBA,mBAHK,CAILE,0BAA0B,CAA1BA,0BAJK,CAULE,yBAAyB,CAAzBA,yBAVK,CAAP,CAYD","sourcesContent":["import type { PaymentSheet } from '../types';\nimport { useState } from 'react';\nimport { useStripe } from './useStripe';\n\n/**\n * usePaymentSheet hook\n */\nexport function usePaymentSheet() {\n const {\n initPaymentSheet: initPaymentSheetNative,\n presentPaymentSheet: presentPaymentSheetNative,\n confirmPaymentSheetPayment: confirmPaymentSheetPaymentNative,\n resetPaymentSheetCustomer: resetPaymentSheetCustomerNative,\n } = useStripe();\n const [loading, setLoading] = useState(false);\n\n const initPaymentSheet = async (params: PaymentSheet.SetupParams) => {\n setLoading(true);\n const result = await initPaymentSheetNative(params);\n setLoading(false);\n return result;\n };\n\n const presentPaymentSheet = async () => {\n setLoading(true);\n const result = await presentPaymentSheetNative();\n setLoading(false);\n return result;\n };\n\n const confirmPaymentSheetPayment = async () => {\n setLoading(true);\n const result = await confirmPaymentSheetPaymentNative();\n setLoading(false);\n return result;\n };\n\n const resetPaymentSheetCustomer = async () => {\n setLoading(true);\n const result = await resetPaymentSheetCustomerNative();\n setLoading(false);\n return result;\n };\n\n return {\n loading,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n /**\n * You must call this method when the user logs out from your app. This will ensure that\n * any persisted authentication state in the PaymentSheet, such as authentication cookies,\n * is also cleared during logout.\n */\n resetPaymentSheetCustomer,\n };\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useStripe=useStripe;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _helpers=require("../helpers");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _functions=require("../functions");function useStripe(){var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),isApplePaySupported=_useState2[0],setApplePaySupported=_useState2[1];(0,_react.useEffect)(function(){function checkApplePaySupport(){return _checkApplePaySupport.apply(this,arguments);}function _checkApplePaySupport(){_checkApplePaySupport=(0,_asyncToGenerator2.default)(function*(){var isSupported=_helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());setApplePaySupported(isSupported);});return _checkApplePaySupport.apply(this,arguments);}checkApplePaySupport();},[]);var _createPaymentMethod=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(data){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return(0,_functions.createPaymentMethod)(data,options);});return function(_x){return _ref.apply(this,arguments);};}(),[]);var _createToken=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createToken)(params);});return function(_x2){return _ref2.apply(this,arguments);};}(),[]);var _retrievePaymentIntent=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrievePaymentIntent)(clientSecret);});return function(_x3){return _ref3.apply(this,arguments);};}(),[]);var _retrieveSetupIntent=(0,_react.useCallback)(function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrieveSetupIntent)(clientSecret);});return function(_x4){return _ref4.apply(this,arguments);};}(),[]);var _confirmPayment=(0,_react.useCallback)(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmPayment)(paymentIntentClientSecret,data,options);});return function(_x5,_x6){return _ref5.apply(this,arguments);};}(),[]);var _presentApplePay=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentApplePay)(params);});return function(_x7){return _ref6.apply(this,arguments);};}(),[]);var _updateApplePaySummaryItems=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return(0,_functions.updateApplePaySummaryItems)(summaryItems,errorAddressFields);});return function(_x8){return _ref7.apply(this,arguments);};}(),[]);var _confirmApplePayPayment=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.confirmApplePayPayment)(clientSecret);});return function(_x9){return _ref8.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x10,_x11){return _ref9.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmSetupIntent)(paymentIntentClientSecret,data,options);});return function(_x12,_x13){return _ref10.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x14){return _ref11.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref12=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x15){return _ref12.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.presentPaymentSheet)();}),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref15.apply(this,arguments);};}(),[]);var _isGooglePaySupported=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isGooglePaySupported)(params);});return function(_x17){return _ref16.apply(this,arguments);};}(),[]);var _initGooglePay=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initGooglePay)(params);});return function(_x18){return _ref17.apply(this,arguments);};}(),[]);var _presentGooglePay=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentGooglePay)(params);});return function(_x19){return _ref18.apply(this,arguments);};}(),[]);var _createGooglePayPaymentMethod=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createGooglePayPaymentMethod)(params);});return function(_x20){return _ref19.apply(this,arguments);};}(),[]);var _openApplePaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openApplePaySetup)();}),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref21=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref21.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref22.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x25,_x26){return _ref23.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x27,_x28){return _ref24.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x29){return _ref25.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectBankAccountToken)(clientSecret);});return function(_x30){return _ref26.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret);});return function(_x31){return _ref27.apply(this,arguments);};}(),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,isApplePaySupported:isApplePaySupported,presentApplePay:_presentApplePay,confirmApplePayPayment:_confirmApplePayPayment,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,updateApplePaySummaryItems:_updateApplePaySummaryItems,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,isGooglePaySupported:_isGooglePaySupported,initGooglePay:_initGooglePay,presentGooglePay:_presentGooglePay,createGooglePayPaymentMethod:_createGooglePayPaymentMethod,openApplePaySetup:_openApplePaySetup,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts};}
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useStripe=useStripe;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=require("react");var _helpers=require("../helpers");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _functions=require("../functions");function useStripe(){var _useState=(0,_react.useState)(null),_useState2=(0,_slicedToArray2.default)(_useState,2),isApplePaySupported=_useState2[0],setApplePaySupported=_useState2[1];(0,_react.useEffect)(function(){function checkApplePaySupport(){return _checkApplePaySupport.apply(this,arguments);}function _checkApplePaySupport(){_checkApplePaySupport=(0,_asyncToGenerator2.default)(function*(){var isSupported=_helpers.isiOS&&(yield _NativeStripeSdk.default.isApplePaySupported());setApplePaySupported(isSupported);});return _checkApplePaySupport.apply(this,arguments);}checkApplePaySupport();},[]);var _createPaymentMethod=(0,_react.useCallback)(function(){var _ref=(0,_asyncToGenerator2.default)(function*(data){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return(0,_functions.createPaymentMethod)(data,options);});return function(_x){return _ref.apply(this,arguments);};}(),[]);var _createToken=(0,_react.useCallback)(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createToken)(params);});return function(_x2){return _ref2.apply(this,arguments);};}(),[]);var _retrievePaymentIntent=(0,_react.useCallback)(function(){var _ref3=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrievePaymentIntent)(clientSecret);});return function(_x3){return _ref3.apply(this,arguments);};}(),[]);var _retrieveSetupIntent=(0,_react.useCallback)(function(){var _ref4=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.retrieveSetupIntent)(clientSecret);});return function(_x4){return _ref4.apply(this,arguments);};}(),[]);var _confirmPayment=(0,_react.useCallback)(function(){var _ref5=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmPayment)(paymentIntentClientSecret,data,options);});return function(_x5,_x6){return _ref5.apply(this,arguments);};}(),[]);var _presentApplePay=(0,_react.useCallback)(function(){var _ref6=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentApplePay)(params);});return function(_x7){return _ref6.apply(this,arguments);};}(),[]);var _updateApplePaySummaryItems=(0,_react.useCallback)(function(){var _ref7=(0,_asyncToGenerator2.default)(function*(summaryItems){var errorAddressFields=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];return(0,_functions.updateApplePaySummaryItems)(summaryItems,errorAddressFields);});return function(_x8){return _ref7.apply(this,arguments);};}(),[]);var _confirmApplePayPayment=(0,_react.useCallback)(function(){var _ref8=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.confirmApplePayPayment)(clientSecret);});return function(_x9){return _ref8.apply(this,arguments);};}(),[]);var _handleNextAction=(0,_react.useCallback)(function(){var _ref9=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,returnURL){return(0,_functions.handleNextAction)(paymentIntentClientSecret,returnURL);});return function(_x10,_x11){return _ref9.apply(this,arguments);};}(),[]);var _confirmSetupIntent=(0,_react.useCallback)(function(){var _ref10=(0,_asyncToGenerator2.default)(function*(paymentIntentClientSecret,data){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return(0,_functions.confirmSetupIntent)(paymentIntentClientSecret,data,options);});return function(_x12,_x13){return _ref10.apply(this,arguments);};}(),[]);var _createTokenForCVCUpdate=(0,_react.useCallback)(function(){var _ref11=(0,_asyncToGenerator2.default)(function*(cvc){return(0,_functions.createTokenForCVCUpdate)(cvc);});return function(_x14){return _ref11.apply(this,arguments);};}(),[]);var _initPaymentSheet=(0,_react.useCallback)(function(){var _ref12=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initPaymentSheet)(params);});return function(_x15){return _ref12.apply(this,arguments);};}(),[]);var _presentPaymentSheet=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.presentPaymentSheet)();}),[]);var _confirmPaymentSheetPayment=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.confirmPaymentSheetPayment)();}),[]);var _handleURLCallback=(0,_react.useCallback)(function(){var _ref15=(0,_asyncToGenerator2.default)(function*(url){return(0,_functions.handleURLCallback)(url);});return function(_x16){return _ref15.apply(this,arguments);};}(),[]);var _isGooglePaySupported=(0,_react.useCallback)(function(){var _ref16=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isGooglePaySupported)(params);});return function(_x17){return _ref16.apply(this,arguments);};}(),[]);var _initGooglePay=(0,_react.useCallback)(function(){var _ref17=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.initGooglePay)(params);});return function(_x18){return _ref17.apply(this,arguments);};}(),[]);var _presentGooglePay=(0,_react.useCallback)(function(){var _ref18=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.presentGooglePay)(params);});return function(_x19){return _ref18.apply(this,arguments);};}(),[]);var _createGooglePayPaymentMethod=(0,_react.useCallback)(function(){var _ref19=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createGooglePayPaymentMethod)(params);});return function(_x20){return _ref19.apply(this,arguments);};}(),[]);var _openApplePaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openApplePaySetup)();}),[]);var _collectBankAccountForPayment=(0,_react.useCallback)(function(){var _ref21=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForPayment)(clientSecret,params);});return function(_x21,_x22){return _ref21.apply(this,arguments);};}(),[]);var _collectBankAccountForSetup=(0,_react.useCallback)(function(){var _ref22=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.collectBankAccountForSetup)(clientSecret,params);});return function(_x23,_x24){return _ref22.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForPayment=(0,_react.useCallback)(function(){var _ref23=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForPayment)(clientSecret,params);});return function(_x25,_x26){return _ref23.apply(this,arguments);};}(),[]);var _verifyMicrodepositsForSetup=(0,_react.useCallback)(function(){var _ref24=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.verifyMicrodepositsForSetup)(clientSecret,params);});return function(_x27,_x28){return _ref24.apply(this,arguments);};}(),[]);var _canAddCardToWallet=(0,_react.useCallback)(function(){var _ref25=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.canAddCardToWallet)(params);});return function(_x29){return _ref25.apply(this,arguments);};}(),[]);var _collectBankAccountToken=(0,_react.useCallback)(function(){var _ref26=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectBankAccountToken)(clientSecret);});return function(_x30){return _ref26.apply(this,arguments);};}(),[]);var _collectFinancialConnectionsAccounts=(0,_react.useCallback)(function(){var _ref27=(0,_asyncToGenerator2.default)(function*(clientSecret){return(0,_functions.collectFinancialConnectionsAccounts)(clientSecret);});return function(_x31){return _ref27.apply(this,arguments);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);return{retrievePaymentIntent:_retrievePaymentIntent,retrieveSetupIntent:_retrieveSetupIntent,confirmPayment:_confirmPayment,createPaymentMethod:_createPaymentMethod,handleNextAction:_handleNextAction,isApplePaySupported:isApplePaySupported,presentApplePay:_presentApplePay,confirmApplePayPayment:_confirmApplePayPayment,confirmSetupIntent:_confirmSetupIntent,createTokenForCVCUpdate:_createTokenForCVCUpdate,updateApplePaySummaryItems:_updateApplePaySummaryItems,handleURLCallback:_handleURLCallback,confirmPaymentSheetPayment:_confirmPaymentSheetPayment,presentPaymentSheet:_presentPaymentSheet,initPaymentSheet:_initPaymentSheet,createToken:_createToken,isGooglePaySupported:_isGooglePaySupported,initGooglePay:_initGooglePay,presentGooglePay:_presentGooglePay,createGooglePayPaymentMethod:_createGooglePayPaymentMethod,openApplePaySetup:_openApplePaySetup,collectBankAccountForPayment:_collectBankAccountForPayment,collectBankAccountForSetup:_collectBankAccountForSetup,verifyMicrodepositsForPayment:_verifyMicrodepositsForPayment,verifyMicrodepositsForSetup:_verifyMicrodepositsForSetup,canAddCardToWallet:_canAddCardToWallet,collectBankAccountToken:_collectBankAccountToken,collectFinancialConnectionsAccounts:_collectFinancialConnectionsAccounts,resetPaymentSheetCustomer:_resetPaymentSheetCustomer};}
|
|
2
2
|
//# sourceMappingURL=useStripe.js.map
|