@stripe/stripe-react-native 0.33.0 → 0.34.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 +16 -0
- package/android/build.gradle +8 -3
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +10 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +84 -19
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +17 -2
- package/android/src/main/res/layout/stripe_react_native_google_pay_button.xml +14 -0
- package/ios/AddressSheet/AddressSheetView.swift +8 -0
- package/ios/CustomerSheet/CustomerSheetUtils.swift +8 -0
- package/lib/commonjs/components/AddressSheet.js +1 -1
- package/lib/commonjs/components/AddressSheet.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
- package/lib/commonjs/types/CustomerSheet.js.map +1 -1
- package/lib/commonjs/types/PlatformPay.js.map +1 -1
- package/lib/commonjs/types/components/GooglePayButtonComponent.js.map +1 -1
- package/lib/module/components/AddressSheet.js +1 -1
- package/lib/module/components/AddressSheet.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/types/CustomerSheet.js.map +1 -1
- package/lib/module/types/PlatformPay.js.map +1 -1
- package/lib/module/types/components/GooglePayButtonComponent.js.map +1 -1
- package/lib/typescript/src/components/AddressSheet.d.ts +2 -2
- package/lib/typescript/src/components/PlatformPayButton.d.ts +2 -2
- package/lib/typescript/src/types/CustomerSheet.d.ts +2 -2
- package/lib/typescript/src/types/PlatformPay.d.ts +2 -2
- package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/AddressSheet.tsx +8 -2
- package/src/components/PlatformPayButton.tsx +4 -2
- package/src/types/CustomerSheet.ts +8 -2
- package/src/types/PlatformPay.ts +2 -2
- package/src/types/components/GooglePayButtonComponent.ts +2 -0
- package/stripe-react-native.podspec +1 -1
- package/android/src/main/res/drawable/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable/googlepay_button_background_shape.xml +0 -5
- package/android/src/main/res/drawable/googlepay_button_content.xml +0 -48
- package/android/src/main/res/drawable/googlepay_mark_background.xml +0 -12
- package/android/src/main/res/drawable/googlepay_mark_content.xml +0 -27
- package/android/src/main/res/drawable/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ar/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ar/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ar/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ar/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ar/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ar/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ar/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bg/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bg/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bg/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bg/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bg/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bg/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bg/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ca/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ca/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ca/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ca/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ca/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ca/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ca/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cs/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cs/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cs/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cs/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cs/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cs/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cs/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-da/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-da/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-da/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-da/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-da/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-da/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-da/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-de/book_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-de/buy_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-de/checkout_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-de/donate_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-de/order_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-de/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-de/subscribe_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-el/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-el/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-el/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-el/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-el/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-el/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-el/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-et/book_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-et/buy_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-et/checkout_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-et/donate_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-et/order_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-et/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-et/subscribe_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fi/book_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fi/buy_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fi/checkout_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fi/donate_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fi/order_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fi/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fi/subscribe_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fr/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr/subscribe_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-hdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable-hr/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hr/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hr/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hr/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hr/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hr/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-id/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-id/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-id/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-id/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-id/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-id/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-id/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-it/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-it/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-it/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-it/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-it/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-it/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-it/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ja/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ja/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ja/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ja/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ja/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ja/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ja/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ko/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ko/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ko/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ko/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ko/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ko/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ko/subscribe_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-mdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable-ms/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ms/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ms/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ms/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ms/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ms/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ms/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-nl/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-nl/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-nl/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-nl/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-nl/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-nl/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-nl/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-no/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-no/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-no/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-no/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-no/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-no/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-no/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pl/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pl/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pl/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pl/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pl/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pl/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pl/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ru/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ru/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ru/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ru/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ru/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ru/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ru/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sk/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sk/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sk/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sk/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sk/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sk/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sk/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sl/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sl/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sl/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sl/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sl/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sl/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sl/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sr/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sr/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sr/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sr/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sr/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sr/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sv/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sv/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sv/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sv/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sv/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sv/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sv/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-th/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-th/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-th/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-th/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-th/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-th/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-th/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-tr/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-tr/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-tr/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-tr/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-tr/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-tr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-tr/subscribe_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uk/book_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uk/buy_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uk/checkout_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uk/donate_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uk/order_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uk/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uk/subscribe_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-v21/googlepay_button_no_shadow_background.xml +0 -7
- package/android/src/main/res/drawable-xhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-xhdpi/googlepay_button_no_shadow_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-xxhdpi/googlepay_button_no_shadow_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-xxxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/layout/book_with_googlepay_button.xml +0 -20
- package/android/src/main/res/layout/buy_with_googlepay_button.xml +0 -20
- package/android/src/main/res/layout/checkout_with_googlepay_button.xml +0 -20
- package/android/src/main/res/layout/donate_with_googlepay_button.xml +0 -20
- package/android/src/main/res/layout/googlepay_mark_button.xml +0 -16
- package/android/src/main/res/layout/order_with_googlepay_button.xml +0 -20
- package/android/src/main/res/layout/pay_with_googlepay_button.xml +0 -20
- package/android/src/main/res/layout/plain_googlepay_button.xml +0 -17
- package/android/src/main/res/layout/subscribe_with_googlepay_button.xml +0 -20
- package/android/src/main/res/values/googlepay_strings.xml +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.34.0 - 2023-10-25
|
|
6
|
+
|
|
7
|
+
**Features**
|
|
8
|
+
|
|
9
|
+
- Added new `presentationStyle` options for CustomerSheet and AddressSheet. [#1515](https://github.com/stripe/stripe-react-native/pull/1515)
|
|
10
|
+
- Support `PlatformPayButton`'s `appearance` and `borderRadius` props on Android. [#1534](https://github.com/stripe/stripe-react-native/pull/1534)
|
|
11
|
+
- PaymentSheet now supports Swish for PaymentIntents in private beta [#1542](https://github.com/stripe/stripe-react-native/pull/1542)
|
|
12
|
+
- PaymentSheet now supports saved payment method support for SEPA family payment methods [#1542](https://github.com/stripe/stripe-react-native/pull/1542)
|
|
13
|
+
|
|
14
|
+
**Fixes**
|
|
15
|
+
|
|
16
|
+
- Fixed an issue on Android where apps could crash when launching Google Pay
|
|
17
|
+
- Fixed an issue on Android where `street` in `shippingContact` for PlatformPay methods would include `null` in the string
|
|
18
|
+
- Fixed an issue on Android where `phoneNumber` in `ShippingContact` for PlatformPay methods would be `null`
|
|
19
|
+
- Removed XML asset files, library size reduced. [#1534](https://github.com/stripe/stripe-react-native/pull/1534)
|
|
20
|
+
|
|
5
21
|
## 0.33.0 - 2023-09-22
|
|
6
22
|
|
|
7
23
|
**Features**
|
package/android/build.gradle
CHANGED
|
@@ -135,15 +135,20 @@ dependencies {
|
|
|
135
135
|
implementation 'com.github.bumptech.glide:glide:4.12.0'
|
|
136
136
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
137
137
|
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
|
|
138
|
-
implementation
|
|
139
|
-
|
|
138
|
+
implementation("com.stripe:stripe-android:$stripe_version") {
|
|
139
|
+
exclude group: 'androidx.emoji2', module: 'emoji2'
|
|
140
|
+
}
|
|
141
|
+
implementation ("com.stripe:financial-connections:$stripe_version") {
|
|
142
|
+
exclude group: 'androidx.emoji2', module: 'emoji2'
|
|
143
|
+
}
|
|
144
|
+
implementation('androidx.emoji2:emoji2:1.3.0').force // Avoid using 1.4.0 since that requires targetSdkVersion 34
|
|
140
145
|
implementation 'com.google.android.material:material:1.3.0'
|
|
141
146
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
|
142
147
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
143
148
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
|
|
144
149
|
|
|
145
150
|
// play-services-wallet is already included in stripe-android
|
|
146
|
-
compileOnly "com.google.android.gms:play-services-wallet:19.
|
|
151
|
+
compileOnly "com.google.android.gms:play-services-wallet:19.2.0"
|
|
147
152
|
|
|
148
153
|
// Users need to declare this dependency on their own, otherwise all methods are a no-op
|
|
149
154
|
compileOnly 'com.stripe:stripe-android-issuing-push-provisioning:1.1.0'
|
|
@@ -20,6 +20,16 @@ class GooglePayButtonManager : SimpleViewManager<GooglePayButtonView?>() {
|
|
|
20
20
|
view.setType(buttonType)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
@ReactProp(name = "appearance")
|
|
24
|
+
fun appearance(view: GooglePayButtonView, appearance: Int) {
|
|
25
|
+
view.setAppearance(appearance)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ReactProp(name = "borderRadius")
|
|
29
|
+
fun borderRadius(view: GooglePayButtonView, borderRadius: Int) {
|
|
30
|
+
view.setBorderRadius(borderRadius)
|
|
31
|
+
}
|
|
32
|
+
|
|
23
33
|
override fun createViewInstance(reactContext: ThemedReactContext): GooglePayButtonView {
|
|
24
34
|
return GooglePayButtonView(reactContext)
|
|
25
35
|
}
|
|
@@ -1,35 +1,91 @@
|
|
|
1
1
|
package com.reactnativestripesdk
|
|
2
2
|
|
|
3
|
-
import android.
|
|
3
|
+
import android.util.Log
|
|
4
4
|
import android.view.View
|
|
5
5
|
import android.widget.FrameLayout
|
|
6
|
+
import com.facebook.react.uimanager.PixelUtil
|
|
6
7
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
8
|
+
import com.google.android.gms.wallet.button.ButtonConstants.ButtonTheme
|
|
9
|
+
import com.google.android.gms.wallet.button.ButtonConstants.ButtonType
|
|
10
|
+
import com.google.android.gms.wallet.button.ButtonOptions
|
|
11
|
+
import com.google.android.gms.wallet.button.PayButton
|
|
12
|
+
import com.stripe.android.GooglePayJsonFactory
|
|
13
|
+
import org.json.JSONArray
|
|
7
14
|
|
|
8
15
|
class GooglePayButtonView(private val context: ThemedReactContext) : FrameLayout(context) {
|
|
9
|
-
private var button: View? = null
|
|
10
16
|
private var type: Int? = null
|
|
17
|
+
private var appearance: Int? = null
|
|
18
|
+
private var borderRadius: Int = 4 // Matches the default on iOS's ApplePayButton
|
|
19
|
+
private var button: PayButton? = null
|
|
11
20
|
|
|
12
21
|
fun initialize() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
11 -> R.layout.order_with_googlepay_button
|
|
21
|
-
1000 -> R.layout.pay_with_googlepay_button
|
|
22
|
-
7 -> R.layout.subscribe_with_googlepay_button
|
|
23
|
-
1001 -> R.layout.googlepay_mark_button
|
|
24
|
-
else -> R.layout.plain_googlepay_button
|
|
25
|
-
}
|
|
22
|
+
if (button != null) {
|
|
23
|
+
removeView(button)
|
|
24
|
+
}
|
|
25
|
+
button = configureGooglePayButton()
|
|
26
|
+
addView(button)
|
|
27
|
+
viewTreeObserver.addOnGlobalLayoutListener { requestLayout() }
|
|
28
|
+
}
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
private fun configureGooglePayButton(): PayButton {
|
|
31
|
+
val googlePayButton = PayButton(
|
|
32
|
+
context
|
|
29
33
|
)
|
|
34
|
+
googlePayButton.initialize(buildButtonOptions())
|
|
35
|
+
googlePayButton.setOnClickListener { _ ->
|
|
36
|
+
// Call the Javascript TouchableOpacity parent where the onClick handler is set
|
|
37
|
+
(this.parent as? View)?.performClick() ?: run {
|
|
38
|
+
Log.e("StripeReactNative", "Unable to find parent of GooglePayButtonView.")
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return googlePayButton
|
|
42
|
+
}
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
private fun buildButtonOptions(): ButtonOptions {
|
|
45
|
+
val allowedPaymentMethods = JSONArray().put(
|
|
46
|
+
GooglePayJsonFactory(context).createCardPaymentMethod(
|
|
47
|
+
billingAddressParameters = null,
|
|
48
|
+
allowCreditCards = null
|
|
49
|
+
)
|
|
50
|
+
).toString()
|
|
51
|
+
|
|
52
|
+
val options = ButtonOptions.newBuilder()
|
|
53
|
+
.setAllowedPaymentMethods(allowedPaymentMethods)
|
|
54
|
+
|
|
55
|
+
getButtonType()?.let {
|
|
56
|
+
options.setButtonType(it)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
getButtonTheme()?.let {
|
|
60
|
+
options.setButtonTheme(it)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
options.setCornerRadius(PixelUtil.toPixelFromDIP(this.borderRadius.toDouble()).toInt())
|
|
64
|
+
|
|
65
|
+
return options.build()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private fun getButtonType(): Int? {
|
|
69
|
+
return when (this.type) {
|
|
70
|
+
0,
|
|
71
|
+
1 -> ButtonType.BUY
|
|
72
|
+
6 -> ButtonType.BOOK
|
|
73
|
+
5 -> ButtonType.CHECKOUT
|
|
74
|
+
4 -> ButtonType.DONATE
|
|
75
|
+
11 -> ButtonType.ORDER
|
|
76
|
+
7 -> ButtonType.SUBSCRIBE
|
|
77
|
+
1000 -> ButtonType.PAY
|
|
78
|
+
1001 -> ButtonType.PLAIN
|
|
79
|
+
else -> null
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private fun getButtonTheme(): Int? {
|
|
84
|
+
return when (this.appearance) {
|
|
85
|
+
0, 1 -> ButtonTheme.LIGHT
|
|
86
|
+
2 -> ButtonTheme.DARK
|
|
87
|
+
else -> null
|
|
88
|
+
}
|
|
33
89
|
}
|
|
34
90
|
|
|
35
91
|
override fun requestLayout() {
|
|
@@ -42,9 +98,18 @@ class GooglePayButtonView(private val context: ThemedReactContext) : FrameLayout
|
|
|
42
98
|
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
|
|
43
99
|
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY))
|
|
44
100
|
button?.layout(left, top, right, bottom)
|
|
101
|
+
|
|
45
102
|
}
|
|
46
103
|
|
|
47
104
|
fun setType(type: Int) {
|
|
48
105
|
this.type = type
|
|
49
106
|
}
|
|
107
|
+
|
|
108
|
+
fun setAppearance(appearance: Int) {
|
|
109
|
+
this.appearance = appearance
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
fun setBorderRadius(borderRadius: Int) {
|
|
113
|
+
this.borderRadius = borderRadius
|
|
114
|
+
}
|
|
50
115
|
}
|
|
@@ -49,7 +49,7 @@ class GooglePayLauncherFragment : Fragment() {
|
|
|
49
49
|
this.mode = mode
|
|
50
50
|
this.callback = callback
|
|
51
51
|
this.currencyCode = googlePayParams.getString("currencyCode") ?: "USD"
|
|
52
|
-
this.amount = googlePayParams
|
|
52
|
+
this.amount = getIntOrNull(googlePayParams, "amount")
|
|
53
53
|
this.label = googlePayParams.getString("label")
|
|
54
54
|
this.configuration = GooglePayLauncher.Config(
|
|
55
55
|
environment = if (googlePayParams.getBoolean("testEnv")) GooglePayEnvironment.Test else GooglePayEnvironment.Production,
|
|
@@ -292,6 +292,7 @@ class PaymentLauncherFragment(
|
|
|
292
292
|
StripeIntent.NextActionType.WeChatPayRedirect,
|
|
293
293
|
StripeIntent.NextActionType.UpiAwaitNotification,
|
|
294
294
|
StripeIntent.NextActionType.CashAppRedirect,
|
|
295
|
+
StripeIntent.NextActionType.SwishRedirect,
|
|
295
296
|
null, -> false
|
|
296
297
|
}
|
|
297
298
|
}
|
|
@@ -502,6 +502,12 @@ internal fun mapNextAction(type: NextActionType?, data: NextActionData?): Writab
|
|
|
502
502
|
nextActionMap.putString("voucherURL", it.hostedVoucherUrl)
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
+
NextActionType.SwishRedirect -> {
|
|
506
|
+
(data as? NextActionData.SwishRedirect)?.let {
|
|
507
|
+
nextActionMap.putString("type", "swishRedirect")
|
|
508
|
+
nextActionMap.putString("mobileAuthUrl", it.mobileAuthUrl)
|
|
509
|
+
}
|
|
510
|
+
}
|
|
505
511
|
}
|
|
506
512
|
return nextActionMap
|
|
507
513
|
}
|
|
@@ -898,13 +904,22 @@ internal fun mapFromShippingContact(googlePayResult: GooglePayResult): WritableM
|
|
|
898
904
|
googlePayResult.name
|
|
899
905
|
name.putString("givenName", googlePayResult.shippingInformation?.name)
|
|
900
906
|
map.putMap("name", name)
|
|
901
|
-
|
|
907
|
+
googlePayResult.shippingInformation?.phone?.let {
|
|
908
|
+
map.putString("phoneNumber", it)
|
|
909
|
+
} ?: run {
|
|
910
|
+
map.putString("phoneNumber", googlePayResult?.phoneNumber)
|
|
911
|
+
}
|
|
902
912
|
val postalAddress = WritableNativeMap()
|
|
903
913
|
postalAddress.putString("city", googlePayResult.shippingInformation?.address?.city)
|
|
904
914
|
postalAddress.putString("country", googlePayResult.shippingInformation?.address?.country)
|
|
905
915
|
postalAddress.putString("postalCode", googlePayResult.shippingInformation?.address?.postalCode)
|
|
906
916
|
postalAddress.putString("state", googlePayResult.shippingInformation?.address?.state)
|
|
907
|
-
|
|
917
|
+
val line1: String? = googlePayResult.shippingInformation?.address?.line1
|
|
918
|
+
val line2: String? = googlePayResult.shippingInformation?.address?.line2
|
|
919
|
+
val street =
|
|
920
|
+
(if (line1 != null) "$line1" else "") +
|
|
921
|
+
(if (line2 != null) "\n$line2" else "")
|
|
922
|
+
postalAddress.putString("street", street)
|
|
908
923
|
postalAddress.putString("isoCountryCode", googlePayResult.shippingInformation?.address?.country)
|
|
909
924
|
map.putMap("postalAddress", postalAddress)
|
|
910
925
|
return map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
android:clickable="true"
|
|
4
|
+
android:focusable="true"
|
|
5
|
+
android:layout_width="match_parent"
|
|
6
|
+
android:layout_height="wrap_content"
|
|
7
|
+
>
|
|
8
|
+
<com.google.android.gms.wallet.button.PayButton
|
|
9
|
+
android:id="@+id/googlePayButton"
|
|
10
|
+
android:layout_width="match_parent"
|
|
11
|
+
android:layout_height="wrap_content"
|
|
12
|
+
android:layout_marginBottom="20dp"
|
|
13
|
+
/>
|
|
14
|
+
</FrameLayout>
|
|
@@ -91,6 +91,14 @@ class AddressSheetView: UIView {
|
|
|
91
91
|
switch (presentationStyle) {
|
|
92
92
|
case "fullscreen":
|
|
93
93
|
return .fullScreen
|
|
94
|
+
case "pageSheet":
|
|
95
|
+
return .pageSheet
|
|
96
|
+
case "formSheet":
|
|
97
|
+
return .formSheet
|
|
98
|
+
case "automatic":
|
|
99
|
+
return .automatic
|
|
100
|
+
case "overFullScreen":
|
|
101
|
+
return .overFullScreen
|
|
94
102
|
case "popover":
|
|
95
103
|
fallthrough
|
|
96
104
|
default:
|
|
@@ -113,6 +113,14 @@ class CustomerSheetUtils {
|
|
|
113
113
|
switch (string) {
|
|
114
114
|
case "fullscreen":
|
|
115
115
|
return .fullScreen
|
|
116
|
+
case "pageSheet":
|
|
117
|
+
return .pageSheet
|
|
118
|
+
case "formSheet":
|
|
119
|
+
return .formSheet
|
|
120
|
+
case "automatic":
|
|
121
|
+
return .automatic
|
|
122
|
+
case "overFullScreen":
|
|
123
|
+
return .overFullScreen
|
|
116
124
|
case "popover":
|
|
117
125
|
fallthrough
|
|
118
126
|
default:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];var AddressSheetNative=(0,_reactNative.requireNativeComponent)('AddressSheetView');function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddressSheetNative,(0,_extends2.default)({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);},__self:this,__source:{fileName:_jsxFileName,lineNumber:
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];var AddressSheetNative=(0,_reactNative.requireNativeComponent)('AddressSheetView');function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddressSheetNative,(0,_extends2.default)({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);},__self:this,__source:{fileName:_jsxFileName,lineNumber:76,columnNumber:5}}));}
|
|
2
2
|
//# sourceMappingURL=AddressSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AddressSheetNative","requireNativeComponent","AddressSheet","onSubmit","onError","props","value","nativeEvent","error"],"sources":["AddressSheet.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n NativeSyntheticEvent,\n} from 'react-native';\nimport type {\n PaymentSheet,\n AddressDetails,\n StripeError,\n AddressSheetError,\n} from '../types';\n\nconst AddressSheetNative = requireNativeComponent<any>('AddressSheetView');\n\n/**\n * Props\n */\nexport interface Props extends AccessibilityProps {\n /** Whether the sheet is visible. Defaults to false. */\n visible: boolean;\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. */\n presentationStyle
|
|
1
|
+
{"version":3,"names":["AddressSheetNative","requireNativeComponent","AddressSheet","onSubmit","onError","props","value","nativeEvent","error"],"sources":["AddressSheet.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n NativeSyntheticEvent,\n} from 'react-native';\nimport type {\n PaymentSheet,\n AddressDetails,\n StripeError,\n AddressSheetError,\n} from '../types';\n\nconst AddressSheetNative = requireNativeComponent<any>('AddressSheetView');\n\n/**\n * Props\n */\nexport interface Props extends AccessibilityProps {\n /** Whether the sheet is visible. Defaults to false. */\n visible: boolean;\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */\n presentationStyle?:\n | 'fullscreen'\n | 'popover'\n | 'pageSheet'\n | 'formSheet'\n | 'automatic'\n | 'overFullScreen';\n /** Controls how the modal animates. iOS only. */\n animationStyle?: 'flip' | 'curl' | 'slide' | 'dissolve';\n /** Configuration for the look and feel of the UI. */\n appearance?: PaymentSheet.AppearanceParams;\n /** The values to prepopulate the sheet's fields with. */\n defaultValues?: AddressDetails;\n /** Configuration for additional fields besides the physical address */\n additionalFields?: {\n /** Determines whether the phone number is hidden, required, or optional. Defaults to hidden. */\n phoneNumber?: 'hidden' | 'optional' | 'required';\n /** The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed. */\n checkboxLabel?: string;\n };\n /** A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. */\n allowedCountries?: Array<string>;\n /** A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. */\n autocompleteCountries?: Array<string>;\n /** The title of the primary button displayed at the bottom of the screen. Defaults to \"Save Address\". */\n primaryButtonTitle?: string;\n /** Title displayed at the top of the sheet. Defaults to \"Address\". */\n sheetTitle?: string;\n /** Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. */\n googlePlacesApiKey?: string;\n /** Called when the user submits their information */\n onSubmit: (result: CollectAddressResult) => void;\n /** Called when the user taps the button to close the sheet before submitting their information, or when an error occurs. */\n onError: (error: StripeError<AddressSheetError>) => void;\n}\n\nexport type CollectAddressResult = Required<AddressDetails>;\n\n/**\n *\n *\n * @example\n * ```ts\n * <AddressSheet\n *\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddressSheet({ onSubmit, onError, ...props }: Props) {\n return (\n <AddressSheetNative\n {...props}\n onSubmitAction={(value: NativeSyntheticEvent<CollectAddressResult>) =>\n onSubmit(value.nativeEvent)\n }\n onErrorAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<AddressSheetError>;\n }>\n ) => onError(value.nativeEvent.error)}\n />\n );\n}\n"],"mappings":"8WAAA,oDACA,yCAIsB,wIAQtB,GAAMA,mBAAkB,CAAG,GAAAC,mCAAsB,EAAM,kBAAkB,CAAC,CA4DnE,QAASC,aAAY,MAAyC,IAAtCC,SAAQ,MAARA,QAAQ,CAAEC,OAAO,MAAPA,OAAO,CAAKC,KAAK,uDACxD,MACE,8BAAC,kBAAkB,0BACbA,KAAK,EACT,cAAc,CAAE,wBAACC,KAAiD,QAChEH,SAAQ,CAACG,KAAK,CAACC,WAAW,CAAC,EAC5B,CACD,aAAa,CAAE,uBACbD,KAEE,QACCF,QAAO,CAACE,KAAK,CAACC,WAAW,CAACC,KAAK,CAAC,EAAC,6EACtC,CAEN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);}:undefined;return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:5}},_reactNative.Platform.OS==='ios'?_react.default.createElement(_ApplePayButtonNative.default,(0,_extends2.default)({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:152,columnNumber:9}})):_react.default.createElement(_GooglePayButtonNative.default,(0,_extends2.default)({type:type,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:165,columnNumber:9}})));}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);}:undefined;return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:5}},_reactNative.Platform.OS==='ios'?_react.default.createElement(_ApplePayButtonNative.default,(0,_extends2.default)({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:152,columnNumber:9}})):_react.default.createElement(_GooglePayButtonNative.default,(0,_extends2.default)({type:type,appearance:appearance,borderRadius:borderRadius,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:165,columnNumber:9}})));}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
|
|
2
2
|
//# sourceMappingURL=PlatformPayButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PlatformPayButton","type","ButtonType","Default","appearance","ButtonStyle","Automatic","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style","props","shippingMethodCallback","value","nativeEvent","undefined","shippingContactCallback","couponCodeCallback","orderTrackingCallback","NativeStripeSdk","configureOrderTracking","styles","notDisabled","Platform","OS","nativeButtonStyle","StyleSheet","create","flex","opacity"],"sources":["PlatformPayButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n TouchableOpacity,\n StyleSheet,\n Platform,\n NativeSyntheticEvent,\n} from 'react-native';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n ButtonType,\n ButtonStyle,\n ShippingMethod,\n ShippingContact,\n} from '../types/PlatformPay';\nimport GooglePayButtonNative from './GooglePayButtonNative';\nimport ApplePayButtonNative from './ApplePayButtonNative';\n\n/**\n * PlatformPayButton Component Props\n */\nexport interface Props extends AccessibilityProps {\n /** Sets the text displayed by the button. */\n type?: ButtonType;\n /**
|
|
1
|
+
{"version":3,"names":["PlatformPayButton","type","ButtonType","Default","appearance","ButtonStyle","Automatic","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style","props","shippingMethodCallback","value","nativeEvent","undefined","shippingContactCallback","couponCodeCallback","orderTrackingCallback","NativeStripeSdk","configureOrderTracking","styles","notDisabled","Platform","OS","nativeButtonStyle","StyleSheet","create","flex","opacity"],"sources":["PlatformPayButton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n StyleProp,\n ViewStyle,\n TouchableOpacity,\n StyleSheet,\n Platform,\n NativeSyntheticEvent,\n} from 'react-native';\nimport NativeStripeSdk from '../NativeStripeSdk';\nimport {\n ButtonType,\n ButtonStyle,\n ShippingMethod,\n ShippingContact,\n} from '../types/PlatformPay';\nimport GooglePayButtonNative from './GooglePayButtonNative';\nimport ApplePayButtonNative from './ApplePayButtonNative';\n\n/**\n * PlatformPayButton Component Props\n */\nexport interface Props extends AccessibilityProps {\n /** Sets the text displayed by the button. */\n type?: ButtonType;\n /** Sets the coloring of the button. */\n appearance?: ButtonStyle;\n /** Sets the border radius of the button. */\n borderRadius?: number;\n /** Function called whenever the button is pressed. */\n onPress(): void;\n /** Set to `true` to disable the button from being pressed & apply a slight opacity to indicate that it is unpressable. Defaults to false. */\n disabled?: boolean;\n /**\n * This callback is triggered whenever the user selects a shipping method in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `shippingMethod` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingMethodSelected?: (event: {\n shippingMethod: ShippingMethod;\n }) => void;\n /**\n * This callback is triggered whenever the user selects a shipping contact in the Apple Pay sheet IF\n * ContactField.PostalAddress was included in the requiredShippingAddressFields array.\n * It receives one parameter: an `event` object with a `shippingContact` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onShippingContactSelected?: (event: {\n shippingContact: ShippingContact;\n }) => void;\n /**\n * This callback is triggered whenever the user inputs a coupon code in the Apple Pay sheet.\n * It receives one parameter: an `event` object with a `couponCode` field. You MUST\n * update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the\n * Apple Pay sheet will hang and the payment flow will automatically cancel.\n */\n onCouponCodeEntered?: (event: { couponCode: string }) => void;\n /** Callback function for setting the order details (retrieved from your server) to give users the\n * ability to track and manage their purchases in Wallet. Stripe calls your implementation after the\n * payment is complete, but before iOS dismisses the Apple Pay sheet. You must call the `completion`\n * function, or else the Apple Pay sheet will hang.*/\n setOrderTracking?: (\n completion: (\n orderIdentifier: string,\n orderTypeIdentifier: string,\n authenticationToken: string,\n webServiceUrl: string\n ) => void\n ) => void;\n testID?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * PlatformPayButton Component. Display the platform-specific native wallet pay button: Apple Pay on iOS, and Google Pay on Android.\n *\n * @example\n * ```ts\n * <PlatformPayButton\n * onPress={pay}\n * type={PlatformPay.ButtonType.Subscribe}\n * appearance={PlatformPay.ButtonStyle.WhiteOutline}\n * borderRadius={4}\n * disabled={!isApplePaySupported}\n * style={styles.payButton}\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function PlatformPayButton({\n type = ButtonType.Default,\n appearance = ButtonStyle.Automatic,\n onPress,\n disabled,\n borderRadius,\n onShippingMethodSelected,\n onShippingContactSelected,\n onCouponCodeEntered,\n setOrderTracking,\n style,\n ...props\n}: Props) {\n const shippingMethodCallback = onShippingMethodSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingMethod: ShippingMethod;\n }>\n ) => {\n onShippingMethodSelected && onShippingMethodSelected(value.nativeEvent);\n }\n : undefined;\n\n const shippingContactCallback = onShippingContactSelected\n ? (\n value: NativeSyntheticEvent<{\n shippingContact: ShippingContact;\n }>\n ) => {\n onShippingContactSelected(value.nativeEvent);\n }\n : undefined;\n\n const couponCodeCallback = onCouponCodeEntered\n ? (\n value: NativeSyntheticEvent<{\n couponCode: string;\n }>\n ) => {\n onCouponCodeEntered && onCouponCodeEntered(value.nativeEvent);\n }\n : undefined;\n\n const orderTrackingCallback = setOrderTracking\n ? () => {\n setOrderTracking(NativeStripeSdk.configureOrderTracking);\n }\n : undefined;\n\n return (\n <TouchableOpacity\n disabled={disabled}\n activeOpacity={disabled ? 0.3 : 1}\n onPress={onPress}\n style={[disabled ? styles.disabled : styles.notDisabled, style]}\n >\n {Platform.OS === 'ios' ? (\n <ApplePayButtonNative\n type={type}\n buttonStyle={appearance}\n borderRadius={borderRadius}\n disabled={disabled}\n onShippingMethodSelectedAction={shippingMethodCallback}\n onShippingContactSelectedAction={shippingContactCallback}\n onCouponCodeEnteredAction={couponCodeCallback}\n onOrderTrackingAction={orderTrackingCallback}\n style={styles.nativeButtonStyle}\n {...props}\n />\n ) : (\n <GooglePayButtonNative\n type={type}\n appearance={appearance}\n borderRadius={borderRadius}\n style={styles.nativeButtonStyle}\n {...props}\n />\n )}\n </TouchableOpacity>\n );\n}\n\nconst styles = StyleSheet.create({\n disabled: {\n flex: 0,\n opacity: 0.4,\n },\n notDisabled: {\n flex: 0,\n },\n nativeButtonStyle: { flex: 1 },\n});\n"],"mappings":"wXAAA,oDACA,yCASA,2EACA,iDAMA,sFACA,oFAA0D,wRA4EnD,QAASA,kBAAiB,MAYvB,oBAXRC,IAAI,CAAJA,IAAI,oBAAGC,uBAAU,CAACC,OAAO,gCACzBC,UAAU,CAAVA,UAAU,0BAAGC,wBAAW,CAACC,SAAS,iBAClCC,OAAO,MAAPA,OAAO,CACPC,QAAQ,MAARA,QAAQ,CACRC,YAAY,MAAZA,YAAY,CACZC,wBAAwB,MAAxBA,wBAAwB,CACxBC,yBAAyB,MAAzBA,yBAAyB,CACzBC,mBAAmB,MAAnBA,mBAAmB,CACnBC,gBAAgB,MAAhBA,gBAAgB,CAChBC,KAAK,MAALA,KAAK,CACFC,KAAK,uDAER,GAAMC,uBAAsB,CAAGN,wBAAwB,CACnD,SACEO,KAEE,CACC,CACHP,wBAAwB,EAAIA,wBAAwB,CAACO,KAAK,CAACC,WAAW,CAAC,CACzE,CAAC,CACDC,SAAS,CAEb,GAAMC,wBAAuB,CAAGT,yBAAyB,CACrD,SACEM,KAEE,CACC,CACHN,yBAAyB,CAACM,KAAK,CAACC,WAAW,CAAC,CAC9C,CAAC,CACDC,SAAS,CAEb,GAAME,mBAAkB,CAAGT,mBAAmB,CAC1C,SACEK,KAEE,CACC,CACHL,mBAAmB,EAAIA,mBAAmB,CAACK,KAAK,CAACC,WAAW,CAAC,CAC/D,CAAC,CACDC,SAAS,CAEb,GAAMG,sBAAqB,CAAGT,gBAAgB,CAC1C,UAAM,CACJA,gBAAgB,CAACU,wBAAe,CAACC,sBAAsB,CAAC,CAC1D,CAAC,CACDL,SAAS,CAEb,MACE,8BAAC,6BAAgB,EACf,QAAQ,CAAEX,QAAS,CACnB,aAAa,CAAEA,QAAQ,CAAG,GAAG,CAAG,CAAE,CAClC,OAAO,CAAED,OAAQ,CACjB,KAAK,CAAE,CAACC,QAAQ,CAAGiB,MAAM,CAACjB,QAAQ,CAAGiB,MAAM,CAACC,WAAW,CAAEZ,KAAK,CAAE,6EAE/Da,qBAAQ,CAACC,EAAE,GAAK,KAAK,CACpB,6BAAC,6BAAoB,wBACnB,IAAI,CAAE3B,IAAK,CACX,WAAW,CAAEG,UAAW,CACxB,YAAY,CAAEK,YAAa,CAC3B,QAAQ,CAAED,QAAS,CACnB,8BAA8B,CAAEQ,sBAAuB,CACvD,+BAA+B,CAAEI,uBAAwB,CACzD,yBAAyB,CAAEC,kBAAmB,CAC9C,qBAAqB,CAAEC,qBAAsB,CAC7C,KAAK,CAAEG,MAAM,CAACI,iBAAkB,EAC5Bd,KAAK,+EACT,CAEF,6BAAC,8BAAqB,wBACpB,IAAI,CAAEd,IAAK,CACX,UAAU,CAAEG,UAAW,CACvB,YAAY,CAAEK,YAAa,CAC3B,KAAK,CAAEgB,MAAM,CAACI,iBAAkB,EAC5Bd,KAAK,+EAEZ,CACgB,CAEvB,CAEA,GAAMU,OAAM,CAAGK,uBAAU,CAACC,MAAM,CAAC,CAC/BvB,QAAQ,CAAE,CACRwB,IAAI,CAAE,CAAC,CACPC,OAAO,CAAE,GACX,CAAC,CACDP,WAAW,CAAE,CACXM,IAAI,CAAE,CACR,CAAC,CACDH,iBAAiB,CAAE,CAAEG,IAAI,CAAE,CAAE,CAC/B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["CustomerSheet.ts"],"sourcesContent":["import type {\n PaymentSheet,\n StripeError,\n CustomerSheetError,\n BillingDetails,\n PaymentMethod,\n} from '../types';\n\nexport type CustomerSheetInitParams = {\n /** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. iOS only. */\n style?: 'alwaysLight' | 'alwaysDark' | 'automatic';\n /** Configuration for the look and feel of the UI. */\n appearance?: PaymentSheet.AppearanceParams;\n /** Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. */\n setupIntentClientSecret?: string;\n /** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */\n customerId: string;\n /** A short-lived token that allows the SDK to access a Customer's payment methods. */\n customerEphemeralKeySecret: string;\n /** Your customer-facing business name. The default value is the name of your app. */\n merchantDisplayName?: string;\n /** Optional configuration for setting the header text of the Payment Method selection screen */\n headerTextForSelectionScreen?: string;\n /** CustomerSheet pre-populates fields with the values provided. If `billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod` is `true`, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI. */\n defaultBillingDetails?: BillingDetails;\n /** Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. */\n billingDetailsCollectionConfiguration?: PaymentSheet.BillingDetailsCollectionConfiguration;\n /** A URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */\n returnURL?: string;\n /** Optional configuration to display a custom message when a saved payment method is removed. iOS only. */\n removeSavedPaymentMethodMessage?: string;\n /** Whether to show Apple Pay as an option. Defaults to false. */\n applePayEnabled?: boolean;\n /** Whether to show Google Pay as an option. Defaults to false. */\n googlePayEnabled?: boolean;\n /** Optional override. It is generally recommended to rely on the default behavior, but- provide a CustomerAdapter here if\n * you would prefer retrieving and updating your Stripe customer object via your own backend instead.\n * WARNING: When implementing your own CustomerAdapter, ensure your application complies with all applicable laws and regulations, including data privacy and consumer protection.\n */\n customerAdapter?: CustomerAdapter;\n};\n\nexport type CustomerSheetPresentParams = {\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. */\n presentationStyle
|
|
1
|
+
{"version":3,"names":[],"sources":["CustomerSheet.ts"],"sourcesContent":["import type {\n PaymentSheet,\n StripeError,\n CustomerSheetError,\n BillingDetails,\n PaymentMethod,\n} from '../types';\n\nexport type CustomerSheetInitParams = {\n /** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. iOS only. */\n style?: 'alwaysLight' | 'alwaysDark' | 'automatic';\n /** Configuration for the look and feel of the UI. */\n appearance?: PaymentSheet.AppearanceParams;\n /** Optional but recommended for cards, required for other payment methods. The SetupIntent client secret that will be used to confirm a new payment method. If this is missing, you will only be able to add cards without authentication steps. */\n setupIntentClientSecret?: string;\n /** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */\n customerId: string;\n /** A short-lived token that allows the SDK to access a Customer's payment methods. */\n customerEphemeralKeySecret: string;\n /** Your customer-facing business name. The default value is the name of your app. */\n merchantDisplayName?: string;\n /** Optional configuration for setting the header text of the Payment Method selection screen */\n headerTextForSelectionScreen?: string;\n /** CustomerSheet pre-populates fields with the values provided. If `billingDetailsCollectionConfiguration.attachDefaultsToPaymentMethod` is `true`, these values will be attached to the payment method even if they are not collected by the CustomerSheet UI. */\n defaultBillingDetails?: BillingDetails;\n /** Describes how billing details should be collected. All values default to `AUTOMATIC`. If `NEVER` is used for a required field for the Payment Method, you must provide an appropriate value as part of `defaultBillingDetails`. */\n billingDetailsCollectionConfiguration?: PaymentSheet.BillingDetailsCollectionConfiguration;\n /** A URL that redirects back to your app that CustomerSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */\n returnURL?: string;\n /** Optional configuration to display a custom message when a saved payment method is removed. iOS only. */\n removeSavedPaymentMethodMessage?: string;\n /** Whether to show Apple Pay as an option. Defaults to false. */\n applePayEnabled?: boolean;\n /** Whether to show Google Pay as an option. Defaults to false. */\n googlePayEnabled?: boolean;\n /** Optional override. It is generally recommended to rely on the default behavior, but- provide a CustomerAdapter here if\n * you would prefer retrieving and updating your Stripe customer object via your own backend instead.\n * WARNING: When implementing your own CustomerAdapter, ensure your application complies with all applicable laws and regulations, including data privacy and consumer protection.\n */\n customerAdapter?: CustomerAdapter;\n};\n\nexport type CustomerSheetPresentParams = {\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */\n presentationStyle?:\n | 'fullscreen'\n | 'popover'\n | 'pageSheet'\n | 'formSheet'\n | 'automatic'\n | 'overFullScreen';\n /** Controls how the modal animates. iOS only. */\n animationStyle?: 'flip' | 'curl' | 'slide' | 'dissolve';\n /** Time (in milliseconds) before the Customer Sheet will automatically dismiss. */\n timeout?: number;\n};\n\nexport type CustomerSheetResult = {\n /** The users selected payment option, if one exists. */\n paymentOption?: PaymentSheet.PaymentOption;\n /** The Stripe PaymentMethod associated with the paymentOption, if it exists. */\n paymentMethod?: PaymentMethod.Result;\n /** The error that occurred. */\n error?: StripeError<CustomerSheetError>;\n};\n\nexport interface CustomerAdapter {\n /** Retrieves a list of Payment Methods attached to a customer.\n * If you are implementing your own CustomerAdapter:\n * Call the list method ( https://stripe.com/docs/api/payment_methods/list )\n * with the Stripe customer. Return the list of payment methods in JSON format.\n */\n fetchPaymentMethods?(): Promise<Array<object>>;\n /** Adds a Payment Method to a customer.\n * If you are implementing your own CustomerAdapter:\n * On your backend, retrieve the Stripe customer associated with your logged-in user.\n * Then, call the Attach method on the Payment Method with that customer's ID\n * ( https://stripe.com/docs/api/payment_methods/attach ).\n * - Parameters:\n * - paymentMethod: A valid Stripe Payment Method ID\n * Return the payment method in JSON format.\n */\n attachPaymentMethod?(paymentMethodId: string): Promise<object>;\n /** Deletes the given Payment Method from the customer.\n * If you are implementing your own CustomerAdapter:\n * Call the Detach method ( https://stripe.com/docs/api/payment_methods/detach )\n * on the Payment Method.\n * - Parameters:\n * - paymentMethod: The Stripe Payment Method ID to delete from the customer\n * Return the payment method in JSON format.\n */\n detachPaymentMethod?(paymentMethodId: String): Promise<object>;\n /** Set the last selected payment method for the customer.\n * To unset the default payment method, `null` is passed as the `paymentOption`.\n * If you are implementing your own CustomerAdapter:\n * Save a representation of the passed `paymentOption` as the customer's default payment method.\n */\n setSelectedPaymentOption?(\n paymentOption: CustomerPaymentOption | null\n ): Promise<void>;\n /** Retrieve the last selected payment method for the customer.\n * If you are implementing your own CustomerAdapter:\n * Return a CustomerPaymentOption for the customer's default selected payment method.\n * If no default payment method is selected, return null.\n */\n fetchSelectedPaymentOption?(): Promise<CustomerPaymentOption | null>;\n /** Creates a SetupIntent configured to attach a new payment method to a customer,\n * then returns the client secret for the created SetupIntent.\n */\n setupIntentClientSecretForCustomerAttach?(): Promise<String>;\n}\n\nexport type CustomerPaymentOption =\n | 'apple_pay'\n | 'google_pay'\n | 'link'\n | string;\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApplePaySheetErrorType","ContactField","InvalidShippingField","PaymentRequestType","ApplePayMerchantCapability","ApplePayShippingType","BillingAddressFormat","ButtonType","ButtonStyle","PaymentType","IntervalUnit"],"sources":["PlatformPay.ts"],"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';\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 you include ContactField.PostalAddress in this array, 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 ApplePayConfirmParams = {\n /** A typical request is for a one-time payment. To support different types of payment requests, include a PaymentRequestType. Only supported on iOS 16 and up. */\n request?:\n | RecurringPaymentRequest\n | AutomaticReloadPaymentRequest\n | MultiMerchantRequest;\n};\n\nexport enum PaymentRequestType {\n Recurring = 'Recurring',\n AutomaticReload = 'AutomaticReload',\n MultiMerchant = 'MultiMerchant',\n}\n\n/** Use this for a recurring payment, typically a subscription. */\nexport type RecurringPaymentRequest = {\n type: PaymentRequestType.Recurring;\n /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */\n description: string;\n /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */\n managementUrl: string;\n /** The regular billing cycle for the payment, including start and end dates, an interval, and an interval count. */\n billing: RecurringCartSummaryItem;\n /** Same as the billing property, but use this if the purchase has a trial period. */\n trialBilling?: RecurringCartSummaryItem;\n /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */\n billingAgreement?: string;\n /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.\n * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.\n */\n tokenNotificationURL?: string;\n};\n\n/** Use this for an automatic reload or refill payment, such as a store card top-up. */\nexport type AutomaticReloadPaymentRequest = {\n type: PaymentRequestType.AutomaticReload;\n /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */\n description: string;\n /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */\n managementUrl: string;\n /** A short, localized description of the item. */\n label: string;\n /** This is the amount that is automatically applied to the account when the account balance drops below the threshold amount. */\n reloadAmount: string;\n /** The balance an account reaches before you apply the automatic reload amount. */\n thresholdAmount: string;\n /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */\n billingAgreement?: string;\n /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.\n * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.\n */\n tokenNotificationURL?: string;\n};\n\n/** Use this to indicate payments for multiple merchants. */\nexport type MultiMerchantRequest = {\n type: PaymentRequestType.MultiMerchant;\n merchants: Array<{\n /** The Apple Pay merchant identifier. */\n merchantIdentifier: string;\n /** An external identifier for the merchant. */\n externalIdentifier: string;\n /** The merchant’s display name that the Apple Pay server associates with the payment token. */\n merchantName: string;\n /** The merchant’s top-level domain that the Apple Pay server associates with the payment token. */\n merchantDomain?: string;\n /** The amount to authorize for the payment token. */\n amount: string;\n }>;\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 /** An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. */\n label?: string;\n /** An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. */\n amount?: number;\n};\n\nexport type GooglePayPaymentMethodParams = {\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 & ApplePayConfirmParams;\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\ninterface PostalAddress {\n city?: string;\n country?: string;\n postalCode?: string;\n state?: string;\n street?: string;\n isoCountryCode?: string;\n subAdministrativeArea?: string;\n subLocality?: string;\n}\n\ninterface ContactName {\n familyName?: string;\n namePrefix?: string;\n nameSuffix?: string;\n givenName?: string;\n middleName?: string;\n nickname?: string;\n}\n\nexport interface ShippingContact {\n emailAddress?: string;\n name: ContactName;\n phoneNumber?: string;\n postalAddress: PostalAddress;\n}\n\n/** Android only. */\nexport type IsGooglePaySupportedParams = {\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. Defaults to false. */\n testEnv?: boolean;\n /**\n * If `true`, Google Pay is considered ready if the customer's Google Pay wallet\n * has an existing payment method. Defaults to false.\n */\n existingPaymentMethodRequired?: boolean;\n};\n\nexport type PaymentMethodResult =\n | {\n paymentMethod: PaymentMethod;\n shippingContact?: ShippingContact;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n shippingContact?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type TokenResult =\n | {\n token: Token;\n shippingContact?: ShippingContact;\n error?: undefined;\n }\n | {\n token?: undefined;\n shippingContact?: 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"],"mappings":"4VAoBYA,uBAAsB,iEAAtBA,sBAAsB,EAAtBA,sBAAsB,oDAAtBA,sBAAsB,gEAAtBA,sBAAsB,0CAAtBA,sBAAsB,6CAAtBA,sBAAsB,kCAAtBA,sBAAsB,SAOtBC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,gCAAZA,YAAY,gBAAZA,YAAY,8BAAZA,YAAY,gCAAZA,YAAY,qCAAZA,YAAY,wBAAZA,YAAY,SAQZC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,oBAApBA,oBAAoB,gBAApBA,oBAAoB,kDAApBA,oBAAoB,kBAApBA,oBAAoB,4BAApBA,oBAAoB,sBAApBA,oBAAoB,8BAApBA,oBAAoB,iCAApBA,oBAAoB,gCAApBA,oBAAoB,SA0CpBC,mBAAkB,yDAAlBA,kBAAkB,EAAlBA,kBAAkB,0BAAlBA,kBAAkB,sCAAlBA,kBAAkB,qCAAlBA,kBAAkB,8BAAlBA,kBAAkB,SAsElBC,2BAA0B,yEAA1BA,0BAA0B,EAA1BA,0BAA0B,8BAA1BA,0BAA0B,oCAA1BA,0BAA0B,qCAA1BA,0BAA0B,sCAA1BA,0BAA0B,SAU1BC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,wBAApBA,oBAAoB,wBAApBA,oBAAoB,8BAApBA,oBAAoB,qCAApBA,oBAAoB,gCAApBA,oBAAoB,SAwDpBC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,gBAApBA,oBAAoB,iBAApBA,oBAAoB,gCAApBA,oBAAoB,SAqBpBC,WAAU,yCAAVA,UAAU,EAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,iBAAVA,UAAU,CAAVA,UAAU,mBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,6BAAVA,UAAU,CAAVA,UAAU,qBAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,0BAAVA,UAAU,CAAVA,UAAU,gCAAVA,UAAU,CAAVA,UAAU,kBAAVA,UAAU,CAAVA,UAAU,4BAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,2CAAVA,UAAU,sBAAVA,UAAU,SA0CVC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,mCAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,gCAAXA,WAAW,uBAAXA,WAAW,SAkBXC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,wBAAXA,WAAW,0BAAXA,WAAW,6BAAXA,WAAW,uBAAXA,WAAW,SAwCXC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,oBAAZA,YAAY,gBAAZA,YAAY,cAAZA,YAAY,kBAAZA,YAAY,mBAAZA,YAAY,wBAAZA,YAAY"}
|
|
1
|
+
{"version":3,"names":["ApplePaySheetErrorType","ContactField","InvalidShippingField","PaymentRequestType","ApplePayMerchantCapability","ApplePayShippingType","BillingAddressFormat","ButtonType","ButtonStyle","PaymentType","IntervalUnit"],"sources":["PlatformPay.ts"],"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';\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 you include ContactField.PostalAddress in this array, 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 ApplePayConfirmParams = {\n /** A typical request is for a one-time payment. To support different types of payment requests, include a PaymentRequestType. Only supported on iOS 16 and up. */\n request?:\n | RecurringPaymentRequest\n | AutomaticReloadPaymentRequest\n | MultiMerchantRequest;\n};\n\nexport enum PaymentRequestType {\n Recurring = 'Recurring',\n AutomaticReload = 'AutomaticReload',\n MultiMerchant = 'MultiMerchant',\n}\n\n/** Use this for a recurring payment, typically a subscription. */\nexport type RecurringPaymentRequest = {\n type: PaymentRequestType.Recurring;\n /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */\n description: string;\n /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */\n managementUrl: string;\n /** The regular billing cycle for the payment, including start and end dates, an interval, and an interval count. */\n billing: RecurringCartSummaryItem;\n /** Same as the billing property, but use this if the purchase has a trial period. */\n trialBilling?: RecurringCartSummaryItem;\n /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */\n billingAgreement?: string;\n /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.\n * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.\n */\n tokenNotificationURL?: string;\n};\n\n/** Use this for an automatic reload or refill payment, such as a store card top-up. */\nexport type AutomaticReloadPaymentRequest = {\n type: PaymentRequestType.AutomaticReload;\n /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */\n description: string;\n /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */\n managementUrl: string;\n /** A short, localized description of the item. */\n label: string;\n /** This is the amount that is automatically applied to the account when the account balance drops below the threshold amount. */\n reloadAmount: string;\n /** The balance an account reaches before you apply the automatic reload amount. */\n thresholdAmount: string;\n /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */\n billingAgreement?: string;\n /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.\n * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.\n */\n tokenNotificationURL?: string;\n};\n\n/** Use this to indicate payments for multiple merchants. */\nexport type MultiMerchantRequest = {\n type: PaymentRequestType.MultiMerchant;\n merchants: Array<{\n /** The Apple Pay merchant identifier. */\n merchantIdentifier: string;\n /** An external identifier for the merchant. */\n externalIdentifier: string;\n /** The merchant’s display name that the Apple Pay server associates with the payment token. */\n merchantName: string;\n /** The merchant’s top-level domain that the Apple Pay server associates with the payment token. */\n merchantDomain?: string;\n /** The amount to authorize for the payment token. */\n amount: string;\n }>;\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 /** An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. */\n label?: string;\n /** An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. Provide this value in the currency’s smallest unit. */\n amount?: number;\n};\n\nexport type GooglePayPaymentMethodParams = {\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 & ApplePayConfirmParams;\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. The Google Pay payment button without the additional text. */\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\ninterface PostalAddress {\n city?: string;\n country?: string;\n postalCode?: string;\n state?: string;\n street?: string;\n isoCountryCode?: string;\n subAdministrativeArea?: string;\n subLocality?: string;\n}\n\ninterface ContactName {\n familyName?: string;\n namePrefix?: string;\n nameSuffix?: string;\n givenName?: string;\n middleName?: string;\n nickname?: string;\n}\n\nexport interface ShippingContact {\n emailAddress?: string;\n name: ContactName;\n phoneNumber?: string;\n postalAddress: PostalAddress;\n}\n\n/** Android only. */\nexport type IsGooglePaySupportedParams = {\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. Defaults to false. */\n testEnv?: boolean;\n /**\n * If `true`, Google Pay is considered ready if the customer's Google Pay wallet\n * has an existing payment method. Defaults to false.\n */\n existingPaymentMethodRequired?: boolean;\n};\n\nexport type PaymentMethodResult =\n | {\n paymentMethod: PaymentMethod;\n shippingContact?: ShippingContact;\n error?: undefined;\n }\n | {\n paymentMethod?: undefined;\n shippingContact?: undefined;\n error: StripeError<PlatformPayError>;\n };\n\nexport type TokenResult =\n | {\n token: Token;\n shippingContact?: ShippingContact;\n error?: undefined;\n }\n | {\n token?: undefined;\n shippingContact?: 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"],"mappings":"4VAoBYA,uBAAsB,iEAAtBA,sBAAsB,EAAtBA,sBAAsB,oDAAtBA,sBAAsB,gEAAtBA,sBAAsB,0CAAtBA,sBAAsB,6CAAtBA,sBAAsB,kCAAtBA,sBAAsB,SAOtBC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,gCAAZA,YAAY,gBAAZA,YAAY,8BAAZA,YAAY,gCAAZA,YAAY,qCAAZA,YAAY,wBAAZA,YAAY,SAQZC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,oBAApBA,oBAAoB,gBAApBA,oBAAoB,kDAApBA,oBAAoB,kBAApBA,oBAAoB,4BAApBA,oBAAoB,sBAApBA,oBAAoB,8BAApBA,oBAAoB,iCAApBA,oBAAoB,gCAApBA,oBAAoB,SA0CpBC,mBAAkB,yDAAlBA,kBAAkB,EAAlBA,kBAAkB,0BAAlBA,kBAAkB,sCAAlBA,kBAAkB,qCAAlBA,kBAAkB,8BAAlBA,kBAAkB,SAsElBC,2BAA0B,yEAA1BA,0BAA0B,EAA1BA,0BAA0B,8BAA1BA,0BAA0B,oCAA1BA,0BAA0B,qCAA1BA,0BAA0B,sCAA1BA,0BAA0B,SAU1BC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,wBAApBA,oBAAoB,wBAApBA,oBAAoB,8BAApBA,oBAAoB,qCAApBA,oBAAoB,gCAApBA,oBAAoB,SAwDpBC,qBAAoB,6DAApBA,oBAAoB,EAApBA,oBAAoB,gBAApBA,oBAAoB,iBAApBA,oBAAoB,gCAApBA,oBAAoB,SAqBpBC,WAAU,yCAAVA,UAAU,EAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,iBAAVA,UAAU,CAAVA,UAAU,mBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,6BAAVA,UAAU,CAAVA,UAAU,qBAAVA,UAAU,CAAVA,UAAU,yBAAVA,UAAU,CAAVA,UAAU,uBAAVA,UAAU,CAAVA,UAAU,2BAAVA,UAAU,CAAVA,UAAU,sBAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,0BAAVA,UAAU,CAAVA,UAAU,gCAAVA,UAAU,CAAVA,UAAU,kBAAVA,UAAU,CAAVA,UAAU,4BAAVA,UAAU,CAAVA,UAAU,oBAAVA,UAAU,CAAVA,UAAU,2CAAVA,UAAU,sBAAVA,UAAU,SA0CVC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,mCAAXA,WAAW,CAAXA,WAAW,qBAAXA,WAAW,CAAXA,WAAW,gCAAXA,WAAW,uBAAXA,WAAW,SAkBXC,YAAW,2CAAXA,WAAW,EAAXA,WAAW,wBAAXA,WAAW,0BAAXA,WAAW,6BAAXA,WAAW,uBAAXA,WAAW,SAwCXC,aAAY,6CAAZA,YAAY,EAAZA,YAAY,oBAAZA,YAAY,gBAAZA,YAAY,cAAZA,YAAY,kBAAZA,YAAY,mBAAZA,YAAY,wBAAZA,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["GooglePayButtonComponent.ts"],"sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n type?: number;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["GooglePayButtonComponent.ts"],"sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\nexport interface NativeProps {\n style?: StyleProp<ViewStyle>;\n type?: number;\n appearance?: number;\n borderRadius?: number;\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];var AddressSheetNative=(0,_reactNative.requireNativeComponent)('AddressSheetView');function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddressSheetNative,(0,_extends2.default)({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);},__self:this,__source:{fileName:_jsxFileName,lineNumber:
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];var AddressSheetNative=(0,_reactNative.requireNativeComponent)('AddressSheetView');function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return _react.default.createElement(AddressSheetNative,(0,_extends2.default)({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);},__self:this,__source:{fileName:_jsxFileName,lineNumber:76,columnNumber:5}}));}
|
|
2
2
|
//# sourceMappingURL=AddressSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AddressSheetNative","requireNativeComponent","AddressSheet","onSubmit","onError","props","value","nativeEvent","error"],"sources":["AddressSheet.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n NativeSyntheticEvent,\n} from 'react-native';\nimport type {\n PaymentSheet,\n AddressDetails,\n StripeError,\n AddressSheetError,\n} from '../types';\n\nconst AddressSheetNative = requireNativeComponent<any>('AddressSheetView');\n\n/**\n * Props\n */\nexport interface Props extends AccessibilityProps {\n /** Whether the sheet is visible. Defaults to false. */\n visible: boolean;\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. */\n presentationStyle
|
|
1
|
+
{"version":3,"names":["AddressSheetNative","requireNativeComponent","AddressSheet","onSubmit","onError","props","value","nativeEvent","error"],"sources":["AddressSheet.tsx"],"sourcesContent":["import React from 'react';\nimport {\n AccessibilityProps,\n requireNativeComponent,\n NativeSyntheticEvent,\n} from 'react-native';\nimport type {\n PaymentSheet,\n AddressDetails,\n StripeError,\n AddressSheetError,\n} from '../types';\n\nconst AddressSheetNative = requireNativeComponent<any>('AddressSheetView');\n\n/**\n * Props\n */\nexport interface Props extends AccessibilityProps {\n /** Whether the sheet is visible. Defaults to false. */\n visible: boolean;\n /** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */\n presentationStyle?:\n | 'fullscreen'\n | 'popover'\n | 'pageSheet'\n | 'formSheet'\n | 'automatic'\n | 'overFullScreen';\n /** Controls how the modal animates. iOS only. */\n animationStyle?: 'flip' | 'curl' | 'slide' | 'dissolve';\n /** Configuration for the look and feel of the UI. */\n appearance?: PaymentSheet.AppearanceParams;\n /** The values to prepopulate the sheet's fields with. */\n defaultValues?: AddressDetails;\n /** Configuration for additional fields besides the physical address */\n additionalFields?: {\n /** Determines whether the phone number is hidden, required, or optional. Defaults to hidden. */\n phoneNumber?: 'hidden' | 'optional' | 'required';\n /** The label of a checkbox displayed below other fields. If null or undefined, the checkbox is not displayed. */\n checkboxLabel?: string;\n };\n /** A list of two-letter country codes representing countries the customers can select. If the list is empty (the default), we display all countries. */\n allowedCountries?: Array<string>;\n /** A list of two-letter country codes representing countries that support address autocomplete. Defaults to a list of countries that Stripe has audited to ensure a good autocomplete experience. */\n autocompleteCountries?: Array<string>;\n /** The title of the primary button displayed at the bottom of the screen. Defaults to \"Save Address\". */\n primaryButtonTitle?: string;\n /** Title displayed at the top of the sheet. Defaults to \"Address\". */\n sheetTitle?: string;\n /** Android only. Google Places api key used to provide autocomplete suggestions. When null, autocomplete is disabled on Android. */\n googlePlacesApiKey?: string;\n /** Called when the user submits their information */\n onSubmit: (result: CollectAddressResult) => void;\n /** Called when the user taps the button to close the sheet before submitting their information, or when an error occurs. */\n onError: (error: StripeError<AddressSheetError>) => void;\n}\n\nexport type CollectAddressResult = Required<AddressDetails>;\n\n/**\n *\n *\n * @example\n * ```ts\n * <AddressSheet\n *\n * />\n * ```\n * @param __namedParameters Props\n * @returns JSX.Element\n * @category ReactComponents\n */\nexport function AddressSheet({ onSubmit, onError, ...props }: Props) {\n return (\n <AddressSheetNative\n {...props}\n onSubmitAction={(value: NativeSyntheticEvent<CollectAddressResult>) =>\n onSubmit(value.nativeEvent)\n }\n onErrorAction={(\n value: NativeSyntheticEvent<{\n error: StripeError<AddressSheetError>;\n }>\n ) => onError(value.nativeEvent.error)}\n />\n );\n}\n"],"mappings":"8WAAA,oDACA,yCAIsB,wIAQtB,GAAMA,mBAAkB,CAAG,GAAAC,mCAAsB,EAAM,kBAAkB,CAAC,CA4DnE,QAASC,aAAY,MAAyC,IAAtCC,SAAQ,MAARA,QAAQ,CAAEC,OAAO,MAAPA,OAAO,CAAKC,KAAK,uDACxD,MACE,8BAAC,kBAAkB,0BACbA,KAAK,EACT,cAAc,CAAE,wBAACC,KAAiD,QAChEH,SAAQ,CAACG,KAAK,CAACC,WAAW,CAAC,EAC5B,CACD,aAAa,CAAE,uBACbD,KAEE,QACCF,QAAO,CAACE,KAAK,CAACC,WAAW,CAACC,KAAK,CAAC,EAAC,6EACtC,CAEN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);}:undefined;return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:5}},_reactNative.Platform.OS==='ios'?_react.default.createElement(_ApplePayButtonNative.default,(0,_extends2.default)({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:152,columnNumber:9}})):_react.default.createElement(_GooglePayButtonNative.default,(0,_extends2.default)({type:type,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:165,columnNumber:9}})));}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdk=_interopRequireDefault(require("../NativeStripeSdk"));var _PlatformPay=require("../types/PlatformPay");var _GooglePayButtonNative=_interopRequireDefault(require("./GooglePayButtonNative"));var _ApplePayButtonNative=_interopRequireDefault(require("./ApplePayButtonNative"));var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdk.default.configureOrderTracking);}:undefined;return _react.default.createElement(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:5}},_reactNative.Platform.OS==='ios'?_react.default.createElement(_ApplePayButtonNative.default,(0,_extends2.default)({type:type,buttonStyle:appearance,borderRadius:borderRadius,disabled:disabled,onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:152,columnNumber:9}})):_react.default.createElement(_GooglePayButtonNative.default,(0,_extends2.default)({type:type,appearance:appearance,borderRadius:borderRadius,style:styles.nativeButtonStyle},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:165,columnNumber:9}})));}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
|
|
2
2
|
//# sourceMappingURL=PlatformPayButton.js.map
|