@stripe/stripe-react-native 0.23.2 → 0.24.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 +39 -9
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +72 -16
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +19 -2
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -1
- package/ios/ApplePayButtonManager.m +1 -0
- package/ios/ApplePayButtonView.swift +2 -0
- package/ios/ApplePayUtils.swift +116 -15
- package/ios/ApplePayViewController.swift +13 -0
- package/ios/Errors.swift +1 -0
- package/ios/StripeSdk+PaymentSheet.swift +166 -0
- package/ios/StripeSdk-Bridging-Header.h +1 -0
- package/ios/StripeSdk.m +17 -1
- package/ios/StripeSdk.swift +67 -134
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.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/Errors.js +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/PlatformPay.js +1 -1
- package/lib/commonjs/types/PlatformPay.js.map +1 -1
- package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.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/Errors.js +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/PlatformPay.js +1 -1
- package/lib/module/types/PlatformPay.js.map +1 -1
- package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +3 -1
- package/lib/typescript/src/components/PlatformPayButton.d.ts +6 -1
- package/lib/typescript/src/functions.d.ts +1 -1
- package/lib/typescript/src/hooks/usePaymentSheet.d.ts +1 -1
- package/lib/typescript/src/hooks/useStripe.d.ts +1 -1
- package/lib/typescript/src/types/Errors.d.ts +2 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +17 -1
- package/lib/typescript/src/types/PlatformPay.d.ts +64 -1
- package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +1 -0
- package/package.json +2 -2
- package/src/NativeStripeSdk.tsx +13 -1
- package/src/components/PlatformPayButton.tsx +31 -3
- package/src/functions.ts +34 -21
- package/src/hooks/usePaymentSheet.tsx +2 -2
- package/src/hooks/useStripe.tsx +8 -4
- package/src/types/Errors.ts +1 -0
- package/src/types/PaymentSheet.ts +33 -3
- package/src/types/PlatformPay.ts +72 -1
- package/src/types/components/ApplePayButtonComponent.ts +1 -0
- package/stripe-react-native.podspec +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updatePlatformPaySheet=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.resetPaymentSheetCustomer=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openPlatformPaySetup=exports.openApplePaySetup=exports.isPlatformPaySupported=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.dismissPlatformPay=exports.createTokenForCVCUpdate=exports.createToken=exports.createPlatformPayToken=exports.createPlatformPayPaymentMethod=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPlatformPaySetupIntent=exports.confirmPlatformPayPayment=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;var isPlatformPaySupported=function(){var _ref36=(0,_asyncToGenerator2.default)(function*(params){return yield _NativeStripeSdk.default.isPlatformPaySupported(params!=null?params:{});});return function isPlatformPaySupported(_x33){return _ref36.apply(this,arguments);};}();exports.isPlatformPaySupported=isPlatformPaySupported;var confirmPlatformPaySetupIntent=function(){var _ref37=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref38=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,false),error=_ref38.error,setupIntent=_ref38.setupIntent;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmPlatformPaySetupIntent(_x34,_x35){return _ref37.apply(this,arguments);};}();exports.confirmPlatformPaySetupIntent=confirmPlatformPaySetupIntent;var confirmPlatformPayPayment=function(){var _ref39=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref40=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,true),error=_ref40.error,paymentIntent=_ref40.paymentIntent;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPlatformPayPayment(_x36,_x37){return _ref39.apply(this,arguments);};}();exports.confirmPlatformPayPayment=confirmPlatformPayPayment;var dismissPlatformPay=function(){var _ref41=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS!=='ios'){return false;}try{var didDismiss=yield _NativeStripeSdk.default.dismissPlatformPay();return didDismiss;}catch(error){return false;}});return function dismissPlatformPay(){return _ref41.apply(this,arguments);};}();exports.dismissPlatformPay=dismissPlatformPay;var createPlatformPayPaymentMethod=function(){var _ref42=(0,_asyncToGenerator2.default)(function*(params){try{var _ref43=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,false),error=_ref43.error,paymentMethod=_ref43.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPlatformPayPaymentMethod(_x38){return _ref42.apply(this,arguments);};}();exports.createPlatformPayPaymentMethod=createPlatformPayPaymentMethod;var createPlatformPayToken=function(){var _ref44=(0,_asyncToGenerator2.default)(function*(params){try{var _ref45=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,true),error=_ref45.error,token=_ref45.token;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createPlatformPayToken(_x39){return _ref44.apply(this,arguments);};}();exports.createPlatformPayToken=createPlatformPayToken;var updatePlatformPaySheet=function(){var _ref46=(0,_asyncToGenerator2.default)(function*(params){if(_reactNative.Platform.OS!=='ios'){return{};}try{yield _NativeStripeSdk.default.updatePlatformPaySheet(params.applePay.cartItems,params.applePay.shippingMethods,params.applePay.errors);return{};}catch(error){return{error:error};}});return function updatePlatformPaySheet(_x40){return _ref46.apply(this,arguments);};}();exports.updatePlatformPaySheet=updatePlatformPaySheet;var openPlatformPaySetup=function(){var _ref47=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS==='ios'){yield _NativeStripeSdk.default.openApplePaySetup();}});return function openPlatformPaySetup(){return _ref47.apply(this,arguments);};}();exports.openPlatformPaySetup=openPlatformPaySetup;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.verifyMicrodepositsForSetup=exports.verifyMicrodepositsForPayment=exports.updatePlatformPaySheet=exports.updateApplePaySummaryItems=exports.retrieveSetupIntent=exports.retrievePaymentIntent=exports.resetPaymentSheetCustomer=exports.presentPaymentSheet=exports.presentGooglePay=exports.presentApplePay=exports.openPlatformPaySetup=exports.openApplePaySetup=exports.isPlatformPaySupported=exports.isGooglePaySupported=exports.isCardInWallet=exports.isApplePaySupported=exports.initPaymentSheet=exports.initGooglePay=exports.handleURLCallback=exports.handleNextAction=exports.dismissPlatformPay=exports.createTokenForCVCUpdate=exports.createToken=exports.createPlatformPayToken=exports.createPlatformPayPaymentMethod=exports.createPaymentMethod=exports.createGooglePayPaymentMethod=exports.confirmSetupIntent=exports.confirmPlatformPaySetupIntent=exports.confirmPlatformPayPayment=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){var _params$applePay;var result;var setOrderTracking=params==null?void 0:(_params$applePay=params.applePay)==null?void 0:_params$applePay.setOrderTracking;try{if(setOrderTracking&&_reactNative.Platform.OS==='ios'){result=yield _NativeStripeSdk.default.initPaymentSheetWithOrderTracking(params,function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);});}else{result=yield _NativeStripeSdk.default.initPaymentSheet(params);}if(result.error){return{error:result.error};}return{paymentOption:result.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*(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};try{var _yield$NativeStripeSd9=yield _NativeStripeSdk.default.presentPaymentSheet(options),paymentOption=_yield$NativeStripeSd9.paymentOption,error=_yield$NativeStripeSd9.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$NativeStripeSd10=yield _NativeStripeSdk.default.confirmPaymentSheetPayment(),error=_yield$NativeStripeSd10.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$NativeStripeSd11=yield _NativeStripeSdk.default.initGooglePay(params),error=_yield$NativeStripeSd11.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$NativeStripeSd12=yield _NativeStripeSdk.default.presentGooglePay(params),error=_yield$NativeStripeSd12.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$NativeStripeSd13=yield _NativeStripeSdk.default.createGooglePayPaymentMethod(params),error=_yield$NativeStripeSd13.error,paymentMethod=_yield$NativeStripeSd13.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$NativeStripeSd14=yield _NativeStripeSdk.default.openApplePaySetup(),error=_yield$NativeStripeSd14.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$NativeStripeSd15=yield _NativeStripeSdk.default.collectBankAccountToken(clientSecret),session=_yield$NativeStripeSd15.session,token=_yield$NativeStripeSd15.token,error=_yield$NativeStripeSd15.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$NativeStripeSd16=yield _NativeStripeSdk.default.collectFinancialConnectionsAccounts(clientSecret),session=_yield$NativeStripeSd16.session,error=_yield$NativeStripeSd16.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$NativeStripeSd17=yield _NativeStripeSdk.default.canAddCardToWallet(params),canAddCard=_yield$NativeStripeSd17.canAddCard,details=_yield$NativeStripeSd17.details,error=_yield$NativeStripeSd17.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$NativeStripeSd18=yield _NativeStripeSdk.default.isCardInWallet(params),isInWallet=_yield$NativeStripeSd18.isInWallet,token=_yield$NativeStripeSd18.token,error=_yield$NativeStripeSd18.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;var isPlatformPaySupported=function(){var _ref36=(0,_asyncToGenerator2.default)(function*(params){return yield _NativeStripeSdk.default.isPlatformPaySupported(params!=null?params:{});});return function isPlatformPaySupported(_x33){return _ref36.apply(this,arguments);};}();exports.isPlatformPaySupported=isPlatformPaySupported;var confirmPlatformPaySetupIntent=function(){var _ref37=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref38=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,false),error=_ref38.error,setupIntent=_ref38.setupIntent;if(error){return{error:error};}return{setupIntent:setupIntent};}catch(error){return{error:error};}});return function confirmPlatformPaySetupIntent(_x34,_x35){return _ref37.apply(this,arguments);};}();exports.confirmPlatformPaySetupIntent=confirmPlatformPaySetupIntent;var confirmPlatformPayPayment=function(){var _ref39=(0,_asyncToGenerator2.default)(function*(clientSecret,params){try{var _ref40=yield _NativeStripeSdk.default.confirmPlatformPay(clientSecret,params,true),error=_ref40.error,paymentIntent=_ref40.paymentIntent;if(error){return{error:error};}return{paymentIntent:paymentIntent};}catch(error){return{error:error};}});return function confirmPlatformPayPayment(_x36,_x37){return _ref39.apply(this,arguments);};}();exports.confirmPlatformPayPayment=confirmPlatformPayPayment;var dismissPlatformPay=function(){var _ref41=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS!=='ios'){return false;}try{var didDismiss=yield _NativeStripeSdk.default.dismissPlatformPay();return didDismiss;}catch(error){return false;}});return function dismissPlatformPay(){return _ref41.apply(this,arguments);};}();exports.dismissPlatformPay=dismissPlatformPay;var createPlatformPayPaymentMethod=function(){var _ref42=(0,_asyncToGenerator2.default)(function*(params){try{var _ref43=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,false),error=_ref43.error,paymentMethod=_ref43.paymentMethod;if(error){return{error:error};}return{paymentMethod:paymentMethod};}catch(error){return{error:error};}});return function createPlatformPayPaymentMethod(_x38){return _ref42.apply(this,arguments);};}();exports.createPlatformPayPaymentMethod=createPlatformPayPaymentMethod;var createPlatformPayToken=function(){var _ref44=(0,_asyncToGenerator2.default)(function*(params){try{var _ref45=yield _NativeStripeSdk.default.createPlatformPayPaymentMethod(params,true),error=_ref45.error,token=_ref45.token;if(error){return{error:error};}return{token:token};}catch(error){return{error:error};}});return function createPlatformPayToken(_x39){return _ref44.apply(this,arguments);};}();exports.createPlatformPayToken=createPlatformPayToken;var updatePlatformPaySheet=function(){var _ref46=(0,_asyncToGenerator2.default)(function*(params){if(_reactNative.Platform.OS!=='ios'){return{};}try{yield _NativeStripeSdk.default.updatePlatformPaySheet(params.applePay.cartItems,params.applePay.shippingMethods,params.applePay.errors);return{};}catch(error){return{error:error};}});return function updatePlatformPaySheet(_x40){return _ref46.apply(this,arguments);};}();exports.updatePlatformPaySheet=updatePlatformPaySheet;var openPlatformPaySetup=function(){var _ref47=(0,_asyncToGenerator2.default)(function*(){if(_reactNative.Platform.OS==='ios'){yield _NativeStripeSdk.default.openApplePaySetup();}});return function openPlatformPaySetup(){return _ref47.apply(this,arguments);};}();exports.openPlatformPaySetup=openPlatformPaySetup;
|
|
2
2
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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","createError","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","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPay","confirmPlatformPayPayment","dismissPlatformPay","didDismiss","createPlatformPayPaymentMethod","createPlatformPayToken","updatePlatformPaySheet","applePay","cartItems","shippingMethods","errors","openPlatformPaySetup"],"sources":["functions.ts"],"sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n PlatformPayError,\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 PlatformPay,\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\n/** @deprecated Use `isPlatformPaySupported` instead. */\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `updatePlatformPaySheet` instead. */\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\n/** @deprecated Use `confirmPlatformPaySetupIntent` or `confirmPlatformPayPayment` instead. */\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\n/** @deprecated Use `isPlatformPaySupported` instead. */\nexport const isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `openNativePaySetup` instead. */\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\n/**\n * Check if the app & device support adding this card to the native wallet.\n * @param params An object containing fields for `primaryAccountIdentifier`, `cardLastFour`, and `testEnv`.\n *\n * @returns A promise resolving to an object of type CanAddCardToWalletResult. Check the `canAddCard` field, if it's true, you should show the `<AddToWalletButton />`\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\n/** @deprecated Please use `canAddCardToWallet` instead. */\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\n/**\n * Check if the relevant native wallet (Apple Pay on iOS, Google Pay on Android) is supported.\n * @returns A boolean indicating whether or not the native wallet is supported.\n */\nexport const isPlatformPaySupported = async (params?: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n}): Promise<boolean> => {\n return await NativeStripeSdk.isPlatformPaySupported(params ?? {});\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [SetupIntent](https://stripe.com/docs/api/setup_intents).\n * @param clientSecret The client secret of the SetupIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `setupIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPaySetupIntent = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n try {\n const { error, setupIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n false\n )) as PlatformPay.ConfirmSetupIntentResult;\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 * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param clientSecret The client secret of the PaymentIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPayPayment = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmPaymentResult> => {\n try {\n const { error, paymentIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n true\n )) as PlatformPay.ConfirmPaymentResult;\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\n/**\n * iOS only, this will always return false on Android. Dismisses the Apple Pay sheet if it is open.\n * @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.\n */\nexport const dismissPlatformPay = async (): Promise<boolean> => {\n if (Platform.OS !== 'ios') {\n return false;\n }\n try {\n const didDismiss = await NativeStripeSdk.dismissPlatformPay();\n return didDismiss;\n } catch (error: any) {\n return false;\n }\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.\n */\nexport const createPlatformPayPaymentMethod = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.PaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n false\n )) as PlatformPay.PaymentMethodResult;\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\n/**\n * @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.\n */\nexport const createPlatformPayToken = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.TokenResult> => {\n try {\n const { error, token } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n true\n )) as PlatformPay.TokenResult;\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\n/**\n * iOS only. Update different items on the Apple Pay sheet, including the summary items, the shipping methods, and any errors shown. iOS only, this is a no-op on Android.\n * @param params an object describing the Apple Pay configuration, with the following fields:\n * - cartItems An array of payment summary items to display in the Apple Pay sheet.\n * - shippingMethods An array of shipping methods to display in the Apple Pay sheet.\n * - errors An array of errors associated with the user's input that must be corrected to proceed with payment. These errors will be shown in the Apple Pay sheet.\n *\n * @returns An object with an optional 'error' field, which is only populated if something went wrong.\n */\nexport const updatePlatformPaySheet = async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n}): Promise<{\n error?: StripeError<PlatformPayError>;\n}> => {\n if (Platform.OS !== 'ios') {\n return {};\n }\n\n try {\n await NativeStripeSdk.updatePlatformPaySheet(\n params.applePay.cartItems,\n params.applePay.shippingMethods,\n params.applePay.errors\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this is a no-op on Android. Use this method to move users to the interface for adding credit cards.\n * This method transfers control to the Wallet app on iPhone or to the Settings\n * app on iPad. For devices that don’t support Apple Pay, this method does nothing.\n */\nexport const openPlatformPaySetup = async (): Promise<void> => {\n if (Platform.OS === 'ios') {\n await NativeStripeSdk.openApplePaySetup();\n }\n};\n"],"mappings":"q4CAAA,kCACA,sCACA,0EACA,8BAsCA,yCAEA,GAAMA,gCAA+B,CACnC,2CAA2C,CAEtC,GAAMC,oBAAmB,oDAAG,UACjCC,MAAkC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e,CAAC2E,sBAAsB,CAC1C7E,MAAM,CAAC8E,QAAQ,CAACC,SAAS,CACzB/E,MAAM,CAAC8E,QAAQ,CAACE,eAAe,CAC/BhF,MAAM,CAAC8E,QAAQ,CAACG,MAAM,CACvB,CAED,MAAO,CAAC,CAAC,CACX,CAAE,MAAO7E,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBA1BYyE,uBAAsB,gDA0BlC,CAAC,sDAOK,GAAMK,qBAAoB,sDAAG,WAA2B,CAC7D,GAAIlD,qBAAQ,CAACC,EAAE,GAAK,KAAK,CAAE,CACzB,KAAM/B,yBAAe,CAACqD,iBAAiB,EAAE,CAC3C,CACF,CAAC,iBAJY2B,qBAAoB,4CAIhC,CAAC"}
|
|
1
|
+
{"version":3,"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","createError","confirmSetupIntent","createTokenForCVCUpdate","cvc","tokenId","handleURLCallback","url","stripeHandled","verifyMicrodepositsForPayment","verifyMicrodeposits","verifyMicrodepositsForSetup","initPaymentSheet","result","setOrderTracking","applePay","initPaymentSheetWithOrderTracking","configureOrderTracking","paymentOption","presentPaymentSheet","confirmPaymentSheetPayment","resetPaymentSheetCustomer","isGooglePaySupported","isAndroid","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccount","collectBankAccountForSetup","collectBankAccountToken","session","collectFinancialConnectionsAccounts","canAddCardToWallet","canAddCard","details","isCardInWallet","isInWallet","Constants","getConstants","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPay","confirmPlatformPayPayment","dismissPlatformPay","didDismiss","createPlatformPayPaymentMethod","createPlatformPayToken","updatePlatformPaySheet","cartItems","shippingMethods","errors","openPlatformPaySetup"],"sources":["functions.ts"],"sourcesContent":["import { isAndroid, isiOS, createError } from './helpers';\nimport { MissingRoutingNumber } from './types/Errors';\nimport NativeStripeSdk from './NativeStripeSdk';\nimport {\n ApplePay,\n ApplePayError,\n ApplePayResult,\n PlatformPayError,\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 PlatformPay,\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\n/** @deprecated Use `isPlatformPaySupported` instead. */\nexport const isApplePaySupported = async (): Promise<boolean> => {\n return isiOS && (await NativeStripeSdk.isApplePaySupported());\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `updatePlatformPaySheet` instead. */\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\n/** @deprecated Use `confirmPlatformPaySetupIntent` or `confirmPlatformPayPayment` instead. */\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 let result;\n\n const setOrderTracking = params?.applePay?.setOrderTracking;\n try {\n if (setOrderTracking && Platform.OS === 'ios') {\n result = await NativeStripeSdk.initPaymentSheetWithOrderTracking(\n params,\n () => {\n setOrderTracking(NativeStripeSdk.configureOrderTracking);\n }\n );\n } else {\n result = await NativeStripeSdk.initPaymentSheet(params);\n }\n\n if (result.error) {\n return {\n error: result.error,\n };\n }\n return {\n paymentOption: result.paymentOption,\n };\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\nexport const presentPaymentSheet = async (\n options: PaymentSheet.PresentOptions = {}\n): Promise<PresentPaymentSheetResult> => {\n try {\n const { paymentOption, error } = await NativeStripeSdk.presentPaymentSheet(\n options\n );\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\n/** @deprecated Use `isPlatformPaySupported` instead. */\nexport const isGooglePaySupported = async (\n params?: GooglePay.IsSupportedParams\n): Promise<boolean> => {\n return (\n isAndroid && (await NativeStripeSdk.isGooglePaySupported(params ?? {}))\n );\n};\n\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `createPlatformPayPaymentMethod` instead. */\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\n/** @deprecated Use `openNativePaySetup` instead. */\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\n/**\n * Check if the app & device support adding this card to the native wallet.\n * @param params An object containing fields for `primaryAccountIdentifier`, `cardLastFour`, and `testEnv`.\n *\n * @returns A promise resolving to an object of type CanAddCardToWalletResult. Check the `canAddCard` field, if it's true, you should show the `<AddToWalletButton />`\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\n/** @deprecated Please use `canAddCardToWallet` instead. */\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\n/**\n * Check if the relevant native wallet (Apple Pay on iOS, Google Pay on Android) is supported.\n * @returns A boolean indicating whether or not the native wallet is supported.\n */\nexport const isPlatformPaySupported = async (params?: {\n googlePay?: PlatformPay.IsGooglePaySupportedParams;\n}): Promise<boolean> => {\n return await NativeStripeSdk.isPlatformPaySupported(params ?? {});\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [SetupIntent](https://stripe.com/docs/api/setup_intents).\n * @param clientSecret The client secret of the SetupIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `setupIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPaySetupIntent = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n try {\n const { error, setupIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n false\n )) as PlatformPay.ConfirmSetupIntentResult;\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 * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to confirm a Stripe [PaymentIntent](https://stripe.com/docs/api/payment_intents).\n * @param clientSecret The client secret of the PaymentIntent.\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentIntent` and `paymentMethod` fields.\n */\nexport const confirmPlatformPayPayment = async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n): Promise<PlatformPay.ConfirmPaymentResult> => {\n try {\n const { error, paymentIntent } = (await NativeStripeSdk.confirmPlatformPay(\n clientSecret,\n params,\n true\n )) as PlatformPay.ConfirmPaymentResult;\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\n/**\n * iOS only, this will always return false on Android. Dismisses the Apple Pay sheet if it is open.\n * @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.\n */\nexport const dismissPlatformPay = async (): Promise<boolean> => {\n if (Platform.OS !== 'ios') {\n return false;\n }\n try {\n const didDismiss = await NativeStripeSdk.dismissPlatformPay();\n return didDismiss;\n } catch (error: any) {\n return false;\n }\n};\n\n/**\n * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.\n */\nexport const createPlatformPayPaymentMethod = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.PaymentMethodResult> => {\n try {\n const { error, paymentMethod } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n false\n )) as PlatformPay.PaymentMethodResult;\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\n/**\n * @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).\n * @param params an object describing the Apple Pay and Google Pay configurations.\n * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.\n */\nexport const createPlatformPayToken = async (\n params: PlatformPay.PaymentMethodParams\n): Promise<PlatformPay.TokenResult> => {\n try {\n const { error, token } =\n (await NativeStripeSdk.createPlatformPayPaymentMethod(\n params,\n true\n )) as PlatformPay.TokenResult;\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\n/**\n * iOS only. Update different items on the Apple Pay sheet, including the summary items, the shipping methods, and any errors shown. iOS only, this is a no-op on Android.\n * @param params an object describing the Apple Pay configuration, with the following fields:\n * - cartItems An array of payment summary items to display in the Apple Pay sheet.\n * - shippingMethods An array of shipping methods to display in the Apple Pay sheet.\n * - errors An array of errors associated with the user's input that must be corrected to proceed with payment. These errors will be shown in the Apple Pay sheet.\n *\n * @returns An object with an optional 'error' field, which is only populated if something went wrong.\n */\nexport const updatePlatformPaySheet = async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n}): Promise<{\n error?: StripeError<PlatformPayError>;\n}> => {\n if (Platform.OS !== 'ios') {\n return {};\n }\n\n try {\n await NativeStripeSdk.updatePlatformPaySheet(\n params.applePay.cartItems,\n params.applePay.shippingMethods,\n params.applePay.errors\n );\n\n return {};\n } catch (error: any) {\n return {\n error,\n };\n }\n};\n\n/**\n * iOS only, this is a no-op on Android. Use this method to move users to the interface for adding credit cards.\n * This method transfers control to the Wallet app on iPhone or to the Settings\n * app on iPad. For devices that don’t support Apple Pay, this method does nothing.\n */\nexport const openPlatformPaySetup = async (): Promise<void> => {\n if (Platform.OS === 'ios') {\n await NativeStripeSdk.openApplePaySetup();\n }\n};\n"],"mappings":"q4CAAA,kCACA,sCACA,0EACA,8BAsCA,yCAEA,GAAMA,gCAA+B,CACnC,2CAA2C,CAEtC,GAAMC,oBAAmB,oDAAG,UACjCC,MAAkC,CAEK,IADvCC,QAAoC,2DAAG,CAAC,CAAC,CAEzC,GAAI,CACF,+BAAuCC,yBAAe,CAACH,mBAAmB,CACxEC,MAAM,CACNC,OAAO,CACR,CAHOE,aAAa,uBAAbA,aAAa,CAAEC,KAAK,uBAALA,KAAK,CAI5B,GAAIA,KAAK,CAAE,CACT,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACA,MAAO,CACLD,aAAa,CAAEA,aACjB,CAAC,CACH,CAAE,MAAOC,KAAU,CAAE,CACnB,MAAO,CACLA,KAAK,CAALA,KACF,CAAC,CACH,CACF,CAAC,iBAtBYL,oBAAmB,4CAsB/B,CAAC,gDAEK,GAAMM,YAAW,qDAAG,UACzBL,MAA0B,CACK,qBAC/B,GACEA,MAAM,CAACM,IAAI,GAAK,aAAa,EAC7B,kBAAAN,MAAM,CAACO,OAAO,eAAd,gBAAgBC,WAAW,EAAE,IAAK,IAAI,EACtC,CAACR,MAAM,CAACS,aAAa,CACrB,CACA,MAAO,CACLL,KAAK,CAAEM,4BACT,CAAC,CACH,CAEA,GAAI,CACF,gCAA+BR,yBAAe,CAACG,WAAW,CAACL,MAAM,CAAC,CAA1DW,KAAK,wBAALA,KAAK,CAAEP,KAAK,wBAALA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AE,GAAK,KAAK,CAAE,CACzB,KAAM/B,yBAAe,CAAC0D,iBAAiB,EAAE,CAC3C,CACF,CAAC,iBAJY0B,qBAAoB,4CAIhC,CAAC"}
|
|
@@ -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,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};}
|
|
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*(options){setLoading(true);var result=yield presentPaymentSheetNative(options);setLoading(false);return result;});return function presentPaymentSheet(_x2){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,"names":["usePaymentSheet","useStripe","initPaymentSheetNative","initPaymentSheet","presentPaymentSheetNative","presentPaymentSheet","confirmPaymentSheetPaymentNative","confirmPaymentSheetPayment","resetPaymentSheetCustomerNative","resetPaymentSheetCustomer","useState","loading","setLoading","params","result"],"sources":["usePaymentSheet.tsx"],"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"],"mappings":"kXACA,4BACA,uCAKO,QAASA,gBAAe,EAAG,CAChC,eAKI,GAAAC,qBAAS,GAAE,CAJKC,sBAAsB,YAAxCC,gBAAgB,CACKC,yBAAyB,YAA9CC,mBAAmB,CACSC,gCAAgC,YAA5DC,0BAA0B,CACCC,+BAA+B,YAA1DC,yBAAyB,CAE3B,cAA8B,GAAAC,eAAQ,EAAC,KAAK,CAAC,qDAAtCC,OAAO,eAAEC,UAAU,eAE1B,GAAMT,iBAAgB,oDAAG,UAAOU,MAAgC,CAAK,CACnED,UAAU,CAAC,IAAI,CAAC,CAChB,GAAME,OAAM,MAASZ,uBAAsB,CAACW,MAAM,CAAC,CACnDD,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOE,OAAM,CACf,CAAC,iBALKX,iBAAgB,4CAKrB,CAED,GAAME,oBAAmB,qDAAG,
|
|
1
|
+
{"version":3,"names":["usePaymentSheet","useStripe","initPaymentSheetNative","initPaymentSheet","presentPaymentSheetNative","presentPaymentSheet","confirmPaymentSheetPaymentNative","confirmPaymentSheetPayment","resetPaymentSheetCustomerNative","resetPaymentSheetCustomer","useState","loading","setLoading","params","result","options"],"sources":["usePaymentSheet.tsx"],"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 (options?: PaymentSheet.PresentOptions) => {\n setLoading(true);\n const result = await presentPaymentSheetNative(options);\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"],"mappings":"kXACA,4BACA,uCAKO,QAASA,gBAAe,EAAG,CAChC,eAKI,GAAAC,qBAAS,GAAE,CAJKC,sBAAsB,YAAxCC,gBAAgB,CACKC,yBAAyB,YAA9CC,mBAAmB,CACSC,gCAAgC,YAA5DC,0BAA0B,CACCC,+BAA+B,YAA1DC,yBAAyB,CAE3B,cAA8B,GAAAC,eAAQ,EAAC,KAAK,CAAC,qDAAtCC,OAAO,eAAEC,UAAU,eAE1B,GAAMT,iBAAgB,oDAAG,UAAOU,MAAgC,CAAK,CACnED,UAAU,CAAC,IAAI,CAAC,CAChB,GAAME,OAAM,MAASZ,uBAAsB,CAACW,MAAM,CAAC,CACnDD,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOE,OAAM,CACf,CAAC,iBALKX,iBAAgB,4CAKrB,CAED,GAAME,oBAAmB,qDAAG,UAAOU,OAAqC,CAAK,CAC3EH,UAAU,CAAC,IAAI,CAAC,CAChB,GAAME,OAAM,MAASV,0BAAyB,CAACW,OAAO,CAAC,CACvDH,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOE,OAAM,CACf,CAAC,iBALKT,oBAAmB,8CAKxB,CAED,GAAME,2BAA0B,qDAAG,WAAY,CAC7CK,UAAU,CAAC,IAAI,CAAC,CAChB,GAAME,OAAM,MAASR,iCAAgC,EAAE,CACvDM,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOE,OAAM,CACf,CAAC,iBALKP,2BAA0B,2CAK/B,CAED,GAAME,0BAAyB,qDAAG,WAAY,CAC5CG,UAAU,CAAC,IAAI,CAAC,CAChB,GAAME,OAAM,MAASN,gCAA+B,EAAE,CACtDI,UAAU,CAAC,KAAK,CAAC,CACjB,MAAOE,OAAM,CACf,CAAC,iBALKL,0BAAyB,2CAK9B,CAED,MAAO,CACLE,OAAO,CAAPA,OAAO,CACPR,gBAAgB,CAAhBA,gBAAgB,CAChBE,mBAAmB,CAAnBA,mBAAmB,CACnBE,0BAA0B,CAA1BA,0BAA0B,CAM1BE,yBAAyB,CAAzBA,yBACF,CAAC,CACH"}
|
|
@@ -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);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);var _isPlatformPaySupported=(0,_react.useCallback)(function(){var _ref29=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isPlatformPaySupported)(params);});return function(_x32){return _ref29.apply(this,arguments);};}(),[]);var _confirmPlatformPaySetupIntent=(0,_react.useCallback)(function(){var _ref30=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPaySetupIntent)(clientSecret,params);});return function(_x33,_x34){return _ref30.apply(this,arguments);};}(),[]);var _confirmPlatformPayPayment=(0,_react.useCallback)(function(){var _ref31=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPayPayment)(clientSecret,params);});return function(_x35,_x36){return _ref31.apply(this,arguments);};}(),[]);var _dismissPlatformPay=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.dismissPlatformPay)();}),[]);var _createPlatformPayPaymentMethod=(0,_react.useCallback)(function(){var _ref33=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayPaymentMethod)(params);});return function(_x37){return _ref33.apply(this,arguments);};}(),[]);var _createPlatformPayToken=(0,_react.useCallback)(function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayToken)(params);});return function(_x38){return _ref34.apply(this,arguments);};}(),[]);var _updatePlatformPaySheet=(0,_react.useCallback)(function(){var _ref35=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.updatePlatformPaySheet)(params);});return function(_x39){return _ref35.apply(this,arguments);};}(),[]);var _openPlatformPaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openPlatformPaySetup)();}),[]);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,isPlatformPaySupported:_isPlatformPaySupported,confirmPlatformPaySetupIntent:_confirmPlatformPaySetupIntent,confirmPlatformPayPayment:_confirmPlatformPayPayment,dismissPlatformPay:_dismissPlatformPay,createPlatformPayPaymentMethod:_createPlatformPayPaymentMethod,createPlatformPayToken:_createPlatformPayToken,updatePlatformPaySheet:_updatePlatformPaySheet,openPlatformPaySetup:_openPlatformPaySetup};}
|
|
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)(function(){var _ref13=(0,_asyncToGenerator2.default)(function*(options){return(0,_functions.presentPaymentSheet)(options);});return function(_x16){return _ref13.apply(this,arguments);};}(),[]);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(_x17){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(_x18){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(_x19){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(_x20){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(_x21){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(_x22,_x23){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(_x24,_x25){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(_x26,_x27){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(_x28,_x29){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(_x30){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(_x31){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(_x32){return _ref27.apply(this,arguments);};}(),[]);var _resetPaymentSheetCustomer=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.resetPaymentSheetCustomer)();}),[]);var _isPlatformPaySupported=(0,_react.useCallback)(function(){var _ref29=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.isPlatformPaySupported)(params);});return function(_x33){return _ref29.apply(this,arguments);};}(),[]);var _confirmPlatformPaySetupIntent=(0,_react.useCallback)(function(){var _ref30=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPaySetupIntent)(clientSecret,params);});return function(_x34,_x35){return _ref30.apply(this,arguments);};}(),[]);var _confirmPlatformPayPayment=(0,_react.useCallback)(function(){var _ref31=(0,_asyncToGenerator2.default)(function*(clientSecret,params){return(0,_functions.confirmPlatformPayPayment)(clientSecret,params);});return function(_x36,_x37){return _ref31.apply(this,arguments);};}(),[]);var _dismissPlatformPay=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.dismissPlatformPay)();}),[]);var _createPlatformPayPaymentMethod=(0,_react.useCallback)(function(){var _ref33=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayPaymentMethod)(params);});return function(_x38){return _ref33.apply(this,arguments);};}(),[]);var _createPlatformPayToken=(0,_react.useCallback)(function(){var _ref34=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.createPlatformPayToken)(params);});return function(_x39){return _ref34.apply(this,arguments);};}(),[]);var _updatePlatformPaySheet=(0,_react.useCallback)(function(){var _ref35=(0,_asyncToGenerator2.default)(function*(params){return(0,_functions.updatePlatformPaySheet)(params);});return function(_x40){return _ref35.apply(this,arguments);};}(),[]);var _openPlatformPaySetup=(0,_react.useCallback)((0,_asyncToGenerator2.default)(function*(){return(0,_functions.openPlatformPaySetup)();}),[]);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,isPlatformPaySupported:_isPlatformPaySupported,confirmPlatformPaySetupIntent:_confirmPlatformPaySetupIntent,confirmPlatformPayPayment:_confirmPlatformPayPayment,dismissPlatformPay:_dismissPlatformPay,createPlatformPayPaymentMethod:_createPlatformPayPaymentMethod,createPlatformPayToken:_createPlatformPayToken,updatePlatformPaySheet:_updatePlatformPaySheet,openPlatformPaySetup:_openPlatformPaySetup};}
|
|
2
2
|
//# sourceMappingURL=useStripe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStripe","useState","isApplePaySupported","setApplePaySupported","useEffect","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","useCallback","data","options","createPaymentMethod","_createToken","params","createToken","_retrievePaymentIntent","clientSecret","retrievePaymentIntent","_retrieveSetupIntent","retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","confirmPayment","_presentApplePay","presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","updateApplePaySummaryItems","_confirmApplePayPayment","confirmApplePayPayment","_handleNextAction","returnURL","handleNextAction","_confirmSetupIntent","confirmSetupIntent","_createTokenForCVCUpdate","cvc","createTokenForCVCUpdate","_initPaymentSheet","initPaymentSheet","_presentPaymentSheet","presentPaymentSheet","_confirmPaymentSheetPayment","confirmPaymentSheetPayment","_handleURLCallback","url","handleURLCallback","_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","_isPlatformPaySupported","isPlatformPaySupported","_confirmPlatformPaySetupIntent","confirmPlatformPaySetupIntent","_confirmPlatformPayPayment","confirmPlatformPayPayment","_dismissPlatformPay","dismissPlatformPay","_createPlatformPayPaymentMethod","createPlatformPayPaymentMethod","_createPlatformPayToken","createPlatformPayToken","_updatePlatformPaySheet","updatePlatformPaySheet","_openPlatformPaySetup","openPlatformPaySetup"],"sources":["useStripe.tsx"],"sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n PlatformPayError,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n isPlatformPaySupported,\n confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment,\n dismissPlatformPay,\n createPlatformPayPaymentMethod,\n createPlatformPayToken,\n updatePlatformPaySheet,\n openPlatformPaySetup,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\n const _createPaymentMethod = useCallback(\n async (\n data: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n ): Promise<CreatePaymentMethodResult> => {\n return createPaymentMethod(data, options);\n },\n []\n );\n\n const _createToken = useCallback(\n async (params: Token.CreateParams): Promise<CreateTokenResult> => {\n return createToken(params);\n },\n []\n );\n\n const _retrievePaymentIntent = useCallback(\n async (clientSecret: string): Promise<RetrievePaymentIntentResult> => {\n return retrievePaymentIntent(clientSecret);\n },\n []\n );\n\n const _retrieveSetupIntent = useCallback(\n async (clientSecret: string): Promise<RetrieveSetupIntentResult> => {\n return retrieveSetupIntent(clientSecret);\n },\n []\n );\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n ): Promise<ConfirmPaymentResult> => {\n return confirmPayment(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\n },\n []\n );\n\n const _handleNextAction = useCallback(\n async (\n paymentIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret, returnURL);\n },\n []\n );\n\n const _confirmSetupIntent = useCallback(\n async (\n paymentIntentClientSecret: string,\n data: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n ): Promise<ConfirmSetupIntentResult> => {\n return confirmSetupIntent(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _createTokenForCVCUpdate = useCallback(\n async (cvc: string): Promise<CreateTokenForCVCUpdateResult> => {\n return createTokenForCVCUpdate(cvc);\n },\n []\n );\n\n const _initPaymentSheet = useCallback(\n async (\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult> => {\n return initPaymentSheet(params);\n },\n []\n );\n\n const _presentPaymentSheet =\n useCallback(async (): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet();\n }, []);\n\n const _confirmPaymentSheetPayment =\n useCallback(async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n return confirmPaymentSheetPayment();\n }, []);\n\n const _handleURLCallback = useCallback(\n async (url: string): Promise<boolean> => {\n return handleURLCallback(url);\n },\n []\n );\n\n const _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\n }, []);\n\n const _collectBankAccountForPayment = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForPaymentResult> => {\n return collectBankAccountForPayment(clientSecret, params);\n },\n []\n );\n\n const _collectBankAccountForSetup = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForSetupResult> => {\n return collectBankAccountForSetup(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForPayment = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForPaymentResult> => {\n return verifyMicrodepositsForPayment(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForSetup = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForSetupResult> => {\n return verifyMicrodepositsForSetup(clientSecret, params);\n },\n []\n );\n\n const _canAddCardToWallet = useCallback(\n async (\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult> => {\n return canAddCardToWallet(params);\n },\n []\n );\n\n const _collectBankAccountToken = useCallback(\n async (clientSecret: string): Promise<FinancialConnections.TokenResult> => {\n return collectBankAccountToken(clientSecret);\n },\n []\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult> => {\n return collectFinancialConnectionsAccounts(clientSecret);\n },\n []\n );\n\n const _resetPaymentSheetCustomer = useCallback(async (): Promise<null> => {\n return resetPaymentSheetCustomer();\n }, []);\n\n const _isPlatformPaySupported = useCallback(\n async (params?: {\n googlePay?: GooglePay.IsSupportedParams;\n }): Promise<boolean> => {\n return isPlatformPaySupported(params);\n },\n []\n );\n\n const _confirmPlatformPaySetupIntent = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n return confirmPlatformPaySetupIntent(clientSecret, params);\n },\n []\n );\n\n const _confirmPlatformPayPayment = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmPaymentResult> => {\n return confirmPlatformPayPayment(clientSecret, params);\n },\n []\n );\n\n const _dismissPlatformPay = useCallback(async (): Promise<boolean> => {\n return dismissPlatformPay();\n }, []);\n\n const _createPlatformPayPaymentMethod = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.PaymentMethodResult> => {\n return createPlatformPayPaymentMethod(params);\n },\n []\n );\n\n const _createPlatformPayToken = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.TokenResult> => {\n return createPlatformPayToken(params);\n },\n []\n );\n\n const _updatePlatformPaySheet = useCallback(\n async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n }): Promise<{\n error?: StripeError<PlatformPayError>;\n }> => {\n return updatePlatformPaySheet(params);\n },\n []\n );\n\n const _openPlatformPaySetup = useCallback(async (): Promise<void> => {\n return openPlatformPaySetup();\n }, []);\n\n return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\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: _resetPaymentSheetCustomer,\n isPlatformPaySupported: _isPlatformPaySupported,\n confirmPlatformPaySetupIntent: _confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment: _confirmPlatformPayPayment,\n dismissPlatformPay: _dismissPlatformPay,\n createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,\n createPlatformPayToken: _createPlatformPayToken,\n updatePlatformPaySheet: _updatePlatformPaySheet,\n openPlatformPaySetup: _openPlatformPaySetup,\n };\n}\n"],"mappings":"sWAqCA,4BACA,mCACA,2EACA,uCA0CO,QAASA,UAAS,EAAG,CAC1B,cAAoD,GAAAC,eAAQ,EAC1D,IAAI,CACL,qDAFMC,mBAAmB,eAAEC,oBAAoB,eAIhD,GAAAC,gBAAS,EAAC,UAAM,SACCC,qBAAoB,6IAAnC,WAAsC,CACpC,GAAMC,YAAW,CACfC,cAAK,QAAWC,yBAAe,CAACN,mBAAmB,EAAE,CAAC,CACxDC,oBAAoB,CAACG,WAAW,CAAC,CACnC,CAAC,sDAEDD,oBAAoB,EAAE,CACxB,CAAC,CAAE,EAAE,CAAC,CAEN,GAAMI,qBAAoB,CAAG,GAAAC,kBAAW,qDACtC,UACEC,IAAgC,CAEO,IADvCC,QAAoC,2DAAG,CAAC,CAAC,CAEzC,MAAO,GAAAC,8BAAmB,EAACF,IAAI,CAAEC,OAAO,CAAC,CAC3C,CAAC,8DACD,EAAE,CACH,CAED,GAAME,aAAY,CAAG,GAAAJ,kBAAW,sDAC9B,UAAOK,MAA0B,CAAiC,CAChE,MAAO,GAAAC,sBAAW,EAACD,MAAM,CAAC,CAC5B,CAAC,gEACD,EAAE,CACH,CAED,GAAME,uBAAsB,CAAG,GAAAP,kBAAW,sDACxC,UAAOQ,YAAoB,CAA2C,CACpE,MAAO,GAAAC,gCAAqB,EAACD,YAAY,CAAC,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,mBAAmB,CACvCG,8BAA8B,CAAED,+BAA+B,CAC/DG,sBAAsB,CAAED,uBAAuB,CAC/CG,sBAAsB,CAAED,uBAAuB,CAC/CG,oBAAoB,CAAED,qBACxB,CAAC,CACH"}
|
|
1
|
+
{"version":3,"names":["useStripe","useState","isApplePaySupported","setApplePaySupported","useEffect","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","useCallback","data","options","createPaymentMethod","_createToken","params","createToken","_retrievePaymentIntent","clientSecret","retrievePaymentIntent","_retrieveSetupIntent","retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","confirmPayment","_presentApplePay","presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","updateApplePaySummaryItems","_confirmApplePayPayment","confirmApplePayPayment","_handleNextAction","returnURL","handleNextAction","_confirmSetupIntent","confirmSetupIntent","_createTokenForCVCUpdate","cvc","createTokenForCVCUpdate","_initPaymentSheet","initPaymentSheet","_presentPaymentSheet","presentPaymentSheet","_confirmPaymentSheetPayment","confirmPaymentSheetPayment","_handleURLCallback","url","handleURLCallback","_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","_isPlatformPaySupported","isPlatformPaySupported","_confirmPlatformPaySetupIntent","confirmPlatformPaySetupIntent","_confirmPlatformPayPayment","confirmPlatformPayPayment","_dismissPlatformPay","dismissPlatformPay","_createPlatformPayPaymentMethod","createPlatformPayPaymentMethod","_createPlatformPayToken","createPlatformPayToken","_updatePlatformPaySheet","updatePlatformPaySheet","_openPlatformPaySetup","openPlatformPaySetup"],"sources":["useStripe.tsx"],"sourcesContent":["import type {\n PaymentMethod,\n PaymentIntent,\n ApplePay,\n PaymentSheet,\n CreatePaymentMethodResult,\n RetrievePaymentIntentResult,\n RetrieveSetupIntentResult,\n ConfirmPaymentResult,\n HandleNextActionResult,\n ConfirmSetupIntentResult,\n CreateTokenForCVCUpdateResult,\n ApplePayResult,\n ApplePayError,\n StripeError,\n InitPaymentSheetResult,\n PresentPaymentSheetResult,\n ConfirmPaymentSheetPaymentResult,\n SetupIntent,\n CreateTokenResult,\n PayWithGooglePayResult,\n GooglePayInitResult,\n GooglePay,\n CreateGooglePayPaymentMethodResult,\n OpenApplePaySetupResult,\n Token,\n VerifyMicrodepositsParams,\n VerifyMicrodepositsForPaymentResult,\n VerifyMicrodepositsForSetupResult,\n CollectBankAccountForSetupResult,\n CollectBankAccountForPaymentResult,\n CanAddCardToWalletParams,\n CanAddCardToWalletResult,\n FinancialConnections,\n PlatformPay,\n PlatformPayError,\n} from '../types';\nimport { useCallback, useEffect, useState } from 'react';\nimport { isiOS } from '../helpers';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n confirmPayment,\n createPaymentMethod,\n retrievePaymentIntent,\n retrieveSetupIntent,\n confirmApplePayPayment,\n confirmSetupIntent,\n createTokenForCVCUpdate,\n handleNextAction,\n handleURLCallback,\n presentApplePay,\n updateApplePaySummaryItems,\n initPaymentSheet,\n presentPaymentSheet,\n confirmPaymentSheetPayment,\n createToken,\n isGooglePaySupported,\n initGooglePay,\n createGooglePayPaymentMethod,\n presentGooglePay,\n openApplePaySetup,\n collectBankAccountForPayment,\n collectBankAccountForSetup,\n verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup,\n canAddCardToWallet,\n collectBankAccountToken,\n collectFinancialConnectionsAccounts,\n resetPaymentSheetCustomer,\n isPlatformPaySupported,\n confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment,\n dismissPlatformPay,\n createPlatformPayPaymentMethod,\n createPlatformPayToken,\n updatePlatformPaySheet,\n openPlatformPaySetup,\n} from '../functions';\n\n/**\n * useStripe hook\n */\nexport function useStripe() {\n const [isApplePaySupported, setApplePaySupported] = useState<boolean | null>(\n null\n );\n\n useEffect(() => {\n async function checkApplePaySupport() {\n const isSupported =\n isiOS && (await NativeStripeSdk.isApplePaySupported());\n setApplePaySupported(isSupported);\n }\n\n checkApplePaySupport();\n }, []);\n\n const _createPaymentMethod = useCallback(\n async (\n data: PaymentMethod.CreateParams,\n options: PaymentMethod.CreateOptions = {}\n ): Promise<CreatePaymentMethodResult> => {\n return createPaymentMethod(data, options);\n },\n []\n );\n\n const _createToken = useCallback(\n async (params: Token.CreateParams): Promise<CreateTokenResult> => {\n return createToken(params);\n },\n []\n );\n\n const _retrievePaymentIntent = useCallback(\n async (clientSecret: string): Promise<RetrievePaymentIntentResult> => {\n return retrievePaymentIntent(clientSecret);\n },\n []\n );\n\n const _retrieveSetupIntent = useCallback(\n async (clientSecret: string): Promise<RetrieveSetupIntentResult> => {\n return retrieveSetupIntent(clientSecret);\n },\n []\n );\n\n const _confirmPayment = useCallback(\n async (\n paymentIntentClientSecret: string,\n data?: PaymentIntent.ConfirmParams,\n options: PaymentIntent.ConfirmOptions = {}\n ): Promise<ConfirmPaymentResult> => {\n return confirmPayment(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _presentApplePay = useCallback(\n async (params: ApplePay.PresentParams): Promise<ApplePayResult> => {\n return presentApplePay(params);\n },\n []\n );\n\n const _updateApplePaySummaryItems = useCallback(\n async (\n summaryItems: ApplePay.CartSummaryItem[],\n errorAddressFields: Array<{\n field: ApplePay.AddressFields;\n message?: string;\n }> = []\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return updateApplePaySummaryItems(summaryItems, errorAddressFields);\n },\n []\n );\n\n const _confirmApplePayPayment = useCallback(\n async (\n clientSecret: string\n ): Promise<{ error?: StripeError<ApplePayError> }> => {\n return confirmApplePayPayment(clientSecret);\n },\n []\n );\n\n const _handleNextAction = useCallback(\n async (\n paymentIntentClientSecret: string,\n returnURL?: string\n ): Promise<HandleNextActionResult> => {\n return handleNextAction(paymentIntentClientSecret, returnURL);\n },\n []\n );\n\n const _confirmSetupIntent = useCallback(\n async (\n paymentIntentClientSecret: string,\n data: SetupIntent.ConfirmParams,\n options: SetupIntent.ConfirmOptions = {}\n ): Promise<ConfirmSetupIntentResult> => {\n return confirmSetupIntent(paymentIntentClientSecret, data, options);\n },\n []\n );\n\n const _createTokenForCVCUpdate = useCallback(\n async (cvc: string): Promise<CreateTokenForCVCUpdateResult> => {\n return createTokenForCVCUpdate(cvc);\n },\n []\n );\n\n const _initPaymentSheet = useCallback(\n async (\n params: PaymentSheet.SetupParams\n ): Promise<InitPaymentSheetResult> => {\n return initPaymentSheet(params);\n },\n []\n );\n\n const _presentPaymentSheet = useCallback(\n async (\n options?: PaymentSheet.PresentOptions\n ): Promise<PresentPaymentSheetResult> => {\n return presentPaymentSheet(options);\n },\n []\n );\n\n const _confirmPaymentSheetPayment =\n useCallback(async (): Promise<ConfirmPaymentSheetPaymentResult> => {\n return confirmPaymentSheetPayment();\n }, []);\n\n const _handleURLCallback = useCallback(\n async (url: string): Promise<boolean> => {\n return handleURLCallback(url);\n },\n []\n );\n\n const _isGooglePaySupported = useCallback(\n async (params?: GooglePay.IsSupportedParams): Promise<boolean> => {\n return isGooglePaySupported(params);\n },\n []\n );\n\n const _initGooglePay = useCallback(\n async (params: GooglePay.InitParams): Promise<GooglePayInitResult> => {\n return initGooglePay(params);\n },\n []\n );\n\n const _presentGooglePay = useCallback(\n async (\n params: GooglePay.PresentParams\n ): Promise<PayWithGooglePayResult> => {\n return presentGooglePay(params);\n },\n []\n );\n\n const _createGooglePayPaymentMethod = useCallback(\n async (\n params: GooglePay.CreatePaymentMethodParams\n ): Promise<CreateGooglePayPaymentMethodResult> => {\n return createGooglePayPaymentMethod(params);\n },\n []\n );\n\n const _openApplePaySetup =\n useCallback(async (): Promise<OpenApplePaySetupResult> => {\n return openApplePaySetup();\n }, []);\n\n const _collectBankAccountForPayment = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForPaymentResult> => {\n return collectBankAccountForPayment(clientSecret, params);\n },\n []\n );\n\n const _collectBankAccountForSetup = useCallback(\n async (\n clientSecret: string,\n params: PaymentMethod.CollectBankAccountParams\n ): Promise<CollectBankAccountForSetupResult> => {\n return collectBankAccountForSetup(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForPayment = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForPaymentResult> => {\n return verifyMicrodepositsForPayment(clientSecret, params);\n },\n []\n );\n\n const _verifyMicrodepositsForSetup = useCallback(\n async (\n clientSecret: string,\n params: VerifyMicrodepositsParams\n ): Promise<VerifyMicrodepositsForSetupResult> => {\n return verifyMicrodepositsForSetup(clientSecret, params);\n },\n []\n );\n\n const _canAddCardToWallet = useCallback(\n async (\n params: CanAddCardToWalletParams\n ): Promise<CanAddCardToWalletResult> => {\n return canAddCardToWallet(params);\n },\n []\n );\n\n const _collectBankAccountToken = useCallback(\n async (clientSecret: string): Promise<FinancialConnections.TokenResult> => {\n return collectBankAccountToken(clientSecret);\n },\n []\n );\n\n const _collectFinancialConnectionsAccounts = useCallback(\n async (\n clientSecret: string\n ): Promise<FinancialConnections.SessionResult> => {\n return collectFinancialConnectionsAccounts(clientSecret);\n },\n []\n );\n\n const _resetPaymentSheetCustomer = useCallback(async (): Promise<null> => {\n return resetPaymentSheetCustomer();\n }, []);\n\n const _isPlatformPaySupported = useCallback(\n async (params?: {\n googlePay?: GooglePay.IsSupportedParams;\n }): Promise<boolean> => {\n return isPlatformPaySupported(params);\n },\n []\n );\n\n const _confirmPlatformPaySetupIntent = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmSetupIntentResult> => {\n return confirmPlatformPaySetupIntent(clientSecret, params);\n },\n []\n );\n\n const _confirmPlatformPayPayment = useCallback(\n async (\n clientSecret: string,\n params: PlatformPay.ConfirmParams\n ): Promise<PlatformPay.ConfirmPaymentResult> => {\n return confirmPlatformPayPayment(clientSecret, params);\n },\n []\n );\n\n const _dismissPlatformPay = useCallback(async (): Promise<boolean> => {\n return dismissPlatformPay();\n }, []);\n\n const _createPlatformPayPaymentMethod = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.PaymentMethodResult> => {\n return createPlatformPayPaymentMethod(params);\n },\n []\n );\n\n const _createPlatformPayToken = useCallback(\n async (\n params: PlatformPay.PaymentMethodParams\n ): Promise<PlatformPay.TokenResult> => {\n return createPlatformPayToken(params);\n },\n []\n );\n\n const _updatePlatformPaySheet = useCallback(\n async (params: {\n applePay: {\n cartItems: Array<PlatformPay.CartSummaryItem>;\n shippingMethods: Array<PlatformPay.ShippingMethod>;\n errors: Array<PlatformPay.ApplePaySheetError>;\n };\n }): Promise<{\n error?: StripeError<PlatformPayError>;\n }> => {\n return updatePlatformPaySheet(params);\n },\n []\n );\n\n const _openPlatformPaySetup = useCallback(async (): Promise<void> => {\n return openPlatformPaySetup();\n }, []);\n\n return {\n retrievePaymentIntent: _retrievePaymentIntent,\n retrieveSetupIntent: _retrieveSetupIntent,\n confirmPayment: _confirmPayment,\n createPaymentMethod: _createPaymentMethod,\n handleNextAction: _handleNextAction,\n isApplePaySupported: isApplePaySupported,\n presentApplePay: _presentApplePay,\n confirmApplePayPayment: _confirmApplePayPayment,\n confirmSetupIntent: _confirmSetupIntent,\n createTokenForCVCUpdate: _createTokenForCVCUpdate,\n updateApplePaySummaryItems: _updateApplePaySummaryItems,\n handleURLCallback: _handleURLCallback,\n confirmPaymentSheetPayment: _confirmPaymentSheetPayment,\n presentPaymentSheet: _presentPaymentSheet,\n initPaymentSheet: _initPaymentSheet,\n createToken: _createToken,\n isGooglePaySupported: _isGooglePaySupported,\n initGooglePay: _initGooglePay,\n presentGooglePay: _presentGooglePay,\n createGooglePayPaymentMethod: _createGooglePayPaymentMethod,\n openApplePaySetup: _openApplePaySetup,\n collectBankAccountForPayment: _collectBankAccountForPayment,\n collectBankAccountForSetup: _collectBankAccountForSetup,\n verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,\n verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,\n canAddCardToWallet: _canAddCardToWallet,\n collectBankAccountToken: _collectBankAccountToken,\n collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,\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: _resetPaymentSheetCustomer,\n isPlatformPaySupported: _isPlatformPaySupported,\n confirmPlatformPaySetupIntent: _confirmPlatformPaySetupIntent,\n confirmPlatformPayPayment: _confirmPlatformPayPayment,\n dismissPlatformPay: _dismissPlatformPay,\n createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,\n createPlatformPayToken: _createPlatformPayToken,\n updatePlatformPaySheet: _updatePlatformPaySheet,\n openPlatformPaySetup: _openPlatformPaySetup,\n };\n}\n"],"mappings":"sWAqCA,4BACA,mCACA,2EACA,uCA0CO,QAASA,UAAS,EAAG,CAC1B,cAAoD,GAAAC,eAAQ,EAC1D,IAAI,CACL,qDAFMC,mBAAmB,eAAEC,oBAAoB,eAIhD,GAAAC,gBAAS,EAAC,UAAM,SACCC,qBAAoB,6IAAnC,WAAsC,CACpC,GAAMC,YAAW,CACfC,cAAK,QAAWC,yBAAe,CAACN,mBAAmB,EAAE,CAAC,CACxDC,oBAAoB,CAACG,WAAW,CAAC,CACnC,CAAC,sDAEDD,oBAAoB,EAAE,CACxB,CAAC,CAAE,EAAE,CAAC,CAEN,GAAMI,qBAAoB,CAAG,GAAAC,kBAAW,qDACtC,UACEC,IAAgC,CAEO,IADvCC,QAAoC,2DAAG,CAAC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AAiB,CAAED,kBAAkB,CACrCG,4BAA4B,CAAED,6BAA6B,CAC3DG,0BAA0B,CAAED,2BAA2B,CACvDG,6BAA6B,CAAED,8BAA8B,CAC7DG,2BAA2B,CAAED,4BAA4B,CACzDG,kBAAkB,CAAED,mBAAmB,CACvCG,uBAAuB,CAAED,wBAAwB,CACjDG,mCAAmC,CAAED,oCAAoC,CAMzEG,yBAAyB,CAAED,0BAA0B,CACrDG,sBAAsB,CAAED,uBAAuB,CAC/CG,6BAA6B,CAAED,8BAA8B,CAC7DG,yBAAyB,CAAED,0BAA0B,CACrDG,kBAAkB,CAAED,mBAAmB,CACvCG,8BAA8B,CAAED,+BAA+B,CAC/DG,sBAAsB,CAAED,uBAAuB,CAC/CG,sBAAsB,CAAED,uBAAuB,CAC/CG,oBAAoB,CAAED,qBACxB,CAAC,CACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.VerifyMicrodepositsError=exports.RetrieveSetupIntentError=exports.RetrievePaymentIntentError=exports.PlatformPayError=exports.PaymentSheetError=exports.MissingRoutingNumber=exports.GooglePayError=exports.CreateTokenError=exports.CreatePaymentMethodError=exports.ConfirmSetupIntentError=exports.ConfirmPaymentError=exports.CollectBankAccountError=exports.CardActionError=exports.ApplePayError=exports.AddressSheetError=void 0;var ConfirmPaymentError;exports.ConfirmPaymentError=ConfirmPaymentError;(function(ConfirmPaymentError){ConfirmPaymentError["Canceled"]="Canceled";ConfirmPaymentError["Failed"]="Failed";ConfirmPaymentError["Unknown"]="Unknown";})(ConfirmPaymentError||(exports.ConfirmPaymentError=ConfirmPaymentError={}));var CardActionError;exports.CardActionError=CardActionError;(function(CardActionError){CardActionError["Canceled"]="Canceled";CardActionError["Failed"]="Failed";CardActionError["Unknown"]="Unknown";})(CardActionError||(exports.CardActionError=CardActionError={}));var ConfirmSetupIntentError;exports.ConfirmSetupIntentError=ConfirmSetupIntentError;(function(ConfirmSetupIntentError){ConfirmSetupIntentError["Canceled"]="Canceled";ConfirmSetupIntentError["Failed"]="Failed";ConfirmSetupIntentError["Unknown"]="Unknown";})(ConfirmSetupIntentError||(exports.ConfirmSetupIntentError=ConfirmSetupIntentError={}));var CreatePaymentMethodError;exports.CreatePaymentMethodError=CreatePaymentMethodError;(function(CreatePaymentMethodError){CreatePaymentMethodError["Failed"]="Failed";})(CreatePaymentMethodError||(exports.CreatePaymentMethodError=CreatePaymentMethodError={}));var CreateTokenError;exports.CreateTokenError=CreateTokenError;(function(CreateTokenError){CreateTokenError["Failed"]="Failed";})(CreateTokenError||(exports.CreateTokenError=CreateTokenError={}));var RetrievePaymentIntentError;exports.RetrievePaymentIntentError=RetrievePaymentIntentError;(function(RetrievePaymentIntentError){RetrievePaymentIntentError["Unknown"]="Unknown";})(RetrievePaymentIntentError||(exports.RetrievePaymentIntentError=RetrievePaymentIntentError={}));var RetrieveSetupIntentError;exports.RetrieveSetupIntentError=RetrieveSetupIntentError;(function(RetrieveSetupIntentError){RetrieveSetupIntentError["Unknown"]="Unknown";})(RetrieveSetupIntentError||(exports.RetrieveSetupIntentError=RetrieveSetupIntentError={}));var ApplePayError;exports.ApplePayError=ApplePayError;(function(ApplePayError){ApplePayError["Canceled"]="Canceled";ApplePayError["Failed"]="Failed";ApplePayError["Unknown"]="Unknown";})(ApplePayError||(exports.ApplePayError=ApplePayError={}));var PaymentSheetError;exports.PaymentSheetError=PaymentSheetError;(function(PaymentSheetError){PaymentSheetError["Failed"]="Failed";PaymentSheetError["Canceled"]="Canceled";})(PaymentSheetError||(exports.PaymentSheetError=PaymentSheetError={}));var GooglePayError;exports.GooglePayError=GooglePayError;(function(GooglePayError){GooglePayError["Failed"]="Failed";GooglePayError["Canceled"]="Canceled";GooglePayError["Unknown"]="Unknown";})(GooglePayError||(exports.GooglePayError=GooglePayError={}));var MissingRoutingNumber={code:CreateTokenError.Failed,message:'You must provide a routing number for US bank accounts. This should be the ACH routing number.'};exports.MissingRoutingNumber=MissingRoutingNumber;var VerifyMicrodepositsError;exports.VerifyMicrodepositsError=VerifyMicrodepositsError;(function(VerifyMicrodepositsError){VerifyMicrodepositsError["Canceled"]="Canceled";VerifyMicrodepositsError["Failed"]="Failed";VerifyMicrodepositsError["Unknown"]="Unknown";})(VerifyMicrodepositsError||(exports.VerifyMicrodepositsError=VerifyMicrodepositsError={}));var CollectBankAccountError;exports.CollectBankAccountError=CollectBankAccountError;(function(CollectBankAccountError){CollectBankAccountError["Canceled"]="Canceled";CollectBankAccountError["Failed"]="Failed";CollectBankAccountError["Unknown"]="Unknown";})(CollectBankAccountError||(exports.CollectBankAccountError=CollectBankAccountError={}));var AddressSheetError;exports.AddressSheetError=AddressSheetError;(function(AddressSheetError){AddressSheetError["Failed"]="Failed";AddressSheetError["Canceled"]="Canceled";})(AddressSheetError||(exports.AddressSheetError=AddressSheetError={}));var PlatformPayError;exports.PlatformPayError=PlatformPayError;(function(PlatformPayError){PlatformPayError["Canceled"]="Canceled";PlatformPayError["Failed"]="Failed";PlatformPayError["Unknown"]="Unknown";})(PlatformPayError||(exports.PlatformPayError=PlatformPayError={}));
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.VerifyMicrodepositsError=exports.RetrieveSetupIntentError=exports.RetrievePaymentIntentError=exports.PlatformPayError=exports.PaymentSheetError=exports.MissingRoutingNumber=exports.GooglePayError=exports.CreateTokenError=exports.CreatePaymentMethodError=exports.ConfirmSetupIntentError=exports.ConfirmPaymentError=exports.CollectBankAccountError=exports.CardActionError=exports.ApplePayError=exports.AddressSheetError=void 0;var ConfirmPaymentError;exports.ConfirmPaymentError=ConfirmPaymentError;(function(ConfirmPaymentError){ConfirmPaymentError["Canceled"]="Canceled";ConfirmPaymentError["Failed"]="Failed";ConfirmPaymentError["Unknown"]="Unknown";})(ConfirmPaymentError||(exports.ConfirmPaymentError=ConfirmPaymentError={}));var CardActionError;exports.CardActionError=CardActionError;(function(CardActionError){CardActionError["Canceled"]="Canceled";CardActionError["Failed"]="Failed";CardActionError["Unknown"]="Unknown";})(CardActionError||(exports.CardActionError=CardActionError={}));var ConfirmSetupIntentError;exports.ConfirmSetupIntentError=ConfirmSetupIntentError;(function(ConfirmSetupIntentError){ConfirmSetupIntentError["Canceled"]="Canceled";ConfirmSetupIntentError["Failed"]="Failed";ConfirmSetupIntentError["Unknown"]="Unknown";})(ConfirmSetupIntentError||(exports.ConfirmSetupIntentError=ConfirmSetupIntentError={}));var CreatePaymentMethodError;exports.CreatePaymentMethodError=CreatePaymentMethodError;(function(CreatePaymentMethodError){CreatePaymentMethodError["Failed"]="Failed";})(CreatePaymentMethodError||(exports.CreatePaymentMethodError=CreatePaymentMethodError={}));var CreateTokenError;exports.CreateTokenError=CreateTokenError;(function(CreateTokenError){CreateTokenError["Failed"]="Failed";})(CreateTokenError||(exports.CreateTokenError=CreateTokenError={}));var RetrievePaymentIntentError;exports.RetrievePaymentIntentError=RetrievePaymentIntentError;(function(RetrievePaymentIntentError){RetrievePaymentIntentError["Unknown"]="Unknown";})(RetrievePaymentIntentError||(exports.RetrievePaymentIntentError=RetrievePaymentIntentError={}));var RetrieveSetupIntentError;exports.RetrieveSetupIntentError=RetrieveSetupIntentError;(function(RetrieveSetupIntentError){RetrieveSetupIntentError["Unknown"]="Unknown";})(RetrieveSetupIntentError||(exports.RetrieveSetupIntentError=RetrieveSetupIntentError={}));var ApplePayError;exports.ApplePayError=ApplePayError;(function(ApplePayError){ApplePayError["Canceled"]="Canceled";ApplePayError["Failed"]="Failed";ApplePayError["Unknown"]="Unknown";})(ApplePayError||(exports.ApplePayError=ApplePayError={}));var PaymentSheetError;exports.PaymentSheetError=PaymentSheetError;(function(PaymentSheetError){PaymentSheetError["Failed"]="Failed";PaymentSheetError["Canceled"]="Canceled";PaymentSheetError["Timeout"]="Timeout";})(PaymentSheetError||(exports.PaymentSheetError=PaymentSheetError={}));var GooglePayError;exports.GooglePayError=GooglePayError;(function(GooglePayError){GooglePayError["Failed"]="Failed";GooglePayError["Canceled"]="Canceled";GooglePayError["Unknown"]="Unknown";})(GooglePayError||(exports.GooglePayError=GooglePayError={}));var MissingRoutingNumber={code:CreateTokenError.Failed,message:'You must provide a routing number for US bank accounts. This should be the ACH routing number.'};exports.MissingRoutingNumber=MissingRoutingNumber;var VerifyMicrodepositsError;exports.VerifyMicrodepositsError=VerifyMicrodepositsError;(function(VerifyMicrodepositsError){VerifyMicrodepositsError["Canceled"]="Canceled";VerifyMicrodepositsError["Failed"]="Failed";VerifyMicrodepositsError["Unknown"]="Unknown";})(VerifyMicrodepositsError||(exports.VerifyMicrodepositsError=VerifyMicrodepositsError={}));var CollectBankAccountError;exports.CollectBankAccountError=CollectBankAccountError;(function(CollectBankAccountError){CollectBankAccountError["Canceled"]="Canceled";CollectBankAccountError["Failed"]="Failed";CollectBankAccountError["Unknown"]="Unknown";})(CollectBankAccountError||(exports.CollectBankAccountError=CollectBankAccountError={}));var AddressSheetError;exports.AddressSheetError=AddressSheetError;(function(AddressSheetError){AddressSheetError["Failed"]="Failed";AddressSheetError["Canceled"]="Canceled";})(AddressSheetError||(exports.AddressSheetError=AddressSheetError={}));var PlatformPayError;exports.PlatformPayError=PlatformPayError;(function(PlatformPayError){PlatformPayError["Canceled"]="Canceled";PlatformPayError["Failed"]="Failed";PlatformPayError["Unknown"]="Unknown";})(PlatformPayError||(exports.PlatformPayError=PlatformPayError={}));
|
|
2
2
|
//# sourceMappingURL=Errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ConfirmPaymentError","CardActionError","ConfirmSetupIntentError","CreatePaymentMethodError","CreateTokenError","RetrievePaymentIntentError","RetrieveSetupIntentError","ApplePayError","PaymentSheetError","GooglePayError","MissingRoutingNumber","code","Failed","message","VerifyMicrodepositsError","CollectBankAccountError","AddressSheetError","PlatformPayError"],"sources":["Errors.ts"],"sourcesContent":["export enum ConfirmPaymentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CardActionError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum ConfirmSetupIntentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CreatePaymentMethodError {\n Failed = 'Failed',\n}\n\nexport enum CreateTokenError {\n Failed = 'Failed',\n}\n\nexport enum RetrievePaymentIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum RetrieveSetupIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum ApplePayError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum PaymentSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n\nexport type ErrorType =\n | 'api_connection_error'\n | 'api_error'\n | 'authentication_error'\n | 'card_error'\n | 'idempotency_error'\n | 'invalid_request_error'\n | 'rate_limit_error';\n\nexport interface StripeError<T> {\n code: T;\n message: string;\n localizedMessage?: string;\n declineCode?: string;\n stripeErrorCode?: string;\n type?: ErrorType;\n}\n\nexport enum GooglePayError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n Unknown = 'Unknown',\n}\n\nexport const MissingRoutingNumber = {\n code: CreateTokenError.Failed,\n message:\n 'You must provide a routing number for US bank accounts. This should be the ACH routing number.',\n};\n\nexport enum VerifyMicrodepositsError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CollectBankAccountError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum AddressSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n\nexport enum PlatformPayError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n"],"mappings":"6eAAYA,oBAAmB,2DAAnBA,mBAAmB,EAAnBA,mBAAmB,wBAAnBA,mBAAmB,oBAAnBA,mBAAmB,yBAAnBA,mBAAmB,+BAAnBA,mBAAmB,SAMnBC,gBAAe,mDAAfA,eAAe,EAAfA,eAAe,wBAAfA,eAAe,oBAAfA,eAAe,yBAAfA,eAAe,2BAAfA,eAAe,SAMfC,wBAAuB,mEAAvBA,uBAAuB,EAAvBA,uBAAuB,wBAAvBA,uBAAuB,oBAAvBA,uBAAuB,yBAAvBA,uBAAuB,mCAAvBA,uBAAuB,SAMvBC,yBAAwB,qEAAxBA,wBAAwB,EAAxBA,wBAAwB,uBAAxBA,wBAAwB,oCAAxBA,wBAAwB,SAIxBC,iBAAgB,qDAAhBA,gBAAgB,EAAhBA,gBAAgB,uBAAhBA,gBAAgB,4BAAhBA,gBAAgB,SAIhBC,2BAA0B,yEAA1BA,0BAA0B,EAA1BA,0BAA0B,yBAA1BA,0BAA0B,sCAA1BA,0BAA0B,SAI1BC,yBAAwB,qEAAxBA,wBAAwB,EAAxBA,wBAAwB,yBAAxBA,wBAAwB,oCAAxBA,wBAAwB,SAIxBC,cAAa,+CAAbA,aAAa,EAAbA,aAAa,wBAAbA,aAAa,oBAAbA,aAAa,yBAAbA,aAAa,yBAAbA,aAAa,SAMbC,kBAAiB,uDAAjBA,iBAAiB,EAAjBA,iBAAiB,oBAAjBA,iBAAiB,
|
|
1
|
+
{"version":3,"names":["ConfirmPaymentError","CardActionError","ConfirmSetupIntentError","CreatePaymentMethodError","CreateTokenError","RetrievePaymentIntentError","RetrieveSetupIntentError","ApplePayError","PaymentSheetError","GooglePayError","MissingRoutingNumber","code","Failed","message","VerifyMicrodepositsError","CollectBankAccountError","AddressSheetError","PlatformPayError"],"sources":["Errors.ts"],"sourcesContent":["export enum ConfirmPaymentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CardActionError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum ConfirmSetupIntentError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CreatePaymentMethodError {\n Failed = 'Failed',\n}\n\nexport enum CreateTokenError {\n Failed = 'Failed',\n}\n\nexport enum RetrievePaymentIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum RetrieveSetupIntentError {\n Unknown = 'Unknown',\n}\n\nexport enum ApplePayError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum PaymentSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n Timeout = 'Timeout',\n}\n\nexport type ErrorType =\n | 'api_connection_error'\n | 'api_error'\n | 'authentication_error'\n | 'card_error'\n | 'idempotency_error'\n | 'invalid_request_error'\n | 'rate_limit_error';\n\nexport interface StripeError<T> {\n code: T;\n message: string;\n localizedMessage?: string;\n declineCode?: string;\n stripeErrorCode?: string;\n type?: ErrorType;\n}\n\nexport enum GooglePayError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n Unknown = 'Unknown',\n}\n\nexport const MissingRoutingNumber = {\n code: CreateTokenError.Failed,\n message:\n 'You must provide a routing number for US bank accounts. This should be the ACH routing number.',\n};\n\nexport enum VerifyMicrodepositsError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum CollectBankAccountError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n\nexport enum AddressSheetError {\n Failed = 'Failed',\n Canceled = 'Canceled',\n}\n\nexport enum PlatformPayError {\n Canceled = 'Canceled',\n Failed = 'Failed',\n Unknown = 'Unknown',\n}\n"],"mappings":"6eAAYA,oBAAmB,2DAAnBA,mBAAmB,EAAnBA,mBAAmB,wBAAnBA,mBAAmB,oBAAnBA,mBAAmB,yBAAnBA,mBAAmB,+BAAnBA,mBAAmB,SAMnBC,gBAAe,mDAAfA,eAAe,EAAfA,eAAe,wBAAfA,eAAe,oBAAfA,eAAe,yBAAfA,eAAe,2BAAfA,eAAe,SAMfC,wBAAuB,mEAAvBA,uBAAuB,EAAvBA,uBAAuB,wBAAvBA,uBAAuB,oBAAvBA,uBAAuB,yBAAvBA,uBAAuB,mCAAvBA,uBAAuB,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