@stripe/stripe-react-native 0.57.2 → 0.58.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/android/build.gradle +1 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +0 -3
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +5 -3
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +12 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +18 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +136 -35
- package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +17 -5
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +9 -2
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +38 -13
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +0 -2
- package/android/src/test/java/com/reactnativestripesdk/DrawableConversionPropertyTest.kt +224 -0
- package/android/src/test/java/com/reactnativestripesdk/DrawableConversionTest.kt +146 -0
- package/android/src/test/java/com/reactnativestripesdk/DrawableLoadingTest.kt +150 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentElementConfigTest.kt +138 -1
- package/android/src/test/java/com/reactnativestripesdk/PaymentOptionImageConsistencyTest.kt +186 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingView.swift +13 -19
- package/ios/StripeSdkImpl+Embedded.swift +4 -1
- package/ios/StripeSdkImpl+PaymentSheet.swift +28 -1
- package/ios/StripeSdkImpl.swift +26 -2
- package/jest/mock.js +6 -0
- package/jest/setup.js +30 -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/connect/Components.js +1 -1
- package/lib/commonjs/connect/Components.js.map +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js +9 -4
- package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
- package/lib/commonjs/connect/NavigationBar.js +1 -1
- package/lib/commonjs/connect/NavigationBar.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js.map +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js +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 +1 -1
- 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/NativeNavigationBar.js +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/types/FinancialConnections.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js +1 -1
- package/lib/commonjs/types/PaymentSheet.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/connect/Components.js +1 -1
- package/lib/module/connect/Components.js.map +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/module/connect/EmbeddedComponent.js +9 -4
- package/lib/module/connect/EmbeddedComponent.js.map +1 -1
- package/lib/module/connect/ModalCloseButton.js +1 -1
- package/lib/module/connect/ModalCloseButton.js.map +1 -1
- package/lib/module/connect/NavigationBar.js +1 -1
- package/lib/module/connect/NavigationBar.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/hooks/useOnramp.js +1 -1
- package/lib/module/hooks/useOnramp.js.map +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js +1 -1
- package/lib/module/specs/NativeAddressSheet.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js +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 +1 -1
- 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/NativeNavigationBar.js +1 -1
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/FinancialConnections.js.map +1 -1
- package/lib/module/types/PaymentSheet.js +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/typescript/src/connect/Components.d.ts.map +1 -1
- package/lib/typescript/src/connect/EmbeddedComponent.d.ts.map +1 -1
- package/lib/typescript/src/connect/connectTypes.d.ts +5 -1
- package/lib/typescript/src/connect/connectTypes.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +2 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +6 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/FinancialConnections.d.ts +2 -0
- package/lib/typescript/src/types/FinancialConnections.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +30 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/package.json +15 -5
- package/src/connect/Components.tsx +18 -11
- package/src/connect/EmbeddedComponent.tsx +223 -12
- package/src/connect/connectTypes.ts +5 -1
- package/src/hooks/useOnramp.tsx +5 -1
- package/src/types/EmbeddedPaymentElement.tsx +6 -1
- package/src/types/FinancialConnections.ts +2 -0
- package/src/types/PaymentSheet.ts +32 -0
- package/stripe-react-native.podspec +1 -1
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/caches/deviceStreaming.xml +0 -1029
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -19
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/runConfigurations.xml +0 -17
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/tianzhao.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/tianzhao.xcuserdatad/xcschemes/xcschememanagement.plist +0 -19
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
package com.reactnativestripesdk
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import android.graphics.drawable.ColorDrawable
|
|
5
|
+
import kotlinx.coroutines.test.runTest
|
|
6
|
+
import org.junit.Assert.assertEquals
|
|
7
|
+
import org.junit.Assert.assertNotEquals
|
|
8
|
+
import org.junit.Assert.assertNotNull
|
|
9
|
+
import org.junit.Assert.assertTrue
|
|
10
|
+
import org.junit.Test
|
|
11
|
+
import org.junit.runner.RunWith
|
|
12
|
+
import org.robolectric.RobolectricTestRunner
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Regression tests for the payment option image consistency bug.
|
|
16
|
+
*
|
|
17
|
+
* Issue: PaymentOption.icon() was returning a DelegateDrawable that loaded asynchronously,
|
|
18
|
+
* causing inconsistent base64 strings across multiple calls. Sometimes it returned a 1x1
|
|
19
|
+
* placeholder (134 bytes), sometimes the full image (5650 bytes).
|
|
20
|
+
*
|
|
21
|
+
* These tests ensure this bug never returns.
|
|
22
|
+
*/
|
|
23
|
+
@RunWith(RobolectricTestRunner::class)
|
|
24
|
+
class PaymentOptionImageConsistencyTest {
|
|
25
|
+
@Test
|
|
26
|
+
fun `REGRESSION - multiple calls return consistent base64 strings`() =
|
|
27
|
+
runTest {
|
|
28
|
+
// This test specifically guards against the original bug where
|
|
29
|
+
// multiple calls to icon() returned inconsistent results
|
|
30
|
+
val drawable =
|
|
31
|
+
ColorDrawable(Color.BLUE).apply {
|
|
32
|
+
setBounds(0, 0, 147, 105) // Typical card icon size
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
val results = mutableListOf<String?>()
|
|
36
|
+
repeat(10) {
|
|
37
|
+
results.add(convertDrawableToBase64(drawable))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// All results should be identical
|
|
41
|
+
val uniqueResults = results.toSet()
|
|
42
|
+
assertEquals(
|
|
43
|
+
"All 10 calls should return identical base64 (was returning different values due to async loading bug)",
|
|
44
|
+
1,
|
|
45
|
+
uniqueResults.size,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
// Verify the result is not null
|
|
49
|
+
assertNotNull("Base64 result should not be null", results.first())
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Test
|
|
53
|
+
fun `REGRESSION - base64 is not 1x1 placeholder`() =
|
|
54
|
+
runTest {
|
|
55
|
+
// This test guards against returning the 1x1 placeholder image
|
|
56
|
+
// Original bug: Sometimes returned 134-byte 1x1 black placeholder
|
|
57
|
+
val drawable =
|
|
58
|
+
ColorDrawable(Color.RED).apply {
|
|
59
|
+
setBounds(0, 0, 147, 105)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
val result = convertDrawableToBase64(drawable)
|
|
63
|
+
|
|
64
|
+
assertNotNull(result)
|
|
65
|
+
// Original bug: 1x1 placeholder was 134 bytes
|
|
66
|
+
// Real image should be much larger
|
|
67
|
+
assertTrue(
|
|
68
|
+
"Base64 should be > 200 chars (original bug returned 134-byte 1x1 placeholder)",
|
|
69
|
+
result!!.length > 200,
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@Test
|
|
74
|
+
fun `REGRESSION - bitmap has correct dimensions not 1x1`() =
|
|
75
|
+
runTest {
|
|
76
|
+
val drawable =
|
|
77
|
+
ColorDrawable(Color.GREEN).apply {
|
|
78
|
+
setBounds(0, 0, 147, 105)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
val bitmap = getBitmapFromDrawable(drawable)
|
|
82
|
+
|
|
83
|
+
assertNotNull(bitmap)
|
|
84
|
+
assertNotEquals(
|
|
85
|
+
"Bitmap width should not be 1 (original bug captured 1x1 placeholder)",
|
|
86
|
+
1,
|
|
87
|
+
bitmap!!.width,
|
|
88
|
+
)
|
|
89
|
+
assertNotEquals(
|
|
90
|
+
"Bitmap height should not be 1 (original bug captured 1x1 placeholder)",
|
|
91
|
+
1,
|
|
92
|
+
bitmap.height,
|
|
93
|
+
)
|
|
94
|
+
assertEquals("Bitmap width should match drawable", 147, bitmap.width)
|
|
95
|
+
assertEquals("Bitmap height should match drawable", 105, bitmap.height)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@Test
|
|
99
|
+
fun `REGRESSION - rapid successive calls all return full image`() =
|
|
100
|
+
runTest {
|
|
101
|
+
// Simulate rapid successive calls like what happens when
|
|
102
|
+
// retrievePaymentOptionSelection() is called multiple times quickly
|
|
103
|
+
val drawable =
|
|
104
|
+
ColorDrawable(Color.MAGENTA).apply {
|
|
105
|
+
setBounds(0, 0, 147, 105)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
val results = mutableListOf<String?>()
|
|
109
|
+
// Rapid fire - no delays
|
|
110
|
+
repeat(20) {
|
|
111
|
+
results.add(convertDrawableToBase64(drawable))
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// All should be non-null
|
|
115
|
+
assertTrue(
|
|
116
|
+
"All results should be non-null",
|
|
117
|
+
results.all { it != null },
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
// All should be full images, not placeholders
|
|
121
|
+
assertTrue(
|
|
122
|
+
"All results should be > 200 chars (not 1x1 placeholders)",
|
|
123
|
+
results.all { it!!.length > 200 },
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
// All should be identical
|
|
127
|
+
val uniqueResults = results.toSet()
|
|
128
|
+
assertEquals(
|
|
129
|
+
"All 20 rapid calls should return identical base64",
|
|
130
|
+
1,
|
|
131
|
+
uniqueResults.size,
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@Test
|
|
136
|
+
fun `REGRESSION - consistent results across different payment method types`() =
|
|
137
|
+
runTest {
|
|
138
|
+
// Test with different typical payment method icon sizes
|
|
139
|
+
val visaDrawable =
|
|
140
|
+
ColorDrawable(Color.BLUE).apply {
|
|
141
|
+
setBounds(0, 0, 147, 105) // Visa
|
|
142
|
+
}
|
|
143
|
+
val mastercardDrawable =
|
|
144
|
+
ColorDrawable(Color.RED).apply {
|
|
145
|
+
setBounds(0, 0, 147, 105) // Mastercard (same size)
|
|
146
|
+
}
|
|
147
|
+
val amexDrawable =
|
|
148
|
+
ColorDrawable(Color.CYAN).apply {
|
|
149
|
+
setBounds(0, 0, 147, 105) // Amex (same size)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
val visa1 = convertDrawableToBase64(visaDrawable)
|
|
153
|
+
val visa2 = convertDrawableToBase64(visaDrawable)
|
|
154
|
+
|
|
155
|
+
val mc1 = convertDrawableToBase64(mastercardDrawable)
|
|
156
|
+
val mc2 = convertDrawableToBase64(mastercardDrawable)
|
|
157
|
+
|
|
158
|
+
val amex1 = convertDrawableToBase64(amexDrawable)
|
|
159
|
+
val amex2 = convertDrawableToBase64(amexDrawable)
|
|
160
|
+
|
|
161
|
+
// Each card type should return consistent results
|
|
162
|
+
assertEquals("Visa should be consistent", visa1, visa2)
|
|
163
|
+
assertEquals("Mastercard should be consistent", mc1, mc2)
|
|
164
|
+
assertEquals("Amex should be consistent", amex1, amex2)
|
|
165
|
+
|
|
166
|
+
// Different card types should have different images
|
|
167
|
+
assertNotEquals("Visa and Mastercard should differ", visa1, mc1)
|
|
168
|
+
assertNotEquals("Mastercard and Amex should differ", mc1, amex1)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@Test
|
|
172
|
+
fun `REGRESSION - setBounds is applied before drawing`() {
|
|
173
|
+
// This test ensures the original fix (setBounds) is still working
|
|
174
|
+
val drawable =
|
|
175
|
+
ColorDrawable(Color.YELLOW).apply {
|
|
176
|
+
setBounds(0, 0, 100, 80)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
val bitmap = getBitmapFromDrawable(drawable)
|
|
180
|
+
|
|
181
|
+
assertNotNull(bitmap)
|
|
182
|
+
// The bitmap dimensions should match the bounds we set
|
|
183
|
+
assertEquals("Bitmap should respect setBounds width", 100, bitmap!!.width)
|
|
184
|
+
assertEquals("Bitmap should respect setBounds height", 80, bitmap.height)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -21,6 +21,7 @@ public class ConnectAccountOnboardingView: UIView {
|
|
|
21
21
|
override public init(frame: CGRect) {
|
|
22
22
|
super.init(frame: frame)
|
|
23
23
|
super.backgroundColor = .clear
|
|
24
|
+
self.isHidden = true // Hide until modal animation completes
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
required init?(coder: NSCoder) {
|
|
@@ -29,10 +30,7 @@ public class ConnectAccountOnboardingView: UIView {
|
|
|
29
30
|
|
|
30
31
|
@objc public func didSetProps() {
|
|
31
32
|
if visible && !wasVisible {
|
|
32
|
-
|
|
33
|
-
DispatchQueue.main.async { [weak self] in
|
|
34
|
-
self?.presentModal()
|
|
35
|
-
}
|
|
33
|
+
presentModal()
|
|
36
34
|
wasVisible = true
|
|
37
35
|
} else if !visible && wasVisible {
|
|
38
36
|
dismissModal()
|
|
@@ -47,6 +45,9 @@ public class ConnectAccountOnboardingView: UIView {
|
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
private func presentModal() {
|
|
48
|
+
// Keep view hidden during modal presentation
|
|
49
|
+
self.isHidden = true
|
|
50
|
+
|
|
50
51
|
// Create the view controller that wraps THIS view
|
|
51
52
|
viewController = ConnectAccountOnboardingViewController()
|
|
52
53
|
viewController?.title = title
|
|
@@ -56,9 +57,6 @@ public class ConnectAccountOnboardingView: UIView {
|
|
|
56
57
|
self?.handleClose()
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
// Add this entire React Native view to the view controller
|
|
60
|
-
viewController?.setReactContentView(self)
|
|
61
|
-
|
|
62
60
|
// Wrap in a navigation controller
|
|
63
61
|
navigationController = UINavigationController(rootViewController: viewController!)
|
|
64
62
|
navigationController?.modalPresentationStyle = .fullScreen
|
|
@@ -66,7 +64,14 @@ public class ConnectAccountOnboardingView: UIView {
|
|
|
66
64
|
|
|
67
65
|
// Find the presenting view controller and present
|
|
68
66
|
let presenter = findViewControllerPresenter(from: RCTKeyWindow()?.rootViewController ?? UIViewController())
|
|
69
|
-
|
|
67
|
+
|
|
68
|
+
// Present the empty modal first, then add React content after animation completes
|
|
69
|
+
presenter.present(navigationController!, animated: true) { [weak self] in
|
|
70
|
+
guard let self = self else { return }
|
|
71
|
+
// Add React content after presentation animation finishes
|
|
72
|
+
self.viewController?.setReactContentView(self)
|
|
73
|
+
self.isHidden = false // Show the view now that modal is presented
|
|
74
|
+
}
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
private func dismissModal() {
|
|
@@ -83,15 +88,4 @@ public class ConnectAccountOnboardingView: UIView {
|
|
|
83
88
|
dismissModal()
|
|
84
89
|
}
|
|
85
90
|
|
|
86
|
-
override public func didMoveToSuperview() {
|
|
87
|
-
super.didMoveToSuperview()
|
|
88
|
-
|
|
89
|
-
// When added to native view hierarchy, ensure layout is triggered
|
|
90
|
-
if let superview = superview {
|
|
91
|
-
// Match the superview's bounds immediately
|
|
92
|
-
self.frame = superview.bounds
|
|
93
|
-
setNeedsLayout()
|
|
94
|
-
layoutIfNeeded()
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
91
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
-
@_spi(EmbeddedPaymentElementPrivateBeta) @_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) @_spi(CustomPaymentMethodsBeta) import StripePaymentSheet
|
|
9
|
+
@_spi(EmbeddedPaymentElementPrivateBeta) @_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) @_spi(CustomPaymentMethodsBeta) @_spi(CardFundingFilteringPrivatePreview) import StripePaymentSheet
|
|
10
10
|
|
|
11
11
|
@objc(StripeSdkImpl)
|
|
12
12
|
extension StripeSdkImpl {
|
|
@@ -311,6 +311,9 @@ extension StripeSdkImpl {
|
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
configuration.cardBrandAcceptance = StripeSdkImpl.computeCardBrandAcceptance(params: params)
|
|
314
|
+
if let allowedCardFundingTypes = StripeSdkImpl.computeAllowedCardFundingTypes(params: params) {
|
|
315
|
+
configuration.allowedCardFundingTypes = allowedCardFundingTypes
|
|
316
|
+
}
|
|
314
317
|
|
|
315
318
|
if let formSheetActionParams = params["formSheetAction"] as? NSDictionary,
|
|
316
319
|
let actionType = formSheetActionParams["type"] as? String {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
-
@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(EmbeddedPaymentElementPrivateBeta) @_spi(STP) @_spi(PaymentMethodOptionsSetupFutureUsagePreview) @_spi(CustomPaymentMethodsBeta) @_spi(ConfirmationTokensPublicPreview) import StripePaymentSheet
|
|
9
|
+
@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(EmbeddedPaymentElementPrivateBeta) @_spi(STP) @_spi(PaymentMethodOptionsSetupFutureUsagePreview) @_spi(CustomPaymentMethodsBeta) @_spi(ConfirmationTokensPublicPreview) @_spi(CardFundingFilteringPrivatePreview) import StripePaymentSheet
|
|
10
10
|
|
|
11
11
|
extension StripeSdkImpl {
|
|
12
12
|
internal func buildPaymentSheetConfiguration(
|
|
@@ -136,6 +136,9 @@ extension StripeSdkImpl {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
configuration.cardBrandAcceptance = StripeSdkImpl.computeCardBrandAcceptance(params: params)
|
|
139
|
+
if let allowedCardFundingTypes = StripeSdkImpl.computeAllowedCardFundingTypes(params: params) {
|
|
140
|
+
configuration.allowedCardFundingTypes = allowedCardFundingTypes
|
|
141
|
+
}
|
|
139
142
|
|
|
140
143
|
// Parse custom payment method configuration
|
|
141
144
|
if let customPaymentMethodConfig = params["customPaymentMethodConfiguration"] as? [String: Any] {
|
|
@@ -286,6 +289,30 @@ extension StripeSdkImpl {
|
|
|
286
289
|
}
|
|
287
290
|
}
|
|
288
291
|
|
|
292
|
+
internal static func computeAllowedCardFundingTypes(params: NSDictionary) -> PaymentSheet.CardFundingType? {
|
|
293
|
+
guard let cardFundingFiltering = params["cardFundingFiltering"] as? NSDictionary,
|
|
294
|
+
let allowedTypes = cardFundingFiltering["allowedCardFundingTypes"] as? [String] else {
|
|
295
|
+
return nil
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
var result: PaymentSheet.CardFundingType = []
|
|
299
|
+
for type in allowedTypes {
|
|
300
|
+
switch type {
|
|
301
|
+
case "debit":
|
|
302
|
+
result.insert(.debit)
|
|
303
|
+
case "credit":
|
|
304
|
+
result.insert(.credit)
|
|
305
|
+
case "prepaid":
|
|
306
|
+
result.insert(.prepaid)
|
|
307
|
+
case "unknown":
|
|
308
|
+
result.insert(.unknown)
|
|
309
|
+
default:
|
|
310
|
+
break
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return result.isEmpty ? nil : result
|
|
314
|
+
}
|
|
315
|
+
|
|
289
316
|
static func mapCaptureMethod(_ captureMethod: String?) -> PaymentSheet.IntentConfiguration.CaptureMethod {
|
|
290
317
|
if let captureMethod = captureMethod {
|
|
291
318
|
switch captureMethod {
|
package/ios/StripeSdkImpl.swift
CHANGED
|
@@ -1120,12 +1120,24 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1120
1120
|
self?.emitter?.emitOnFinancialConnectionsEvent(mappedEvent)
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
|
+
// Use connectedAccountId from params if provided
|
|
1124
|
+
let originalStripeAccount = STPAPIClient.shared.stripeAccount
|
|
1125
|
+
if let connectedAccountId = params["connectedAccountId"] as? String {
|
|
1126
|
+
STPAPIClient.shared.stripeAccount = connectedAccountId
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
let wrappedResolve: RCTPromiseResolveBlock = { result in
|
|
1130
|
+
// Restore original stripeAccount after completion
|
|
1131
|
+
STPAPIClient.shared.stripeAccount = originalStripeAccount
|
|
1132
|
+
resolve(result)
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1123
1135
|
FinancialConnections.presentForToken(
|
|
1124
1136
|
withClientSecret: clientSecret,
|
|
1125
1137
|
returnURL: returnURL,
|
|
1126
1138
|
configuration: configuration,
|
|
1127
1139
|
onEvent: onEvent,
|
|
1128
|
-
resolve:
|
|
1140
|
+
resolve: wrappedResolve
|
|
1129
1141
|
)
|
|
1130
1142
|
}
|
|
1131
1143
|
|
|
@@ -1154,12 +1166,24 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1154
1166
|
self?.emitter?.emitOnFinancialConnectionsEvent(mappedEvent)
|
|
1155
1167
|
}
|
|
1156
1168
|
|
|
1169
|
+
// Use connectedAccountId from params if provided
|
|
1170
|
+
let originalStripeAccount = STPAPIClient.shared.stripeAccount
|
|
1171
|
+
if let connectedAccountId = params["connectedAccountId"] as? String {
|
|
1172
|
+
STPAPIClient.shared.stripeAccount = connectedAccountId
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
let wrappedResolve: RCTPromiseResolveBlock = { result in
|
|
1176
|
+
// Restore original stripeAccount after completion
|
|
1177
|
+
STPAPIClient.shared.stripeAccount = originalStripeAccount
|
|
1178
|
+
resolve(result)
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1157
1181
|
FinancialConnections.present(
|
|
1158
1182
|
withClientSecret: clientSecret,
|
|
1159
1183
|
returnURL: returnURL,
|
|
1160
1184
|
configuration: configuration,
|
|
1161
1185
|
onEvent: onEvent,
|
|
1162
|
-
resolve:
|
|
1186
|
+
resolve: wrappedResolve
|
|
1163
1187
|
)
|
|
1164
1188
|
}
|
|
1165
1189
|
|
package/jest/mock.js
CHANGED
|
@@ -255,6 +255,12 @@ const StripeConstants = {
|
|
|
255
255
|
Allowed: 'allowed',
|
|
256
256
|
Disallowed: 'disallowed',
|
|
257
257
|
},
|
|
258
|
+
CardFundingType: {
|
|
259
|
+
Debit: 'debit',
|
|
260
|
+
Credit: 'credit',
|
|
261
|
+
Prepaid: 'prepaid',
|
|
262
|
+
Unknown: 'unknown',
|
|
263
|
+
},
|
|
258
264
|
CustomPaymentMethodResultStatus: {
|
|
259
265
|
Completed: 'completed',
|
|
260
266
|
Canceled: 'canceled',
|
package/jest/setup.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
/**
|
|
3
|
+
* Jest setup file to mock native modules
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Mock OnrampSdk TurboModule
|
|
7
|
+
jest.mock('../src/specs/NativeOnrampSdkModule', () => ({
|
|
8
|
+
__esModule: true,
|
|
9
|
+
default: {
|
|
10
|
+
initialise: jest.fn(),
|
|
11
|
+
configureOnramp: jest.fn(),
|
|
12
|
+
hasLinkAccount: jest.fn(),
|
|
13
|
+
registerLinkUser: jest.fn(),
|
|
14
|
+
registerWalletAddress: jest.fn(),
|
|
15
|
+
attachKycInfo: jest.fn(),
|
|
16
|
+
presentKycInfoVerification: jest.fn(),
|
|
17
|
+
updatePhoneNumber: jest.fn(),
|
|
18
|
+
authenticateUser: jest.fn(),
|
|
19
|
+
authenticateUserWithToken: jest.fn(),
|
|
20
|
+
verifyIdentity: jest.fn(),
|
|
21
|
+
collectPaymentMethod: jest.fn(),
|
|
22
|
+
provideCheckoutClientSecret: jest.fn(),
|
|
23
|
+
onCheckoutClientSecretRequested: null,
|
|
24
|
+
createCryptoPaymentToken: jest.fn(),
|
|
25
|
+
performCheckout: jest.fn(),
|
|
26
|
+
onrampAuthorize: jest.fn(),
|
|
27
|
+
getCryptoTokenDisplayData: jest.fn(),
|
|
28
|
+
logout: jest.fn(),
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddToWalletButton=_interopRequireDefault(require("../specs/NativeAddToWalletButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddToWalletButton=_interopRequireDefault(require("../specs/NativeAddToWalletButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddToWalletButton.default,Object.assign({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);}}));}
|
|
2
2
|
//# sourceMappingURL=AddToWalletButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddToWalletButton","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButton","_ref","onComplete","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AddToWalletButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAcA,IAAAC,wBAAA,CAAAF,sBAAA,CAAAC,OAAA,sCAAuE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddToWalletButton","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButton","_ref","onComplete","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AddToWalletButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAcA,IAAAC,wBAAA,CAAAF,sBAAA,CAAAC,OAAA,sCAAuE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,mFAAAC,SAAA,gBAgEhE,QAAS,CAAAC,iBAAiBA,CAAAC,IAAA,CAAkC,IAA/B,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,CAAAF,SAAA,EACtD,MACE,GAAAF,WAAA,CAAAS,GAAA,EAACV,wBAAA,CAAAS,OAAuB,CAAAE,MAAA,CAAAC,MAAA,IAClBL,KAAK,EACTM,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CACdC,KAEE,QACC,CAAAR,UAAU,CAACQ,KAAK,CAACC,WAAW,CAAC,EAAC,EACpC,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddressSheet=_interopRequireDefault(require("../specs/NativeAddressSheet"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAddressSheet=_interopRequireDefault(require("../specs/NativeAddressSheet"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAddressSheet.default,Object.assign({},props,{onSubmitAction:function onSubmitAction(event){return onSubmit(event.nativeEvent.result);},onErrorAction:function onErrorAction(event){return onError(event.nativeEvent.error);}}));}
|
|
2
2
|
//# sourceMappingURL=AddressSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddressSheet","_jsxRuntime","_jsxFileName","_excluded","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","event","nativeEvent","result","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAQA,IAAAC,mBAAA,CAAAF,sBAAA,CAAAC,OAAA,iCAA6D,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAddressSheet","_jsxRuntime","_jsxFileName","_excluded","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","event","nativeEvent","result","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAQA,IAAAC,mBAAA,CAAAF,sBAAA,CAAAC,OAAA,iCAA6D,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,8EAAAC,SAAA,wBA4DtD,QAAS,CAAAC,YAAYA,CAAAC,IAAA,CAAyC,IAAtC,CAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,OAAO,CAAAF,IAAA,CAAPE,OAAO,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,CAAAF,SAAA,EACxD,MACE,GAAAF,WAAA,CAAAU,GAAA,EAACX,mBAAA,CAAAU,OAAkB,CAAAE,MAAA,CAAAC,MAAA,IACbL,KAAK,EACTM,cAAc,CAAE,QAAhB,CAAAA,cAAcA,CAAGC,KAAK,QAAK,CAAAT,QAAQ,CAACS,KAAK,CAACC,WAAW,CAACC,MAAM,CAAC,EAAC,CAC9DC,aAAa,CAAE,QAAf,CAAAA,aAAaA,CAAGH,KAAK,QAAK,CAAAR,OAAO,CAACQ,KAAK,CAACC,WAAW,CAACG,KAAK,CAAC,EAAC,EAC5D,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAuBECSDebitForm=_interopRequireDefault(require("../specs/NativeAuBECSDebitForm"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _NativeAuBECSDebitForm=_interopRequireDefault(require("../specs/NativeAuBECSDebitForm"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_NativeAuBECSDebitForm.default,Object.assign({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props));}
|
|
2
2
|
//# sourceMappingURL=AuBECSDebitForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAuBECSDebitForm","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitForm","_ref","onComplete","companyName","formStyle","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AuBECSDebitForm.tsx"],"mappings":"oSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAEA,IAAAC,sBAAA,CAAAF,sBAAA,CAAAC,OAAA,oCAAmE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_NativeAuBECSDebitForm","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitForm","_ref","onComplete","companyName","formStyle","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AuBECSDebitForm.tsx"],"mappings":"oSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WAEA,IAAAC,sBAAA,CAAAF,sBAAA,CAAAC,OAAA,oCAAmE,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,iFAAAC,SAAA,0CA6B5D,QAAS,CAAAC,eAAeA,CAAAC,IAAA,CAKrB,IAJR,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,SAAS,CAAAH,IAAA,CAATG,SAAS,CACNC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAN,IAAA,CAAAF,SAAA,EAER,MACE,GAAAF,WAAA,CAAAW,GAAA,EAACZ,sBAAA,CAAAW,OAAqB,CAAAE,MAAA,CAAAC,MAAA,EACpBC,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CAAGC,KAAK,QAAK,CAAAV,UAAU,CAACU,KAAK,CAACC,WAAW,CAAC,EAAC,CAC3DV,WAAW,CAAEA,WAAY,CACzBC,SAAS,CAAAK,MAAA,CAAAC,MAAA,IAAON,SAAS,CAAG,EACxBC,KAAK,CACV,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _helpers=require("../helpers");var _NativeCardField=_interopRequireWildcard(require("../specs/NativeCardField"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails"];var _this=this,_jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardField=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _helpers=require("../helpers");var _NativeCardField=_interopRequireWildcard(require("../specs/NativeCardField"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails"];var _this=this,_jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/CardField.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var CardField=exports.CardField=(0,_react.forwardRef)(function(_ref,ref){var onCardChange=_ref.onCardChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,autofocus=_ref.autofocus,postalCodeEnabled=_ref.postalCodeEnabled,disabled=_ref.disabled,dangerouslyGetFullCardDetails=_ref.dangerouslyGetFullCardDetails,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onCardChangeHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent.card;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,validExpiryDate:card.validExpiryDate,validNumber:card.validNumber,validCVC:card.validCVC};if(card.hasOwnProperty('postalCode')){data.postalCode=card.postalCode||'';}if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onCardChange&&card.complete){console.warn(`[stripe-react-native] ⚠️ WARNING: You've enabled \`dangerouslyGetFullCardDetails\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`);}}onCardChange==null||onCardChange(data);},[onCardChange]);var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);onFocus==null||onFocus(focusedField);}else{onBlur==null||onBlur();}},[onFocus,onBlur]);var focus=function focus(){_NativeCardField.Commands.focus(inputRef.current);};var blur=function blur(){_NativeCardField.Commands.blur(inputRef.current);};var clear=function clear(){_NativeCardField.Commands.clear(inputRef.current);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur,clear:clear};});(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return(0,_jsxRuntime.jsx)(_NativeCardField.default,Object.assign({ref:inputRef,onCardChange:onCardChangeHandler,onFocusChange:onFocusHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},autofocus:autofocus!=null?autofocus:false,postalCodeEnabled:postalCodeEnabled!=null?postalCodeEnabled:true,disabled:disabled!=null?disabled:false,dangerouslyGetFullCardDetails:dangerouslyGetFullCardDetails!=null?dangerouslyGetFullCardDetails:false},props));});
|
|
2
2
|
//# sourceMappingURL=CardField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_helpers","_NativeCardField","_jsxRuntime","_excluded","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CardField","exports","forwardRef","_ref","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails","props","_objectWithoutProperties2","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","Commands","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","onFocusChange","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sourceRoot":"../../../src","sources":["components/CardField.tsx"],"mappings":"qRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,QAAA,CAAAD,OAAA,eAMA,IAAAE,gBAAA,CAAAH,uBAAA,CAAAC,OAAA,8BAGkC,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,+IAAAC,KAAA,MAAAC,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_helpers","_NativeCardField","_jsxRuntime","_excluded","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CardField","exports","forwardRef","_ref","ref","onCardChange","onFocus","onBlur","cardStyle","placeholders","autofocus","postalCodeEnabled","disabled","dangerouslyGetFullCardDetails","props","_objectWithoutProperties2","inputRef","useRef","onCardChangeHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","validExpiryDate","validNumber","validCVC","postalCode","number","cvc","__DEV__","console","warn","onFocusHandler","focusedField","focusInput","current","focus","Commands","blur","clear","useImperativeHandle","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","onFocusChange","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration"],"sourceRoot":"../../../src","sources":["components/CardField.tsx"],"mappings":"qRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,QAAA,CAAAD,OAAA,eAMA,IAAAE,gBAAA,CAAAH,uBAAA,CAAAC,OAAA,8BAGkC,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,+IAAAC,KAAA,MAAAC,YAAA,gFAAAP,wBAAAQ,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAV,uBAAA,UAAAA,wBAAAQ,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QA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 -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _NativeCardForm=_interopRequireWildcard(require("../specs/NativeCardForm"));var _helpers=require("../helpers");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues","autofocus","dangerouslyGetFullCardDetails","disabled"];var _this=this,_jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.CardForm=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _NativeCardForm=_interopRequireWildcard(require("../specs/NativeCardForm"));var _helpers=require("../helpers");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onFormComplete","cardStyle","placeholders","defaultValues","autofocus","dangerouslyGetFullCardDetails","disabled"];var _this=this,_jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/CardForm.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var CardForm=exports.CardForm=(0,_react.forwardRef)(function(_ref,ref){var onFormComplete=_ref.onFormComplete,cardStyle=_ref.cardStyle,placeholders=_ref.placeholders,defaultValues=_ref.defaultValues,autofocus=_ref.autofocus,dangerouslyGetFullCardDetails=_ref.dangerouslyGetFullCardDetails,disabled=_ref.disabled,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var inputRef=(0,_react.useRef)(null);var onFormCompleteHandler=(0,_react.useCallback)(function(event){var card=event.nativeEvent.card;var data={last4:card.last4,expiryMonth:card.expiryMonth,expiryYear:card.expiryYear,complete:card.complete,brand:card.brand,country:card.country,postalCode:card.postalCode};if(card.hasOwnProperty('number')||card.hasOwnProperty('cvc')){data.number=card.number||'';data.cvc=card.cvc||'';if(__DEV__&&onFormComplete&&card.complete){console.warn(`[stripe-react-native] ⚠️ WARNING: You've enabled \`dangerouslyGetFullCardDetails\`, meaning full card details are being returned. Only do this if you're certain that you fulfill the necessary PCI compliance requirements. Make sure that you're not mistakenly logging or storing full card details! See the docs for details: https://stripe.com/docs/security/guide#validating-pci-compliance`);}}onFormComplete==null||onFormComplete(data);},[onFormComplete]);var focus=function focus(){_NativeCardForm.Commands.focus(inputRef.current);};var blur=function blur(){_NativeCardForm.Commands.blur(inputRef.current);};(0,_react.useImperativeHandle)(ref,function(){return{focus:focus,blur:blur};});var onFocusHandler=(0,_react.useCallback)(function(event){var focusedField=event.nativeEvent.focusedField;if(focusedField){(0,_helpers.focusInput)(inputRef.current);}},[]);(0,_react.useLayoutEffect)(function(){var inputRefValue=inputRef.current;if(inputRefValue!==null){(0,_helpers.registerInput)(inputRefValue);return function(){(0,_helpers.unregisterInput)(inputRefValue);if((0,_helpers.currentlyFocusedInput)()===inputRefValue){inputRefValue.blur();}};}return function(){};},[inputRef]);return(0,_jsxRuntime.jsx)(_NativeCardForm.default,Object.assign({ref:inputRef,onFormComplete:onFormCompleteHandler,cardStyle:{backgroundColor:cardStyle==null?void 0:cardStyle.backgroundColor,borderColor:cardStyle==null?void 0:cardStyle.borderColor,borderWidth:cardStyle==null?void 0:cardStyle.borderWidth,borderRadius:cardStyle==null?void 0:cardStyle.borderRadius,cursorColor:cardStyle==null?void 0:cardStyle.cursorColor,fontSize:cardStyle==null?void 0:cardStyle.fontSize,placeholderColor:cardStyle==null?void 0:cardStyle.placeholderColor,textColor:cardStyle==null?void 0:cardStyle.textColor,textErrorColor:cardStyle==null?void 0:cardStyle.textErrorColor,fontFamily:cardStyle==null?void 0:cardStyle.fontFamily},placeholders:{number:placeholders==null?void 0:placeholders.number,expiration:placeholders==null?void 0:placeholders.expiration,cvc:placeholders==null?void 0:placeholders.cvc,postalCode:placeholders==null?void 0:placeholders.postalCode},defaultValues:Object.assign({},defaultValues!=null?defaultValues:{}),onFocusChange:onFocusHandler,autofocus:autofocus!=null?autofocus:false,dangerouslyGetFullCardDetails:dangerouslyGetFullCardDetails!=null?dangerouslyGetFullCardDetails:false,disabled:disabled!=null?disabled:false,postalCodeEnabled:true},props));});
|
|
2
2
|
//# sourceMappingURL=CardForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_NativeCardForm","_helpers","_jsxRuntime","_excluded","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CardForm","exports","forwardRef","_ref","ref","onFormComplete","cardStyle","placeholders","defaultValues","autofocus","dangerouslyGetFullCardDetails","disabled","props","_objectWithoutProperties2","inputRef","useRef","onFormCompleteHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","number","cvc","__DEV__","console","warn","focus","Commands","current","blur","useImperativeHandle","onFocusHandler","focusedField","focusInput","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration","onFocusChange","postalCodeEnabled"],"sourceRoot":"../../../src","sources":["components/CardForm.tsx"],"mappings":"oRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,eAAA,CAAAF,uBAAA,CAAAC,OAAA,6BACA,IAAAE,QAAA,CAAAF,OAAA,eAKoB,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,0HAAAC,KAAA,MAAAC,YAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_NativeCardForm","_helpers","_jsxRuntime","_excluded","_this","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CardForm","exports","forwardRef","_ref","ref","onFormComplete","cardStyle","placeholders","defaultValues","autofocus","dangerouslyGetFullCardDetails","disabled","props","_objectWithoutProperties2","inputRef","useRef","onFormCompleteHandler","useCallback","event","card","nativeEvent","data","last4","expiryMonth","expiryYear","complete","brand","country","postalCode","number","cvc","__DEV__","console","warn","focus","Commands","current","blur","useImperativeHandle","onFocusHandler","focusedField","focusInput","useLayoutEffect","inputRefValue","registerInput","unregisterInput","currentlyFocusedInput","jsx","assign","backgroundColor","borderColor","borderWidth","borderRadius","cursorColor","fontSize","placeholderColor","textColor","textErrorColor","fontFamily","expiration","onFocusChange","postalCodeEnabled"],"sourceRoot":"../../../src","sources":["components/CardForm.tsx"],"mappings":"oRAAA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WAaA,IAAAC,eAAA,CAAAF,uBAAA,CAAAC,OAAA,6BACA,IAAAE,QAAA,CAAAF,OAAA,eAKoB,IAAAG,WAAA,CAAAH,OAAA,0BAAAI,SAAA,0HAAAC,KAAA,MAAAC,YAAA,+EAAAP,wBAAAQ,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAV,uBAAA,UAAAA,wBAAAQ,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,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CAAEjD,SAAS,cAATA,SAAS,CAAEiD,gBAAgB,CAC7CC,SAAS,CAAElD,SAAS,cAATA,SAAS,CAAEkD,SAAS,CAC/BC,cAAc,CAAEnD,SAAS,cAATA,SAAS,CAAEmD,cAAc,CACzCC,UAAU,CAAEpD,SAAS,cAATA,SAAS,CAAEoD,UACzB,CAAE,CACFnD,YAAY,CAAE,CACZsB,MAAM,CAAEtB,YAAY,cAAZA,YAAY,CAAEsB,MAAM,CAC5B8B,UAAU,CAAEpD,YAAY,cAAZA,YAAY,CAAEoD,UAAU,CACpC7B,GAAG,CAAEvB,YAAY,cAAZA,YAAY,CAAEuB,GAAG,CACtBF,UAAU,CAAErB,YAAY,cAAZA,YAAY,CAAEqB,UAC5B,CAAE,CACFpB,aAAa,CAAAX,MAAA,CAAAmD,MAAA,IACPxC,aAAa,OAAbA,aAAa,CAAI,CAAC,CAAC,CACvB,CACFoD,aAAa,CAAErB,cAAe,CAC9B9B,SAAS,CAAEA,SAAS,OAATA,SAAS,CAAI,KAAM,CAC9BC,6BAA6B,CAAEA,6BAA6B,OAA7BA,6BAA6B,CAAI,KAAM,CACtEC,QAAQ,CAAEA,QAAQ,OAARA,QAAQ,CAAI,KAAM,CAC5BkD,iBAAiB,OACbjD,KAAK,CACV,CAAC,CAEN,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdkModule=_interopRequireDefault(require("../specs/NativeStripeSdkModule"));var _PlatformPay=require("../types/PlatformPay");var _NativeApplePayButton=_interopRequireDefault(require("../specs/NativeApplePayButton"));var _NativeGooglePayButton=_interopRequireDefault(require("../specs/NativeGooglePayButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PlatformPayButton=PlatformPayButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _NativeStripeSdkModule=_interopRequireDefault(require("../specs/NativeStripeSdkModule"));var _PlatformPay=require("../types/PlatformPay");var _NativeApplePayButton=_interopRequireDefault(require("../specs/NativeApplePayButton"));var _NativeGooglePayButton=_interopRequireDefault(require("../specs/NativeGooglePayButton"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/wooj/stripe/stripe-react-native/src/components/PlatformPayButton.tsx";var _excluded=["type","appearance","onPress","disabled","borderRadius","onShippingMethodSelected","onShippingContactSelected","onCouponCodeEntered","setOrderTracking","style"];function PlatformPayButton(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?_PlatformPay.ButtonType.Default:_ref$type,_ref$appearance=_ref.appearance,appearance=_ref$appearance===void 0?_PlatformPay.ButtonStyle.Automatic:_ref$appearance,onPress=_ref.onPress,disabled=_ref.disabled,borderRadius=_ref.borderRadius,onShippingMethodSelected=_ref.onShippingMethodSelected,onShippingContactSelected=_ref.onShippingContactSelected,onCouponCodeEntered=_ref.onCouponCodeEntered,setOrderTracking=_ref.setOrderTracking,style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var shippingMethodCallback=onShippingMethodSelected?function(value){onShippingMethodSelected&&onShippingMethodSelected(value.nativeEvent);}:undefined;var shippingContactCallback=onShippingContactSelected?function(value){onShippingContactSelected(value.nativeEvent);}:undefined;var couponCodeCallback=onCouponCodeEntered?function(value){onCouponCodeEntered&&onCouponCodeEntered(value.nativeEvent);}:undefined;var orderTrackingCallback=setOrderTracking?function(){setOrderTracking(_NativeStripeSdkModule.default.configureOrderTracking);}:undefined;var callbackProps={onShippingMethodSelectedAction:shippingMethodCallback,onShippingContactSelectedAction:shippingContactCallback,onCouponCodeEnteredAction:couponCodeCallback,onOrderTrackingAction:orderTrackingCallback,hasShippingMethodCallback:!!onShippingMethodSelected,hasShippingContactCallback:!!onShippingContactSelected,hasCouponCodeCallback:!!onCouponCodeEntered,hasOrderTrackingCallback:!!setOrderTracking};return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{disabled:disabled,activeOpacity:disabled?0.3:1,onPress:onPress,style:[disabled?styles.disabled:styles.notDisabled,style],children:_reactNative.Platform.OS==='ios'?(0,_jsxRuntime.jsx)(_NativeApplePayButton.default,Object.assign({type:type,buttonStyle:appearance,buttonBorderRadius:borderRadius,disabled:disabled!=null?disabled:false,style:styles.nativeButtonStyle},callbackProps,props)):(0,_jsxRuntime.jsx)(_NativeGooglePayButton.default,Object.assign({type:type,appearance:appearance,borderRadius:borderRadius,style:styles.nativeButtonStyle},props))});}var styles=_reactNative.StyleSheet.create({disabled:{flex:0,opacity:0.4},notDisabled:{flex:0},nativeButtonStyle:{flex:1}});
|
|
2
2
|
//# sourceMappingURL=PlatformPayButton.js.map
|