@stripe/stripe-react-native 0.59.1 → 0.59.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 +5 -2
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +0 -5
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +20 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +2 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +0 -4
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +103 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +97 -187
- package/android/src/test/java/com/reactnativestripesdk/PaymentElementConfigTest.kt +72 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +3 -3
- package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +219 -0
- package/ios/PaymentMethodMessagingElementConfig.swift +1 -1
- package/ios/StripeOnrampSdk.mm +0 -6
- package/ios/StripeSdkImpl+PaymentSheet.swift +25 -0
- package/ios/StripeSdkImpl.swift +2 -36
- package/jest/setup.js +0 -1
- 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 +1 -1
- 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/NativeOnrampSdkModule.js.map +1 -1
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.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/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 +1 -1
- 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/NativeOnrampSdkModule.js.map +1 -1
- package/lib/module/specs/NativePaymentMethodMessagingElement.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/PaymentSheet.js +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +2 -8
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +0 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +0 -12
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +22 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useOnramp.tsx +2 -14
- package/src/specs/NativeOnrampSdkModule.ts +0 -1
- package/src/types/Onramp.ts +0 -15
- package/src/types/PaymentSheet.ts +23 -0
- package/stripe-react-native.podspec +1 -1
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- 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
|
@@ -3,6 +3,7 @@ package com.reactnativestripesdk
|
|
|
3
3
|
import com.reactnativestripesdk.utils.PaymentSheetException
|
|
4
4
|
import com.reactnativestripesdk.utils.readableArrayOf
|
|
5
5
|
import com.reactnativestripesdk.utils.readableMapOf
|
|
6
|
+
import com.stripe.android.model.PaymentMethod
|
|
6
7
|
import com.stripe.android.paymentelement.PaymentMethodOptionsSetupFutureUsagePreview
|
|
7
8
|
import com.stripe.android.paymentsheet.CardFundingFilteringPrivatePreview
|
|
8
9
|
import com.stripe.android.paymentsheet.PaymentSheet
|
|
@@ -1098,6 +1099,77 @@ class PaymentElementConfigTest {
|
|
|
1098
1099
|
assertNull(result)
|
|
1099
1100
|
}
|
|
1100
1101
|
|
|
1102
|
+
// ============================================
|
|
1103
|
+
// mapToTermsDisplay Tests
|
|
1104
|
+
// ============================================
|
|
1105
|
+
|
|
1106
|
+
@Test
|
|
1107
|
+
fun mapToTermsDisplay_NullParams_ReturnsNull() {
|
|
1108
|
+
val result = mapToTermsDisplay(null)
|
|
1109
|
+
assertNull(result)
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
@Test
|
|
1113
|
+
fun mapToTermsDisplay_NoTermsDisplayKey_ReturnsNull() {
|
|
1114
|
+
val params = readableMapOf("someOtherKey" to "value")
|
|
1115
|
+
val result = mapToTermsDisplay(params)
|
|
1116
|
+
assertNull(result)
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
@Test
|
|
1120
|
+
fun mapToTermsDisplay_CardNever_ReturnsSingleEntry() {
|
|
1121
|
+
val params =
|
|
1122
|
+
readableMapOf(
|
|
1123
|
+
"termsDisplay" to readableMapOf("card" to "never"),
|
|
1124
|
+
)
|
|
1125
|
+
val result = mapToTermsDisplay(params)
|
|
1126
|
+
assertNotNull(result)
|
|
1127
|
+
assertEquals(1, result!!.size)
|
|
1128
|
+
assertEquals(PaymentSheet.TermsDisplay.NEVER, result[PaymentMethod.Type.Card])
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
@Test
|
|
1132
|
+
fun mapToTermsDisplay_CardAutomatic_ReturnsSingleEntry() {
|
|
1133
|
+
val params =
|
|
1134
|
+
readableMapOf(
|
|
1135
|
+
"termsDisplay" to readableMapOf("card" to "automatic"),
|
|
1136
|
+
)
|
|
1137
|
+
val result = mapToTermsDisplay(params)
|
|
1138
|
+
assertNotNull(result)
|
|
1139
|
+
assertEquals(1, result!!.size)
|
|
1140
|
+
assertEquals(PaymentSheet.TermsDisplay.AUTOMATIC, result[PaymentMethod.Type.Card])
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
@Test
|
|
1144
|
+
fun mapToTermsDisplay_InvalidValue_Skipped() {
|
|
1145
|
+
val params =
|
|
1146
|
+
readableMapOf(
|
|
1147
|
+
"termsDisplay" to readableMapOf("card" to "invalid"),
|
|
1148
|
+
)
|
|
1149
|
+
val result = mapToTermsDisplay(params)
|
|
1150
|
+
assertNull(result)
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
@Test
|
|
1154
|
+
fun mapToTermsDisplay_InvalidPaymentMethodType_Skipped() {
|
|
1155
|
+
val params =
|
|
1156
|
+
readableMapOf(
|
|
1157
|
+
"termsDisplay" to readableMapOf("foobar" to "never"),
|
|
1158
|
+
)
|
|
1159
|
+
val result = mapToTermsDisplay(params)
|
|
1160
|
+
assertNull(result)
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
@Test
|
|
1164
|
+
fun mapToTermsDisplay_EmptyMap_ReturnsNull() {
|
|
1165
|
+
val params =
|
|
1166
|
+
readableMapOf(
|
|
1167
|
+
"termsDisplay" to readableMapOf(),
|
|
1168
|
+
)
|
|
1169
|
+
val result = mapToTermsDisplay(params)
|
|
1170
|
+
assertNull(result)
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1101
1173
|
@Test
|
|
1102
1174
|
fun mapToAllowedCardFundingTypes_MissingAllowedCardFundingTypes_ReturnsNull() {
|
|
1103
1175
|
val params =
|
package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt
CHANGED
|
@@ -365,7 +365,7 @@ class PaymentMethodMessagingElementConfigTest {
|
|
|
365
365
|
val colors =
|
|
366
366
|
PaymentMethodMessagingElement.Appearance
|
|
367
367
|
.Colors()
|
|
368
|
-
.
|
|
368
|
+
.linkTextColor("#0000FF".toColorInt())
|
|
369
369
|
colors(colors)
|
|
370
370
|
}
|
|
371
371
|
|
|
@@ -391,7 +391,7 @@ class PaymentMethodMessagingElementConfigTest {
|
|
|
391
391
|
val colors =
|
|
392
392
|
PaymentMethodMessagingElement.Appearance
|
|
393
393
|
.Colors()
|
|
394
|
-
.
|
|
394
|
+
.linkTextColor("#0000FF".toColorInt())
|
|
395
395
|
colors(colors)
|
|
396
396
|
}
|
|
397
397
|
|
|
@@ -526,7 +526,7 @@ class PaymentMethodMessagingElementConfigTest {
|
|
|
526
526
|
expected: Any,
|
|
527
527
|
actual: Any,
|
|
528
528
|
) {
|
|
529
|
-
val fieldNames = listOf("textColor", "
|
|
529
|
+
val fieldNames = listOf("textColor", "linkTextColor")
|
|
530
530
|
|
|
531
531
|
for (fieldName in fieldNames) {
|
|
532
532
|
val expectedField = expected.javaClass.getDeclaredField(fieldName)
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
package com.reactnativestripesdk.mappers
|
|
2
|
+
|
|
3
|
+
import android.annotation.SuppressLint
|
|
4
|
+
import androidx.compose.ui.graphics.toArgb
|
|
5
|
+
import com.reactnativestripesdk.mapAppearance
|
|
6
|
+
import com.reactnativestripesdk.mapConfig
|
|
7
|
+
import com.reactnativestripesdk.utils.readableMapOf
|
|
8
|
+
import com.stripe.android.link.LinkAppearance.Style
|
|
9
|
+
import org.junit.Assert.assertEquals
|
|
10
|
+
import org.junit.Assert.assertNotNull
|
|
11
|
+
import org.junit.Assert.assertNull
|
|
12
|
+
import org.junit.Test
|
|
13
|
+
import org.junit.runner.RunWith
|
|
14
|
+
import org.robolectric.RobolectricTestRunner
|
|
15
|
+
|
|
16
|
+
@SuppressLint("RestrictedApi")
|
|
17
|
+
@RunWith(RobolectricTestRunner::class)
|
|
18
|
+
class OnrampMappersTest {
|
|
19
|
+
@Test
|
|
20
|
+
fun mapConfig_WithAppearance() {
|
|
21
|
+
val appearance =
|
|
22
|
+
readableMapOf(
|
|
23
|
+
"style" to "ALWAYS_DARK",
|
|
24
|
+
)
|
|
25
|
+
val config =
|
|
26
|
+
readableMapOf(
|
|
27
|
+
"merchantDisplayName" to "Test",
|
|
28
|
+
"appearance" to appearance,
|
|
29
|
+
"cryptoCustomerId" to "cust_abc",
|
|
30
|
+
)
|
|
31
|
+
val result = mapConfig(config, "pk_test_123")
|
|
32
|
+
|
|
33
|
+
assertNotNull(result)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Test
|
|
37
|
+
fun mapAppearance_EmptyMap_ReturnsDefaultValue() {
|
|
38
|
+
val appearanceMap = readableMapOf()
|
|
39
|
+
val result = mapAppearance(appearanceMap).build()
|
|
40
|
+
|
|
41
|
+
assertEquals(Style.AUTOMATIC, result.style)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@Test
|
|
45
|
+
fun mapAppearance_StyleAlwaysLight() {
|
|
46
|
+
val appearanceMap =
|
|
47
|
+
readableMapOf(
|
|
48
|
+
"style" to "ALWAYS_LIGHT",
|
|
49
|
+
)
|
|
50
|
+
val result = mapAppearance(appearanceMap).build()
|
|
51
|
+
|
|
52
|
+
assertEquals(Style.ALWAYS_LIGHT, result.style)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Test
|
|
56
|
+
fun mapAppearance_StyleAlwaysDark() {
|
|
57
|
+
val appearanceMap =
|
|
58
|
+
readableMapOf(
|
|
59
|
+
"style" to "ALWAYS_DARK",
|
|
60
|
+
)
|
|
61
|
+
val result = mapAppearance(appearanceMap).build()
|
|
62
|
+
|
|
63
|
+
assertEquals(Style.ALWAYS_DARK, result.style)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@Test
|
|
67
|
+
fun mapAppearance_StyleUnknown_DefaultsToAutomatic() {
|
|
68
|
+
val appearanceMap =
|
|
69
|
+
readableMapOf(
|
|
70
|
+
"style" to "SOMETHING_UNKNOWN",
|
|
71
|
+
)
|
|
72
|
+
val result = mapAppearance(appearanceMap).build()
|
|
73
|
+
|
|
74
|
+
assertEquals(Style.AUTOMATIC, result.style)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@Test
|
|
78
|
+
fun mapAppearance_WithLightColors() {
|
|
79
|
+
val lightColors =
|
|
80
|
+
readableMapOf(
|
|
81
|
+
"primary" to "#FF0000",
|
|
82
|
+
"contentOnPrimary" to "#FFFFFF",
|
|
83
|
+
"borderSelected" to "#00FF00",
|
|
84
|
+
)
|
|
85
|
+
val appearanceMap =
|
|
86
|
+
readableMapOf(
|
|
87
|
+
"lightColors" to lightColors,
|
|
88
|
+
)
|
|
89
|
+
val state = mapAppearance(appearanceMap).build()
|
|
90
|
+
|
|
91
|
+
assertEquals(0xFFFF0000.toInt(), state.lightColors.primary.toArgb())
|
|
92
|
+
assertEquals(0xFFFFFFFF.toInt(), state.lightColors.contentOnPrimary.toArgb())
|
|
93
|
+
assertEquals(0xFF00FF00.toInt(), state.lightColors.borderSelected.toArgb())
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@Test
|
|
97
|
+
fun mapAppearance_WithDarkColors() {
|
|
98
|
+
val darkColors =
|
|
99
|
+
readableMapOf(
|
|
100
|
+
"primary" to "#0000FF",
|
|
101
|
+
"contentOnPrimary" to "#000000",
|
|
102
|
+
"borderSelected" to "#FF00FF",
|
|
103
|
+
)
|
|
104
|
+
val appearanceMap =
|
|
105
|
+
readableMapOf(
|
|
106
|
+
"darkColors" to darkColors,
|
|
107
|
+
)
|
|
108
|
+
val state = mapAppearance(appearanceMap).build()
|
|
109
|
+
|
|
110
|
+
assertEquals(0xFF0000FF.toInt(), state.darkColors.primary.toArgb())
|
|
111
|
+
assertEquals(0xFF000000.toInt(), state.darkColors.contentOnPrimary.toArgb())
|
|
112
|
+
assertEquals(0xFFFF00FF.toInt(), state.darkColors.borderSelected.toArgb())
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@Test
|
|
116
|
+
fun mapAppearance_WithLightAndDarkColors() {
|
|
117
|
+
val lightColors =
|
|
118
|
+
readableMapOf(
|
|
119
|
+
"primary" to "#FF0000",
|
|
120
|
+
"contentOnPrimary" to "#FFFFFF",
|
|
121
|
+
"borderSelected" to "#00FF00",
|
|
122
|
+
)
|
|
123
|
+
val darkColors =
|
|
124
|
+
readableMapOf(
|
|
125
|
+
"primary" to "#0000FF",
|
|
126
|
+
"contentOnPrimary" to "#000000",
|
|
127
|
+
"borderSelected" to "#FF00FF",
|
|
128
|
+
)
|
|
129
|
+
val appearanceMap =
|
|
130
|
+
readableMapOf(
|
|
131
|
+
"lightColors" to lightColors,
|
|
132
|
+
"darkColors" to darkColors,
|
|
133
|
+
)
|
|
134
|
+
val state = mapAppearance(appearanceMap).build()
|
|
135
|
+
|
|
136
|
+
assertEquals(0xFFFF0000.toInt(), state.lightColors.primary.toArgb())
|
|
137
|
+
assertEquals(0xFFFFFFFF.toInt(), state.lightColors.contentOnPrimary.toArgb())
|
|
138
|
+
assertEquals(0xFF00FF00.toInt(), state.lightColors.borderSelected.toArgb())
|
|
139
|
+
|
|
140
|
+
assertEquals(0xFF0000FF.toInt(), state.darkColors.primary.toArgb())
|
|
141
|
+
assertEquals(0xFF000000.toInt(), state.darkColors.contentOnPrimary.toArgb())
|
|
142
|
+
assertEquals(0xFFFF00FF.toInt(), state.darkColors.borderSelected.toArgb())
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@Test
|
|
146
|
+
fun mapAppearance_WithPrimaryButton() {
|
|
147
|
+
val primaryButton =
|
|
148
|
+
readableMapOf(
|
|
149
|
+
"cornerRadius" to 8.0,
|
|
150
|
+
"height" to 48.0,
|
|
151
|
+
)
|
|
152
|
+
val appearanceMap =
|
|
153
|
+
readableMapOf(
|
|
154
|
+
"primaryButton" to primaryButton,
|
|
155
|
+
)
|
|
156
|
+
val state = mapAppearance(appearanceMap).build()
|
|
157
|
+
|
|
158
|
+
assertEquals(8f, state.primaryButton.cornerRadiusDp)
|
|
159
|
+
assertEquals(48f, state.primaryButton.heightDp)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@Test
|
|
163
|
+
fun mapAppearance_WithPrimaryButtonPartialFields() {
|
|
164
|
+
val primaryButton =
|
|
165
|
+
readableMapOf(
|
|
166
|
+
"cornerRadius" to 12.0,
|
|
167
|
+
)
|
|
168
|
+
val appearanceMap =
|
|
169
|
+
readableMapOf(
|
|
170
|
+
"primaryButton" to primaryButton,
|
|
171
|
+
)
|
|
172
|
+
val state = mapAppearance(appearanceMap).build()
|
|
173
|
+
|
|
174
|
+
assertEquals(12f, state.primaryButton.cornerRadiusDp)
|
|
175
|
+
assertNull(state.primaryButton.heightDp)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@Test
|
|
179
|
+
fun mapAppearance_FullConfig() {
|
|
180
|
+
val lightColors =
|
|
181
|
+
readableMapOf(
|
|
182
|
+
"primary" to "#FF0000",
|
|
183
|
+
"contentOnPrimary" to "#FFFFFF",
|
|
184
|
+
"borderSelected" to "#00FF00",
|
|
185
|
+
)
|
|
186
|
+
val darkColors =
|
|
187
|
+
readableMapOf(
|
|
188
|
+
"primary" to "#0000FF",
|
|
189
|
+
"contentOnPrimary" to "#000000",
|
|
190
|
+
"borderSelected" to "#FF00FF",
|
|
191
|
+
)
|
|
192
|
+
val primaryButton =
|
|
193
|
+
readableMapOf(
|
|
194
|
+
"cornerRadius" to 8.0,
|
|
195
|
+
"height" to 48.0,
|
|
196
|
+
)
|
|
197
|
+
val appearanceMap =
|
|
198
|
+
readableMapOf(
|
|
199
|
+
"style" to "ALWAYS_LIGHT",
|
|
200
|
+
"lightColors" to lightColors,
|
|
201
|
+
"darkColors" to darkColors,
|
|
202
|
+
"primaryButton" to primaryButton,
|
|
203
|
+
)
|
|
204
|
+
val state = mapAppearance(appearanceMap).build()
|
|
205
|
+
|
|
206
|
+
assertEquals(Style.ALWAYS_LIGHT, state.style)
|
|
207
|
+
|
|
208
|
+
assertEquals(0xFFFF0000.toInt(), state.lightColors.primary.toArgb())
|
|
209
|
+
assertEquals(0xFFFFFFFF.toInt(), state.lightColors.contentOnPrimary.toArgb())
|
|
210
|
+
assertEquals(0xFF00FF00.toInt(), state.lightColors.borderSelected.toArgb())
|
|
211
|
+
|
|
212
|
+
assertEquals(0xFF0000FF.toInt(), state.darkColors.primary.toArgb())
|
|
213
|
+
assertEquals(0xFF000000.toInt(), state.darkColors.contentOnPrimary.toArgb())
|
|
214
|
+
assertEquals(0xFFFF00FF.toInt(), state.darkColors.borderSelected.toArgb())
|
|
215
|
+
|
|
216
|
+
assertEquals(8f, state.primaryButton.cornerRadiusDp)
|
|
217
|
+
assertEquals(48f, state.primaryButton.heightDp)
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -42,7 +42,7 @@ internal class PaymentMethodMessagingElementConfig {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
if let linkTextColorHex = parseThemedColor(params: params, key: "linkTextColor") {
|
|
45
|
-
appearance.
|
|
45
|
+
appearance.linkTextColor = linkTextColorHex
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
return appearance
|
package/ios/StripeOnrampSdk.mm
CHANGED
|
@@ -43,12 +43,6 @@ RCT_EXPORT_METHOD(registerLinkUser:(nonnull NSDictionary *)info
|
|
|
43
43
|
[StripeSdkImpl.shared registerLinkUser:info resolver:resolve rejecter:reject];
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
RCT_EXPORT_METHOD(authenticateUser:(nonnull RCTPromiseResolveBlock)resolve
|
|
47
|
-
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
48
|
-
{
|
|
49
|
-
[StripeSdkImpl.shared authenticateUser:resolve rejecter:reject];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
46
|
RCT_EXPORT_METHOD(authenticateUserWithToken:(nonnull NSString *)linkAuthTokenClientSecret
|
|
53
47
|
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
54
48
|
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
@@ -152,6 +152,10 @@ extension StripeSdkImpl {
|
|
|
152
152
|
)
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
if let termsDisplay = StripeSdkImpl.mapToTermsDisplay(params: params) {
|
|
156
|
+
configuration.termsDisplay = termsDisplay
|
|
157
|
+
}
|
|
158
|
+
|
|
155
159
|
return (nil, configuration)
|
|
156
160
|
}
|
|
157
161
|
|
|
@@ -481,6 +485,27 @@ extension StripeSdkImpl {
|
|
|
481
485
|
}
|
|
482
486
|
}
|
|
483
487
|
|
|
488
|
+
internal static func mapToTermsDisplay(params: NSDictionary) -> [STPPaymentMethodType: PaymentSheet.TermsDisplay]? {
|
|
489
|
+
guard let termsDisplayDict = params["termsDisplay"] as? [String: String] else {
|
|
490
|
+
return nil
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
var result: [STPPaymentMethodType: PaymentSheet.TermsDisplay] = [:]
|
|
494
|
+
for (code, value) in termsDisplayDict {
|
|
495
|
+
let paymentMethodType = STPPaymentMethodType.fromIdentifier(code)
|
|
496
|
+
let termsDisplay: PaymentSheet.TermsDisplay? = switch value {
|
|
497
|
+
case "never": .never
|
|
498
|
+
case "automatic": .automatic
|
|
499
|
+
default: nil
|
|
500
|
+
}
|
|
501
|
+
if paymentMethodType != .unknown, let termsDisplay {
|
|
502
|
+
result[paymentMethodType] = termsDisplay
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return result.isEmpty ? nil : result
|
|
507
|
+
}
|
|
508
|
+
|
|
484
509
|
internal static func mapToLinkDisplay(value: String?) -> PaymentSheet.LinkConfiguration.Display {
|
|
485
510
|
switch value {
|
|
486
511
|
case "automatic":
|
package/ios/StripeSdkImpl.swift
CHANGED
|
@@ -1332,35 +1332,6 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
|
-
@objc(authenticateUser:rejecter:)
|
|
1336
|
-
public func authenticateUser(
|
|
1337
|
-
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
1338
|
-
rejecter reject: @escaping RCTPromiseRejectBlock
|
|
1339
|
-
) {
|
|
1340
|
-
guard isPublishableKeyAvailable(resolve), let coordinator = requireOnrampCoordinator(resolve) else {
|
|
1341
|
-
return
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
Task {
|
|
1345
|
-
do {
|
|
1346
|
-
let presentingViewController = await MainActor.run {
|
|
1347
|
-
findViewControllerPresenter(from: RCTKeyWindow()?.rootViewController ?? UIViewController())
|
|
1348
|
-
}
|
|
1349
|
-
let result = try await coordinator.authenticateUser(from: presentingViewController)
|
|
1350
|
-
switch result {
|
|
1351
|
-
case let .completed(customerId):
|
|
1352
|
-
resolve(["customerId": customerId])
|
|
1353
|
-
case .canceled:
|
|
1354
|
-
let errorResult = Errors.createError(ErrorType.Canceled, "Authentication was cancelled")
|
|
1355
|
-
resolve(["error": errorResult["error"]!])
|
|
1356
|
-
}
|
|
1357
|
-
} catch {
|
|
1358
|
-
let errorResult = Errors.createError(ErrorType.Failed, error)
|
|
1359
|
-
resolve(["error": errorResult["error"]!])
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
1335
|
@objc(authenticateUserWithToken:resolver:rejecter:)
|
|
1365
1336
|
public func authenticateUserWithToken(
|
|
1366
1337
|
_ linkAuthTokenClientSecret: String,
|
|
@@ -1739,7 +1710,7 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1739
1710
|
let formattedBrandName = String(format: mappedFunding.displayNameWithBrand, brandName ?? "")
|
|
1740
1711
|
let sublabel = "\(formattedBrandName) •••• \(last4)"
|
|
1741
1712
|
|
|
1742
|
-
let result = PaymentMethodDisplayData(icon: icon, label: label, sublabel: sublabel)
|
|
1713
|
+
let result = PaymentMethodDisplayData(paymentMethodType: .card, icon: icon, label: label, sublabel: sublabel)
|
|
1743
1714
|
let displayData = Mappers.paymentMethodDisplayDataToMap(result)
|
|
1744
1715
|
|
|
1745
1716
|
resolve(["displayData": displayData])
|
|
@@ -1751,7 +1722,7 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1751
1722
|
let icon = PaymentSheetImageLibrary.bankIcon(for: iconCode, iconStyle: .filled)
|
|
1752
1723
|
let sublabel = "\(bankName) •••• \(last4)"
|
|
1753
1724
|
|
|
1754
|
-
let result = PaymentMethodDisplayData(icon: icon, label: label, sublabel: sublabel)
|
|
1725
|
+
let result = PaymentMethodDisplayData(paymentMethodType: .bankAccount, icon: icon, label: label, sublabel: sublabel)
|
|
1755
1726
|
let displayData = Mappers.paymentMethodDisplayDataToMap(result)
|
|
1756
1727
|
|
|
1757
1728
|
resolve(["displayData": displayData])
|
|
@@ -1801,11 +1772,6 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
|
1801
1772
|
resolveWithCryptoOnrampNotAvailableError(resolve)
|
|
1802
1773
|
}
|
|
1803
1774
|
|
|
1804
|
-
@objc(authenticateUser:rejecter:)
|
|
1805
|
-
public func authenticateUser(resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
1806
|
-
resolveWithCryptoOnrampNotAvailableError(resolve)
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
1775
|
@objc(authenticateUserWithToken:resolver:rejecter:)
|
|
1810
1776
|
public func authenticateUserWithToken(
|
|
1811
1777
|
_ linkAuthTokenClientSecret: String,
|
package/jest/setup.js
CHANGED
|
@@ -15,7 +15,6 @@ jest.mock('../src/specs/NativeOnrampSdkModule', () => ({
|
|
|
15
15
|
attachKycInfo: jest.fn(),
|
|
16
16
|
presentKycInfoVerification: jest.fn(),
|
|
17
17
|
updatePhoneNumber: jest.fn(),
|
|
18
|
-
authenticateUser: jest.fn(),
|
|
19
18
|
authenticateUserWithToken: jest.fn(),
|
|
20
19
|
verifyIdentity: jest.fn(),
|
|
21
20
|
collectPaymentMethod: jest.fn(),
|
|
@@ -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/mats/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/mats/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/mats/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/mats/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,QAAAQ,CAAA,IAAAF,CAAA,CAAAL,CAAA,CAAAG,CAAA,CAAAD,CAAA,KAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,SAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,EAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,CAAAQ,CAAA,WAAAM,EAAA,IAAAd,CAAA,aAAAc,EAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc,EAAA,KAAAP,CAAA,EAAAD,CAAA,CAAAW,MAAA,CAAAC,cAAA,GAAAD,MAAA,CAAAE,wBAAA,CAAAnB,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cAATA,SAAS,CAAEmD,WAAW,CACnCC,QAAQ,CAAEpD,SAAS,cAATA,SAAS,CAAEoD,QAAQ,CAC7BC,gBAAgB,CAAErD,SAAS,cAATA,SAAS,CAAEqD,gBAAgB,CAC7CC,SAAS,CAAEtD,SAAS,cAATA,SAAS,CAAEsD,SAAS,CAC/BC,cAAc,CAAEvD,SAAS,cAATA,SAAS,CAAEuD,cAAc,CACzCC,UAAU,CAAExD,SAAS,cAATA,SAAS,CAAEwD,UACzB,CAAE,CACFvD,YAAY,CAAE,CACZwB,MAAM,CAAExB,YAAY,cAAZA,YAAY,CAAEwB,MAAM,CAC5BgC,UAAU,CAAExD,YAAY,cAAZA,YAAY,CAAEwD,UAAU,CACpC/B,GAAG,CAAEzB,YAAY,cAAZA,YAAY,CAAEyB,GAAG,CACtBF,UAAU,CAAEvB,YAAY,cAAZA,YAAY,CAAEuB,UAC5B,CAAE,CACFtB,SAAS,CAAEA,SAAS,OAATA,SAAS,CAAI,KAAM,CAC9BC,iBAAiB,CAAEA,iBAAiB,OAAjBA,iBAAiB,CAAI,IAAK,CAC7CC,QAAQ,CAAEA,QAAQ,OAARA,QAAQ,CAAI,KAAM,CAC5BC,6BAA6B,CAAEA,6BAA6B,OAA7BA,6BAA6B,CAAI,KAAM,EAClEC,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.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/mats/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,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAQ,CAAA,IAAAF,CAAA,CAAAL,CAAA,CAAAG,CAAA,CAAAD,CAAA,KAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,SAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,EAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,CAAAQ,CAAA,WAAAM,EAAA,IAAAd,CAAA,aAAAc,EAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc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