@stripe/stripe-react-native 0.32.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 +43 -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 +6 -2
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +3 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +5 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +29 -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/ApplePayViewController.swift +13 -2
- package/ios/CustomerSheet/CustomerSheetUtils.swift +8 -0
- package/ios/Mappers.swift +10 -8
- package/ios/StripeSdk.swift +1 -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/NextAction.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.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/NextAction.js.map +1 -1
- package/lib/module/types/PaymentSheet.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/NextAction.d.ts +4 -2
- package/lib/typescript/src/types/PaymentSheet.d.ts +4 -0
- package/lib/typescript/src/types/PlatformPay.d.ts +5 -3
- 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/NextAction.ts +5 -2
- package/src/types/PaymentSheet.ts +4 -0
- package/src/types/PlatformPay.ts +5 -3
- 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,49 @@
|
|
|
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
|
+
|
|
21
|
+
## 0.33.0 - 2023-09-22
|
|
22
|
+
|
|
23
|
+
**Features**
|
|
24
|
+
|
|
25
|
+
- Added the `amount` and `label` params to `initPaymentSheet`'s `googlePay` field configuration. Use this to diplay the amount for setup intents.
|
|
26
|
+
- Added the `amount` and `label` params `createPlatformPayPaymentMethod`, `confirmPlatformPayPayment`, and `confirmPlatformPaySetupIntent`.
|
|
27
|
+
- PaymentSheet now supports the following payment methods on both iOS and Android (previously some of the following were iOS only) for SetupIntents and PaymentIntents with setup for future usage:
|
|
28
|
+
- Alipay
|
|
29
|
+
- BECS Direct Debit
|
|
30
|
+
- Cash App Pay
|
|
31
|
+
- iDEAL
|
|
32
|
+
- SEPA
|
|
33
|
+
- Sofort
|
|
34
|
+
- Bancontact
|
|
35
|
+
- BLIK
|
|
36
|
+
- Boleto
|
|
37
|
+
- Revolut Pay
|
|
38
|
+
- OXXO (PaymentIntents only)
|
|
39
|
+
- Konbini (PaymentIntents only)
|
|
40
|
+
- PaymentSheet now supports the following payment methods on iOS only for SetupIntents and PaymentIntents with setup for future usage:
|
|
41
|
+
- PayNow
|
|
42
|
+
- PromptPay
|
|
43
|
+
|
|
44
|
+
**Fixes**
|
|
45
|
+
|
|
46
|
+
- Fixed an issue on iOS where the value for the `paymentMethod` field on the returned `paymentIntent` object from `confirmPlatformPayPayment` and the returned `setupIntent` object from `confirmPlatformPaySetupIntent` would be null.
|
|
47
|
+
|
|
5
48
|
## 0.32.0 - 2023-09-15
|
|
6
49
|
|
|
7
50
|
**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
|
}
|
|
@@ -24,6 +24,8 @@ class GooglePayLauncherFragment : Fragment() {
|
|
|
24
24
|
private lateinit var mode: Mode
|
|
25
25
|
private lateinit var configuration: GooglePayLauncher.Config
|
|
26
26
|
private lateinit var currencyCode: String
|
|
27
|
+
private var amount: Int? = null
|
|
28
|
+
private var label: String? = null
|
|
27
29
|
private lateinit var callback: (result: GooglePayLauncher.Result?, error: WritableMap?) -> Unit
|
|
28
30
|
|
|
29
31
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
|
@@ -47,6 +49,8 @@ class GooglePayLauncherFragment : Fragment() {
|
|
|
47
49
|
this.mode = mode
|
|
48
50
|
this.callback = callback
|
|
49
51
|
this.currencyCode = googlePayParams.getString("currencyCode") ?: "USD"
|
|
52
|
+
this.amount = getIntOrNull(googlePayParams, "amount")
|
|
53
|
+
this.label = googlePayParams.getString("label")
|
|
50
54
|
this.configuration = GooglePayLauncher.Config(
|
|
51
55
|
environment = if (googlePayParams.getBoolean("testEnv")) GooglePayEnvironment.Test else GooglePayEnvironment.Production,
|
|
52
56
|
merchantCountryCode = googlePayParams.getString("merchantCountryCode").orEmpty(),
|
|
@@ -89,10 +93,10 @@ class GooglePayLauncherFragment : Fragment() {
|
|
|
89
93
|
if (isReady) {
|
|
90
94
|
when (mode) {
|
|
91
95
|
Mode.ForSetup -> {
|
|
92
|
-
launcher.presentForSetupIntent(clientSecret, currencyCode)
|
|
96
|
+
launcher.presentForSetupIntent(clientSecret, currencyCode, amount?.toLong(), label)
|
|
93
97
|
}
|
|
94
98
|
Mode.ForPayment -> {
|
|
95
|
-
launcher.presentForPaymentIntent(clientSecret)
|
|
99
|
+
launcher.presentForPaymentIntent(clientSecret, label)
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
102
|
} else {
|
|
@@ -80,12 +80,14 @@ class GooglePayRequestHelper {
|
|
|
80
80
|
val countryCode = params.getString("merchantCountryCode").orEmpty()
|
|
81
81
|
val currencyCode = params.getString("currencyCode") ?: "USD"
|
|
82
82
|
val amount = params.getInt("amount")
|
|
83
|
+
val label = params.getString("label")
|
|
83
84
|
|
|
84
85
|
return GooglePayJsonFactory.TransactionInfo(
|
|
85
86
|
currencyCode = currencyCode,
|
|
86
87
|
totalPriceStatus = GooglePayJsonFactory.TransactionInfo.TotalPriceStatus.Estimated,
|
|
87
88
|
countryCode = countryCode,
|
|
88
89
|
totalPrice = amount,
|
|
90
|
+
totalPriceLabel = label,
|
|
89
91
|
checkoutOption = GooglePayJsonFactory.TransactionInfo.CheckoutOption.Default
|
|
90
92
|
)
|
|
91
93
|
}
|
|
@@ -282,6 +282,8 @@ class PaymentLauncherFragment(
|
|
|
282
282
|
private fun isNextActionSuccessState(nextAction: StripeIntent.NextActionType?): Boolean {
|
|
283
283
|
return when (nextAction) {
|
|
284
284
|
StripeIntent.NextActionType.DisplayOxxoDetails,
|
|
285
|
+
StripeIntent.NextActionType.DisplayBoletoDetails,
|
|
286
|
+
StripeIntent.NextActionType.DisplayKonbiniDetails,
|
|
285
287
|
StripeIntent.NextActionType.VerifyWithMicrodeposits -> true
|
|
286
288
|
StripeIntent.NextActionType.RedirectToUrl,
|
|
287
289
|
StripeIntent.NextActionType.UseStripeSdk,
|
|
@@ -290,6 +292,7 @@ class PaymentLauncherFragment(
|
|
|
290
292
|
StripeIntent.NextActionType.WeChatPayRedirect,
|
|
291
293
|
StripeIntent.NextActionType.UpiAwaitNotification,
|
|
292
294
|
StripeIntent.NextActionType.CashAppRedirect,
|
|
295
|
+
StripeIntent.NextActionType.SwishRedirect,
|
|
293
296
|
null, -> false
|
|
294
297
|
}
|
|
295
298
|
}
|
|
@@ -354,11 +354,15 @@ class PaymentSheetFragment(
|
|
|
354
354
|
val countryCode = params.getString("merchantCountryCode").orEmpty()
|
|
355
355
|
val currencyCode = params.getString("currencyCode").orEmpty()
|
|
356
356
|
val testEnv = params.getBoolean("testEnv")
|
|
357
|
+
val amount = params.getString("amount")?.toLongOrNull()
|
|
358
|
+
val label = params.getString("label")
|
|
357
359
|
|
|
358
360
|
return PaymentSheet.GooglePayConfiguration(
|
|
359
361
|
environment = if (testEnv) PaymentSheet.GooglePayConfiguration.Environment.Test else PaymentSheet.GooglePayConfiguration.Environment.Production,
|
|
360
362
|
countryCode = countryCode,
|
|
361
|
-
currencyCode = currencyCode
|
|
363
|
+
currencyCode = currencyCode,
|
|
364
|
+
amount = amount,
|
|
365
|
+
label = label
|
|
362
366
|
)
|
|
363
367
|
}
|
|
364
368
|
|
|
@@ -490,6 +490,24 @@ internal fun mapNextAction(type: NextActionType?, data: NextActionData?): Writab
|
|
|
490
490
|
NextActionType.CashAppRedirect, NextActionType.BlikAuthorize, NextActionType.UseStripeSdk, NextActionType.UpiAwaitNotification, null -> {
|
|
491
491
|
return null
|
|
492
492
|
}
|
|
493
|
+
NextActionType.DisplayBoletoDetails -> {
|
|
494
|
+
(data as? NextActionData.DisplayBoletoDetails)?.let {
|
|
495
|
+
nextActionMap.putString("type", "boletoVoucher")
|
|
496
|
+
nextActionMap.putString("voucherURL", it.hostedVoucherUrl)
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
NextActionType.DisplayKonbiniDetails -> {
|
|
500
|
+
(data as? NextActionData.DisplayKonbiniDetails)?.let {
|
|
501
|
+
nextActionMap.putString("type", "konbiniVoucher")
|
|
502
|
+
nextActionMap.putString("voucherURL", it.hostedVoucherUrl)
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
NextActionType.SwishRedirect -> {
|
|
506
|
+
(data as? NextActionData.SwishRedirect)?.let {
|
|
507
|
+
nextActionMap.putString("type", "swishRedirect")
|
|
508
|
+
nextActionMap.putString("mobileAuthUrl", it.mobileAuthUrl)
|
|
509
|
+
}
|
|
510
|
+
}
|
|
493
511
|
}
|
|
494
512
|
return nextActionMap
|
|
495
513
|
}
|
|
@@ -886,13 +904,22 @@ internal fun mapFromShippingContact(googlePayResult: GooglePayResult): WritableM
|
|
|
886
904
|
googlePayResult.name
|
|
887
905
|
name.putString("givenName", googlePayResult.shippingInformation?.name)
|
|
888
906
|
map.putMap("name", name)
|
|
889
|
-
|
|
907
|
+
googlePayResult.shippingInformation?.phone?.let {
|
|
908
|
+
map.putString("phoneNumber", it)
|
|
909
|
+
} ?: run {
|
|
910
|
+
map.putString("phoneNumber", googlePayResult?.phoneNumber)
|
|
911
|
+
}
|
|
890
912
|
val postalAddress = WritableNativeMap()
|
|
891
913
|
postalAddress.putString("city", googlePayResult.shippingInformation?.address?.city)
|
|
892
914
|
postalAddress.putString("country", googlePayResult.shippingInformation?.address?.country)
|
|
893
915
|
postalAddress.putString("postalCode", googlePayResult.shippingInformation?.address?.postalCode)
|
|
894
916
|
postalAddress.putString("state", googlePayResult.shippingInformation?.address?.state)
|
|
895
|
-
|
|
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)
|
|
896
923
|
postalAddress.putString("isoCountryCode", googlePayResult.shippingInformation?.address?.country)
|
|
897
924
|
map.putMap("postalAddress", postalAddress)
|
|
898
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:
|
|
@@ -165,6 +165,7 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC
|
|
|
165
165
|
paymentInformation: PKPayment,
|
|
166
166
|
completion: @escaping STPIntentClientSecretCompletionBlock
|
|
167
167
|
) {
|
|
168
|
+
self.confirmApplePayPaymentMethod = paymentMethod
|
|
168
169
|
if let clientSecret = self.confirmApplePayPaymentClientSecret {
|
|
169
170
|
completion(clientSecret, nil)
|
|
170
171
|
} else if let clientSecret = self.confirmApplePaySetupClientSecret {
|
|
@@ -207,10 +208,15 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC
|
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
if let paymentIntent = paymentIntent {
|
|
210
|
-
|
|
211
|
+
let result = Mappers.mapFromPaymentIntent(paymentIntent: paymentIntent)
|
|
212
|
+
if (paymentIntent.paymentMethod == nil) {
|
|
213
|
+
result.setValue(Mappers.mapFromPaymentMethod(self.confirmApplePayPaymentMethod), forKey: "paymentMethod")
|
|
214
|
+
}
|
|
215
|
+
resolve(Mappers.createResult("paymentIntent", result))
|
|
211
216
|
} else {
|
|
212
217
|
resolve(Mappers.createResult("paymentIntent", nil))
|
|
213
218
|
}
|
|
219
|
+
self.confirmApplePayPaymentMethod = nil
|
|
214
220
|
}
|
|
215
221
|
} else if let clientSecret = self.confirmApplePaySetupClientSecret {
|
|
216
222
|
STPAPIClient.shared.retrieveSetupIntent(withClientSecret: clientSecret) { (setupIntent, error) in
|
|
@@ -224,10 +230,15 @@ extension StripeSdk : PKPaymentAuthorizationViewControllerDelegate, STPApplePayC
|
|
|
224
230
|
}
|
|
225
231
|
|
|
226
232
|
if let setupIntent = setupIntent {
|
|
227
|
-
|
|
233
|
+
let result = Mappers.mapFromSetupIntent(setupIntent: setupIntent)
|
|
234
|
+
if (setupIntent.paymentMethod == nil) {
|
|
235
|
+
result.setValue(Mappers.mapFromPaymentMethod(self.confirmApplePayPaymentMethod), forKey: "paymentMethod")
|
|
236
|
+
}
|
|
237
|
+
resolve(Mappers.createResult("setupIntent", result))
|
|
228
238
|
} else {
|
|
229
239
|
resolve(Mappers.createResult("setupIntent", nil))
|
|
230
240
|
}
|
|
241
|
+
self.confirmApplePayPaymentMethod = nil
|
|
231
242
|
}
|
|
232
243
|
}
|
|
233
244
|
}
|
|
@@ -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:
|
package/ios/Mappers.swift
CHANGED
|
@@ -451,14 +451,16 @@ class Mappers {
|
|
|
451
451
|
"voucherURL": it.oxxoDisplayDetails?.hostedVoucherURL.absoluteString ?? NSNull(),
|
|
452
452
|
"voucherNumber": it.oxxoDisplayDetails?.number ?? NSNull(),
|
|
453
453
|
]
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
454
|
+
case .boletoDisplayDetails:
|
|
455
|
+
return [
|
|
456
|
+
"type": "boletoVoucher",
|
|
457
|
+
"voucherURL": it.boletoDisplayDetails?.hostedVoucherURL.absoluteString ?? NSNull(),
|
|
458
|
+
]
|
|
459
|
+
case .konbiniDisplayDetails:
|
|
460
|
+
return [
|
|
461
|
+
"type": "konbiniVoucher",
|
|
462
|
+
"voucherURL": it.konbiniDisplayDetails?.hostedVoucherURL.absoluteString ?? NSNull(),
|
|
463
|
+
]
|
|
462
464
|
default: // .useStripeSDK, .BLIKAuthorize, .unknown
|
|
463
465
|
return nil
|
|
464
466
|
}
|
package/ios/StripeSdk.swift
CHANGED
|
@@ -22,6 +22,7 @@ class StripeSdk: RCTEventEmitter, STPBankSelectionViewControllerDelegate, UIAdap
|
|
|
22
22
|
var confirmApplePayResolver: RCTPromiseResolveBlock? = nil
|
|
23
23
|
var confirmApplePayPaymentClientSecret: String? = nil
|
|
24
24
|
var confirmApplePaySetupClientSecret: String? = nil
|
|
25
|
+
var confirmApplePayPaymentMethod: STPPaymentMethod? = nil
|
|
25
26
|
|
|
26
27
|
var applePaymentAuthorizationController: PKPaymentAuthorizationViewController? = nil
|
|
27
28
|
var createPlatformPayPaymentMethodResolver: RCTPromiseResolveBlock? = nil
|
|
@@ -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":[],"sources":["NextAction.ts"],"sourcesContent":["export type NextAction =\n | VerifyWithMicrodepositsAction\n | UrlRedirectAction\n | WeChatRedirectAction\n | AlipayRedirectAction\n | BoletoVoucherAction\n | OxxoVoucherAction;\n\nexport type VerifyWithMicrodepositsAction = {\n type: 'verifyWithMicrodeposits';\n redirectUrl: string;\n microdepositType: string;\n arrivalDate: string;\n};\n\nexport type UrlRedirectAction = {\n type: 'urlRedirect';\n redirectUrl: string;\n};\n\nexport type WeChatRedirectAction = {\n type: 'weChatRedirect';\n redirectUrl: string;\n};\n\nexport type AlipayRedirectAction = {\n type: 'alipayRedirect';\n redirectUrl: string;\n nativeRedirectUrl: string;\n};\n\nexport type BoletoVoucherAction = {\n type: 'boletoVoucher';\n
|
|
1
|
+
{"version":3,"names":[],"sources":["NextAction.ts"],"sourcesContent":["export type NextAction =\n | VerifyWithMicrodepositsAction\n | UrlRedirectAction\n | WeChatRedirectAction\n | AlipayRedirectAction\n | BoletoVoucherAction\n | OxxoVoucherAction;\n\nexport type VerifyWithMicrodepositsAction = {\n type: 'verifyWithMicrodeposits';\n redirectUrl: string;\n microdepositType: string;\n arrivalDate: string;\n};\n\nexport type UrlRedirectAction = {\n type: 'urlRedirect';\n redirectUrl: string;\n};\n\nexport type WeChatRedirectAction = {\n type: 'weChatRedirect';\n redirectUrl: string;\n};\n\nexport type AlipayRedirectAction = {\n type: 'alipayRedirect';\n redirectUrl: string;\n nativeRedirectUrl: string;\n};\n\nexport type BoletoVoucherAction = {\n type: 'boletoVoucher';\n voucherURL: string;\n};\n\nexport type KonbiniVoucherAction = {\n type: 'konbiniVoucher';\n voucherURL: string;\n};\n\nexport type OxxoVoucherAction = {\n type: 'oxxoVoucher';\n expiration: number;\n voucherURL: string;\n voucherNumber: string;\n};\n"],"mappings":""}
|