@stripe/stripe-react-native 0.57.0 → 0.57.2
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/README.md +0 -8
- package/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +1029 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +19 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +76 -118
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/settings.gradle +2 -0
- package/android/spotless.gradle +1 -1
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +20 -17
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +13 -11
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +17 -21
- package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherManager.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/CustomPaymentMethodActivity.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +53 -11
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +105 -117
- package/android/src/main/java/com/reactnativestripesdk/EventEmitterCompat.kt +4 -8
- package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +154 -0
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetManager.kt +13 -15
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherManager.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +7 -5
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarManager.kt +31 -0
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +120 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +228 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherManager.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +3 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt +4 -6
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +73 -30
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +19 -245
- package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +53 -17
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +52 -14
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +21 -2
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +4 -4
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +2 -2
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +15 -35
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerSessionProvider.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +5 -10
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +90 -77
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +6 -4
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +13 -3
- package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +41 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +92 -44
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java +3 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java +2 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +118 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +4 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +922 -0
- package/android/src/test/java/com/facebook/testutils/shadows/ShadowArguments.kt +29 -0
- package/android/src/test/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManagerTest.kt +163 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentElementConfigTest.kt +976 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentSheetAppearanceTest.kt +801 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentSheetManagerTest.kt +523 -0
- package/android/src/test/java/com/reactnativestripesdk/addresssheet/AddressSheetViewTest.kt +551 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/MappersTest.kt +567 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/PaymentOptionDisplayDataMapperTest.kt +456 -0
- package/android/src/test/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxyTest.kt +43 -0
- package/android/src/test/resources/robolectric.properties +2 -0
- package/ios/AddressSheet/AddressSheetUtils.swift +3 -3
- package/ios/AddressSheet/AddressSheetView.swift +25 -25
- package/ios/AddressSheet/AddressSheetViewManager.swift +2 -2
- package/ios/ApplePayButtonManager.swift +1 -1
- package/ios/ApplePayButtonView.swift +9 -10
- package/ios/ApplePayUtils.swift +51 -51
- package/ios/ApplePayViewController.swift +25 -29
- package/ios/AuBECSDebitFormManager.swift +1 -1
- package/ios/AuBECSDebitFormView.swift +13 -15
- package/ios/CardFieldManager.swift +4 -4
- package/ios/CardFieldView.swift +9 -9
- package/ios/CardFormManager.swift +3 -3
- package/ios/CardFormView.swift +28 -28
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingView.swift +97 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewController.swift +133 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewManager.m +16 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewManager.swift +17 -0
- package/ios/CustomerSheet/CustomerSheetUtils.swift +15 -16
- package/ios/CustomerSheet/ReactNativeCustomerAdapter.swift +19 -19
- package/ios/EmbeddedPaymentElementView.swift +2 -2
- package/ios/Errors.swift +22 -23
- package/ios/FinancialConnections.swift +37 -37
- package/ios/Mappers.swift +210 -71
- package/ios/NavigationBarManager.m +13 -0
- package/ios/NavigationBarManager.swift +17 -0
- package/ios/NavigationBarView.swift +65 -0
- package/ios/NewArch/NavigationBarComponentView.h +10 -0
- package/ios/NewArch/NavigationBarComponentView.mm +86 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.h +1 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.m +7 -1
- package/ios/PaymentMethodFactory.swift +24 -24
- package/ios/PaymentOptionDisplayData+ReactNative.swift +4 -4
- package/ios/PaymentPassFinder.swift +9 -10
- package/ios/PaymentSheetAppearance.swift +137 -138
- package/ios/PushProvisioning/AddToWalletButtonManager.swift +2 -2
- package/ios/PushProvisioning/AddToWalletButtonView.swift +15 -17
- package/ios/PushProvisioning/PushProvisioningUtils.swift +11 -11
- package/ios/StripeContainerManager.swift +1 -1
- package/ios/StripeContainerView.swift +3 -3
- package/ios/StripeOnrampSdk.h +17 -0
- package/ios/StripeOnrampSdk.mm +158 -0
- package/ios/StripeSdk.mm +8 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/tianzhao.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/tianzhao.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/ios/StripeSdkEmitter.swift +4 -0
- package/ios/StripeSdkImpl+CustomerSheet.swift +30 -25
- package/ios/StripeSdkImpl+Embedded.swift +11 -9
- package/ios/StripeSdkImpl+PaymentSheet.swift +36 -34
- package/ios/StripeSdkImpl.swift +913 -185
- package/ios/UIColorExtension.swift +72 -0
- package/lib/commonjs/components/AddToWalletButton.js +1 -1
- package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
- package/lib/commonjs/components/AddressSheet.js +1 -1
- package/lib/commonjs/components/AddressSheet.js.map +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
- package/lib/commonjs/components/CardField.js +1 -1
- package/lib/commonjs/components/CardField.js.map +1 -1
- package/lib/commonjs/components/CardForm.js +1 -1
- package/lib/commonjs/components/CardForm.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
- package/lib/commonjs/components/StripeContainer.js +1 -1
- package/lib/commonjs/components/StripeContainer.js.map +1 -1
- package/lib/commonjs/components/StripeProvider.js +1 -1
- package/lib/commonjs/components/StripeProvider.js.map +1 -1
- package/lib/commonjs/connect/Components.js +2 -0
- package/lib/commonjs/connect/Components.js.map +1 -0
- package/lib/commonjs/connect/ConnectComponentsProvider.js +2 -0
- package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -0
- package/lib/commonjs/connect/EmbeddedComponent.js +19 -0
- package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -0
- package/lib/commonjs/connect/ModalCloseButton.js +2 -0
- package/lib/commonjs/connect/ModalCloseButton.js.map +1 -0
- package/lib/commonjs/connect/NavigationBar.js +2 -0
- package/lib/commonjs/connect/NavigationBar.js.map +1 -0
- package/lib/commonjs/connect/connectTypes.js +2 -0
- package/lib/commonjs/connect/connectTypes.js.map +1 -0
- package/lib/commonjs/events.js +1 -1
- package/lib/commonjs/events.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/helpers.js.map +1 -1
- package/lib/commonjs/hooks/useOnramp.js +2 -0
- package/lib/commonjs/hooks/useOnramp.js.map +1 -0
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/plugin/withStripe.js +1 -1
- package/lib/commonjs/plugin/withStripe.js.map +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js.map +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js.map +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js.map +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js.map +1 -1
- package/lib/commonjs/specs/NativeCardField.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js.map +1 -1
- package/lib/commonjs/specs/NativeCardForm.js +1 -1
- package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
- package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +2 -0
- package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js.map +1 -0
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
- package/lib/commonjs/specs/NativeGooglePayButton.js.map +1 -1
- package/lib/commonjs/specs/NativeNavigationBar.js +2 -0
- package/lib/commonjs/specs/NativeNavigationBar.js.map +1 -0
- package/lib/commonjs/specs/NativeOnrampSdkModule.js +2 -0
- package/lib/commonjs/specs/NativeOnrampSdkModule.js.map +1 -0
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js.map +1 -1
- package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.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/Onramp.js +2 -0
- package/lib/commonjs/types/Onramp.js.map +1 -0
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/components/AddToWalletButton.js +1 -1
- package/lib/module/components/AddToWalletButton.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/AuBECSDebitForm.js +1 -1
- package/lib/module/components/AuBECSDebitForm.js.map +1 -1
- package/lib/module/components/CardField.js +1 -1
- package/lib/module/components/CardField.js.map +1 -1
- package/lib/module/components/CardForm.js +1 -1
- package/lib/module/components/CardForm.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/components/StripeContainer.js +1 -1
- package/lib/module/components/StripeContainer.js.map +1 -1
- package/lib/module/components/StripeProvider.js +1 -1
- package/lib/module/components/StripeProvider.js.map +1 -1
- package/lib/module/connect/Components.js +2 -0
- package/lib/module/connect/Components.js.map +1 -0
- package/lib/module/connect/ConnectComponentsProvider.js +2 -0
- package/lib/module/connect/ConnectComponentsProvider.js.map +1 -0
- package/lib/module/connect/EmbeddedComponent.js +19 -0
- package/lib/module/connect/EmbeddedComponent.js.map +1 -0
- package/lib/module/connect/ModalCloseButton.js +2 -0
- package/lib/module/connect/ModalCloseButton.js.map +1 -0
- package/lib/module/connect/NavigationBar.js +2 -0
- package/lib/module/connect/NavigationBar.js.map +1 -0
- package/lib/module/connect/connectTypes.js +2 -0
- package/lib/module/connect/connectTypes.js.map +1 -0
- package/lib/module/events.js +1 -1
- package/lib/module/events.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/helpers.js.map +1 -1
- package/lib/module/hooks/useOnramp.js +2 -0
- package/lib/module/hooks/useOnramp.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/plugin/withStripe.js +1 -1
- package/lib/module/plugin/withStripe.js.map +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js.map +1 -1
- package/lib/module/specs/NativeAddressSheet.js +1 -1
- package/lib/module/specs/NativeAddressSheet.js.map +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js.map +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js.map +1 -1
- package/lib/module/specs/NativeCardField.js +1 -1
- package/lib/module/specs/NativeCardField.js.map +1 -1
- package/lib/module/specs/NativeCardForm.js +1 -1
- package/lib/module/specs/NativeCardForm.js.map +1 -1
- package/lib/module/specs/NativeConnectAccountOnboardingView.js +2 -0
- package/lib/module/specs/NativeConnectAccountOnboardingView.js.map +1 -0
- package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/module/specs/NativeGooglePayButton.js +1 -1
- package/lib/module/specs/NativeGooglePayButton.js.map +1 -1
- package/lib/module/specs/NativeNavigationBar.js +2 -0
- package/lib/module/specs/NativeNavigationBar.js.map +1 -0
- package/lib/module/specs/NativeOnrampSdkModule.js +2 -0
- package/lib/module/specs/NativeOnrampSdkModule.js.map +1 -0
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/specs/NativeStripeContainer.js.map +1 -1
- package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.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/Onramp.js +2 -0
- package/lib/module/types/Onramp.js.map +1 -0
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -1
- package/lib/typescript/src/connect/Components.d.ts +23 -0
- package/lib/typescript/src/connect/Components.d.ts.map +1 -0
- package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts +22 -0
- package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/src/connect/EmbeddedComponent.d.ts +18 -0
- package/lib/typescript/src/connect/EmbeddedComponent.d.ts.map +1 -0
- package/lib/typescript/src/connect/ModalCloseButton.d.ts +7 -0
- package/lib/typescript/src/connect/ModalCloseButton.d.ts.map +1 -0
- package/lib/typescript/src/connect/NavigationBar.d.ts +8 -0
- package/lib/typescript/src/connect/NavigationBar.d.ts.map +1 -0
- package/lib/typescript/src/connect/connectTypes.d.ts +464 -0
- package/lib/typescript/src/connect/connectTypes.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +4 -0
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/helpers.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +158 -0
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/plugin/withStripe.d.ts +15 -0
- package/lib/typescript/src/plugin/withStripe.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeConnectAccountOnboardingView.d.ts +14 -0
- package/lib/typescript/src/specs/NativeConnectAccountOnboardingView.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts +1 -0
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeNavigationBar.d.ts +11 -0
- package/lib/typescript/src/specs/NativeNavigationBar.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +28 -0
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +3 -0
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/Errors.d.ts +5 -0
- package/lib/typescript/src/types/Errors.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +275 -0
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts +7 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +7 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +25 -14
- package/src/components/StripeProvider.tsx +5 -0
- package/src/connect/Components.tsx +279 -0
- package/src/connect/ConnectComponentsProvider.tsx +93 -0
- package/src/connect/EmbeddedComponent.tsx +407 -0
- package/src/connect/ModalCloseButton.tsx +44 -0
- package/src/connect/NavigationBar.tsx +29 -0
- package/src/connect/connectTypes.ts +626 -0
- package/src/events.ts +23 -0
- package/src/hooks/useOnramp.tsx +334 -0
- package/src/index.tsx +13 -0
- package/src/plugin/withStripe.ts +104 -7
- package/src/specs/NativeConnectAccountOnboardingView.ts +19 -0
- package/src/specs/NativeEmbeddedPaymentElement.ts +5 -1
- package/src/specs/NativeNavigationBar.ts +16 -0
- package/src/specs/NativeOnrampSdkModule.ts +47 -0
- package/src/specs/NativeStripeSdkModule.ts +5 -0
- package/src/types/EmbeddedPaymentElement.tsx +24 -3
- package/src/types/Errors.ts +6 -0
- package/src/types/Onramp.ts +317 -0
- package/src/types/PaymentSheet.ts +7 -0
- package/src/types/index.ts +8 -0
- package/stripe-react-native.podspec +20 -7
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#import "NavigationBarComponentView.h"
|
|
2
|
+
|
|
3
|
+
#import <react/renderer/components/rnstripe/ComponentDescriptors.h>
|
|
4
|
+
#import <react/renderer/components/rnstripe/EventEmitters.h>
|
|
5
|
+
#import <react/renderer/components/rnstripe/Props.h>
|
|
6
|
+
#import <react/renderer/components/rnstripe/RCTComponentViewHelpers.h>
|
|
7
|
+
|
|
8
|
+
#import <React/RCTConversions.h>
|
|
9
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
10
|
+
#import "StripeNewArchConversions.h"
|
|
11
|
+
#import "StripeSwiftInterop.h"
|
|
12
|
+
|
|
13
|
+
using namespace facebook::react;
|
|
14
|
+
using namespace stripe::react;
|
|
15
|
+
|
|
16
|
+
@interface NavigationBarComponentView () <RCTNavigationBarViewProtocol>
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation NavigationBarComponentView {
|
|
20
|
+
NavigationBarView *_view;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Needed because of this: https://github.com/facebook/react-native/pull/37274
|
|
24
|
+
+ (void)load
|
|
25
|
+
{
|
|
26
|
+
[super load];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
30
|
+
{
|
|
31
|
+
if (self = [super initWithFrame:frame]) {
|
|
32
|
+
static const auto defaultProps = std::make_shared<const NavigationBarProps>();
|
|
33
|
+
_props = defaultProps;
|
|
34
|
+
[self prepareView];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
- (void)prepareView
|
|
41
|
+
{
|
|
42
|
+
_view = [[NavigationBarView alloc] initWithFrame:self.frame];
|
|
43
|
+
self.contentView = _view;
|
|
44
|
+
|
|
45
|
+
__weak __typeof(self) weakSelf = self;
|
|
46
|
+
|
|
47
|
+
_view.onCloseButtonPress = ^(NSDictionary *event) {
|
|
48
|
+
__typeof(self) strongSelf = weakSelf;
|
|
49
|
+
if (!strongSelf || !strongSelf->_eventEmitter) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
NavigationBarEventEmitter::OnCloseButtonPress emitterEvent = {};
|
|
53
|
+
std::static_pointer_cast<const NavigationBarEventEmitter>(strongSelf->_eventEmitter)
|
|
54
|
+
->onCloseButtonPress(std::move(emitterEvent));
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (void)updateProps:(const facebook::react::Props::Shared &)props
|
|
59
|
+
oldProps:(const facebook::react::Props::Shared &)oldProps
|
|
60
|
+
{
|
|
61
|
+
const auto &newViewProps = *std::static_pointer_cast<const NavigationBarProps>(props);
|
|
62
|
+
|
|
63
|
+
_view.title = RCTNSStringFromStringNilIfEmpty(newViewProps.title);
|
|
64
|
+
|
|
65
|
+
[super updateProps:props oldProps:oldProps];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#pragma mark - RCTComponentViewProtocol
|
|
69
|
+
|
|
70
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
71
|
+
{
|
|
72
|
+
return concreteComponentDescriptorProvider<NavigationBarComponentDescriptor>();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
- (void)prepareForRecycle
|
|
76
|
+
{
|
|
77
|
+
[super prepareForRecycle];
|
|
78
|
+
[self prepareView];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@end
|
|
82
|
+
|
|
83
|
+
Class<RCTComponentViewProtocol> NavigationBarCls(void)
|
|
84
|
+
{
|
|
85
|
+
return NavigationBarComponentView.class;
|
|
86
|
+
}
|
|
@@ -23,5 +23,6 @@
|
|
|
23
23
|
- (void)emitEmbeddedPaymentElementRowSelectionImmediateAction;
|
|
24
24
|
- (void)emitEmbeddedPaymentElementLoadingFailed:(NSDictionary *)value;
|
|
25
25
|
- (void)emitOnCustomPaymentMethodConfirmHandlerCallback:(NSDictionary *)value;
|
|
26
|
+
- (void)emitOnCheckoutClientSecretRequested:(NSDictionary *)value;
|
|
26
27
|
@end
|
|
27
28
|
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
@"embeddedPaymentElementFormSheetConfirmComplete",
|
|
24
24
|
@"embeddedPaymentElementRowSelectionImmediateAction",
|
|
25
25
|
@"embeddedPaymentElementLoadingFailed",
|
|
26
|
-
@"onCustomPaymentMethodConfirmHandlerCallback"
|
|
26
|
+
@"onCustomPaymentMethodConfirmHandlerCallback",
|
|
27
|
+
@"onCheckoutClientSecretRequested"
|
|
27
28
|
];
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -122,4 +123,9 @@
|
|
|
122
123
|
[self sendEventWithName:@"onCustomPaymentMethodConfirmHandlerCallback" body:value];
|
|
123
124
|
}
|
|
124
125
|
|
|
126
|
+
- (void)emitOnCheckoutClientSecretRequested:(NSDictionary *)value
|
|
127
|
+
{
|
|
128
|
+
[self sendEventWithName:@"onCheckoutClientSecretRequested" body:value];
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
@end
|
|
@@ -2,12 +2,12 @@ import Foundation
|
|
|
2
2
|
import Stripe
|
|
3
3
|
|
|
4
4
|
class PaymentMethodFactory {
|
|
5
|
-
var billingDetailsParams: STPPaymentMethodBillingDetails?
|
|
6
|
-
var paymentMethodData: NSDictionary?
|
|
7
|
-
var paymentMethodOptions: NSDictionary?
|
|
8
|
-
var cardFieldView: CardFieldView?
|
|
9
|
-
var cardFormView: CardFormView?
|
|
10
|
-
var metadata: [String: String]?
|
|
5
|
+
var billingDetailsParams: STPPaymentMethodBillingDetails?
|
|
6
|
+
var paymentMethodData: NSDictionary?
|
|
7
|
+
var paymentMethodOptions: NSDictionary?
|
|
8
|
+
var cardFieldView: CardFieldView?
|
|
9
|
+
var cardFormView: CardFormView?
|
|
10
|
+
var metadata: [String: String]?
|
|
11
11
|
|
|
12
12
|
init(paymentMethodData: NSDictionary?, options: NSDictionary, cardFieldView: CardFieldView?, cardFormView: CardFormView?) {
|
|
13
13
|
self.paymentMethodData = paymentMethodData
|
|
@@ -61,8 +61,8 @@ class PaymentMethodFactory {
|
|
|
61
61
|
return try createCashAppPaymentMethodParams()
|
|
62
62
|
case STPPaymentMethodType.revolutPay:
|
|
63
63
|
return try createRevolutPayPaymentMethodParams()
|
|
64
|
-
// case STPPaymentMethodType.weChatPay:
|
|
65
|
-
// return try createWeChatPayPaymentMethodParams()
|
|
64
|
+
// case STPPaymentMethodType.weChatPay:
|
|
65
|
+
// return try createWeChatPayPaymentMethodParams()
|
|
66
66
|
default:
|
|
67
67
|
throw PaymentMethodError.paymentNotSupported
|
|
68
68
|
}
|
|
@@ -124,11 +124,11 @@ class PaymentMethodFactory {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
// private func createWeChatPayPaymentMethodParams() throws -> STPPaymentMethodParams {
|
|
128
|
-
// let params = STPPaymentMethodWeChatPayParams()
|
|
129
|
-
// return STPPaymentMethodParams(weChatPay: params, billingDetails: billingDetailsParams, metadata: metadata)
|
|
130
|
-
// }
|
|
131
|
-
//
|
|
127
|
+
// private func createWeChatPayPaymentMethodParams() throws -> STPPaymentMethodParams {
|
|
128
|
+
// let params = STPPaymentMethodWeChatPayParams()
|
|
129
|
+
// return STPPaymentMethodParams(weChatPay: params, billingDetails: billingDetailsParams, metadata: metadata)
|
|
130
|
+
// }
|
|
131
|
+
//
|
|
132
132
|
|
|
133
133
|
private func createUSBankAccountPaymentMethodOptions() throws -> STPConfirmPaymentMethodOptions {
|
|
134
134
|
let paymentOptions = STPConfirmPaymentMethodOptions()
|
|
@@ -155,26 +155,25 @@ class PaymentMethodFactory {
|
|
|
155
155
|
params.bankName = bankName
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
return STPPaymentMethodParams(iDEAL: params, billingDetails: billingDetailsParams, metadata: metadata)
|
|
158
|
+
return STPPaymentMethodParams(iDEAL: params, billingDetails: billingDetailsParams, metadata: metadata)
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
private func createGrabpayPaymentMethodParams() -> STPPaymentMethodParams {
|
|
163
162
|
let params = STPPaymentMethodGrabPayParams()
|
|
164
163
|
|
|
165
|
-
|
|
164
|
+
return STPPaymentMethodParams(grabPay: params, billingDetails: billingDetailsParams, metadata: metadata)
|
|
166
165
|
}
|
|
167
166
|
|
|
168
167
|
private func createCardPaymentMethodParams() throws -> STPPaymentMethodParams {
|
|
169
168
|
if let token = paymentMethodData?["token"] as? String {
|
|
170
169
|
let methodParams = STPPaymentMethodCardParams()
|
|
171
170
|
methodParams.token = token
|
|
172
|
-
|
|
171
|
+
return STPPaymentMethodParams(card: methodParams, billingDetails: billingDetailsParams, metadata: metadata)
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
if let params = cardFieldView?.cardParams as? STPPaymentMethodParams {
|
|
176
175
|
if let postalCode = cardFieldView?.cardPostalCode{
|
|
177
|
-
if
|
|
176
|
+
if billingDetailsParams == nil {
|
|
178
177
|
let bd = STPPaymentMethodBillingDetails()
|
|
179
178
|
bd.address = STPPaymentMethodAddress()
|
|
180
179
|
bd.address?.postalCode = postalCode
|
|
@@ -188,7 +187,7 @@ class PaymentMethodFactory {
|
|
|
188
187
|
}
|
|
189
188
|
if let params = cardFormView?.cardParams as? STPPaymentMethodCardParams {
|
|
190
189
|
if let address = cardFormView?.cardForm?.cardParams?.billingDetails?.address {
|
|
191
|
-
if
|
|
190
|
+
if billingDetailsParams == nil {
|
|
192
191
|
let bd = STPPaymentMethodBillingDetails()
|
|
193
192
|
bd.address = STPPaymentMethodAddress()
|
|
194
193
|
bd.address?.postalCode = address.postalCode
|
|
@@ -205,7 +204,6 @@ class PaymentMethodFactory {
|
|
|
205
204
|
throw PaymentMethodError.cardPaymentMissingParams
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
|
|
209
207
|
private func createCardPaymentMethodOptions() -> STPConfirmPaymentMethodOptions? {
|
|
210
208
|
let cvc = paymentMethodData?["cvc"] as? String
|
|
211
209
|
guard cvc != nil else {
|
|
@@ -213,7 +211,7 @@ class PaymentMethodFactory {
|
|
|
213
211
|
}
|
|
214
212
|
|
|
215
213
|
let cardOptions = STPConfirmCardOptions()
|
|
216
|
-
cardOptions.cvc = cvc
|
|
214
|
+
cardOptions.cvc = cvc
|
|
217
215
|
let paymentMethodOptions = STPConfirmPaymentMethodOptions()
|
|
218
216
|
paymentMethodOptions.cardOptions = cardOptions
|
|
219
217
|
|
|
@@ -227,7 +225,7 @@ class PaymentMethodFactory {
|
|
|
227
225
|
params.rawBankString = "test_offline_bank"
|
|
228
226
|
}
|
|
229
227
|
|
|
230
|
-
|
|
228
|
+
return STPPaymentMethodParams(fpx: params, billingDetails: billingDetailsParams, metadata: metadata)
|
|
231
229
|
}
|
|
232
230
|
|
|
233
231
|
private func createAlipayPaymentMethodParams() throws -> STPPaymentMethodParams {
|
|
@@ -366,8 +364,10 @@ class PaymentMethodFactory {
|
|
|
366
364
|
}
|
|
367
365
|
|
|
368
366
|
private func createAffirmPaymentMethodParams() throws -> STPPaymentMethodParams {
|
|
369
|
-
let
|
|
370
|
-
|
|
367
|
+
let affirmParams = STPPaymentMethodAffirmParams()
|
|
368
|
+
let params = STPPaymentMethodParams(affirm: affirmParams, metadata: metadata)
|
|
369
|
+
params.billingDetails = billingDetailsParams
|
|
370
|
+
return params
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
private func createCashAppPaymentMethodParams() throws -> STPPaymentMethodParams {
|
|
@@ -32,7 +32,7 @@ extension EmbeddedPaymentElement.PaymentOptionDisplayData {
|
|
|
32
32
|
"line1": addr.line1 ?? "",
|
|
33
33
|
"line2": addr.line2 ?? "",
|
|
34
34
|
"postalCode": addr.postalCode ?? "",
|
|
35
|
-
"state": addr.state ?? ""
|
|
35
|
+
"state": addr.state ?? "",
|
|
36
36
|
]
|
|
37
37
|
}()
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ extension EmbeddedPaymentElement.PaymentOptionDisplayData {
|
|
|
40
40
|
"name": billing.name ?? "",
|
|
41
41
|
"email": billing.email ?? "",
|
|
42
42
|
"phone": billing.phone ?? "",
|
|
43
|
-
"address": addressDict
|
|
43
|
+
"address": addressDict,
|
|
44
44
|
]
|
|
45
45
|
}()
|
|
46
46
|
|
|
@@ -53,7 +53,7 @@ extension EmbeddedPaymentElement.PaymentOptionDisplayData {
|
|
|
53
53
|
from: NSRange(location: 0, length: mandateText.length),
|
|
54
54
|
documentAttributes: [
|
|
55
55
|
.documentType: NSAttributedString.DocumentType.html,
|
|
56
|
-
.characterEncoding: String.Encoding.utf8.rawValue
|
|
56
|
+
.characterEncoding: String.Encoding.utf8.rawValue,
|
|
57
57
|
]
|
|
58
58
|
)
|
|
59
59
|
return String(data: htmlData, encoding: .utf8)
|
|
@@ -69,7 +69,7 @@ extension EmbeddedPaymentElement.PaymentOptionDisplayData {
|
|
|
69
69
|
"label": label,
|
|
70
70
|
"billingDetails": billingDetailsDict,
|
|
71
71
|
"paymentMethodType": paymentMethodType,
|
|
72
|
-
"mandateHTML": mandateTextHTML
|
|
72
|
+
"mandateHTML": mandateTextHTML,
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -12,7 +12,7 @@ internal class PaymentPassFinder: NSObject {
|
|
|
12
12
|
case CURRENT_DEVICE
|
|
13
13
|
case PAIRED_DEVICE
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
class func findPassWith(
|
|
17
17
|
primaryAccountIdentifier: String,
|
|
18
18
|
hasPairedAppleWatch: Bool,
|
|
@@ -27,21 +27,21 @@ internal class PaymentPassFinder: NSObject {
|
|
|
27
27
|
.first(where: { $0.paymentPass?.primaryAccountIdentifier == primaryAccountIdentifier && $0.paymentPass?.passActivationState != .deactivated && !$0.isRemotePass })
|
|
28
28
|
}
|
|
29
29
|
}()
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
var passLocations: [PassLocation] = []
|
|
32
|
-
if
|
|
32
|
+
if existingPassOnDevice != nil {
|
|
33
33
|
passLocations.append(.CURRENT_DEVICE)
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
// We're done here if the user does not have a paired Apple Watch
|
|
37
|
-
if
|
|
37
|
+
if !hasPairedAppleWatch {
|
|
38
38
|
completion(
|
|
39
39
|
passLocations.count < 1,
|
|
40
40
|
passLocations
|
|
41
41
|
)
|
|
42
42
|
return
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
let existingPassOnPairedDevices: PKPass? = {
|
|
46
46
|
if #available(iOS 13.4, *) {
|
|
47
47
|
return PKPassLibrary().remoteSecureElementPasses
|
|
@@ -51,12 +51,11 @@ internal class PaymentPassFinder: NSObject {
|
|
|
51
51
|
.first(where: { $0.paymentPass?.primaryAccountIdentifier == primaryAccountIdentifier && $0.paymentPass?.passActivationState != .deactivated })
|
|
52
52
|
}
|
|
53
53
|
}()
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (existingPassOnPairedDevices != nil) {
|
|
54
|
+
|
|
55
|
+
if existingPassOnPairedDevices != nil {
|
|
57
56
|
passLocations.append(.PAIRED_DEVICE)
|
|
58
57
|
}
|
|
59
|
-
|
|
58
|
+
|
|
60
59
|
completion(
|
|
61
60
|
passLocations.count < 2,
|
|
62
61
|
passLocations
|