@stripe/stripe-react-native 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -1
- package/android/build.gradle +1 -0
- package/android/gradle.properties +1 -1
- package/android/proguard-rules.txt +7 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +4 -0
- package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +4 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +5 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +46 -8
- package/android/src/main/java/com/reactnativestripesdk/GooglePayFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +132 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +144 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +10 -9
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +8 -3
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +142 -21
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt +111 -0
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetEvent.kt +28 -0
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +178 -0
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +67 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +5 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -1
- package/android/src/main/res/drawable/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/googlepay_button_background_shape.xml +11 -0
- package/android/src/main/res/drawable/googlepay_mark_background.xml +12 -0
- package/android/src/main/res/drawable/googlepay_mark_content.xml +27 -0
- package/android/src/main/res/drawable/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ar/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-ar/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-bg/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-bg/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ca/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-ca/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-cs/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-cs/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-da/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-da/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-de/book_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/buy_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/checkout_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/donate_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/order_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-de/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-de/subscribe_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-el/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-el/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-el/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-et/book_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/buy_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/checkout_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/donate_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/order_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-et/pay_with_googlepay_button_content.xml +8 -8
- package/android/src/main/res/drawable-et/subscribe_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/book_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/buy_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/checkout_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/donate_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/order_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fi/pay_with_googlepay_button_content.xml +8 -8
- package/android/src/main/res/drawable-fi/subscribe_with_googlepay_button_content.xml +15 -0
- package/android/src/main/res/drawable-fr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-fr/pay_with_googlepay_button_content.xml +5 -5
- package/android/src/main/res/drawable-fr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-hr/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-hr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-id/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-id/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-it/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-it/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ja/pay_with_googlepay_button_content.xml +5 -5
- package/android/src/main/res/drawable-ja/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ko/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-ko/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ms/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-ms/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-nl/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-nl/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-no/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-no/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-pl/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-pl/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-ru/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-ru/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sk/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-sk/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sl/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-sl/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sr/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-sr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-sv/pay_with_googlepay_button_content.xml +4 -4
- package/android/src/main/res/drawable-sv/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-th/pay_with_googlepay_button_content.xml +6 -6
- package/android/src/main/res/drawable-th/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-tr/pay_with_googlepay_button_content.xml +7 -7
- package/android/src/main/res/drawable-tr/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/book_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/buy_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/checkout_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/donate_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/order_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/drawable-uk/pay_with_googlepay_button_content.xml +5 -5
- package/android/src/main/res/drawable-uk/subscribe_with_googlepay_button_content.xml +14 -0
- package/android/src/main/res/layout/book_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/buy_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/checkout_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/donate_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/googlepay_mark_button.xml +18 -0
- package/android/src/main/res/layout/order_with_googlepay_button.xml +20 -0
- package/android/src/main/res/layout/pay_with_googlepay_button.xml +10 -24
- package/android/src/main/res/layout/plain_googlepay_button.xml +17 -0
- package/android/src/main/res/layout/subscribe_with_googlepay_button.xml +20 -0
- package/android/src/main/res/values/googlepay_strings.xml +3 -2
- package/ios/AddressSheet/AddressSheetUtils.swift +98 -0
- package/ios/AddressSheet/AddressSheetView.swift +131 -0
- package/ios/AddressSheet/AddressSheetViewManager.m +25 -0
- package/ios/AddressSheet/AddressSheetViewManager.swift +19 -0
- package/ios/ApplePayButtonManager.m +5 -0
- package/ios/ApplePayButtonManager.swift +3 -1
- package/ios/ApplePayButtonView.swift +21 -0
- package/ios/ApplePayUtils.swift +187 -0
- package/ios/ApplePayViewController.swift +279 -0
- package/ios/PaymentPassFinder.swift +61 -0
- package/ios/PaymentSheetAppearance.swift +24 -23
- package/ios/{pushprovisioning → PushProvisioning}/AddToWalletButtonManager.m +0 -0
- package/ios/{pushprovisioning → PushProvisioning}/AddToWalletButtonManager.swift +0 -0
- package/ios/{pushprovisioning → PushProvisioning}/AddToWalletButtonView.swift +10 -10
- package/ios/PushProvisioning/PushProvisioningUtils.swift +87 -0
- package/ios/StripeSdk.m +29 -0
- package/ios/StripeSdk.swift +200 -130
- package/ios/Tests/AddressSheetUtilsTests.swift +273 -0
- package/ios/Tests/PushProvisioningTests.swift +14 -11
- package/jest/mock.js +44 -0
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/AddressSheet.js +2 -0
- package/lib/commonjs/components/AddressSheet.js.map +1 -0
- package/lib/commonjs/components/PlatformPayButton.js +2 -0
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -0
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/usePlatformPay.js +2 -0
- package/lib/commonjs/hooks/usePlatformPay.js.map +1 -0
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/Errors.js +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/PlatformPay.js +2 -0
- package/lib/commonjs/types/PlatformPay.js.map +1 -0
- package/lib/commonjs/types/PushProvisioning.js +2 -0
- package/lib/commonjs/types/PushProvisioning.js.map +1 -0
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/AddressSheet.js +2 -0
- package/lib/module/components/AddressSheet.js.map +1 -0
- package/lib/module/components/PlatformPayButton.js +2 -0
- package/lib/module/components/PlatformPayButton.js.map +1 -0
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/usePlatformPay.js +2 -0
- package/lib/module/hooks/usePlatformPay.js.map +1 -0
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/Errors.js +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/PlatformPay.js +2 -0
- package/lib/module/types/PlatformPay.js.map +1 -0
- package/lib/module/types/PushProvisioning.js +2 -0
- package/lib/module/types/PushProvisioning.js.map +1 -0
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +8 -1
- package/lib/typescript/src/components/AddressSheet.d.ts +53 -0
- package/lib/typescript/src/components/PlatformPayButton.d.ts +65 -0
- package/lib/typescript/src/functions.d.ts +73 -1
- package/lib/typescript/src/hooks/usePlatformPay.d.ts +70 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +18 -1
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/types/ApplePay.d.ts +9 -0
- package/lib/typescript/src/types/Common.d.ts +12 -0
- package/lib/typescript/src/types/Errors.d.ts +9 -0
- package/lib/typescript/src/types/GooglePay.d.ts +2 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +7 -1
- package/lib/typescript/src/types/PlatformPay.d.ts +285 -0
- package/lib/typescript/src/types/PushProvisioning.d.ts +66 -0
- package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +2 -2
- package/lib/typescript/src/types/index.d.ts +6 -44
- package/package.json +8 -1
- package/src/NativeStripeSdk.tsx +20 -0
- package/src/components/AddressSheet.tsx +82 -0
- package/src/components/PlatformPayButton.tsx +157 -0
- package/src/functions.ts +181 -0
- package/src/hooks/usePlatformPay.tsx +174 -0
- package/src/hooks/useStripe.tsx +77 -0
- package/src/index.tsx +9 -0
- package/src/types/ApplePay.ts +9 -0
- package/src/types/Common.ts +13 -0
- package/src/types/Errors.ts +11 -0
- package/src/types/GooglePay.ts +2 -1
- package/src/types/PaymentSheet.ts +7 -1
- package/src/types/PlatformPay.ts +326 -0
- package/src/types/PushProvisioning.ts +76 -0
- package/src/types/components/ApplePayButtonComponent.ts +3 -2
- package/src/types/index.ts +8 -64
- package/stripe-react-native.podspec +1 -1
- package/android/src/main/res/drawable/googlepay_button_background.xml +0 -6
- package/android/src/main/res/drawable/googlepay_button_content.xml +0 -48
- package/android/src/main/res/drawable/googlepay_button_overlay.xml +0 -12
- package/android/src/main/res/drawable-af/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-am/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-as/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-az/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-be/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bn/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-bs/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-cy/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rau/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rca/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rgb/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-en-rin/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-es/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-es-res/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-eu/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-fa/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fil/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-fr-rca/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ga/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-gl/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-gu/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-hdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-hu/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-hy/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-is/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-iw/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ka/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-kk/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-km/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-kn/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ky/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-lo/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-lt/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-lv/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-mdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-mk/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ml/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-mn/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-mr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ne/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pt-rbr/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-pt-rpt/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ro/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sq/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-sw/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ta/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-te/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-ur/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-uz/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-v21/googlepay_button_background.xml +0 -7
- package/android/src/main/res/drawable-vi/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/drawable-xhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-zh-rcn/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-zh-rhk/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-zh-rtw/pay_with_googlepay_button_content.xml +0 -15
- package/android/src/main/res/drawable-zu/pay_with_googlepay_button_content.xml +0 -14
- package/android/src/main/res/layout/googlepay_button.xml +0 -39
- package/ios/pushprovisioning/PushProvisioningUtils.swift +0 -64
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { useConfirmPayment } from './hooks/useConfirmPayment';
|
|
2
2
|
export { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';
|
|
3
3
|
export { useStripe } from './hooks/useStripe';
|
|
4
|
+
export { usePlatformPay } from './hooks/usePlatformPay';
|
|
4
5
|
export { useApplePay, Props as UseApplePayProps } from './hooks/useApplePay';
|
|
5
6
|
export { usePaymentSheet } from './hooks/usePaymentSheet';
|
|
6
7
|
export { useGooglePay } from './hooks/useGooglePay';
|
|
@@ -13,5 +14,7 @@ export { AuBECSDebitForm, Props as AuBECSDebitFormProps, } from './components/Au
|
|
|
13
14
|
export { StripeContainer, Props as StripeContainerProps, } from './components/StripeContainer';
|
|
14
15
|
export { GooglePayButton, Props as GooglePayButtonProps, } from './components/GooglePayButton';
|
|
15
16
|
export { AddToWalletButton, Props as AddToWalletButtonProps, } from './components/AddToWalletButton';
|
|
17
|
+
export { AddressSheet, Props as AddressSheetProps, } from './components/AddressSheet';
|
|
18
|
+
export { PlatformPayButton, Props as PlatformPayButtonProps, } from './components/PlatformPayButton';
|
|
16
19
|
export * from './functions';
|
|
17
20
|
export * from './types/index';
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
export declare type ContactFieldsType = 'emailAddress' | 'name' | 'phoneNumber' | 'phoneticName' | 'postalAddress';
|
|
2
2
|
export declare type AddressFields = 'street' | 'city' | 'subAdministrativeArea' | 'state' | 'postalCode' | 'country' | 'countryCode' | 'subLocality';
|
|
3
3
|
export interface ShippingMethod {
|
|
4
|
+
/** A short, localized description. */
|
|
4
5
|
label: string;
|
|
6
|
+
/** The cost associated with this shipping option. */
|
|
5
7
|
amount: string;
|
|
8
|
+
/** When creating items for estimates or charges whose final value is not yet known, set this to true. */
|
|
6
9
|
isPending?: boolean;
|
|
10
|
+
/** A unique identifier for the shipping method. */
|
|
7
11
|
identifier: string;
|
|
12
|
+
/** A user-readable description of the shipping method. For example “Ships in 24 hours.” Don't repeat the content of the 'label' property. */
|
|
8
13
|
detail?: string;
|
|
14
|
+
/** 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. */
|
|
15
|
+
startDate?: number;
|
|
16
|
+
/** 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. */
|
|
17
|
+
endDate?: number;
|
|
9
18
|
}
|
|
10
19
|
interface PostalAddress {
|
|
11
20
|
city?: string;
|
|
@@ -12,3 +12,15 @@ export interface Address {
|
|
|
12
12
|
postalCode?: string;
|
|
13
13
|
state?: string;
|
|
14
14
|
}
|
|
15
|
+
export declare type AddressDetails = {
|
|
16
|
+
/** The customer's full name. */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** The customer's address. */
|
|
19
|
+
address?: Address;
|
|
20
|
+
/** The customer's phone number. */
|
|
21
|
+
phone?: string;
|
|
22
|
+
/** Whether or not the checkbox is initally selected. Defaults to false.
|
|
23
|
+
* Note: The checkbox is displayed below the other fields when additionalFields.checkboxLabel is set.
|
|
24
|
+
* */
|
|
25
|
+
isCheckboxSelected?: boolean;
|
|
26
|
+
};
|
|
@@ -62,3 +62,12 @@ export declare enum CollectBankAccountError {
|
|
|
62
62
|
Failed = "Failed",
|
|
63
63
|
Unknown = "Unknown"
|
|
64
64
|
}
|
|
65
|
+
export declare enum AddressSheetError {
|
|
66
|
+
Failed = "Failed",
|
|
67
|
+
Canceled = "Canceled"
|
|
68
|
+
}
|
|
69
|
+
export declare enum PlatformPayError {
|
|
70
|
+
Canceled = "Canceled",
|
|
71
|
+
Failed = "Failed",
|
|
72
|
+
Unknown = "Unknown"
|
|
73
|
+
}
|
|
@@ -22,10 +22,11 @@ export declare type InitParams = {
|
|
|
22
22
|
isEmailRequired?: boolean;
|
|
23
23
|
} & IsSupportedParams;
|
|
24
24
|
export declare type IsSupportedParams = {
|
|
25
|
+
/** 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. */
|
|
25
26
|
testEnv?: boolean;
|
|
26
27
|
/**
|
|
27
28
|
* If `true`, Google Pay is considered ready if the customer's Google Pay wallet
|
|
28
|
-
* has an existing payment method.
|
|
29
|
+
* has an existing payment method. Defaults to false.
|
|
29
30
|
*/
|
|
30
31
|
existingPaymentMethodRequired?: boolean;
|
|
31
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BillingDetails } from './Common';
|
|
1
|
+
import type { BillingDetails, AddressDetails } from './Common';
|
|
2
2
|
import type { CartSummaryItem } from './ApplePay';
|
|
3
3
|
export declare type SetupParams = ClientSecretParams & {
|
|
4
4
|
/** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
|
|
@@ -20,6 +20,12 @@ export declare type SetupParams = ClientSecretParams & {
|
|
|
20
20
|
returnURL?: string;
|
|
21
21
|
/** PaymentSheet pre-populates the billing fields with the values provided. */
|
|
22
22
|
defaultBillingDetails?: BillingDetails;
|
|
23
|
+
/**
|
|
24
|
+
* The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.
|
|
25
|
+
* This is used to display a "Billing address is same as shipping" checkbox if `defaultBillingDetails` is not provided.
|
|
26
|
+
* If `name` and `line1` are populated, it's also [attached to the PaymentIntent](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-shipping) during payment.
|
|
27
|
+
*/
|
|
28
|
+
defaultShippingDetails?: AddressDetails;
|
|
23
29
|
/** If true, allows payment methods that do not move money at the end of the checkout. Defaults to false.
|
|
24
30
|
*
|
|
25
31
|
* Some payment methods can’t guarantee you will receive funds from your customer at the end of the checkout
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import type { Result as Token } from './Token';
|
|
2
|
+
import type { Result as PaymentMethod } from './PaymentMethod';
|
|
3
|
+
import type { Result as PaymentIntent } from './PaymentIntent';
|
|
4
|
+
import type { Result as SetupIntent } from './SetupIntent';
|
|
5
|
+
import type { StripeError, PlatformPayError } from './Errors';
|
|
6
|
+
import type { ShippingContact as ApplePayShippingContact } from './ApplePay';
|
|
7
|
+
import type { IsSupportedParams } from './GooglePay';
|
|
8
|
+
export declare type ApplePaySheetError = {
|
|
9
|
+
errorType: ApplePaySheetErrorType.InvalidShippingAddress;
|
|
10
|
+
field: InvalidShippingField;
|
|
11
|
+
message?: string;
|
|
12
|
+
} | {
|
|
13
|
+
errorType: ApplePaySheetErrorType.UnserviceableShippingAddress | ApplePaySheetErrorType.InvalidCouponCode | ApplePaySheetErrorType.ExpiredCouponCode;
|
|
14
|
+
message?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare enum ApplePaySheetErrorType {
|
|
17
|
+
InvalidShippingAddress = "InvalidShippingAddress",
|
|
18
|
+
UnserviceableShippingAddress = "UnserviceableShippingAddress",
|
|
19
|
+
InvalidCouponCode = "InvalidCouponCode",
|
|
20
|
+
ExpiredCouponCode = "ExpiredCouponCode"
|
|
21
|
+
}
|
|
22
|
+
export declare enum ContactField {
|
|
23
|
+
EmailAddress = "emailAddress",
|
|
24
|
+
Name = "name",
|
|
25
|
+
PhoneNumber = "phoneNumber",
|
|
26
|
+
PhoneticName = "phoneticName",
|
|
27
|
+
PostalAddress = "postalAddress"
|
|
28
|
+
}
|
|
29
|
+
export declare enum InvalidShippingField {
|
|
30
|
+
Street = "street",
|
|
31
|
+
City = "city",
|
|
32
|
+
SubAdministrativeArea = "subAdministrativeArea",
|
|
33
|
+
State = "state",
|
|
34
|
+
PostalCode = "postalCode",
|
|
35
|
+
Country = "country",
|
|
36
|
+
CountryCode = "countryCode",
|
|
37
|
+
SubLocality = "subLocality"
|
|
38
|
+
}
|
|
39
|
+
export declare type ApplePayBaseParams = {
|
|
40
|
+
/** ISO 3166-1 alpha-2 country code where the transaction is processed. */
|
|
41
|
+
merchantCountryCode: string;
|
|
42
|
+
/** ISO 4217 alphabetic currency code. */
|
|
43
|
+
currencyCode: string;
|
|
44
|
+
/** 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. */
|
|
45
|
+
additionalEnabledNetworks?: Array<string>;
|
|
46
|
+
/** The list of items that describe a purchase. For example: total, tax, discount, and grand total. */
|
|
47
|
+
cartItems: Array<CartSummaryItem>;
|
|
48
|
+
/** The list of fields that you need for a shipping contact in order to process the transaction. If provided, you must implement the PlatformPayButton component's `onShippingContactSelected` callback and call `updatePlatformPaySheet` from there.*/
|
|
49
|
+
requiredShippingAddressFields?: Array<ContactField>;
|
|
50
|
+
/** The list of fields that you need for a billing contact in order to process the transaction. */
|
|
51
|
+
requiredBillingContactFields?: Array<ContactField>;
|
|
52
|
+
/** 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. */
|
|
53
|
+
shippingMethods?: Array<ShippingMethod>;
|
|
54
|
+
/** Set the payment capabilities you support. If set, 3DS is required. */
|
|
55
|
+
merchantCapabilities?: Array<ApplePayMerchantCapability>;
|
|
56
|
+
/** An optional value that indicates how to ship purchased items. Defaults to 'Shipping'.*/
|
|
57
|
+
shippingType?: ApplePayShippingType;
|
|
58
|
+
/** A list of two-letter ISO 3166 country codes for limiting payment to cards from specific countries or regions. */
|
|
59
|
+
supportedCountries?: Array<string>;
|
|
60
|
+
};
|
|
61
|
+
export declare type ApplePayPaymentMethodParams = {
|
|
62
|
+
/** 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. */
|
|
63
|
+
supportsCouponCode?: boolean;
|
|
64
|
+
/** 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. */
|
|
65
|
+
couponCode?: string;
|
|
66
|
+
};
|
|
67
|
+
export declare enum ApplePayMerchantCapability {
|
|
68
|
+
/** Required. This value must be supplied. */
|
|
69
|
+
Supports3DS = "supports3DS",
|
|
70
|
+
/** Optional. If present, only transactions that are categorized as credit cards are allowed. */
|
|
71
|
+
SupportsCredit = "supportsCredit",
|
|
72
|
+
/** Optional. If present, only transactions that are categorized as debit cards are allowed. */
|
|
73
|
+
SupportsDebit = "supportsDebit"
|
|
74
|
+
}
|
|
75
|
+
/** A type that indicates how to ship purchased items. */
|
|
76
|
+
export declare enum ApplePayShippingType {
|
|
77
|
+
/** Default. */
|
|
78
|
+
Shipping = "shipping",
|
|
79
|
+
Delivery = "delivery",
|
|
80
|
+
StorePickup = "storePickup",
|
|
81
|
+
ServicePickup = "servicePickup"
|
|
82
|
+
}
|
|
83
|
+
export declare type GooglePayBaseParams = {
|
|
84
|
+
/**
|
|
85
|
+
* 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.
|
|
86
|
+
- Does not require the application to be uploaded to the Google Play Store.
|
|
87
|
+
- Does not require a Google Pay Developer Profile.
|
|
88
|
+
- It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential.
|
|
89
|
+
- The user will see a warning message that the app is not recognized/verified.
|
|
90
|
+
*/
|
|
91
|
+
testEnv: boolean;
|
|
92
|
+
/** ISO 3166-1 alpha-2 country code where the transaction is processed. */
|
|
93
|
+
merchantCountryCode: string;
|
|
94
|
+
/** ISO 4217 alphabetic currency code. */
|
|
95
|
+
currencyCode: string;
|
|
96
|
+
/** Your merchant name, displayed in the Google Pay sheet. */
|
|
97
|
+
merchantName?: string;
|
|
98
|
+
/** Set to true to request an email address. Defaults to false. */
|
|
99
|
+
isEmailRequired?: boolean;
|
|
100
|
+
/** Set to false if you don't support credit cards. Defaults to true. */
|
|
101
|
+
allowCreditCards?: boolean;
|
|
102
|
+
/** If true, Google Pay is considered "available" if the customer's Google Pay wallet has an existing payment method. Defaults to false. */
|
|
103
|
+
existingPaymentMethodRequired?: boolean;
|
|
104
|
+
/** Describes the configuration for billing address collection in the Google Pay sheet. */
|
|
105
|
+
billingAddressConfig?: {
|
|
106
|
+
/** Set to true if billing address is required for payment. Defaults to false. */
|
|
107
|
+
isRequired?: boolean;
|
|
108
|
+
/** Set to true if phone number is required for payment. Defaults to false. */
|
|
109
|
+
isPhoneNumberRequired?: boolean;
|
|
110
|
+
/** Defines what address fields to collect. Defaults to BillingAddressFormat.Min */
|
|
111
|
+
format?: BillingAddressFormat;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export declare type GooglePayPaymentMethodParams = {
|
|
115
|
+
/** Total monetary value of the transaction. */
|
|
116
|
+
amount: number;
|
|
117
|
+
/** Describes the configuration for shipping address collection in the Google Pay sheet. */
|
|
118
|
+
shippingAddressConfig?: {
|
|
119
|
+
/** Set to true if shipping address is required for payment. Defaults to false. */
|
|
120
|
+
isRequired?: boolean;
|
|
121
|
+
/** Set to true if phone number is required for payment. Defaults to false. */
|
|
122
|
+
isPhoneNumberRequired?: boolean;
|
|
123
|
+
/** Set of ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. Defaults to all shipping address countries. */
|
|
124
|
+
allowedCountryCodes?: Array<string>;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
export declare enum BillingAddressFormat {
|
|
128
|
+
/** Collect name, street address, locality, region, country code, and postal code. */
|
|
129
|
+
Full = "FULL",
|
|
130
|
+
/** Collect name, country code, and postal code (default). */
|
|
131
|
+
Min = "MIN"
|
|
132
|
+
}
|
|
133
|
+
export declare type PaymentMethodParams = {
|
|
134
|
+
/** Defines Google Pay behavior. Android only. */
|
|
135
|
+
googlePay?: GooglePayBaseParams & GooglePayPaymentMethodParams;
|
|
136
|
+
/** Defines Apple Pay behavior. iOS only. */
|
|
137
|
+
applePay?: ApplePayBaseParams & ApplePayPaymentMethodParams;
|
|
138
|
+
};
|
|
139
|
+
export declare type ConfirmParams = {
|
|
140
|
+
/** Defines Google Pay behavior. Android only. */
|
|
141
|
+
googlePay?: GooglePayBaseParams;
|
|
142
|
+
/** Defines Apple Pay behavior. iOS only. */
|
|
143
|
+
applePay?: ApplePayBaseParams;
|
|
144
|
+
};
|
|
145
|
+
export declare enum ButtonType {
|
|
146
|
+
/** A button with the Apple Pay or Google Pay logo only, useful when an additional call to action isn't needed. */
|
|
147
|
+
Default = 0,
|
|
148
|
+
/** A button useful for product purchases. */
|
|
149
|
+
Buy = 1,
|
|
150
|
+
/** A button useful for booking trips, flights, or other experiences. */
|
|
151
|
+
Book = 6,
|
|
152
|
+
/** A button useful for purchase experiences that include other payment buttons that start with “Check out”. */
|
|
153
|
+
Checkout = 5,
|
|
154
|
+
/** A button used by approved nonprofit organization that lets people make donations. */
|
|
155
|
+
Donate = 4,
|
|
156
|
+
/** A button useful for placing orders for such as like meals or flowers. */
|
|
157
|
+
Order = 11,
|
|
158
|
+
/** A button useful for purchasing a subscription such as a gym membership or meal-kit delivery service. */
|
|
159
|
+
Subscribe = 7,
|
|
160
|
+
/** iOS only. A button useful for prompting the user to set up a card. */
|
|
161
|
+
SetUp = 2,
|
|
162
|
+
/** iOS only. A button useful for paying bills or invoices. */
|
|
163
|
+
InStore = 3,
|
|
164
|
+
/** iOS only. A button useful for adding money to a card, account, or payment system.*/
|
|
165
|
+
Reload = 8,
|
|
166
|
+
/** iOS only. A button useful for adding money to a card, account, or payment system. */
|
|
167
|
+
AddMoney = 9,
|
|
168
|
+
/** iOS only. A button useful for adding money to a card, account, or payment system. */
|
|
169
|
+
TopUp = 10,
|
|
170
|
+
/** iOS only. A button useful for renting items such as cars or scooters. */
|
|
171
|
+
Rent = 12,
|
|
172
|
+
/** iOS only. A button useful supporting people give money to projects, causes, organizations, and other entities.*/
|
|
173
|
+
Support = 13,
|
|
174
|
+
/** iOS only. A button useful to help people contribute money to projects, causes, organizations, and other entities. */
|
|
175
|
+
Contribute = 14,
|
|
176
|
+
/** iOS only. A button useful useful for letting people tip for goods or services. */
|
|
177
|
+
Tip = 15,
|
|
178
|
+
/** iOS only. A button useful for general purchases. */
|
|
179
|
+
Continue = 16,
|
|
180
|
+
/** Android only. A button useful for general payments. */
|
|
181
|
+
Pay = 1000,
|
|
182
|
+
/** 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. */
|
|
183
|
+
GooglePayMark = 1001
|
|
184
|
+
}
|
|
185
|
+
/** iOS only. */
|
|
186
|
+
export declare enum ButtonStyle {
|
|
187
|
+
/** A white button with black lettering. */
|
|
188
|
+
White = 0,
|
|
189
|
+
/** A white button with black lettering and a black outline. */
|
|
190
|
+
WhiteOutline = 1,
|
|
191
|
+
/** A black button with white lettering. */
|
|
192
|
+
Black = 2,
|
|
193
|
+
/** Default. A button that automatically changes its appearance when the user switches between Light Mode and Dark Mode. */
|
|
194
|
+
Automatic = 3
|
|
195
|
+
}
|
|
196
|
+
/** iOS only. */
|
|
197
|
+
export declare type CartSummaryItem = DeferredCartSummaryItem | ImmediateCartSummaryItem | RecurringCartSummaryItem;
|
|
198
|
+
/** iOS only. */
|
|
199
|
+
export declare enum PaymentType {
|
|
200
|
+
Deferred = "Deferred",
|
|
201
|
+
Immediate = "Immediate",
|
|
202
|
+
Recurring = "Recurring"
|
|
203
|
+
}
|
|
204
|
+
/** 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. */
|
|
205
|
+
export declare type DeferredCartSummaryItem = {
|
|
206
|
+
paymentType: PaymentType.Deferred;
|
|
207
|
+
/** The unix timestamp of the date, in the future, of the payment. Measured in seconds. */
|
|
208
|
+
deferredDate: number;
|
|
209
|
+
label: string;
|
|
210
|
+
amount: string;
|
|
211
|
+
};
|
|
212
|
+
/** iOS only. Use this type for payments that will occur immediately. */
|
|
213
|
+
export declare type ImmediateCartSummaryItem = {
|
|
214
|
+
paymentType: PaymentType.Immediate;
|
|
215
|
+
/** When creating items for estimates or charges whose final value is not yet known, set this to true. */
|
|
216
|
+
isPending?: boolean;
|
|
217
|
+
label: string;
|
|
218
|
+
amount: string;
|
|
219
|
+
};
|
|
220
|
+
/** 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.*/
|
|
221
|
+
export declare type RecurringCartSummaryItem = {
|
|
222
|
+
paymentType: PaymentType.Recurring;
|
|
223
|
+
/** 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.*/
|
|
224
|
+
intervalUnit: IntervalUnit;
|
|
225
|
+
/** 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.*/
|
|
226
|
+
intervalCount: number;
|
|
227
|
+
/** The unix timestamp of the start date. Measured in seconds. */
|
|
228
|
+
startDate?: number;
|
|
229
|
+
/** The unix timestamp of the end date. Measured in seconds. */
|
|
230
|
+
endDate?: number;
|
|
231
|
+
label: string;
|
|
232
|
+
amount: string;
|
|
233
|
+
};
|
|
234
|
+
/** iOS only. */
|
|
235
|
+
export declare enum IntervalUnit {
|
|
236
|
+
Minute = "minute",
|
|
237
|
+
Hour = "hour",
|
|
238
|
+
Day = "day",
|
|
239
|
+
Month = "month",
|
|
240
|
+
Year = "year"
|
|
241
|
+
}
|
|
242
|
+
/** iOS only. */
|
|
243
|
+
export declare type ShippingMethod = {
|
|
244
|
+
/** A short, localized description. */
|
|
245
|
+
label: string;
|
|
246
|
+
/** The cost associated with this shipping option. */
|
|
247
|
+
amount: string;
|
|
248
|
+
/** When creating items for estimates or charges whose final value is not yet known, set this to true. */
|
|
249
|
+
isPending?: boolean;
|
|
250
|
+
/** A unique identifier for the shipping method. */
|
|
251
|
+
identifier: string;
|
|
252
|
+
/** A user-readable description of the shipping method. For example “Ships in 24 hours.” Don't repeat the content of the 'label' property. */
|
|
253
|
+
detail?: string;
|
|
254
|
+
/** 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. */
|
|
255
|
+
startDate?: number;
|
|
256
|
+
/** 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. */
|
|
257
|
+
endDate?: number;
|
|
258
|
+
};
|
|
259
|
+
/** iOS only. */
|
|
260
|
+
export declare type ShippingContact = ApplePayShippingContact;
|
|
261
|
+
/** Android only. */
|
|
262
|
+
export declare type IsGooglePaySupportedParams = IsSupportedParams;
|
|
263
|
+
export declare type PaymentMethodResult = {
|
|
264
|
+
paymentMethod: PaymentMethod;
|
|
265
|
+
token: Token;
|
|
266
|
+
error?: undefined;
|
|
267
|
+
} | {
|
|
268
|
+
paymentMethod?: undefined;
|
|
269
|
+
token?: undefined;
|
|
270
|
+
error: StripeError<PlatformPayError>;
|
|
271
|
+
};
|
|
272
|
+
export declare type ConfirmPaymentResult = {
|
|
273
|
+
paymentIntent: PaymentIntent;
|
|
274
|
+
error?: StripeError<PlatformPayError>;
|
|
275
|
+
} | {
|
|
276
|
+
paymentIntent?: undefined;
|
|
277
|
+
error: StripeError<PlatformPayError>;
|
|
278
|
+
};
|
|
279
|
+
export declare type ConfirmSetupIntentResult = {
|
|
280
|
+
setupIntent: SetupIntent;
|
|
281
|
+
error?: StripeError<PlatformPayError>;
|
|
282
|
+
} | {
|
|
283
|
+
setupIntent?: undefined;
|
|
284
|
+
error: StripeError<PlatformPayError>;
|
|
285
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { StripeError, GooglePayError } from './Errors';
|
|
2
|
+
export declare type GooglePayCardToken = {
|
|
3
|
+
id: string;
|
|
4
|
+
cardLastFour: string;
|
|
5
|
+
network: number;
|
|
6
|
+
serviceProvider: number;
|
|
7
|
+
issuer: string;
|
|
8
|
+
status: GooglePayCardTokenStatus;
|
|
9
|
+
};
|
|
10
|
+
export declare enum GooglePayCardTokenStatus {
|
|
11
|
+
/** */
|
|
12
|
+
TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION = "TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION",
|
|
13
|
+
/** */
|
|
14
|
+
TOKEN_STATE_PENDING = "TOKEN_STATE_PENDING",
|
|
15
|
+
/** */
|
|
16
|
+
TOKEN_STATE_SUSPENDED = "TOKEN_STATE_SUSPENDED",
|
|
17
|
+
/** */
|
|
18
|
+
TOKEN_STATE_ACTIVE = "TOKEN_STATE_ACTIVE",
|
|
19
|
+
/** */
|
|
20
|
+
TOKEN_STATE_FELICA_PENDING_PROVISIONING = "TOKEN_STATE_FELICA_PENDING_PROVISIONING",
|
|
21
|
+
/** */
|
|
22
|
+
TOKEN_STATE_UNTOKENIZED = "TOKEN_STATE_UNTOKENIZED"
|
|
23
|
+
}
|
|
24
|
+
export declare type IsCardInWalletResult = {
|
|
25
|
+
isInWallet: boolean;
|
|
26
|
+
token?: GooglePayCardToken;
|
|
27
|
+
error?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
isInWallet?: undefined;
|
|
30
|
+
token?: undefined;
|
|
31
|
+
error: StripeError<GooglePayError>;
|
|
32
|
+
};
|
|
33
|
+
export declare type CanAddCardToWalletParams = {
|
|
34
|
+
/** The `primary_account_identifier` value from the issued card. Can be an empty string. */
|
|
35
|
+
primaryAccountIdentifier: string | null;
|
|
36
|
+
/** Last 4 digits of the card number. */
|
|
37
|
+
cardLastFour: string;
|
|
38
|
+
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
39
|
+
testEnv?: boolean;
|
|
40
|
+
/** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */
|
|
41
|
+
hasPairedAppleWatch?: boolean;
|
|
42
|
+
};
|
|
43
|
+
export declare type CanAddCardToWalletResult = {
|
|
44
|
+
canAddCard: boolean;
|
|
45
|
+
details?: {
|
|
46
|
+
token?: GooglePayCardToken;
|
|
47
|
+
status?: CanAddCardToWalletStatus;
|
|
48
|
+
};
|
|
49
|
+
error?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
canAddCard?: undefined;
|
|
52
|
+
details?: undefined;
|
|
53
|
+
error: StripeError<GooglePayError>;
|
|
54
|
+
};
|
|
55
|
+
export declare enum CanAddCardToWalletStatus {
|
|
56
|
+
/** You are missing configuration required for Push Provisioning. Make sure you've completed all steps at https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native. */
|
|
57
|
+
MISSING_CONFIGURATION = "MISSING_CONFIGURATION",
|
|
58
|
+
/** This device doesn't support adding a card to the native wallet. */
|
|
59
|
+
UNSUPPORTED_DEVICE = "UNSUPPORTED_DEVICE",
|
|
60
|
+
/** This card already exists on this device and any paired devices. */
|
|
61
|
+
CARD_ALREADY_EXISTS = "CARD_ALREADY_EXISTS",
|
|
62
|
+
/** This card already exists on this device, but not on the paired device. */
|
|
63
|
+
CARD_EXISTS_ON_CURRENT_DEVICE = "CARD_EXISTS_ON_CURRENT_DEVICE",
|
|
64
|
+
/** This card already exists on the paired device, but not on this device. */
|
|
65
|
+
CARD_EXISTS_ON_PAIRED_DEVICE = "CARD_EXISTS_ON_PAIRED_DEVICE"
|
|
66
|
+
}
|
|
@@ -4,7 +4,7 @@ export interface NativeProps {
|
|
|
4
4
|
type?: number;
|
|
5
5
|
buttonStyle?: number;
|
|
6
6
|
borderRadius?: number;
|
|
7
|
-
onPressAction(): void;
|
|
7
|
+
onPressAction?(): void;
|
|
8
8
|
}
|
|
9
|
-
export declare type Type = 'plain' | 'buy' | 'setUp' | 'inStore' | 'donate' | 'checkout' | 'book' | 'subscribe' | 'reload' | 'addMoney' | 'topUp' | 'order' | 'rent' | 'support' | 'contribute' | 'tip';
|
|
9
|
+
export declare type Type = 'plain' | 'buy' | 'setUp' | 'inStore' | 'donate' | 'checkout' | 'book' | 'subscribe' | 'reload' | 'addMoney' | 'topUp' | 'order' | 'rent' | 'support' | 'contribute' | 'tip' | 'continue';
|
|
10
10
|
export declare type Style = 'white' | 'whiteOutline' | 'black' | 'automatic';
|
|
@@ -12,9 +12,11 @@ import * as CardFieldInput from './components/CardFieldInput';
|
|
|
12
12
|
import * as CardFormView from './components/CardFormView';
|
|
13
13
|
import * as Token from './Token';
|
|
14
14
|
import * as FinancialConnections from './FinancialConnections';
|
|
15
|
-
|
|
15
|
+
import * as PlatformPay from './PlatformPay';
|
|
16
|
+
export { ApplePay, PaymentIntent, PaymentMethod, PaymentSheet, SetupIntent, ThreeDSecure, GooglePay, ApplePayButtonComponent, AuBECSDebitFormComponent, CardFieldInput, CardFormView, Token, FinancialConnections, PlatformPay, };
|
|
17
|
+
export * from './PushProvisioning';
|
|
16
18
|
export * from './Errors';
|
|
17
|
-
export { Address, BillingDetails } from './Common';
|
|
19
|
+
export { Address, BillingDetails, AddressDetails } from './Common';
|
|
18
20
|
/**
|
|
19
21
|
* @ignore
|
|
20
22
|
*/
|
|
@@ -84,11 +86,8 @@ export declare type InitPaymentSheetResult = {
|
|
|
84
86
|
error: StripeError<PaymentSheetError>;
|
|
85
87
|
};
|
|
86
88
|
export declare type PresentPaymentSheetResult = {
|
|
87
|
-
paymentOption
|
|
88
|
-
error?: undefined;
|
|
89
|
-
} | {
|
|
90
|
-
paymentOption?: undefined;
|
|
91
|
-
error: StripeError<PaymentSheetError>;
|
|
89
|
+
paymentOption?: PaymentSheet.PaymentOption | undefined;
|
|
90
|
+
error?: StripeError<PaymentSheetError> | undefined;
|
|
92
91
|
};
|
|
93
92
|
export declare type CreateTokenResult = {
|
|
94
93
|
token: Token.Result;
|
|
@@ -175,40 +174,3 @@ export declare type CollectBankAccountForSetupResult = {
|
|
|
175
174
|
setupIntent?: undefined;
|
|
176
175
|
error: StripeError<CollectBankAccountError>;
|
|
177
176
|
};
|
|
178
|
-
export declare type GooglePayCardToken = {
|
|
179
|
-
id: string;
|
|
180
|
-
cardLastFour: string;
|
|
181
|
-
network: number;
|
|
182
|
-
serviceProvider: number;
|
|
183
|
-
issuer: string;
|
|
184
|
-
status: 'TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION' | 'TOKEN_STATE_PENDING' | 'TOKEN_STATE_SUSPENDED' | 'TOKEN_STATE_ACTIVE' | 'TOKEN_STATE_FELICA_PENDING_PROVISIONING' | 'TOKEN_STATE_UNTOKENIZED';
|
|
185
|
-
};
|
|
186
|
-
export declare type IsCardInWalletResult = {
|
|
187
|
-
isInWallet: boolean;
|
|
188
|
-
token?: GooglePayCardToken;
|
|
189
|
-
error?: undefined;
|
|
190
|
-
} | {
|
|
191
|
-
isInWallet?: undefined;
|
|
192
|
-
token?: undefined;
|
|
193
|
-
error: StripeError<GooglePayError>;
|
|
194
|
-
};
|
|
195
|
-
export declare type CanAddCardToWalletParams = {
|
|
196
|
-
/** The `primary_account_identifier` value from the issued card. Can be an empty string. */
|
|
197
|
-
primaryAccountIdentifier: string | null;
|
|
198
|
-
/** Last 4 digits of the card number. */
|
|
199
|
-
cardLastFour: string;
|
|
200
|
-
/** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
|
|
201
|
-
testEnv?: boolean;
|
|
202
|
-
};
|
|
203
|
-
export declare type CanAddCardToWalletResult = {
|
|
204
|
-
canAddCard: boolean;
|
|
205
|
-
details?: {
|
|
206
|
-
token?: GooglePayCardToken;
|
|
207
|
-
status?: 'MISSING_CONFIGURATION' | 'UNSUPPORTED_DEVICE' | 'CARD_ALREADY_EXISTS';
|
|
208
|
-
};
|
|
209
|
-
error?: undefined;
|
|
210
|
-
} | {
|
|
211
|
-
canAddCard?: undefined;
|
|
212
|
-
details?: undefined;
|
|
213
|
-
error: StripeError<GooglePayError>;
|
|
214
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -109,6 +109,13 @@
|
|
|
109
109
|
"trailingComma": "es5",
|
|
110
110
|
"useTabs": false
|
|
111
111
|
}
|
|
112
|
+
],
|
|
113
|
+
"no-restricted-syntax": [
|
|
114
|
+
"error",
|
|
115
|
+
{
|
|
116
|
+
"selector": "TSEnumDeclaration[const=true]",
|
|
117
|
+
"message": "`const enum` declarations are not allowed"
|
|
118
|
+
}
|
|
112
119
|
]
|
|
113
120
|
}
|
|
114
121
|
},
|
package/src/NativeStripeSdk.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
PaymentMethod,
|
|
4
4
|
PaymentIntent,
|
|
5
5
|
ApplePay,
|
|
6
|
+
PlatformPay,
|
|
6
7
|
PaymentSheet,
|
|
7
8
|
SetupIntent,
|
|
8
9
|
InitialiseParams,
|
|
@@ -106,6 +107,25 @@ type NativeStripeSdkType = {
|
|
|
106
107
|
clientSecret: string
|
|
107
108
|
): Promise<FinancialConnections.SessionResult>;
|
|
108
109
|
resetPaymentSheetCustomer(): Promise<null>;
|
|
110
|
+
isPlatformPaySupported(params: {
|
|
111
|
+
googlePay?: GooglePay.IsSupportedParams;
|
|
112
|
+
}): Promise<boolean>;
|
|
113
|
+
createPlatformPayPaymentMethod(
|
|
114
|
+
params: PlatformPay.PaymentMethodParams
|
|
115
|
+
): Promise<PlatformPay.PaymentMethodResult>;
|
|
116
|
+
dismissPlatformPay(): Promise<boolean>;
|
|
117
|
+
updatePlatformPaySheet(
|
|
118
|
+
summaryItems: Array<ApplePay.CartSummaryItem>,
|
|
119
|
+
shippingMethods: Array<ApplePay.ShippingMethod>,
|
|
120
|
+
errors: Array<PlatformPay.ApplePaySheetError>
|
|
121
|
+
): Promise<void>;
|
|
122
|
+
confirmPlatformPay(
|
|
123
|
+
clientSecret: string,
|
|
124
|
+
params: PlatformPay.ConfirmParams,
|
|
125
|
+
isPaymentIntent: boolean
|
|
126
|
+
): Promise<
|
|
127
|
+
PlatformPay.ConfirmPaymentResult | PlatformPay.ConfirmSetupIntentResult
|
|
128
|
+
>;
|
|
109
129
|
};
|
|
110
130
|
|
|
111
131
|
const { StripeSdk } = NativeModules;
|