@stripe/stripe-react-native 0.21.0 → 0.22.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 +18 -1
- package/android/build.gradle +1 -0
- package/android/proguard-rules.txt +7 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +4 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +5 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +46 -8
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +132 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +144 -0
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +123 -8
- package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +5 -0
- package/android/src/main/res/drawable/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/googlepay_button_background_shape.xml +11 -0
- package/android/src/main/res/drawable/googlepay_mark_background.xml +12 -0
- package/android/src/main/res/drawable/googlepay_mark_content.xml +27 -0
- package/android/src/main/res/drawable/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-ar/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-bg/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-ca/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-cs/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-da/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-de/book_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/buy_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/checkout_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/donate_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/order_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-de/subscribe_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-el/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-el/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-et/book_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/buy_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/checkout_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/donate_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/order_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/pay_with_googlepay_button_content.xml +8 -8
- package/android/src/main/res/drawable-et/subscribe_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/book_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/buy_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/checkout_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/donate_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/order_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/pay_with_googlepay_button_content.xml +8 -8
- package/android/src/main/res/drawable-fi/subscribe_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/pay_with_googlepay_button_content.xml +5 -5
- package/android/src/main/res/drawable-fr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-hr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-id/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-it/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/pay_with_googlepay_button_content.xml +5 -5
- package/android/src/main/res/drawable-ja/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-ko/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-ms/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-nl/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-no/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-pl/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-ru/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-sk/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-sl/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-sr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-sv/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-th/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-tr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/pay_with_googlepay_button_content.xml +5 -5
- package/android/src/main/res/drawable-uk/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/layout/book_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/buy_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/checkout_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/donate_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/googlepay_mark_button.xml +18 -0
- package/android/src/main/res/layout/order_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/pay_with_googlepay_button.xml +10 -24
- package/android/src/main/res/layout/plain_googlepay_button.xml +17 -0
- package/android/src/main/res/layout/subscribe_with_googlepay_button.xml +20 -0
- package/android/src/main/res/values/googlepay_strings.xml +3 -2
- package/ios/ApplePayButtonManager.m +5 -0
- package/ios/ApplePayButtonManager.swift +3 -1
- package/ios/ApplePayButtonView.swift +21 -0
- package/ios/ApplePayUtils.swift +187 -0
- package/ios/ApplePayViewController.swift +279 -0
- package/ios/PaymentPassFinder.swift +61 -0
- package/ios/PushProvisioning/AddToWalletButtonView.swift +10 -10
- package/ios/PushProvisioning/PushProvisioningUtils.swift +39 -16
- package/ios/StripeSdk.m +29 -0
- package/ios/StripeSdk.swift +193 -129
- package/ios/Tests/AddressSheetUtilsTests.swift +1 -7
- package/ios/Tests/PushProvisioningTests.swift +14 -11
- package/jest/mock.js +44 -0
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +2 -0
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -0
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/usePlatformPay.js +2 -0
- package/lib/commonjs/hooks/usePlatformPay.js.map +1 -0
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.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/PlatformPay.js +2 -0
- package/lib/commonjs/types/PlatformPay.js.map +1 -0
- package/lib/commonjs/types/PushProvisioning.js +2 -0
- package/lib/commonjs/types/PushProvisioning.js.map +1 -0
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +2 -0
- package/lib/module/components/PlatformPayButton.js.map +1 -0
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/usePlatformPay.js +2 -0
- package/lib/module/hooks/usePlatformPay.js.map +1 -0
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.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/PlatformPay.js +2 -0
- package/lib/module/types/PlatformPay.js.map +1 -0
- package/lib/module/types/PushProvisioning.js +2 -0
- package/lib/module/types/PushProvisioning.js.map +1 -0
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +8 -1
- package/lib/typescript/src/components/PlatformPayButton.d.ts +65 -0
- package/lib/typescript/src/functions.d.ts +73 -1
- package/lib/typescript/src/hooks/usePlatformPay.d.ts +70 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +18 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/types/ApplePay.d.ts +9 -0
- package/lib/typescript/src/types/Errors.d.ts +6 -1
- package/lib/typescript/src/types/GooglePay.d.ts +2 -1
- package/lib/typescript/src/types/PlatformPay.d.ts +285 -0
- package/lib/typescript/src/types/PushProvisioning.d.ts +66 -0
- package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +2 -2
- package/lib/typescript/src/types/index.d.ts +3 -38
- package/package.json +8 -1
- package/src/NativeStripeSdk.tsx +20 -0
- package/src/components/PlatformPayButton.tsx +157 -0
- package/src/functions.ts +181 -0
- package/src/hooks/usePlatformPay.tsx +174 -0
- package/src/hooks/useStripe.tsx +77 -0
- package/src/index.tsx +6 -0
- package/src/types/ApplePay.ts +9 -0
- package/src/types/Errors.ts +7 -1
- package/src/types/GooglePay.ts +2 -1
- package/src/types/PlatformPay.ts +326 -0
- package/src/types/PushProvisioning.ts +76 -0
- package/src/types/components/ApplePayButtonComponent.ts +3 -2
- package/src/types/index.ts +3 -54
- package/android/src/main/res/drawable/googlepay_button_background.xml +0 -6
- package/android/src/main/res/drawable/googlepay_button_content.xml +0 -48
- package/android/src/main/res/drawable/googlepay_button_overlay.xml +0 -12
- package/android/src/main/res/drawable-af/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-am/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-as/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-az/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-be/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bn/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bs/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cy/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rau/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rca/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rgb/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rin/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-es/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-es-res/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-eu/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fa/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fil/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr-rca/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ga/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-gl/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-gu/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-hu/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-hy/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-is/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-iw/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ka/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-kk/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-km/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-kn/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ky/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-lo/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-lt/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-lv/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-mdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-mk/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ml/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-mn/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-mr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ne/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pt-rbr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pt-rpt/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ro/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sq/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sw/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ta/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-te/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ur/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uz/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-v21/googlepay_button_background.xml +0 -7
- package/android/src/main/res/drawable-vi/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-xhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-zh-rcn/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-zh-rhk/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-zh-rtw/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-zu/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/layout/googlepay_button.xml +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts","resetPaymentSheetCustomer"],"mappings":"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","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} 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} 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 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 };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["useStripe.tsx"],"names":["useStripe","isApplePaySupported","setApplePaySupported","checkApplePaySupport","isSupported","isiOS","NativeStripeSdk","_createPaymentMethod","data","options","_createToken","params","_retrievePaymentIntent","clientSecret","_retrieveSetupIntent","_confirmPayment","paymentIntentClientSecret","_presentApplePay","_updateApplePaySummaryItems","summaryItems","errorAddressFields","_confirmApplePayPayment","_handleNextAction","returnURL","_confirmSetupIntent","_createTokenForCVCUpdate","cvc","_initPaymentSheet","_presentPaymentSheet","_confirmPaymentSheetPayment","_handleURLCallback","url","_isGooglePaySupported","_initGooglePay","_presentGooglePay","_createGooglePayPaymentMethod","_openApplePaySetup","_collectBankAccountForPayment","_collectBankAccountForSetup","_verifyMicrodepositsForPayment","_verifyMicrodepositsForSetup","_canAddCardToWallet","_collectBankAccountToken","_collectFinancialConnectionsAccounts","_resetPaymentSheetCustomer","_isPlatformPaySupported","_confirmPlatformPaySetupIntent","_confirmPlatformPayPayment","_dismissPlatformPay","_createPlatformPayPaymentMethod","_updatePlatformPaySheet","_openPlatformPaySetup","retrievePaymentIntent","retrieveSetupIntent","confirmPayment","createPaymentMethod","handleNextAction","presentApplePay","confirmApplePayPayment","confirmSetupIntent","createTokenForCVCUpdate","updateApplePaySummaryItems","handleURLCallback","confirmPaymentSheetPayment","presentPaymentSheet","initPaymentSheet","createToken","isGooglePaySupported","initGooglePay","presentGooglePay","createGooglePayPaymentMethod","openApplePaySetup","collectBankAccountForPayment","collectBankAccountForSetup","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","canAddCardToWallet","collectBankAccountToken","collectFinancialConnectionsAccounts","resetPaymentSheetCustomer","isPlatformPaySupported","confirmPlatformPaySetupIntent","confirmPlatformPayPayment","dismissPlatformPay","createPlatformPayPaymentMethod","updatePlatformPaySheet","openPlatformPaySetup"],"mappings":"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","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 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 _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 updatePlatformPaySheet: _updatePlatformPaySheet,\n openPlatformPaySetup: _openPlatformPaySetup,\n };\n}\n"]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={useConfirmPayment:true,useConfirmSetupIntent:true,useStripe:true,useApplePay:true,UseApplePayProps:true,usePaymentSheet:true,useGooglePay:true,useFinancialConnectionsSheet:true,initStripe:true,StripeProvider:true,StripeProviderProps:true,CardField:true,CardFieldProps:true,CardForm:true,CardFormProps:true,ApplePayButton:true,ApplePayButtonProps:true,AuBECSDebitForm:true,AuBECSDebitFormProps:true,StripeContainer:true,StripeContainerProps:true,GooglePayButton:true,GooglePayButtonProps:true,AddToWalletButton:true,AddToWalletButtonProps:true,AddressSheet:true,AddressSheetProps:true};Object.defineProperty(exports,"AddToWalletButton",{enumerable:true,get:function get(){return _AddToWalletButton.AddToWalletButton;}});Object.defineProperty(exports,"AddToWalletButtonProps",{enumerable:true,get:function get(){return _AddToWalletButton.Props;}});Object.defineProperty(exports,"AddressSheet",{enumerable:true,get:function get(){return _AddressSheet.AddressSheet;}});Object.defineProperty(exports,"AddressSheetProps",{enumerable:true,get:function get(){return _AddressSheet.Props;}});Object.defineProperty(exports,"ApplePayButton",{enumerable:true,get:function get(){return _ApplePayButton.ApplePayButton;}});Object.defineProperty(exports,"ApplePayButtonProps",{enumerable:true,get:function get(){return _ApplePayButton.Props;}});Object.defineProperty(exports,"AuBECSDebitForm",{enumerable:true,get:function get(){return _AuBECSDebitForm.AuBECSDebitForm;}});Object.defineProperty(exports,"AuBECSDebitFormProps",{enumerable:true,get:function get(){return _AuBECSDebitForm.Props;}});Object.defineProperty(exports,"CardField",{enumerable:true,get:function get(){return _CardField.CardField;}});Object.defineProperty(exports,"CardFieldProps",{enumerable:true,get:function get(){return _CardField.Props;}});Object.defineProperty(exports,"CardForm",{enumerable:true,get:function get(){return _CardForm.CardForm;}});Object.defineProperty(exports,"CardFormProps",{enumerable:true,get:function get(){return _CardForm.Props;}});Object.defineProperty(exports,"GooglePayButton",{enumerable:true,get:function get(){return _GooglePayButton.GooglePayButton;}});Object.defineProperty(exports,"GooglePayButtonProps",{enumerable:true,get:function get(){return _GooglePayButton.Props;}});Object.defineProperty(exports,"StripeContainer",{enumerable:true,get:function get(){return _StripeContainer.StripeContainer;}});Object.defineProperty(exports,"StripeContainerProps",{enumerable:true,get:function get(){return _StripeContainer.Props;}});Object.defineProperty(exports,"StripeProvider",{enumerable:true,get:function get(){return _StripeProvider.StripeProvider;}});Object.defineProperty(exports,"StripeProviderProps",{enumerable:true,get:function get(){return _StripeProvider.Props;}});Object.defineProperty(exports,"UseApplePayProps",{enumerable:true,get:function get(){return _useApplePay.Props;}});Object.defineProperty(exports,"initStripe",{enumerable:true,get:function get(){return _StripeProvider.initStripe;}});Object.defineProperty(exports,"useApplePay",{enumerable:true,get:function get(){return _useApplePay.useApplePay;}});Object.defineProperty(exports,"useConfirmPayment",{enumerable:true,get:function get(){return _useConfirmPayment.useConfirmPayment;}});Object.defineProperty(exports,"useConfirmSetupIntent",{enumerable:true,get:function get(){return _useConfirmSetupIntent.useConfirmSetupIntent;}});Object.defineProperty(exports,"useFinancialConnectionsSheet",{enumerable:true,get:function get(){return _useFinancialConnectionsSheet.useFinancialConnectionsSheet;}});Object.defineProperty(exports,"useGooglePay",{enumerable:true,get:function get(){return _useGooglePay.useGooglePay;}});Object.defineProperty(exports,"usePaymentSheet",{enumerable:true,get:function get(){return _usePaymentSheet.usePaymentSheet;}});Object.defineProperty(exports,"useStripe",{enumerable:true,get:function get(){return _useStripe.useStripe;}});var _useConfirmPayment=require("./hooks/useConfirmPayment");var _useConfirmSetupIntent=require("./hooks/useConfirmSetupIntent");var _useStripe=require("./hooks/useStripe");var _useApplePay=require("./hooks/useApplePay");var _usePaymentSheet=require("./hooks/usePaymentSheet");var _useGooglePay=require("./hooks/useGooglePay");var _useFinancialConnectionsSheet=require("./hooks/useFinancialConnectionsSheet");var _StripeProvider=require("./components/StripeProvider");var _CardField=require("./components/CardField");var _CardForm=require("./components/CardForm");var _ApplePayButton=require("./components/ApplePayButton");var _AuBECSDebitForm=require("./components/AuBECSDebitForm");var _StripeContainer=require("./components/StripeContainer");var _GooglePayButton=require("./components/GooglePayButton");var _AddToWalletButton=require("./components/AddToWalletButton");var _AddressSheet=require("./components/AddressSheet");var _functions=require("./functions");Object.keys(_functions).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_functions[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _functions[key];}});});var _index=require("./types/index");Object.keys(_index).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_index[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _index[key];}});});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={useConfirmPayment:true,useConfirmSetupIntent:true,useStripe:true,usePlatformPay:true,useApplePay:true,UseApplePayProps:true,usePaymentSheet:true,useGooglePay:true,useFinancialConnectionsSheet:true,initStripe:true,StripeProvider:true,StripeProviderProps:true,CardField:true,CardFieldProps:true,CardForm:true,CardFormProps:true,ApplePayButton:true,ApplePayButtonProps:true,AuBECSDebitForm:true,AuBECSDebitFormProps:true,StripeContainer:true,StripeContainerProps:true,GooglePayButton:true,GooglePayButtonProps:true,AddToWalletButton:true,AddToWalletButtonProps:true,AddressSheet:true,AddressSheetProps:true,PlatformPayButton:true,PlatformPayButtonProps:true};Object.defineProperty(exports,"AddToWalletButton",{enumerable:true,get:function get(){return _AddToWalletButton.AddToWalletButton;}});Object.defineProperty(exports,"AddToWalletButtonProps",{enumerable:true,get:function get(){return _AddToWalletButton.Props;}});Object.defineProperty(exports,"AddressSheet",{enumerable:true,get:function get(){return _AddressSheet.AddressSheet;}});Object.defineProperty(exports,"AddressSheetProps",{enumerable:true,get:function get(){return _AddressSheet.Props;}});Object.defineProperty(exports,"ApplePayButton",{enumerable:true,get:function get(){return _ApplePayButton.ApplePayButton;}});Object.defineProperty(exports,"ApplePayButtonProps",{enumerable:true,get:function get(){return _ApplePayButton.Props;}});Object.defineProperty(exports,"AuBECSDebitForm",{enumerable:true,get:function get(){return _AuBECSDebitForm.AuBECSDebitForm;}});Object.defineProperty(exports,"AuBECSDebitFormProps",{enumerable:true,get:function get(){return _AuBECSDebitForm.Props;}});Object.defineProperty(exports,"CardField",{enumerable:true,get:function get(){return _CardField.CardField;}});Object.defineProperty(exports,"CardFieldProps",{enumerable:true,get:function get(){return _CardField.Props;}});Object.defineProperty(exports,"CardForm",{enumerable:true,get:function get(){return _CardForm.CardForm;}});Object.defineProperty(exports,"CardFormProps",{enumerable:true,get:function get(){return _CardForm.Props;}});Object.defineProperty(exports,"GooglePayButton",{enumerable:true,get:function get(){return _GooglePayButton.GooglePayButton;}});Object.defineProperty(exports,"GooglePayButtonProps",{enumerable:true,get:function get(){return _GooglePayButton.Props;}});Object.defineProperty(exports,"PlatformPayButton",{enumerable:true,get:function get(){return _PlatformPayButton.PlatformPayButton;}});Object.defineProperty(exports,"PlatformPayButtonProps",{enumerable:true,get:function get(){return _PlatformPayButton.Props;}});Object.defineProperty(exports,"StripeContainer",{enumerable:true,get:function get(){return _StripeContainer.StripeContainer;}});Object.defineProperty(exports,"StripeContainerProps",{enumerable:true,get:function get(){return _StripeContainer.Props;}});Object.defineProperty(exports,"StripeProvider",{enumerable:true,get:function get(){return _StripeProvider.StripeProvider;}});Object.defineProperty(exports,"StripeProviderProps",{enumerable:true,get:function get(){return _StripeProvider.Props;}});Object.defineProperty(exports,"UseApplePayProps",{enumerable:true,get:function get(){return _useApplePay.Props;}});Object.defineProperty(exports,"initStripe",{enumerable:true,get:function get(){return _StripeProvider.initStripe;}});Object.defineProperty(exports,"useApplePay",{enumerable:true,get:function get(){return _useApplePay.useApplePay;}});Object.defineProperty(exports,"useConfirmPayment",{enumerable:true,get:function get(){return _useConfirmPayment.useConfirmPayment;}});Object.defineProperty(exports,"useConfirmSetupIntent",{enumerable:true,get:function get(){return _useConfirmSetupIntent.useConfirmSetupIntent;}});Object.defineProperty(exports,"useFinancialConnectionsSheet",{enumerable:true,get:function get(){return _useFinancialConnectionsSheet.useFinancialConnectionsSheet;}});Object.defineProperty(exports,"useGooglePay",{enumerable:true,get:function get(){return _useGooglePay.useGooglePay;}});Object.defineProperty(exports,"usePaymentSheet",{enumerable:true,get:function get(){return _usePaymentSheet.usePaymentSheet;}});Object.defineProperty(exports,"usePlatformPay",{enumerable:true,get:function get(){return _usePlatformPay.usePlatformPay;}});Object.defineProperty(exports,"useStripe",{enumerable:true,get:function get(){return _useStripe.useStripe;}});var _useConfirmPayment=require("./hooks/useConfirmPayment");var _useConfirmSetupIntent=require("./hooks/useConfirmSetupIntent");var _useStripe=require("./hooks/useStripe");var _usePlatformPay=require("./hooks/usePlatformPay");var _useApplePay=require("./hooks/useApplePay");var _usePaymentSheet=require("./hooks/usePaymentSheet");var _useGooglePay=require("./hooks/useGooglePay");var _useFinancialConnectionsSheet=require("./hooks/useFinancialConnectionsSheet");var _StripeProvider=require("./components/StripeProvider");var _CardField=require("./components/CardField");var _CardForm=require("./components/CardForm");var _ApplePayButton=require("./components/ApplePayButton");var _AuBECSDebitForm=require("./components/AuBECSDebitForm");var _StripeContainer=require("./components/StripeContainer");var _GooglePayButton=require("./components/GooglePayButton");var _AddToWalletButton=require("./components/AddToWalletButton");var _AddressSheet=require("./components/AddressSheet");var _PlatformPayButton=require("./components/PlatformPayButton");var _functions=require("./functions");Object.keys(_functions).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_functions[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _functions[key];}});});var _index=require("./types/index");Object.keys(_index).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_index[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _index[key];}});});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.tsx"],"names":[],"mappings":"g2IACA,4DACA,oEACA,4CACA,sDACA,gDACA,wDACA,kDACA,kFAGA,2DAKA,iDACA,+CACA,2DAIA,6DAIA,6DAIA,6DAIA,iEAIA,uDAIA,iEAKA,gWAEA","sourcesContent":["// hooks\nexport { useConfirmPayment } from './hooks/useConfirmPayment';\nexport { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';\nexport { useStripe } from './hooks/useStripe';\nexport { usePlatformPay } from './hooks/usePlatformPay';\nexport { useApplePay, Props as UseApplePayProps } from './hooks/useApplePay';\nexport { usePaymentSheet } from './hooks/usePaymentSheet';\nexport { useGooglePay } from './hooks/useGooglePay';\nexport { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';\n\n//components\nexport {\n initStripe,\n StripeProvider,\n Props as StripeProviderProps,\n} from './components/StripeProvider';\nexport { CardField, Props as CardFieldProps } from './components/CardField';\nexport { CardForm, Props as CardFormProps } from './components/CardForm';\nexport {\n ApplePayButton,\n Props as ApplePayButtonProps,\n} from './components/ApplePayButton';\nexport {\n AuBECSDebitForm,\n Props as AuBECSDebitFormProps,\n} from './components/AuBECSDebitForm';\nexport {\n StripeContainer,\n Props as StripeContainerProps,\n} from './components/StripeContainer';\nexport {\n GooglePayButton,\n Props as GooglePayButtonProps,\n} from './components/GooglePayButton';\nexport {\n AddToWalletButton,\n Props as AddToWalletButtonProps,\n} from './components/AddToWalletButton';\nexport {\n AddressSheet,\n Props as AddressSheetProps,\n} from './components/AddressSheet';\nexport {\n PlatformPayButton,\n Props as PlatformPayButtonProps,\n} from './components/PlatformPayButton';\n\nexport * from './functions';\n\nexport * from './types/index';\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.VerifyMicrodepositsError=exports.RetrieveSetupIntentError=exports.RetrievePaymentIntentError=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={}));
|
|
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={}));
|
|
2
2
|
//# sourceMappingURL=Errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Errors.ts"],"names":["ConfirmPaymentError","CardActionError","ConfirmSetupIntentError","CreatePaymentMethodError","CreateTokenError","RetrievePaymentIntentError","RetrieveSetupIntentError","ApplePayError","PaymentSheetError","GooglePayError","MissingRoutingNumber","code","Failed","message","VerifyMicrodepositsError","CollectBankAccountError","AddressSheetError"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["Errors.ts"],"names":["ConfirmPaymentError","CardActionError","ConfirmSetupIntentError","CreatePaymentMethodError","CreateTokenError","RetrievePaymentIntentError","RetrieveSetupIntentError","ApplePayError","PaymentSheetError","GooglePayError","MissingRoutingNumber","code","Failed","message","VerifyMicrodepositsError","CollectBankAccountError","AddressSheetError","PlatformPayError"],"mappings":"6eAAYA,CAAAA,mB,2DAAAA,mB,EAAAA,mB,wBAAAA,mB,oBAAAA,mB,yBAAAA,mB,+BAAAA,mB,SAMAC,CAAAA,e,mDAAAA,e,EAAAA,e,wBAAAA,e,oBAAAA,e,yBAAAA,e,2BAAAA,e,SAMAC,CAAAA,uB,mEAAAA,uB,EAAAA,uB,wBAAAA,uB,oBAAAA,uB,yBAAAA,uB,mCAAAA,uB,SAMAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,uBAAAA,wB,oCAAAA,wB,SAIAC,CAAAA,gB,qDAAAA,gB,EAAAA,gB,uBAAAA,gB,4BAAAA,gB,SAIAC,CAAAA,0B,yEAAAA,0B,EAAAA,0B,yBAAAA,0B,sCAAAA,0B,SAIAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,yBAAAA,wB,oCAAAA,wB,SAIAC,CAAAA,a,+CAAAA,a,EAAAA,a,wBAAAA,a,oBAAAA,a,yBAAAA,a,yBAAAA,a,SAMAC,CAAAA,iB,uDAAAA,iB,EAAAA,iB,oBAAAA,iB,2BAAAA,iB,6BAAAA,iB,SAuBAC,CAAAA,c,iDAAAA,c,EAAAA,c,oBAAAA,c,wBAAAA,c,yBAAAA,c,0BAAAA,c,MAML,GAAMC,CAAAA,oBAAoB,CAAG,CAClCC,IAAI,CAAEP,gBAAgB,CAACQ,MADW,CAElCC,OAAO,CACL,gGAHgC,CAA7B,C,qDAMKC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,wBAAAA,wB,oBAAAA,wB,yBAAAA,wB,oCAAAA,wB,SAMAC,CAAAA,uB,mEAAAA,uB,EAAAA,uB,wBAAAA,uB,oBAAAA,uB,yBAAAA,uB,mCAAAA,uB,SAMAC,CAAAA,iB,uDAAAA,iB,EAAAA,iB,oBAAAA,iB,2BAAAA,iB,6BAAAA,iB,SAKAC,CAAAA,gB,qDAAAA,gB,EAAAA,gB,wBAAAA,gB,oBAAAA,gB,yBAAAA,gB,4BAAAA,gB","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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.PaymentType=exports.InvalidShippingField=exports.IntervalUnit=exports.ContactField=exports.ButtonType=exports.ButtonStyle=exports.BillingAddressFormat=exports.ApplePayShippingType=exports.ApplePaySheetErrorType=exports.ApplePayMerchantCapability=void 0;var ApplePaySheetErrorType;exports.ApplePaySheetErrorType=ApplePaySheetErrorType;(function(ApplePaySheetErrorType){ApplePaySheetErrorType["InvalidShippingAddress"]="InvalidShippingAddress";ApplePaySheetErrorType["UnserviceableShippingAddress"]="UnserviceableShippingAddress";ApplePaySheetErrorType["InvalidCouponCode"]="InvalidCouponCode";ApplePaySheetErrorType["ExpiredCouponCode"]="ExpiredCouponCode";})(ApplePaySheetErrorType||(exports.ApplePaySheetErrorType=ApplePaySheetErrorType={}));var ContactField;exports.ContactField=ContactField;(function(ContactField){ContactField["EmailAddress"]="emailAddress";ContactField["Name"]="name";ContactField["PhoneNumber"]="phoneNumber";ContactField["PhoneticName"]="phoneticName";ContactField["PostalAddress"]="postalAddress";})(ContactField||(exports.ContactField=ContactField={}));var InvalidShippingField;exports.InvalidShippingField=InvalidShippingField;(function(InvalidShippingField){InvalidShippingField["Street"]="street";InvalidShippingField["City"]="city";InvalidShippingField["SubAdministrativeArea"]="subAdministrativeArea";InvalidShippingField["State"]="state";InvalidShippingField["PostalCode"]="postalCode";InvalidShippingField["Country"]="country";InvalidShippingField["CountryCode"]="countryCode";InvalidShippingField["SubLocality"]="subLocality";})(InvalidShippingField||(exports.InvalidShippingField=InvalidShippingField={}));var ApplePayMerchantCapability;exports.ApplePayMerchantCapability=ApplePayMerchantCapability;(function(ApplePayMerchantCapability){ApplePayMerchantCapability["Supports3DS"]="supports3DS";ApplePayMerchantCapability["SupportsCredit"]="supportsCredit";ApplePayMerchantCapability["SupportsDebit"]="supportsDebit";})(ApplePayMerchantCapability||(exports.ApplePayMerchantCapability=ApplePayMerchantCapability={}));var ApplePayShippingType;exports.ApplePayShippingType=ApplePayShippingType;(function(ApplePayShippingType){ApplePayShippingType["Shipping"]="shipping";ApplePayShippingType["Delivery"]="delivery";ApplePayShippingType["StorePickup"]="storePickup";ApplePayShippingType["ServicePickup"]="servicePickup";})(ApplePayShippingType||(exports.ApplePayShippingType=ApplePayShippingType={}));var BillingAddressFormat;exports.BillingAddressFormat=BillingAddressFormat;(function(BillingAddressFormat){BillingAddressFormat["Full"]="FULL";BillingAddressFormat["Min"]="MIN";})(BillingAddressFormat||(exports.BillingAddressFormat=BillingAddressFormat={}));var ButtonType;exports.ButtonType=ButtonType;(function(ButtonType){ButtonType[ButtonType["Default"]=0]="Default";ButtonType[ButtonType["Buy"]=1]="Buy";ButtonType[ButtonType["Book"]=6]="Book";ButtonType[ButtonType["Checkout"]=5]="Checkout";ButtonType[ButtonType["Donate"]=4]="Donate";ButtonType[ButtonType["Order"]=11]="Order";ButtonType[ButtonType["Subscribe"]=7]="Subscribe";ButtonType[ButtonType["SetUp"]=2]="SetUp";ButtonType[ButtonType["InStore"]=3]="InStore";ButtonType[ButtonType["Reload"]=8]="Reload";ButtonType[ButtonType["AddMoney"]=9]="AddMoney";ButtonType[ButtonType["TopUp"]=10]="TopUp";ButtonType[ButtonType["Rent"]=12]="Rent";ButtonType[ButtonType["Support"]=13]="Support";ButtonType[ButtonType["Contribute"]=14]="Contribute";ButtonType[ButtonType["Tip"]=15]="Tip";ButtonType[ButtonType["Continue"]=16]="Continue";ButtonType[ButtonType["Pay"]=1000]="Pay";ButtonType[ButtonType["GooglePayMark"]=1001]="GooglePayMark";})(ButtonType||(exports.ButtonType=ButtonType={}));var ButtonStyle;exports.ButtonStyle=ButtonStyle;(function(ButtonStyle){ButtonStyle[ButtonStyle["White"]=0]="White";ButtonStyle[ButtonStyle["WhiteOutline"]=1]="WhiteOutline";ButtonStyle[ButtonStyle["Black"]=2]="Black";ButtonStyle[ButtonStyle["Automatic"]=3]="Automatic";})(ButtonStyle||(exports.ButtonStyle=ButtonStyle={}));var PaymentType;exports.PaymentType=PaymentType;(function(PaymentType){PaymentType["Deferred"]="Deferred";PaymentType["Immediate"]="Immediate";PaymentType["Recurring"]="Recurring";})(PaymentType||(exports.PaymentType=PaymentType={}));var IntervalUnit;exports.IntervalUnit=IntervalUnit;(function(IntervalUnit){IntervalUnit["Minute"]="minute";IntervalUnit["Hour"]="hour";IntervalUnit["Day"]="day";IntervalUnit["Month"]="month";IntervalUnit["Year"]="year";})(IntervalUnit||(exports.IntervalUnit=IntervalUnit={}));
|
|
2
|
+
//# sourceMappingURL=PlatformPay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PlatformPay.ts"],"names":["ApplePaySheetErrorType","ContactField","InvalidShippingField","ApplePayMerchantCapability","ApplePayShippingType","BillingAddressFormat","ButtonType","ButtonStyle","PaymentType","IntervalUnit"],"mappings":"iUAsBYA,CAAAA,sB,iEAAAA,sB,EAAAA,sB,oDAAAA,sB,gEAAAA,sB,0CAAAA,sB,6CAAAA,sB,kCAAAA,sB,SAOAC,CAAAA,Y,6CAAAA,Y,EAAAA,Y,gCAAAA,Y,gBAAAA,Y,8BAAAA,Y,gCAAAA,Y,qCAAAA,Y,wBAAAA,Y,SAQAC,CAAAA,oB,6DAAAA,oB,EAAAA,oB,oBAAAA,oB,gBAAAA,oB,kDAAAA,oB,kBAAAA,oB,4BAAAA,oB,sBAAAA,oB,8BAAAA,oB,iCAAAA,oB,gCAAAA,oB,SAyCAC,CAAAA,0B,yEAAAA,0B,EAAAA,0B,8BAAAA,0B,oCAAAA,0B,qCAAAA,0B,sCAAAA,0B,SAUAC,CAAAA,oB,6DAAAA,oB,EAAAA,oB,wBAAAA,oB,wBAAAA,oB,8BAAAA,oB,qCAAAA,oB,gCAAAA,oB,SAsDAC,CAAAA,oB,6DAAAA,oB,EAAAA,oB,gBAAAA,oB,iBAAAA,oB,gCAAAA,oB,SAqBAC,CAAAA,U,yCAAAA,U,EAAAA,U,CAAAA,U,yBAAAA,U,CAAAA,U,iBAAAA,U,CAAAA,U,mBAAAA,U,CAAAA,U,2BAAAA,U,CAAAA,U,uBAAAA,U,CAAAA,U,sBAAAA,U,CAAAA,U,6BAAAA,U,CAAAA,U,qBAAAA,U,CAAAA,U,yBAAAA,U,CAAAA,U,uBAAAA,U,CAAAA,U,2BAAAA,U,CAAAA,U,sBAAAA,U,CAAAA,U,oBAAAA,U,CAAAA,U,0BAAAA,U,CAAAA,U,gCAAAA,U,CAAAA,U,kBAAAA,U,CAAAA,U,4BAAAA,U,CAAAA,U,oBAAAA,U,CAAAA,U,2CAAAA,U,sBAAAA,U,SA0CAC,CAAAA,W,2CAAAA,W,EAAAA,W,CAAAA,W,qBAAAA,W,CAAAA,W,mCAAAA,W,CAAAA,W,qBAAAA,W,CAAAA,W,gCAAAA,W,uBAAAA,W,SAkBAC,CAAAA,W,2CAAAA,W,EAAAA,W,wBAAAA,W,0BAAAA,W,6BAAAA,W,uBAAAA,W,SAwCAC,CAAAA,Y,6CAAAA,Y,EAAAA,Y,oBAAAA,Y,gBAAAA,Y,cAAAA,Y,kBAAAA,Y,mBAAAA,Y,wBAAAA,Y","sourcesContent":["import type { Result as Token } from './Token';\nimport type { Result as PaymentMethod } from './PaymentMethod';\nimport type { Result as PaymentIntent } from './PaymentIntent';\nimport type { Result as SetupIntent } from './SetupIntent';\nimport type { StripeError, PlatformPayError } from './Errors';\nimport type { ShippingContact as ApplePayShippingContact } from './ApplePay';\nimport type { IsSupportedParams } from './GooglePay';\n\nexport type ApplePaySheetError =\n | {\n errorType: ApplePaySheetErrorType.InvalidShippingAddress;\n field: InvalidShippingField;\n message?: string;\n }\n | {\n errorType:\n | ApplePaySheetErrorType.UnserviceableShippingAddress\n | ApplePaySheetErrorType.InvalidCouponCode\n | ApplePaySheetErrorType.ExpiredCouponCode;\n message?: string;\n };\n\nexport enum ApplePaySheetErrorType {\n InvalidShippingAddress = 'InvalidShippingAddress',\n UnserviceableShippingAddress = 'UnserviceableShippingAddress',\n InvalidCouponCode = 'InvalidCouponCode',\n ExpiredCouponCode = 'ExpiredCouponCode',\n}\n\nexport enum ContactField {\n EmailAddress = 'emailAddress',\n Name = 'name',\n PhoneNumber = 'phoneNumber',\n PhoneticName = 'phoneticName',\n PostalAddress = 'postalAddress',\n}\n\nexport enum InvalidShippingField {\n Street = 'street',\n City = 'city',\n SubAdministrativeArea = 'subAdministrativeArea',\n State = 'state',\n PostalCode = 'postalCode',\n Country = 'country',\n CountryCode = 'countryCode',\n SubLocality = 'subLocality',\n}\n\nexport type ApplePayBaseParams = {\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** The SDK accepts Amex, Mastercard, Visa, and Discover for Apple Pay by default. Set this property to enable other card networks, for example: [\"JCB\", \"barcode\", \"chinaUnionPay\"]. A full list of possible networks can be found at https://developer.apple.com/documentation/passkit/pkpaymentnetwork. */\n additionalEnabledNetworks?: Array<string>;\n /** The list of items that describe a purchase. For example: total, tax, discount, and grand total. */\n cartItems: Array<CartSummaryItem>;\n /** The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there.*/\n requiredShippingAddressFields?: Array<ContactField>;\n /** The list of fields that you need for a billing contact in order to process the transaction. */\n requiredBillingContactFields?: Array<ContactField>;\n /** An array of shipping method objects that describe the supported shipping methods. If provided, you must implement the PlatformPayButton component's `onShippingMethodSelected` callback and call `updatePlatformPaySheet` from there. */\n shippingMethods?: Array<ShippingMethod>;\n /** Set the payment capabilities you support. If set, 3DS is required. */\n merchantCapabilities?: Array<ApplePayMerchantCapability>;\n /** An optional value that indicates how to ship purchased items. Defaults to 'Shipping'.*/\n shippingType?: ApplePayShippingType;\n /** A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. */\n supportedCountries?: Array<string>;\n};\n\nexport type ApplePayPaymentMethodParams = {\n /** Set this value to true to display the coupon code field, or pass the 'couponCode' field to autofill with a coupon code. Defaults to false. If true, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n supportsCouponCode?: boolean;\n /** Set this value to autofill with a coupon code. If provided, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */\n couponCode?: string;\n};\n\nexport enum ApplePayMerchantCapability {\n /** Required. This value must be supplied. */\n Supports3DS = 'supports3DS',\n /** Optional. If present, only transactions that are categorized as credit cards are allowed. */\n SupportsCredit = 'supportsCredit',\n /** Optional. If present, only transactions that are categorized as debit cards are allowed. */\n SupportsDebit = 'supportsDebit',\n}\n\n/** A type that indicates how to ship purchased items. */\nexport enum ApplePayShippingType {\n /** Default. */\n Shipping = 'shipping',\n Delivery = 'delivery',\n StorePickup = 'storePickup',\n ServicePickup = 'servicePickup',\n}\n\nexport type GooglePayBaseParams = {\n /**\n * Set to true to run in a test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing SDK.\n - Does not require the application to be uploaded to the Google Play Store.\n - Does not require a Google Pay Developer Profile.\n - It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential.\n - The user will see a warning message that the app is not recognized/verified.\n */\n testEnv: boolean;\n /** ISO 3166-1 alpha-2 country code where the transaction is processed. */\n merchantCountryCode: string;\n /** ISO 4217 alphabetic currency code. */\n currencyCode: string;\n /** Your merchant name, displayed in the Google Pay sheet. */\n merchantName?: string;\n /** Set to true to request an email address. Defaults to false. */\n isEmailRequired?: boolean;\n /** Set to false if you don't support credit cards. Defaults to true. */\n allowCreditCards?: boolean;\n /** If true, Google Pay is considered \"available\" if the customer's Google Pay wallet has an existing payment method. Defaults to false. */\n existingPaymentMethodRequired?: boolean;\n /** Describes the configuration for billing address collection in the Google Pay sheet. */\n billingAddressConfig?: {\n /** Set to true if billing address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Defines what address fields to collect. Defaults to BillingAddressFormat.Min */\n format?: BillingAddressFormat;\n };\n};\n\nexport type GooglePayPaymentMethodParams = {\n /** Total monetary value of the transaction. */\n amount: number;\n /** Describes the configuration for shipping address collection in the Google Pay sheet. */\n shippingAddressConfig?: {\n /** Set to true if shipping address is required for payment. Defaults to false. */\n isRequired?: boolean;\n /** Set to true if phone number is required for payment. Defaults to false. */\n isPhoneNumberRequired?: boolean;\n /** Set of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. Defaults to all shipping address countries. */\n allowedCountryCodes?: Array<string>;\n };\n};\n\nexport enum BillingAddressFormat {\n /** Collect name, street address, locality, region, country code, and postal code. */\n Full = 'FULL',\n /** Collect name, country code, and postal code (default). */\n Min = 'MIN',\n}\n\nexport type PaymentMethodParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams & GooglePayPaymentMethodParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams & ApplePayPaymentMethodParams;\n};\n\nexport type ConfirmParams = {\n /** Defines Google Pay behavior. Android only. */\n googlePay?: GooglePayBaseParams;\n /** Defines Apple Pay behavior. iOS only. */\n applePay?: ApplePayBaseParams;\n};\n\nexport enum ButtonType {\n /** A button with the Apple Pay or Google Pay logo only, useful when an additional call to action isn't needed. */\n Default = 0,\n /** A button useful for product purchases. */\n Buy = 1,\n /** A button useful for booking trips, flights, or other experiences. */\n Book = 6,\n /** A button useful for purchase experiences that include other payment buttons that start with “Check out”. */\n Checkout = 5,\n /** A button used by approved nonprofit organization that lets people make donations. */\n Donate = 4,\n /** A button useful for placing orders for such as like meals or flowers. */\n Order = 11,\n /** A button useful for purchasing a subscription such as a gym membership or meal-kit delivery service. */\n Subscribe = 7,\n /** iOS only. A button useful for prompting the user to set up a card. */\n SetUp = 2,\n /** iOS only. A button useful for paying bills or invoices. */\n InStore = 3,\n /** iOS only. A button useful for adding money to a card, account, or payment system.*/\n Reload = 8,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n AddMoney = 9,\n /** iOS only. A button useful for adding money to a card, account, or payment system. */\n TopUp = 10,\n /** iOS only. A button useful for renting items such as cars or scooters. */\n Rent = 12,\n /** iOS only. A button useful supporting people give money to projects, causes, organizations, and other entities.*/\n Support = 13,\n /** iOS only. A button useful to help people contribute money to projects, causes, organizations, and other entities. */\n Contribute = 14,\n /** iOS only. A button useful useful for letting people tip for goods or services. */\n Tip = 15,\n /** iOS only. A button useful for general purchases. */\n Continue = 16,\n /** Android only. A button useful for general payments. */\n Pay = 1000,\n /** Android only. A plain white button with the Google Pay logo. Use when you show Google Pay as a payment option in your payment flows. */\n GooglePayMark = 1001,\n}\n\n/** iOS only. */\nexport enum ButtonStyle {\n /** A white button with black lettering. */\n White = 0,\n /** A white button with black lettering and a black outline. */\n WhiteOutline = 1,\n /** A black button with white lettering. */\n Black = 2,\n /** Default. A button that automatically changes its appearance when the user switches between Light Mode and Dark Mode. */\n Automatic = 3,\n}\n\n/** iOS only. */\nexport type CartSummaryItem =\n | DeferredCartSummaryItem\n | ImmediateCartSummaryItem\n | RecurringCartSummaryItem;\n\n/** iOS only. */\nexport enum PaymentType {\n Deferred = 'Deferred',\n Immediate = 'Immediate',\n Recurring = 'Recurring',\n}\n\n/** iOS only. Use this type for a payment that occurs in the future, such as a pre-order. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem. */\nexport type DeferredCartSummaryItem = {\n paymentType: PaymentType.Deferred;\n /** The unix timestamp of the date, in the future, of the payment. Measured in seconds. */\n deferredDate: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that will occur immediately. */\nexport type ImmediateCartSummaryItem = {\n paymentType: PaymentType.Immediate;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n label: string;\n amount: string;\n};\n\n/** iOS only. Use this type for payments that occur more than once, such as a subscription. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem.*/\nexport type RecurringCartSummaryItem = {\n paymentType: PaymentType.Recurring;\n /** The amount of time – in calendar units such as Day, Month, or Year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalUnit: IntervalUnit;\n /** The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'Month' and intervalCount to 3, then the payment interval is three months.*/\n intervalCount: number;\n /** The unix timestamp of the start date. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date. Measured in seconds. */\n endDate?: number;\n label: string;\n amount: string;\n};\n\n/** iOS only. */\nexport enum IntervalUnit {\n Minute = 'minute',\n Hour = 'hour',\n Day = 'day',\n Month = 'month',\n Year = 'year',\n}\n\n/** iOS only. */\nexport type ShippingMethod = {\n /** A short, localized description. */\n label: string;\n /** The cost associated with this shipping option. */\n amount: string;\n /** When creating items for estimates or charges whose final value is not yet known, set this to true. */\n isPending?: boolean;\n /** A unique identifier for the shipping method. */\n identifier: string;\n /** A user-readable description of the shipping method. For example “Ships in 24 hours.” Don't repeat the content of the 'label' property. */\n detail?: string;\n /** The unix timestamp of the start date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n startDate?: number;\n /** The unix timestamp of the end date of the expected range of delivery or shipping dates for a package, or the time range when an item is available for pickup. Measured in seconds. */\n endDate?: number;\n};\n\n/** iOS only. */\nexport type ShippingContact = ApplePayShippingContact;\n\n/** Android only. */\nexport type IsGooglePaySupportedParams = IsSupportedParams;\n\nexport type PaymentMethodResult =\n | {\n paymentMethod: PaymentMethod;\n token: Token;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n token?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent;\n error?: StripeError<PlatformPayError>;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<PlatformPayError>;\n };\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.GooglePayCardTokenStatus=exports.CanAddCardToWalletStatus=void 0;var GooglePayCardTokenStatus;exports.GooglePayCardTokenStatus=GooglePayCardTokenStatus;(function(GooglePayCardTokenStatus){GooglePayCardTokenStatus["TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION"]="TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION";GooglePayCardTokenStatus["TOKEN_STATE_PENDING"]="TOKEN_STATE_PENDING";GooglePayCardTokenStatus["TOKEN_STATE_SUSPENDED"]="TOKEN_STATE_SUSPENDED";GooglePayCardTokenStatus["TOKEN_STATE_ACTIVE"]="TOKEN_STATE_ACTIVE";GooglePayCardTokenStatus["TOKEN_STATE_FELICA_PENDING_PROVISIONING"]="TOKEN_STATE_FELICA_PENDING_PROVISIONING";GooglePayCardTokenStatus["TOKEN_STATE_UNTOKENIZED"]="TOKEN_STATE_UNTOKENIZED";})(GooglePayCardTokenStatus||(exports.GooglePayCardTokenStatus=GooglePayCardTokenStatus={}));var CanAddCardToWalletStatus;exports.CanAddCardToWalletStatus=CanAddCardToWalletStatus;(function(CanAddCardToWalletStatus){CanAddCardToWalletStatus["MISSING_CONFIGURATION"]="MISSING_CONFIGURATION";CanAddCardToWalletStatus["UNSUPPORTED_DEVICE"]="UNSUPPORTED_DEVICE";CanAddCardToWalletStatus["CARD_ALREADY_EXISTS"]="CARD_ALREADY_EXISTS";CanAddCardToWalletStatus["CARD_EXISTS_ON_CURRENT_DEVICE"]="CARD_EXISTS_ON_CURRENT_DEVICE";CanAddCardToWalletStatus["CARD_EXISTS_ON_PAIRED_DEVICE"]="CARD_EXISTS_ON_PAIRED_DEVICE";})(CanAddCardToWalletStatus||(exports.CanAddCardToWalletStatus=CanAddCardToWalletStatus={}));
|
|
2
|
+
//# sourceMappingURL=PushProvisioning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PushProvisioning.ts"],"names":["GooglePayCardTokenStatus","CanAddCardToWalletStatus"],"mappings":"qIAWYA,CAAAA,wB,qEAAAA,wB,EAAAA,wB,sFAAAA,wB,8CAAAA,wB,kDAAAA,wB,4CAAAA,wB,sFAAAA,wB,yDAAAA,wB,oCAAAA,wB,SAqDAC,CAAAA,wB,qEAAAA,wB,EAAAA,wB,kDAAAA,wB,4CAAAA,wB,8CAAAA,wB,kEAAAA,wB,mEAAAA,wB,oCAAAA,wB","sourcesContent":["import type { StripeError, GooglePayError } from './Errors';\n\nexport type GooglePayCardToken = {\n id: string;\n cardLastFour: string;\n network: number;\n serviceProvider: number;\n issuer: string;\n status: GooglePayCardTokenStatus;\n};\n\nexport enum GooglePayCardTokenStatus {\n /** */\n TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION = 'TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION',\n /** */\n TOKEN_STATE_PENDING = 'TOKEN_STATE_PENDING',\n /** */\n TOKEN_STATE_SUSPENDED = 'TOKEN_STATE_SUSPENDED',\n /** */\n TOKEN_STATE_ACTIVE = 'TOKEN_STATE_ACTIVE',\n /** */\n TOKEN_STATE_FELICA_PENDING_PROVISIONING = 'TOKEN_STATE_FELICA_PENDING_PROVISIONING',\n /** */\n TOKEN_STATE_UNTOKENIZED = 'TOKEN_STATE_UNTOKENIZED',\n}\n\nexport type IsCardInWalletResult =\n | {\n isInWallet: boolean;\n token?: GooglePayCardToken;\n error?: undefined;\n }\n | {\n isInWallet?: undefined;\n token?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type CanAddCardToWalletParams = {\n /** The `primary_account_identifier` value from the issued card. Can be an empty string. */\n primaryAccountIdentifier: string | null;\n /** Last 4 digits of the card number. */\n cardLastFour: string;\n /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */\n testEnv?: boolean;\n /** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */\n hasPairedAppleWatch?: boolean;\n};\n\nexport type CanAddCardToWalletResult =\n | {\n canAddCard: boolean;\n details?: {\n token?: GooglePayCardToken;\n status?: CanAddCardToWalletStatus;\n };\n error?: undefined;\n }\n | {\n canAddCard?: undefined;\n details?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport enum CanAddCardToWalletStatus {\n /** You are missing configuration required for Push Provisioning. Make sure you've completed all steps at https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native. */\n MISSING_CONFIGURATION = 'MISSING_CONFIGURATION',\n /** This device doesn't support adding a card to the native wallet. */\n UNSUPPORTED_DEVICE = 'UNSUPPORTED_DEVICE',\n /** This card already exists on this device and any paired devices. */\n CARD_ALREADY_EXISTS = 'CARD_ALREADY_EXISTS',\n /** This card already exists on this device, but not on the paired device. */\n CARD_EXISTS_ON_CURRENT_DEVICE = 'CARD_EXISTS_ON_CURRENT_DEVICE',\n /** This card already exists on the paired device, but not on this device. */\n CARD_EXISTS_ON_PAIRED_DEVICE = 'CARD_EXISTS_ON_PAIRED_DEVICE',\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={ApplePay:true,PaymentIntent:true,PaymentMethod:true,PaymentSheet:true,SetupIntent:true,ThreeDSecure:true,GooglePay:true,ApplePayButtonComponent:true,AuBECSDebitFormComponent:true,CardFieldInput:true,CardFormView:true,Token:true,FinancialConnections:true,Address:true,BillingDetails:true,AddressDetails:true};Object.defineProperty(exports,"Address",{enumerable:true,get:function get(){return _Common.Address;}});Object.defineProperty(exports,"AddressDetails",{enumerable:true,get:function get(){return _Common.AddressDetails;}});exports.AuBECSDebitFormComponent=exports.ApplePayButtonComponent=exports.ApplePay=void 0;Object.defineProperty(exports,"BillingDetails",{enumerable:true,get:function get(){return _Common.BillingDetails;}});exports.Token=exports.ThreeDSecure=exports.SetupIntent=exports.PaymentSheet=exports.PaymentMethod=exports.PaymentIntent=exports.GooglePay=exports.FinancialConnections=exports.CardFormView=exports.CardFieldInput=void 0;var ApplePay=_interopRequireWildcard(require("./ApplePay"));exports.ApplePay=ApplePay;var PaymentIntent=_interopRequireWildcard(require("./PaymentIntent"));exports.PaymentIntent=PaymentIntent;var PaymentMethod=_interopRequireWildcard(require("./PaymentMethod"));exports.PaymentMethod=PaymentMethod;var PaymentSheet=_interopRequireWildcard(require("./PaymentSheet"));exports.PaymentSheet=PaymentSheet;var SetupIntent=_interopRequireWildcard(require("./SetupIntent"));exports.SetupIntent=SetupIntent;var ThreeDSecure=_interopRequireWildcard(require("./ThreeDSecure"));exports.ThreeDSecure=ThreeDSecure;var GooglePay=_interopRequireWildcard(require("./GooglePay"));exports.GooglePay=GooglePay;var ApplePayButtonComponent=_interopRequireWildcard(require("./components/ApplePayButtonComponent"));exports.ApplePayButtonComponent=ApplePayButtonComponent;var AuBECSDebitFormComponent=_interopRequireWildcard(require("./components/AuBECSDebitFormComponent"));exports.AuBECSDebitFormComponent=AuBECSDebitFormComponent;var CardFieldInput=_interopRequireWildcard(require("./components/CardFieldInput"));exports.CardFieldInput=CardFieldInput;var CardFormView=_interopRequireWildcard(require("./components/CardFormView"));exports.CardFormView=CardFormView;var Token=_interopRequireWildcard(require("./Token"));exports.Token=Token;var FinancialConnections=_interopRequireWildcard(require("./FinancialConnections"));exports.FinancialConnections=FinancialConnections;var _Errors=require("./Errors");Object.keys(_Errors).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_Errors[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _Errors[key];}});});var _Common=require("./Common");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={ApplePay:true,PaymentIntent:true,PaymentMethod:true,PaymentSheet:true,SetupIntent:true,ThreeDSecure:true,GooglePay:true,ApplePayButtonComponent:true,AuBECSDebitFormComponent:true,CardFieldInput:true,CardFormView:true,Token:true,FinancialConnections:true,PlatformPay:true,Address:true,BillingDetails:true,AddressDetails:true};Object.defineProperty(exports,"Address",{enumerable:true,get:function get(){return _Common.Address;}});Object.defineProperty(exports,"AddressDetails",{enumerable:true,get:function get(){return _Common.AddressDetails;}});exports.AuBECSDebitFormComponent=exports.ApplePayButtonComponent=exports.ApplePay=void 0;Object.defineProperty(exports,"BillingDetails",{enumerable:true,get:function get(){return _Common.BillingDetails;}});exports.Token=exports.ThreeDSecure=exports.SetupIntent=exports.PlatformPay=exports.PaymentSheet=exports.PaymentMethod=exports.PaymentIntent=exports.GooglePay=exports.FinancialConnections=exports.CardFormView=exports.CardFieldInput=void 0;var ApplePay=_interopRequireWildcard(require("./ApplePay"));exports.ApplePay=ApplePay;var PaymentIntent=_interopRequireWildcard(require("./PaymentIntent"));exports.PaymentIntent=PaymentIntent;var PaymentMethod=_interopRequireWildcard(require("./PaymentMethod"));exports.PaymentMethod=PaymentMethod;var PaymentSheet=_interopRequireWildcard(require("./PaymentSheet"));exports.PaymentSheet=PaymentSheet;var SetupIntent=_interopRequireWildcard(require("./SetupIntent"));exports.SetupIntent=SetupIntent;var ThreeDSecure=_interopRequireWildcard(require("./ThreeDSecure"));exports.ThreeDSecure=ThreeDSecure;var GooglePay=_interopRequireWildcard(require("./GooglePay"));exports.GooglePay=GooglePay;var ApplePayButtonComponent=_interopRequireWildcard(require("./components/ApplePayButtonComponent"));exports.ApplePayButtonComponent=ApplePayButtonComponent;var AuBECSDebitFormComponent=_interopRequireWildcard(require("./components/AuBECSDebitFormComponent"));exports.AuBECSDebitFormComponent=AuBECSDebitFormComponent;var CardFieldInput=_interopRequireWildcard(require("./components/CardFieldInput"));exports.CardFieldInput=CardFieldInput;var CardFormView=_interopRequireWildcard(require("./components/CardFormView"));exports.CardFormView=CardFormView;var Token=_interopRequireWildcard(require("./Token"));exports.Token=Token;var FinancialConnections=_interopRequireWildcard(require("./FinancialConnections"));exports.FinancialConnections=FinancialConnections;var PlatformPay=_interopRequireWildcard(require("./PlatformPay"));exports.PlatformPay=PlatformPay;var _PushProvisioning=require("./PushProvisioning");Object.keys(_PushProvisioning).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_PushProvisioning[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _PushProvisioning[key];}});});var _Errors=require("./Errors");Object.keys(_Errors).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_Errors[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _Errors[key];}});});var _Common=require("./Common");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"wiCAeA,4D,0BACA,sE,oCACA,sE,oCACA,oE,kCACA,kE,gCACA,oE,kCACA,8D,4BACA,qG,wDACA,uG,0DACA,mF,sCACA,+E,kCACA,sD,oBACA,oF,kDACA,kE,gCAmBA,mYACA,iVACA,gC","sourcesContent":["import type {\n ApplePayError,\n CardActionError,\n ConfirmPaymentError,\n ConfirmSetupIntentError,\n CreatePaymentMethodError,\n CreateTokenError,\n GooglePayError,\n PaymentSheetError,\n RetrievePaymentIntentError,\n RetrieveSetupIntentError,\n StripeError,\n VerifyMicrodepositsError,\n CollectBankAccountError,\n} from './Errors';\nimport * as ApplePay from './ApplePay';\nimport * as PaymentIntent from './PaymentIntent';\nimport * as PaymentMethod from './PaymentMethod';\nimport * as PaymentSheet from './PaymentSheet';\nimport * as SetupIntent from './SetupIntent';\nimport * as ThreeDSecure from './ThreeDSecure';\nimport * as GooglePay from './GooglePay';\nimport * as ApplePayButtonComponent from './components/ApplePayButtonComponent';\nimport * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent';\nimport * as CardFieldInput from './components/CardFieldInput';\nimport * as CardFormView from './components/CardFormView';\nimport * as Token from './Token';\nimport * as FinancialConnections from './FinancialConnections';\nimport * as PlatformPay from './PlatformPay';\n\nexport {\n ApplePay,\n PaymentIntent,\n PaymentMethod,\n PaymentSheet,\n SetupIntent,\n ThreeDSecure,\n GooglePay,\n ApplePayButtonComponent,\n AuBECSDebitFormComponent,\n CardFieldInput,\n CardFormView,\n Token,\n FinancialConnections,\n PlatformPay,\n};\n\nexport * from './PushProvisioning';\nexport * from './Errors';\nexport { Address, BillingDetails, AddressDetails } from './Common';\n\n/**\n * @ignore\n */\nexport type Dictionary<T> = {\n [key: string]: T;\n};\n\nexport interface AppInfo {\n name?: string;\n partnerId?: string;\n url?: string;\n version?: string;\n}\n\nexport type CreatePaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<CreatePaymentMethodError>;\n };\n\nexport type RetrievePaymentIntentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<RetrievePaymentIntentError>;\n };\n\nexport type RetrieveSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<RetrieveSetupIntentError>;\n };\n\nexport type ConfirmPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<ConfirmPaymentError>;\n };\n\nexport type HandleNextActionResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CardActionError>;\n };\n\nexport type ConfirmSetupIntentResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type CreateTokenForCVCUpdateResult =\n | {\n tokenId: string;\n error?: undefined;\n }\n | {\n tokenId?: undefined;\n error: StripeError<ConfirmSetupIntentError>;\n };\n\nexport type InitPaymentSheetResult =\n | {\n paymentOption?: PaymentSheet.PaymentOption;\n error?: undefined;\n }\n | {\n paymentOption?: undefined;\n error: StripeError<PaymentSheetError>;\n };\n\nexport type PresentPaymentSheetResult = {\n paymentOption?: PaymentSheet.PaymentOption | undefined;\n error?: StripeError<PaymentSheetError> | undefined;\n};\n\nexport type CreateTokenResult =\n | {\n token: Token.Result;\n error?: undefined;\n }\n | {\n token?: undefined;\n error: StripeError<CreateTokenError>;\n };\n\nexport type ConfirmPaymentSheetPaymentResult = {\n error?: StripeError<PaymentSheetError>;\n};\n\nexport type ApplePayResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<ApplePayError>;\n };\n\nexport interface InitStripeParams {\n publishableKey: string;\n stripeAccountId?: string;\n threeDSecureParams?: ThreeDSecure.ConfigurationParams;\n merchantIdentifier?: string;\n urlScheme?: string;\n setReturnUrlSchemeOnAndroid?: boolean;\n}\n\nexport interface InitialiseParams extends InitStripeParams {\n appInfo: AppInfo;\n}\n\nexport type GooglePayInitResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type PayWithGooglePayResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<GooglePayError>;\n };\n\nexport type CreateGooglePayPaymentMethodResult =\n | {\n paymentMethod: PaymentMethod.Result;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n error: StripeError<GooglePayError>;\n };\n\nexport type OpenApplePaySetupResult =\n | {\n error?: undefined;\n }\n | {\n error: StripeError<ApplePayError>;\n };\n\nexport type VerifyMicrodepositsParams =\n | {\n amounts: number[];\n descriptorCode?: undefined;\n }\n | {\n amounts?: undefined;\n descriptorCode: string;\n };\n\nexport type VerifyMicrodepositsForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type VerifyMicrodepositsForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<VerifyMicrodepositsError>;\n };\n\nexport type CollectBankAccountForPaymentResult =\n | {\n paymentIntent: PaymentIntent.Result;\n error?: undefined;\n }\n | {\n paymentIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n\nexport type CollectBankAccountForSetupResult =\n | {\n setupIntent: SetupIntent.Result;\n error?: undefined;\n }\n | {\n setupIntent?: undefined;\n error: StripeError<CollectBankAccountError>;\n };\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PaymentMethod, PaymentIntent, ApplePay, PaymentSheet, SetupIntent, InitialiseParams, CreatePaymentMethodResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, ConfirmPaymentResult, HandleNextActionResult, ConfirmSetupIntentResult, CreateTokenForCVCUpdateResult, InitPaymentSheetResult, PresentPaymentSheetResult, ConfirmPaymentSheetPaymentResult, ApplePayResult, CreateTokenResult, GooglePayInitResult, PayWithGooglePayResult, CreateGooglePayPaymentMethodResult, GooglePay, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, IsCardInWalletResult, CanAddCardToWalletParams, CanAddCardToWalletResult, FinancialConnections } from './types';
|
|
1
|
+
import type { PaymentMethod, PaymentIntent, ApplePay, PlatformPay, PaymentSheet, SetupIntent, InitialiseParams, CreatePaymentMethodResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, ConfirmPaymentResult, HandleNextActionResult, ConfirmSetupIntentResult, CreateTokenForCVCUpdateResult, InitPaymentSheetResult, PresentPaymentSheetResult, ConfirmPaymentSheetPaymentResult, ApplePayResult, CreateTokenResult, GooglePayInitResult, PayWithGooglePayResult, CreateGooglePayPaymentMethodResult, GooglePay, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, IsCardInWalletResult, CanAddCardToWalletParams, CanAddCardToWalletResult, FinancialConnections } from './types';
|
|
2
2
|
declare type NativeStripeSdkType = {
|
|
3
3
|
initialise(params: InitialiseParams): Promise<void>;
|
|
4
4
|
createPaymentMethod(params: PaymentMethod.CreateParams, options: PaymentMethod.CreateOptions): Promise<CreatePaymentMethodResult>;
|
|
@@ -40,6 +40,13 @@ declare type NativeStripeSdkType = {
|
|
|
40
40
|
collectBankAccountToken(clientSecret: string): Promise<FinancialConnections.TokenResult>;
|
|
41
41
|
collectFinancialConnectionsAccounts(clientSecret: string): Promise<FinancialConnections.SessionResult>;
|
|
42
42
|
resetPaymentSheetCustomer(): Promise<null>;
|
|
43
|
+
isPlatformPaySupported(params: {
|
|
44
|
+
googlePay?: GooglePay.IsSupportedParams;
|
|
45
|
+
}): Promise<boolean>;
|
|
46
|
+
createPlatformPayPaymentMethod(params: PlatformPay.PaymentMethodParams): Promise<PlatformPay.PaymentMethodResult>;
|
|
47
|
+
dismissPlatformPay(): Promise<boolean>;
|
|
48
|
+
updatePlatformPaySheet(summaryItems: Array<ApplePay.CartSummaryItem>, shippingMethods: Array<ApplePay.ShippingMethod>, errors: Array<PlatformPay.ApplePaySheetError>): Promise<void>;
|
|
49
|
+
confirmPlatformPay(clientSecret: string, params: PlatformPay.ConfirmParams, isPaymentIntent: boolean): Promise<PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult>;
|
|
43
50
|
};
|
|
44
51
|
declare const _default: NativeStripeSdkType;
|
|
45
52
|
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { AccessibilityProps, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { ButtonType, ButtonStyle, ShippingMethod, ShippingContact } from '../types/PlatformPay';
|
|
3
|
+
/**
|
|
4
|
+
* PlatformPayButton Component Props
|
|
5
|
+
*/
|
|
6
|
+
export interface Props extends AccessibilityProps {
|
|
7
|
+
/** Sets the text displayed by the button. */
|
|
8
|
+
type?: ButtonType;
|
|
9
|
+
/** iOS only. Sets the coloring of the button. */
|
|
10
|
+
appearance?: ButtonStyle;
|
|
11
|
+
/** iOS only. Sets the border radius of the button. */
|
|
12
|
+
borderRadius?: number;
|
|
13
|
+
/** Function called whenever the button is pressed. */
|
|
14
|
+
onPress(): void;
|
|
15
|
+
/** Set to `true` to disable the button from being pressed & apply a slight opacity to indicate that it is unpressable. Defaults to false. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* This callback is triggered whenever the user selects a shipping method in the Apple Pay sheet.
|
|
19
|
+
* It receives one parameter: an `event` object with a `shippingMethod` field. You MUST
|
|
20
|
+
* update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the
|
|
21
|
+
* Apple Pay sheet will hang and the payment flow will automatically cancel.
|
|
22
|
+
*/
|
|
23
|
+
onShippingMethodSelected?: (event: {
|
|
24
|
+
shippingMethod: ShippingMethod;
|
|
25
|
+
}) => void;
|
|
26
|
+
/**
|
|
27
|
+
* This callback is triggered whenever the user selects a shipping contact in the Apple Pay sheet.
|
|
28
|
+
* It receives one parameter: an `event` object with a `shippingContact` field. You MUST
|
|
29
|
+
* update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the
|
|
30
|
+
* Apple Pay sheet will hang and the payment flow will automatically cancel.
|
|
31
|
+
*/
|
|
32
|
+
onShippingContactSelected?: (event: {
|
|
33
|
+
shippingContact: ShippingContact;
|
|
34
|
+
}) => void;
|
|
35
|
+
/**
|
|
36
|
+
* This callback is triggered whenever the user inputs a coupon code in the Apple Pay sheet.
|
|
37
|
+
* It receives one parameter: an `event` object with a `couponCode` field. You MUST
|
|
38
|
+
* update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the
|
|
39
|
+
* Apple Pay sheet will hang and the payment flow will automatically cancel.
|
|
40
|
+
*/
|
|
41
|
+
onCouponCodeEntered?: (event: {
|
|
42
|
+
couponCode: string;
|
|
43
|
+
}) => void;
|
|
44
|
+
testID?: string;
|
|
45
|
+
style?: StyleProp<ViewStyle>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* PlatformPayButton Component. Display the platform-specific native wallet pay button: Apple Pay on iOS, and Google Pay on Android.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* <PlatformPayButton
|
|
53
|
+
* onPress={pay}
|
|
54
|
+
* type={PlatformPay.ButtonType.Subscribe}
|
|
55
|
+
* appearance={PlatformPay.ButtonStyle.WhiteOutline}
|
|
56
|
+
* borderRadius={4}
|
|
57
|
+
* disabled={!isApplePaySupported}
|
|
58
|
+
* style={styles.payButton}
|
|
59
|
+
* />
|
|
60
|
+
* ```
|
|
61
|
+
* @param __namedParameters Props
|
|
62
|
+
* @returns JSX.Element
|
|
63
|
+
* @category ReactComponents
|
|
64
|
+
*/
|
|
65
|
+
export declare function PlatformPayButton({ type, appearance, onPress, disabled, borderRadius, onShippingMethodSelected, onShippingContactSelected, onCouponCodeEntered, ...props }: Props): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplePay, ApplePayError, ApplePayResult, ConfirmPaymentResult, ConfirmPaymentSheetPaymentResult, SetupIntent, PaymentIntent, ConfirmSetupIntentResult, CreatePaymentMethodResult, CreateTokenForCVCUpdateResult, CreateTokenResult, GooglePayInitResult, HandleNextActionResult, InitPaymentSheetResult, PaymentMethod, PaymentSheet, PayWithGooglePayResult, PresentPaymentSheetResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, StripeError, GooglePay, CreateGooglePayPaymentMethodResult, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, VerifyMicrodepositsForPaymentResult, VerifyMicrodepositsForSetupResult, CollectBankAccountForPaymentResult, CollectBankAccountForSetupResult, IsCardInWalletResult, CanAddCardToWalletParams, CanAddCardToWalletResult, FinancialConnections } from './types';
|
|
1
|
+
import { ApplePay, ApplePayError, ApplePayResult, PlatformPayError, ConfirmPaymentResult, ConfirmPaymentSheetPaymentResult, SetupIntent, PaymentIntent, ConfirmSetupIntentResult, CreatePaymentMethodResult, CreateTokenForCVCUpdateResult, CreateTokenResult, GooglePayInitResult, HandleNextActionResult, InitPaymentSheetResult, PaymentMethod, PaymentSheet, PayWithGooglePayResult, PresentPaymentSheetResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, StripeError, GooglePay, CreateGooglePayPaymentMethodResult, OpenApplePaySetupResult, Token, VerifyMicrodepositsParams, VerifyMicrodepositsForPaymentResult, VerifyMicrodepositsForSetupResult, CollectBankAccountForPaymentResult, CollectBankAccountForSetupResult, IsCardInWalletResult, CanAddCardToWalletParams, CanAddCardToWalletResult, FinancialConnections, PlatformPay } from './types';
|
|
2
2
|
export declare const createPaymentMethod: (params: PaymentMethod.CreateParams, options?: PaymentMethod.CreateOptions) => Promise<CreatePaymentMethodResult>;
|
|
3
3
|
export declare const createToken: (params: Token.CreateParams) => Promise<CreateTokenResult>;
|
|
4
4
|
export declare const retrievePaymentIntent: (clientSecret: string) => Promise<RetrievePaymentIntentResult>;
|
|
@@ -12,14 +12,18 @@ export declare const retrieveSetupIntent: (clientSecret: string) => Promise<Retr
|
|
|
12
12
|
* @returns A promise that resolves to an object containing either a `paymentIntent` field, or an `error` field.
|
|
13
13
|
*/
|
|
14
14
|
export declare const confirmPayment: (paymentIntentClientSecret: string, params?: PaymentMethod.CreateParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>;
|
|
15
|
+
/** @deprecated Use `isPlatformPaySupported` instead. */
|
|
15
16
|
export declare const isApplePaySupported: () => Promise<boolean>;
|
|
17
|
+
/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */
|
|
16
18
|
export declare const presentApplePay: (params: ApplePay.PresentParams) => Promise<ApplePayResult>;
|
|
19
|
+
/** @deprecated Use `updatePlatformPaySheet` instead. */
|
|
17
20
|
export declare const updateApplePaySummaryItems: (summaryItems: ApplePay.CartSummaryItem[], errorAddressFields?: Array<{
|
|
18
21
|
field: ApplePay.AddressFields;
|
|
19
22
|
message?: string;
|
|
20
23
|
}>) => Promise<{
|
|
21
24
|
error?: StripeError<ApplePayError>;
|
|
22
25
|
}>;
|
|
26
|
+
/** @deprecated Use `confirmPlatformPaySetupIntent` or `confirmPlatformPayPayment` instead. */
|
|
23
27
|
export declare const confirmApplePayPayment: (clientSecret: string) => Promise<{
|
|
24
28
|
error?: StripeError<ApplePayError>;
|
|
25
29
|
}>;
|
|
@@ -44,10 +48,15 @@ export declare const confirmPaymentSheetPayment: () => Promise<ConfirmPaymentShe
|
|
|
44
48
|
* is also cleared during logout.
|
|
45
49
|
*/
|
|
46
50
|
export declare const resetPaymentSheetCustomer: () => Promise<null>;
|
|
51
|
+
/** @deprecated Use `isPlatformPaySupported` instead. */
|
|
47
52
|
export declare const isGooglePaySupported: (params?: GooglePay.IsSupportedParams | undefined) => Promise<boolean>;
|
|
53
|
+
/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */
|
|
48
54
|
export declare const initGooglePay: (params: GooglePay.InitParams) => Promise<GooglePayInitResult>;
|
|
55
|
+
/** @deprecated Use `confirmPlatformPaySetupIntent`, `confirmPlatformPayPayment`, or `createPlatformPayPaymentMethod` instead. */
|
|
49
56
|
export declare const presentGooglePay: (params: GooglePay.PresentParams) => Promise<PayWithGooglePayResult>;
|
|
57
|
+
/** @deprecated Use `createPlatformPayPaymentMethod` instead. */
|
|
50
58
|
export declare const createGooglePayPaymentMethod: (params: GooglePay.CreatePaymentMethodParams) => Promise<CreateGooglePayPaymentMethodResult>;
|
|
59
|
+
/** @deprecated Use `openNativePaySetup` instead. */
|
|
51
60
|
export declare const openApplePaySetup: () => Promise<OpenApplePaySetupResult>;
|
|
52
61
|
export declare const collectBankAccountForPayment: (clientSecret: string, params: PaymentMethod.CollectBankAccountParams) => Promise<CollectBankAccountForPaymentResult>;
|
|
53
62
|
export declare const collectBankAccountForSetup: (clientSecret: string, params: PaymentMethod.CollectBankAccountParams) => Promise<CollectBankAccountForSetupResult>;
|
|
@@ -65,7 +74,14 @@ export declare const collectBankAccountToken: (clientSecret: string) => Promise<
|
|
|
65
74
|
* @returns A promise that resolves to an object containing either a `session` field, or an error field.
|
|
66
75
|
*/
|
|
67
76
|
export declare const collectFinancialConnectionsAccounts: (clientSecret: string) => Promise<FinancialConnections.SessionResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Check if the app & device support adding this card to the native wallet.
|
|
79
|
+
* @param params An object containing fields for `primaryAccountIdentifier`, `cardLastFour`, and `testEnv`.
|
|
80
|
+
*
|
|
81
|
+
* @returns A promise resolving to an object of type CanAddCardToWalletResult. Check the `canAddCard` field, if it's true, you should show the `<AddToWalletButton />`
|
|
82
|
+
*/
|
|
68
83
|
export declare const canAddCardToWallet: (params: CanAddCardToWalletParams) => Promise<CanAddCardToWalletResult>;
|
|
84
|
+
/** @deprecated Please use `canAddCardToWallet` instead. */
|
|
69
85
|
export declare const isCardInWallet: (params: {
|
|
70
86
|
cardLastFour: string;
|
|
71
87
|
}) => Promise<IsCardInWalletResult>;
|
|
@@ -75,3 +91,59 @@ export declare const Constants: {
|
|
|
75
91
|
ISSUING: string;
|
|
76
92
|
};
|
|
77
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* Check if the relevant native wallet (Apple Pay on iOS, Google Pay on Android) is supported.
|
|
96
|
+
* @returns A boolean indicating whether or not the native wallet is supported.
|
|
97
|
+
*/
|
|
98
|
+
export declare const isPlatformPaySupported: (params?: {
|
|
99
|
+
googlePay?: GooglePay.IsSupportedParams | undefined;
|
|
100
|
+
} | undefined) => Promise<boolean>;
|
|
101
|
+
/**
|
|
102
|
+
* 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).
|
|
103
|
+
* @param clientSecret The client secret of the SetupIntent.
|
|
104
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
105
|
+
* @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.
|
|
106
|
+
*/
|
|
107
|
+
export declare const confirmPlatformPaySetupIntent: (clientSecret: string, params: PlatformPay.ConfirmParams) => Promise<PlatformPay.ConfirmSetupIntentResult>;
|
|
108
|
+
/**
|
|
109
|
+
* 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).
|
|
110
|
+
* @param clientSecret The client secret of the PaymentIntent.
|
|
111
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
112
|
+
* @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.
|
|
113
|
+
*/
|
|
114
|
+
export declare const confirmPlatformPayPayment: (clientSecret: string, params: PlatformPay.ConfirmParams) => Promise<PlatformPay.ConfirmPaymentResult>;
|
|
115
|
+
/**
|
|
116
|
+
* iOS only, this will always return false on Android. Dismisses the Apple Pay sheet if it is open.
|
|
117
|
+
* @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.
|
|
118
|
+
*/
|
|
119
|
+
export declare const dismissPlatformPay: () => Promise<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* 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) and [token](https://stripe.com/docs/api/tokens).
|
|
122
|
+
* @param params an object describing the Apple Pay and Google Pay configurations.
|
|
123
|
+
* @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.
|
|
124
|
+
*/
|
|
125
|
+
export declare const createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>;
|
|
126
|
+
/**
|
|
127
|
+
* 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.
|
|
128
|
+
* @param params an object describing the Apple Pay configuration, with the following fields:
|
|
129
|
+
* - cartItems An array of payment summary items to display in the Apple Pay sheet.
|
|
130
|
+
* - shippingMethods An array of shipping methods to display in the Apple Pay sheet.
|
|
131
|
+
* - 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.
|
|
132
|
+
*
|
|
133
|
+
* @returns An object with an optional 'error' field, which is only populated if something went wrong.
|
|
134
|
+
*/
|
|
135
|
+
export declare const updatePlatformPaySheet: (params: {
|
|
136
|
+
applePay: {
|
|
137
|
+
cartItems: Array<PlatformPay.CartSummaryItem>;
|
|
138
|
+
shippingMethods: Array<PlatformPay.ShippingMethod>;
|
|
139
|
+
errors: Array<PlatformPay.ApplePaySheetError>;
|
|
140
|
+
};
|
|
141
|
+
}) => Promise<{
|
|
142
|
+
error?: StripeError<PlatformPayError>;
|
|
143
|
+
}>;
|
|
144
|
+
/**
|
|
145
|
+
* iOS only, this is a no-op on Android. Use this method to move users to the interface for adding credit cards.
|
|
146
|
+
* This method transfers control to the Wallet app on iPhone or to the Settings
|
|
147
|
+
* app on iPad. For devices that don’t support Apple Pay, this method does nothing.
|
|
148
|
+
*/
|
|
149
|
+
export declare const openPlatformPaySetup: () => Promise<void>;
|