@stripe/stripe-react-native 0.57.3 → 0.59.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 +2 -0
- package/android/gradle.properties +1 -1
- package/android/src/main/AndroidManifest.xml +27 -1
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +0 -3
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +7 -3
- package/android/src/main/java/com/reactnativestripesdk/EventEmitterCompat.kt +8 -0
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +12 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +26 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +147 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementView.kt +164 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementViewManager.kt +65 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +60 -31
- package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +17 -5
- package/android/src/main/java/com/reactnativestripesdk/StripeConnectDeepLinkInterceptorActivity.kt +77 -0
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +334 -24
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +3 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +8 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +0 -2
- package/android/src/main/res/xml/file_paths.xml +4 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/PaymentMethodMessagingElementViewManagerDelegate.java +36 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/PaymentMethodMessagingElementViewManagerInterface.java +18 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +20 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentElementConfigTest.kt +175 -1
- package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +543 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentSheetManagerTest.kt +70 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingView.swift +13 -19
- package/ios/CustomerSheet/CustomerSheetUtils.swift +4 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.h +2 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.m +13 -1
- package/ios/PaymentMethodMessagingElementConfig.swift +116 -0
- package/ios/PaymentMethodMessagingElementHandler.m +9 -0
- package/ios/PaymentMethodMessagingElementView.swift +139 -0
- package/ios/StripeSdk.mm +40 -0
- package/ios/StripeSdkEmitter.swift +2 -0
- package/ios/StripeSdkImpl+CustomerSheet.swift +1 -0
- package/ios/StripeSdkImpl+Embedded.swift +8 -1
- package/ios/StripeSdkImpl+PaymentSheet.swift +44 -1
- package/ios/StripeSdkImpl.swift +158 -2
- package/jest/mock.js +26 -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 +10 -5
- 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/connect/analytics/AnalyticsClient.js +2 -0
- package/lib/commonjs/connect/analytics/AnalyticsClient.js.map +1 -0
- package/lib/commonjs/connect/analytics/ComponentAnalyticsClient.js +2 -0
- package/lib/commonjs/connect/analytics/ComponentAnalyticsClient.js.map +1 -0
- package/lib/commonjs/connect/analytics/events.js +2 -0
- package/lib/commonjs/connect/analytics/events.js.map +1 -0
- package/lib/commonjs/connect/testUtils.js +2 -0
- package/lib/commonjs/connect/testUtils.js.map +1 -0
- package/lib/commonjs/events.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.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/NativePaymentMethodMessagingElement.js +2 -0
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js.map +1 -0
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/types/Errors.js +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/FinancialConnections.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/components/PaymentMethodMessagingElementComponent.js +2 -0
- package/lib/commonjs/types/components/PaymentMethodMessagingElementComponent.js.map +1 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/components/AddToWalletButton.js +1 -1
- package/lib/module/components/AddToWalletButton.js.map +1 -1
- package/lib/module/components/AddressSheet.js +1 -1
- package/lib/module/components/AddressSheet.js.map +1 -1
- package/lib/module/components/AuBECSDebitForm.js +1 -1
- package/lib/module/components/AuBECSDebitForm.js.map +1 -1
- package/lib/module/components/CardField.js +1 -1
- package/lib/module/components/CardField.js.map +1 -1
- package/lib/module/components/CardForm.js +1 -1
- package/lib/module/components/CardForm.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/components/StripeContainer.js +1 -1
- package/lib/module/components/StripeContainer.js.map +1 -1
- package/lib/module/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 +10 -5
- 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/connect/analytics/AnalyticsClient.js +2 -0
- package/lib/module/connect/analytics/AnalyticsClient.js.map +1 -0
- package/lib/module/connect/analytics/ComponentAnalyticsClient.js +2 -0
- package/lib/module/connect/analytics/ComponentAnalyticsClient.js.map +1 -0
- package/lib/module/connect/analytics/events.js +2 -0
- package/lib/module/connect/analytics/events.js.map +1 -0
- package/lib/module/connect/testUtils.js +2 -0
- package/lib/module/connect/testUtils.js.map +1 -0
- package/lib/module/events.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.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/NativePaymentMethodMessagingElement.js +2 -0
- package/lib/module/specs/NativePaymentMethodMessagingElement.js.map +1 -0
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/Errors.js +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/FinancialConnections.js.map +1 -1
- package/lib/module/types/PaymentSheet.js +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/components/PaymentMethodMessagingElementComponent.js +2 -0
- package/lib/module/types/components/PaymentMethodMessagingElementComponent.js.map +1 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/connect/Components.d.ts +91 -0
- package/lib/typescript/src/connect/Components.d.ts.map +1 -1
- package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts +61 -0
- package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts.map +1 -1
- package/lib/typescript/src/connect/EmbeddedComponent.d.ts.map +1 -1
- package/lib/typescript/src/connect/analytics/AnalyticsClient.d.ts +32 -0
- package/lib/typescript/src/connect/analytics/AnalyticsClient.d.ts.map +1 -0
- package/lib/typescript/src/connect/analytics/ComponentAnalyticsClient.d.ts +94 -0
- package/lib/typescript/src/connect/analytics/ComponentAnalyticsClient.d.ts.map +1 -0
- package/lib/typescript/src/connect/analytics/events.d.ts +215 -0
- package/lib/typescript/src/connect/analytics/events.d.ts.map +1 -0
- 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/connect/testUtils.d.ts +45 -0
- package/lib/typescript/src/connect/testUtils.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +2 -0
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts +13 -1
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useStripe.d.ts +2 -1
- package/lib/typescript/src/hooks/useStripe.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts +16 -0
- package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +16 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/CustomerSheet.d.ts +5 -0
- package/lib/typescript/src/types/CustomerSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +11 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/Errors.d.ts +4 -0
- package/lib/typescript/src/types/Errors.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 +35 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts +69 -0
- package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +8 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/connect/Components.tsx +109 -11
- package/src/connect/ConnectComponentsProvider.tsx +69 -2
- package/src/connect/EmbeddedComponent.tsx +458 -23
- package/src/connect/analytics/AnalyticsClient.ts +75 -0
- package/src/connect/analytics/ComponentAnalyticsClient.ts +315 -0
- package/src/connect/analytics/events.ts +253 -0
- package/src/connect/connectTypes.ts +5 -1
- package/src/connect/testUtils.ts +37 -0
- package/src/events.ts +2 -0
- package/src/functions.ts +10 -0
- package/src/hooks/useStripe.tsx +8 -0
- package/src/specs/NativePaymentMethodMessagingElement.ts +25 -0
- package/src/specs/NativeStripeSdkModule.ts +21 -1
- package/src/types/CustomerSheet.ts +5 -0
- package/src/types/EmbeddedPaymentElement.tsx +11 -1
- package/src/types/Errors.ts +5 -0
- package/src/types/FinancialConnections.ts +2 -0
- package/src/types/PaymentSheet.ts +38 -1
- package/src/types/components/PaymentMethodMessagingElementComponent.tsx +74 -0
- package/src/types/index.ts +11 -0
- package/stripe-react-native.podspec +1 -1
|
@@ -5,9 +5,13 @@ import android.app.Activity
|
|
|
5
5
|
import android.app.Application
|
|
6
6
|
import android.content.Intent
|
|
7
7
|
import android.os.Bundle
|
|
8
|
+
import android.os.Handler
|
|
9
|
+
import android.os.Looper
|
|
8
10
|
import android.util.Log
|
|
9
11
|
import android.view.ViewGroup
|
|
12
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
10
13
|
import androidx.browser.customtabs.CustomTabsIntent
|
|
14
|
+
import androidx.core.net.toUri
|
|
11
15
|
import androidx.fragment.app.FragmentActivity
|
|
12
16
|
import com.facebook.react.ReactActivity
|
|
13
17
|
import com.facebook.react.bridge.Arguments
|
|
@@ -19,6 +23,7 @@ import com.facebook.react.bridge.ReadableArray
|
|
|
19
23
|
import com.facebook.react.bridge.ReadableMap
|
|
20
24
|
import com.facebook.react.bridge.UiThreadUtil
|
|
21
25
|
import com.facebook.react.bridge.WritableMap
|
|
26
|
+
import com.facebook.react.bridge.WritableNativeMap
|
|
22
27
|
import com.facebook.react.module.annotations.ReactModule
|
|
23
28
|
import com.reactnativestripesdk.addresssheet.AddressLauncherManager
|
|
24
29
|
import com.reactnativestripesdk.customersheet.CustomerSheetManager
|
|
@@ -63,6 +68,7 @@ import com.stripe.android.model.ConfirmPaymentIntentParams
|
|
|
63
68
|
import com.stripe.android.model.ConfirmSetupIntentParams
|
|
64
69
|
import com.stripe.android.model.PaymentIntent
|
|
65
70
|
import com.stripe.android.model.PaymentMethod
|
|
71
|
+
import com.stripe.android.model.RadarSession
|
|
66
72
|
import com.stripe.android.model.SetupIntent
|
|
67
73
|
import com.stripe.android.model.Token
|
|
68
74
|
import com.stripe.android.payments.bankaccount.CollectBankAccountConfiguration
|
|
@@ -106,6 +112,10 @@ class StripeSdkModule(
|
|
|
106
112
|
|
|
107
113
|
internal var composeCompatView: StripeAbstractComposeView.CompatView? = null
|
|
108
114
|
|
|
115
|
+
// Storage for pending stripe-connect:// deep link URLs to prevent Expo Router from receiving them
|
|
116
|
+
private val pendingStripeConnectUrls = mutableListOf<String>()
|
|
117
|
+
private val pendingUrlsLock = Any()
|
|
118
|
+
|
|
109
119
|
val eventEmitter: EventEmitterCompat by lazy { EventEmitterCompat(reactApplicationContext) }
|
|
110
120
|
|
|
111
121
|
private val mActivityEventListener =
|
|
@@ -128,11 +138,6 @@ class StripeSdkModule(
|
|
|
128
138
|
it,
|
|
129
139
|
)
|
|
130
140
|
createPlatformPayPaymentMethodPromise = null
|
|
131
|
-
} ?: run {
|
|
132
|
-
Log.d(
|
|
133
|
-
"StripeReactNative",
|
|
134
|
-
"No promise was found, Google Pay result went unhandled,",
|
|
135
|
-
)
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
143
|
}
|
|
@@ -179,14 +184,38 @@ class StripeSdkModule(
|
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
@SuppressLint("RestrictedApi")
|
|
182
|
-
override fun getTypedExportedConstants()
|
|
183
|
-
|
|
187
|
+
override fun getTypedExportedConstants(): Map<String, Any> {
|
|
188
|
+
val packageInfo =
|
|
189
|
+
try {
|
|
190
|
+
reactApplicationContext.packageManager.getPackageInfo(
|
|
191
|
+
reactApplicationContext.packageName,
|
|
192
|
+
0,
|
|
193
|
+
)
|
|
194
|
+
} catch (e: Exception) {
|
|
195
|
+
null
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return mapOf(
|
|
184
199
|
"API_VERSIONS" to
|
|
185
200
|
mapOf(
|
|
186
201
|
"CORE" to ApiVersion.API_VERSION_CODE,
|
|
187
202
|
"ISSUING" to PushProvisioningProxy.getApiVersion(),
|
|
188
203
|
),
|
|
204
|
+
"SYSTEM_INFO" to
|
|
205
|
+
mapOf(
|
|
206
|
+
"sdkVersion" to STRIPE_ANDROID_SDK_VERSION,
|
|
207
|
+
"osVersion" to android.os.Build.VERSION.RELEASE,
|
|
208
|
+
"deviceType" to "${android.os.Build.MANUFACTURER} ${android.os.Build.MODEL}",
|
|
209
|
+
"appName" to (
|
|
210
|
+
reactApplicationContext.applicationInfo
|
|
211
|
+
.loadLabel(
|
|
212
|
+
reactApplicationContext.packageManager,
|
|
213
|
+
).toString()
|
|
214
|
+
),
|
|
215
|
+
"appVersion" to (packageInfo?.versionName ?: ""),
|
|
216
|
+
),
|
|
189
217
|
)
|
|
218
|
+
}
|
|
190
219
|
|
|
191
220
|
@ReactMethod
|
|
192
221
|
override fun initialise(
|
|
@@ -1072,6 +1101,10 @@ class StripeSdkModule(
|
|
|
1072
1101
|
promise.resolve(createMissingInitError())
|
|
1073
1102
|
return
|
|
1074
1103
|
}
|
|
1104
|
+
|
|
1105
|
+
// Use connectedAccountId from params if provided, otherwise fall back to global stripeAccountId
|
|
1106
|
+
val accountId = getValOr(params, "connectedAccountId", null) ?: stripeAccountId
|
|
1107
|
+
|
|
1075
1108
|
unregisterStripeUIManager(financialConnectionsSheetManager)
|
|
1076
1109
|
financialConnectionsSheetManager =
|
|
1077
1110
|
FinancialConnectionsSheetManager(
|
|
@@ -1079,7 +1112,7 @@ class StripeSdkModule(
|
|
|
1079
1112
|
clientSecret,
|
|
1080
1113
|
FinancialConnectionsSheetManager.Mode.ForToken,
|
|
1081
1114
|
publishableKey,
|
|
1082
|
-
|
|
1115
|
+
accountId,
|
|
1083
1116
|
).also {
|
|
1084
1117
|
registerStripeUIManager(it)
|
|
1085
1118
|
it.present(promise)
|
|
@@ -1097,6 +1130,9 @@ class StripeSdkModule(
|
|
|
1097
1130
|
return
|
|
1098
1131
|
}
|
|
1099
1132
|
|
|
1133
|
+
// Use connectedAccountId from params if provided, otherwise fall back to global stripeAccountId
|
|
1134
|
+
val accountId = getValOr(params, "connectedAccountId", null) ?: stripeAccountId
|
|
1135
|
+
|
|
1100
1136
|
unregisterStripeUIManager(financialConnectionsSheetManager)
|
|
1101
1137
|
financialConnectionsSheetManager =
|
|
1102
1138
|
FinancialConnectionsSheetManager(
|
|
@@ -1104,7 +1140,7 @@ class StripeSdkModule(
|
|
|
1104
1140
|
clientSecret,
|
|
1105
1141
|
FinancialConnectionsSheetManager.Mode.ForSession,
|
|
1106
1142
|
publishableKey,
|
|
1107
|
-
|
|
1143
|
+
accountId,
|
|
1108
1144
|
).also {
|
|
1109
1145
|
registerStripeUIManager(it)
|
|
1110
1146
|
it.present(promise)
|
|
@@ -1293,6 +1329,31 @@ class StripeSdkModule(
|
|
|
1293
1329
|
}
|
|
1294
1330
|
}
|
|
1295
1331
|
|
|
1332
|
+
@ReactMethod
|
|
1333
|
+
override fun createRadarSession(promise: Promise) {
|
|
1334
|
+
if (!::stripe.isInitialized) {
|
|
1335
|
+
promise.resolve(createMissingInitError())
|
|
1336
|
+
return
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
stripe.createRadarSession(
|
|
1340
|
+
stripeAccountId = stripeAccountId,
|
|
1341
|
+
callback =
|
|
1342
|
+
object : com.stripe.android.ApiResultCallback<RadarSession> {
|
|
1343
|
+
override fun onSuccess(session: RadarSession) {
|
|
1344
|
+
val result = WritableNativeMap()
|
|
1345
|
+
result.putString("id", session.id)
|
|
1346
|
+
promise.resolve(result)
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
override fun onError(e: Exception) {
|
|
1350
|
+
promise.resolve(createError(ErrorType.Failed.toString(), e))
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
activity = getCurrentActivityOrResolveWithError(promise) as? AppCompatActivity,
|
|
1354
|
+
)
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1296
1357
|
@ReactMethod
|
|
1297
1358
|
override fun createEmbeddedPaymentElement(
|
|
1298
1359
|
intentConfig: ReadableMap,
|
|
@@ -1340,11 +1401,12 @@ class StripeSdkModule(
|
|
|
1340
1401
|
url: String,
|
|
1341
1402
|
promise: Promise,
|
|
1342
1403
|
) {
|
|
1404
|
+
isAuthWebViewActive = true
|
|
1343
1405
|
val activity = getCurrentActivityOrResolveWithError(promise) ?: return
|
|
1344
1406
|
|
|
1345
1407
|
UiThreadUtil.runOnUiThread {
|
|
1346
1408
|
try {
|
|
1347
|
-
val uri =
|
|
1409
|
+
val uri = url.toUri()
|
|
1348
1410
|
val builder =
|
|
1349
1411
|
androidx.browser.customtabs.CustomTabsIntent
|
|
1350
1412
|
.Builder()
|
|
@@ -1355,18 +1417,214 @@ class StripeSdkModule(
|
|
|
1355
1417
|
|
|
1356
1418
|
val customTabsIntent = builder.build()
|
|
1357
1419
|
|
|
1420
|
+
// NOTE: We intentionally do NOT use FLAG_ACTIVITY_NO_HISTORY here.
|
|
1421
|
+
// That flag can cause React Native's state restoration to fail when returning from Custom Tabs,
|
|
1422
|
+
// resulting in the navigation stack being reset and the previous screen being dismissed.
|
|
1423
|
+
// Custom Tabs will be properly cleaned up when the user navigates back or the session completes.
|
|
1424
|
+
|
|
1358
1425
|
// Note: Custom Tabs doesn't have built-in redirect handling like iOS ASWebAuthenticationSession.
|
|
1359
1426
|
// The redirect will be handled via deep linking when the auth server redirects to stripe-connect://
|
|
1360
1427
|
// The React Native Linking module will capture the deep link and pass it back to the JS layer.
|
|
1361
1428
|
customTabsIntent.launchUrl(activity, uri)
|
|
1362
1429
|
|
|
1430
|
+
// Fallback: Reset after timeout if JavaScript doesn't call authWebViewDeepLinkHandled
|
|
1431
|
+
Handler(Looper.getMainLooper()).postDelayed({
|
|
1432
|
+
if (isAuthWebViewActive) {
|
|
1433
|
+
isAuthWebViewActive = false
|
|
1434
|
+
}
|
|
1435
|
+
}, AUTH_WEBVIEW_FALLBACK_TIMEOUT_MS)
|
|
1436
|
+
|
|
1363
1437
|
promise.resolve(null)
|
|
1364
1438
|
} catch (e: Exception) {
|
|
1439
|
+
isAuthWebViewActive = false
|
|
1365
1440
|
promise.resolve(createError("Failed", e))
|
|
1366
1441
|
}
|
|
1367
1442
|
}
|
|
1368
1443
|
}
|
|
1369
1444
|
|
|
1445
|
+
@ReactMethod
|
|
1446
|
+
override fun downloadAndShareFile(
|
|
1447
|
+
url: String,
|
|
1448
|
+
filename: String?,
|
|
1449
|
+
promise: Promise,
|
|
1450
|
+
) {
|
|
1451
|
+
CoroutineScope(Dispatchers.IO).launch {
|
|
1452
|
+
try {
|
|
1453
|
+
// Download file
|
|
1454
|
+
val client = okhttp3.OkHttpClient()
|
|
1455
|
+
val request =
|
|
1456
|
+
okhttp3.Request
|
|
1457
|
+
.Builder()
|
|
1458
|
+
.url(url)
|
|
1459
|
+
.build()
|
|
1460
|
+
val response = client.newCall(request).execute()
|
|
1461
|
+
|
|
1462
|
+
if (!response.isSuccessful) {
|
|
1463
|
+
promise.resolve(
|
|
1464
|
+
Arguments.createMap().apply {
|
|
1465
|
+
putBoolean("success", false)
|
|
1466
|
+
putString("error", "NetworkError")
|
|
1467
|
+
putString("message", "HTTP ${response.code}")
|
|
1468
|
+
},
|
|
1469
|
+
)
|
|
1470
|
+
return@launch
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
// Save to cache directory
|
|
1474
|
+
val exportsDir = java.io.File(reactApplicationContext.cacheDir, "stripe-exports")
|
|
1475
|
+
exportsDir.mkdirs()
|
|
1476
|
+
|
|
1477
|
+
val file = java.io.File(exportsDir, "export-${java.util.UUID.randomUUID()}.csv")
|
|
1478
|
+
|
|
1479
|
+
response.body?.byteStream()?.use { input ->
|
|
1480
|
+
file.outputStream().use { output ->
|
|
1481
|
+
input.copyTo(output)
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
// Share on main thread
|
|
1486
|
+
UiThreadUtil.runOnUiThread {
|
|
1487
|
+
shareFile(file, promise)
|
|
1488
|
+
}
|
|
1489
|
+
} catch (e: Exception) {
|
|
1490
|
+
promise.resolve(
|
|
1491
|
+
Arguments.createMap().apply {
|
|
1492
|
+
putBoolean("success", false)
|
|
1493
|
+
putString("error", "DownloadFailed")
|
|
1494
|
+
putString("message", e.message ?: "Unknown error")
|
|
1495
|
+
},
|
|
1496
|
+
)
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
private fun shareFile(
|
|
1502
|
+
file: java.io.File,
|
|
1503
|
+
promise: Promise,
|
|
1504
|
+
) {
|
|
1505
|
+
val activity = reactApplicationContext.getCurrentActivity()
|
|
1506
|
+
if (activity == null) {
|
|
1507
|
+
promise.resolve(
|
|
1508
|
+
Arguments.createMap().apply {
|
|
1509
|
+
putBoolean("success", false)
|
|
1510
|
+
putString("error", "NoActivity")
|
|
1511
|
+
putString("message", "No activity available")
|
|
1512
|
+
},
|
|
1513
|
+
)
|
|
1514
|
+
return
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
try {
|
|
1518
|
+
val uri =
|
|
1519
|
+
androidx.core.content.FileProvider.getUriForFile(
|
|
1520
|
+
reactApplicationContext,
|
|
1521
|
+
"${reactApplicationContext.packageName}.stripe.fileprovider",
|
|
1522
|
+
file,
|
|
1523
|
+
)
|
|
1524
|
+
|
|
1525
|
+
val shareIntent =
|
|
1526
|
+
Intent(Intent.ACTION_SEND).apply {
|
|
1527
|
+
type = "text/csv"
|
|
1528
|
+
putExtra(Intent.EXTRA_STREAM, uri)
|
|
1529
|
+
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
val chooser = Intent.createChooser(shareIntent, "Share CSV Export")
|
|
1533
|
+
activity.startActivity(chooser)
|
|
1534
|
+
|
|
1535
|
+
// Schedule cleanup
|
|
1536
|
+
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
|
|
1537
|
+
file.delete()
|
|
1538
|
+
}, 3000)
|
|
1539
|
+
|
|
1540
|
+
promise.resolve(
|
|
1541
|
+
Arguments.createMap().apply {
|
|
1542
|
+
putBoolean("success", true)
|
|
1543
|
+
},
|
|
1544
|
+
)
|
|
1545
|
+
} catch (e: Exception) {
|
|
1546
|
+
promise.resolve(
|
|
1547
|
+
Arguments.createMap().apply {
|
|
1548
|
+
putBoolean("success", false)
|
|
1549
|
+
putString("error", "ShareFailed")
|
|
1550
|
+
putString("message", e.message ?: "Unknown error")
|
|
1551
|
+
},
|
|
1552
|
+
)
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
@ReactMethod
|
|
1557
|
+
override fun authWebViewDeepLinkHandled(
|
|
1558
|
+
id: String,
|
|
1559
|
+
promise: Promise,
|
|
1560
|
+
) {
|
|
1561
|
+
isAuthWebViewActive = false
|
|
1562
|
+
promise.resolve(null)
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
/**
|
|
1566
|
+
* Store a stripe-connect:// deep link URL for later retrieval.
|
|
1567
|
+
* This prevents the URL from being broadcast to Expo Router.
|
|
1568
|
+
*/
|
|
1569
|
+
@ReactMethod
|
|
1570
|
+
override fun storeStripeConnectDeepLink(
|
|
1571
|
+
url: String,
|
|
1572
|
+
promise: Promise,
|
|
1573
|
+
) {
|
|
1574
|
+
synchronized(pendingUrlsLock) {
|
|
1575
|
+
pendingStripeConnectUrls.add(url)
|
|
1576
|
+
}
|
|
1577
|
+
promise.resolve(null)
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
/**
|
|
1581
|
+
* Poll for pending stripe-connect:// deep link URLs.
|
|
1582
|
+
* Returns all pending URLs and clears the queue.
|
|
1583
|
+
*
|
|
1584
|
+
* URLs are captured by StripeConnectDeepLinkInterceptor Activity, which prevents
|
|
1585
|
+
* Expo Router from receiving the URLs and dismissing the current screen.
|
|
1586
|
+
*/
|
|
1587
|
+
@ReactMethod
|
|
1588
|
+
override fun pollAndClearPendingStripeConnectUrls(promise: Promise) {
|
|
1589
|
+
try {
|
|
1590
|
+
val urlsArray = Arguments.createArray()
|
|
1591
|
+
|
|
1592
|
+
// Get URLs from SDK's internal storage (set by StripeConnectDeepLinkInterceptor)
|
|
1593
|
+
val sdkUrls = retrieveAndClearPendingUrls()
|
|
1594
|
+
sdkUrls.forEach { url ->
|
|
1595
|
+
urlsArray.pushString(url)
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
// Legacy: Support old MainActivity pattern (deprecated, will be removed in future version)
|
|
1599
|
+
// This maintains backward compatibility for apps that implemented the manual pattern
|
|
1600
|
+
try {
|
|
1601
|
+
val mainActivityClass = Class.forName("com.stripe.examplestripeconnect.MainActivity")
|
|
1602
|
+
val getPendingUrlsMethod = mainActivityClass.getMethod("getPendingUrls")
|
|
1603
|
+
|
|
1604
|
+
@Suppress("UNCHECKED_CAST")
|
|
1605
|
+
val mainActivityUrls = getPendingUrlsMethod.invoke(null) as? List<String>
|
|
1606
|
+
if (!mainActivityUrls.isNullOrEmpty()) {
|
|
1607
|
+
Log.w(
|
|
1608
|
+
TAG,
|
|
1609
|
+
"Using deprecated MainActivity.getPendingUrls() pattern. " +
|
|
1610
|
+
"This pattern is no longer needed and will be removed in a future version. " +
|
|
1611
|
+
"The SDK now handles stripe-connect:// URLs automatically.",
|
|
1612
|
+
)
|
|
1613
|
+
mainActivityUrls.forEach { url ->
|
|
1614
|
+
urlsArray.pushString(url)
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
} catch (e: Exception) {
|
|
1618
|
+
// Expected when not using deprecated pattern - this is fine
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
promise.resolve(urlsArray)
|
|
1622
|
+
} catch (e: Exception) {
|
|
1623
|
+
Log.e(TAG, "Error polling URLs", e)
|
|
1624
|
+
promise.reject("PollError", "Failed to poll pending Stripe Connect URLs: ${e.message}", e)
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1370
1628
|
override fun addListener(eventType: String?) {
|
|
1371
1629
|
// noop, iOS only
|
|
1372
1630
|
}
|
|
@@ -1422,40 +1680,49 @@ class StripeSdkModule(
|
|
|
1422
1680
|
}
|
|
1423
1681
|
|
|
1424
1682
|
private var isRecreatingReactActivity = false
|
|
1683
|
+
private var isAuthWebViewActive = false
|
|
1425
1684
|
private val activityLifecycleCallbacks =
|
|
1426
1685
|
object : Application.ActivityLifecycleCallbacks {
|
|
1427
1686
|
override fun onActivityCreated(
|
|
1428
1687
|
activity: Activity,
|
|
1429
1688
|
bundle: Bundle?,
|
|
1430
1689
|
) {
|
|
1431
|
-
|
|
1690
|
+
// Only set flag when ReactActivity is actually being recreated (bundle != null)
|
|
1691
|
+
// bundle != null means this is a recreation, not first creation
|
|
1692
|
+
if (activity is ReactActivity && bundle != null) {
|
|
1432
1693
|
isRecreatingReactActivity = true
|
|
1433
1694
|
}
|
|
1434
|
-
|
|
1695
|
+
|
|
1696
|
+
// Don't finish Stripe activities during auth webview flow to prevent dismissing the previous screen
|
|
1697
|
+
val isStripeActivity = activity.javaClass.name.startsWith("com.stripe.android")
|
|
1698
|
+
val shouldFinish = isRecreatingReactActivity && isStripeActivity && !isAuthWebViewActive
|
|
1699
|
+
|
|
1700
|
+
if (shouldFinish) {
|
|
1435
1701
|
activity.finish()
|
|
1436
1702
|
}
|
|
1437
|
-
}
|
|
1438
1703
|
|
|
1439
|
-
|
|
1704
|
+
// Reset flag after finishing Stripe activities
|
|
1705
|
+
if (isRecreatingReactActivity && shouldFinish) {
|
|
1706
|
+
Handler(Looper.getMainLooper()).post {
|
|
1707
|
+
isRecreatingReactActivity = false
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1440
1710
|
}
|
|
1441
1711
|
|
|
1442
|
-
override fun
|
|
1443
|
-
}
|
|
1712
|
+
override fun onActivityStarted(activity: Activity) {}
|
|
1444
1713
|
|
|
1445
|
-
override fun
|
|
1446
|
-
}
|
|
1714
|
+
override fun onActivityResumed(activity: Activity) {}
|
|
1447
1715
|
|
|
1448
|
-
override fun
|
|
1449
|
-
|
|
1716
|
+
override fun onActivityPaused(activity: Activity) {}
|
|
1717
|
+
|
|
1718
|
+
override fun onActivityStopped(activity: Activity) {}
|
|
1450
1719
|
|
|
1451
1720
|
override fun onActivitySaveInstanceState(
|
|
1452
1721
|
activity: Activity,
|
|
1453
1722
|
bundle: Bundle,
|
|
1454
|
-
) {
|
|
1455
|
-
}
|
|
1723
|
+
) {}
|
|
1456
1724
|
|
|
1457
|
-
override fun onActivityDestroyed(activity: Activity) {
|
|
1458
|
-
}
|
|
1725
|
+
override fun onActivityDestroyed(activity: Activity) {}
|
|
1459
1726
|
}
|
|
1460
1727
|
|
|
1461
1728
|
/**
|
|
@@ -1484,5 +1751,48 @@ class StripeSdkModule(
|
|
|
1484
1751
|
|
|
1485
1752
|
companion object {
|
|
1486
1753
|
const val NAME = NativeStripeSdkModuleSpec.NAME
|
|
1754
|
+
private const val TAG = "StripeSdkModule"
|
|
1755
|
+
|
|
1756
|
+
// Read the Stripe Android SDK version from gradle.properties at build time
|
|
1757
|
+
private val STRIPE_ANDROID_SDK_VERSION = BuildConfig.STRIPE_ANDROID_SDK_VERSION
|
|
1758
|
+
|
|
1759
|
+
// Timeout for auth webview fallback (if JavaScript doesn't call authWebViewDeepLinkHandled)
|
|
1760
|
+
private const val AUTH_WEBVIEW_FALLBACK_TIMEOUT_MS = 60_000L
|
|
1761
|
+
|
|
1762
|
+
// SDK-managed storage for pending stripe-connect:// URLs
|
|
1763
|
+
// This is static because deep links can arrive before ReactContext is available
|
|
1764
|
+
private val pendingConnectUrls = mutableListOf<String>()
|
|
1765
|
+
private val urlsLock = Any()
|
|
1766
|
+
|
|
1767
|
+
/**
|
|
1768
|
+
* Store a stripe-connect:// deep link URL.
|
|
1769
|
+
* Called automatically by StripeConnectDeepLinkInterceptor.
|
|
1770
|
+
* Can also be called manually from MainActivity if users implement custom handling.
|
|
1771
|
+
*
|
|
1772
|
+
* This method is thread-safe and can be called from any thread.
|
|
1773
|
+
*
|
|
1774
|
+
* @param url The stripe-connect:// URL to store
|
|
1775
|
+
*/
|
|
1776
|
+
@JvmStatic
|
|
1777
|
+
fun storeStripeConnectDeepLink(url: String) {
|
|
1778
|
+
synchronized(urlsLock) {
|
|
1779
|
+
pendingConnectUrls.add(url)
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* Retrieve and clear pending URLs.
|
|
1785
|
+
* Internal method used by pollAndClearPendingStripeConnectUrls() bridge method.
|
|
1786
|
+
*
|
|
1787
|
+
* @return List of pending stripe-connect:// URLs
|
|
1788
|
+
*/
|
|
1789
|
+
@JvmStatic
|
|
1790
|
+
internal fun retrieveAndClearPendingUrls(): List<String> {
|
|
1791
|
+
synchronized(urlsLock) {
|
|
1792
|
+
val urls = pendingConnectUrls.toList()
|
|
1793
|
+
pendingConnectUrls.clear()
|
|
1794
|
+
return urls
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1487
1797
|
}
|
|
1488
1798
|
}
|
|
@@ -60,6 +60,7 @@ class StripeSdkPackage : BaseReactPackage() {
|
|
|
60
60
|
AddressSheetViewManager(),
|
|
61
61
|
EmbeddedPaymentElementViewManager(),
|
|
62
62
|
NavigationBarManager(),
|
|
63
|
+
PaymentMethodMessagingElementViewManager(),
|
|
63
64
|
)
|
|
64
65
|
|
|
65
66
|
private fun getOnrampModuleClass(): Class<out NativeModule?> {
|
package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt
CHANGED
|
@@ -64,6 +64,8 @@ class CustomerSheetManager(
|
|
|
64
64
|
val billingConfigParams = arguments.getMap("billingDetailsCollectionConfiguration")
|
|
65
65
|
val allowsRemovalOfLastSavedPaymentMethod =
|
|
66
66
|
arguments.getBooleanOr("allowsRemovalOfLastSavedPaymentMethod", true)
|
|
67
|
+
val opensCardScannerAutomatically =
|
|
68
|
+
arguments.getBooleanOr("opensCardScannerAutomatically", false)
|
|
67
69
|
val paymentMethodOrder = arguments.getStringList("paymentMethodOrder")
|
|
68
70
|
|
|
69
71
|
val appearance =
|
|
@@ -83,6 +85,7 @@ class CustomerSheetManager(
|
|
|
83
85
|
.preferredNetworks(
|
|
84
86
|
mapToPreferredNetworks(arguments.getIntegerList("preferredNetworks")),
|
|
85
87
|
).allowsRemovalOfLastSavedPaymentMethod(allowsRemovalOfLastSavedPaymentMethod)
|
|
88
|
+
.opensCardScannerAutomatically(opensCardScannerAutomatically)
|
|
86
89
|
.cardBrandAcceptance(mapToCardBrandAcceptance(arguments))
|
|
87
90
|
|
|
88
91
|
paymentMethodOrder?.let { configuration.paymentMethodOrder(it) }
|
|
@@ -58,6 +58,14 @@ class PaymentSheetException(
|
|
|
58
58
|
message: String,
|
|
59
59
|
) : Exception(message)
|
|
60
60
|
|
|
61
|
+
class PaymentMethodMessagingElementAppearanceException(
|
|
62
|
+
message: String,
|
|
63
|
+
) : Exception(message)
|
|
64
|
+
|
|
65
|
+
class PaymentMethodMessagingElementConfigurationException(
|
|
66
|
+
message: String,
|
|
67
|
+
) : Exception(message)
|
|
68
|
+
|
|
61
69
|
internal fun mapError(
|
|
62
70
|
code: String,
|
|
63
71
|
message: String?,
|
|
@@ -25,7 +25,6 @@ import com.stripe.android.model.StripeIntent
|
|
|
25
25
|
import com.stripe.android.model.StripeIntent.NextActionData
|
|
26
26
|
import com.stripe.android.model.StripeIntent.NextActionType
|
|
27
27
|
import com.stripe.android.model.Token
|
|
28
|
-
import com.stripe.android.paymentelement.ExperimentalCustomPaymentMethodsApi
|
|
29
28
|
import com.stripe.android.paymentsheet.PaymentSheet
|
|
30
29
|
import java.lang.IllegalArgumentException
|
|
31
30
|
|
|
@@ -1036,7 +1035,6 @@ private fun Map<String, Any?>.toReadableMap(): ReadableMap {
|
|
|
1036
1035
|
return writableMap
|
|
1037
1036
|
}
|
|
1038
1037
|
|
|
1039
|
-
@OptIn(ExperimentalCustomPaymentMethodsApi::class)
|
|
1040
1038
|
@SuppressLint("RestrictedApi")
|
|
1041
1039
|
internal fun parseCustomPaymentMethods(customPaymentMethodConfig: ReadableMap?): List<PaymentSheet.CustomPaymentMethod> {
|
|
1042
1040
|
if (customPaymentMethodConfig == null) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.bridge.DynamicFromObject;
|
|
15
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
16
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
17
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
18
|
+
|
|
19
|
+
public class PaymentMethodMessagingElementViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PaymentMethodMessagingElementViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
20
|
+
public PaymentMethodMessagingElementViewManagerDelegate(U viewManager) {
|
|
21
|
+
super(viewManager);
|
|
22
|
+
}
|
|
23
|
+
@Override
|
|
24
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
25
|
+
switch (propName) {
|
|
26
|
+
case "appearance":
|
|
27
|
+
mViewManager.setAppearance(view, new DynamicFromObject(value));
|
|
28
|
+
break;
|
|
29
|
+
case "configuration":
|
|
30
|
+
mViewManager.setConfiguration(view, new DynamicFromObject(value));
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
super.setProperty(view, propName, value);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import com.facebook.react.bridge.Dynamic;
|
|
14
|
+
|
|
15
|
+
public interface PaymentMethodMessagingElementViewManagerInterface<T extends View> {
|
|
16
|
+
void setAppearance(T view, Dynamic value);
|
|
17
|
+
void setConfiguration(T view, Dynamic value);
|
|
18
|
+
}
|
|
@@ -272,6 +272,22 @@ public abstract class NativeStripeSdkModuleSpec extends ReactContextBaseJavaModu
|
|
|
272
272
|
@DoNotStrip
|
|
273
273
|
public abstract void openAuthenticatedWebView(String id, String url, Promise promise);
|
|
274
274
|
|
|
275
|
+
@ReactMethod
|
|
276
|
+
@DoNotStrip
|
|
277
|
+
public abstract void downloadAndShareFile(String url, @Nullable String filename, Promise promise);
|
|
278
|
+
|
|
279
|
+
@ReactMethod
|
|
280
|
+
@DoNotStrip
|
|
281
|
+
public abstract void authWebViewDeepLinkHandled(String id, Promise promise);
|
|
282
|
+
|
|
283
|
+
@ReactMethod
|
|
284
|
+
@DoNotStrip
|
|
285
|
+
public abstract void storeStripeConnectDeepLink(String url, Promise promise);
|
|
286
|
+
|
|
287
|
+
@ReactMethod
|
|
288
|
+
@DoNotStrip
|
|
289
|
+
public abstract void pollAndClearPendingStripeConnectUrls(Promise promise);
|
|
290
|
+
|
|
275
291
|
@ReactMethod
|
|
276
292
|
@DoNotStrip
|
|
277
293
|
public abstract void addListener(String eventType);
|
|
@@ -279,4 +295,8 @@ public abstract class NativeStripeSdkModuleSpec extends ReactContextBaseJavaModu
|
|
|
279
295
|
@ReactMethod
|
|
280
296
|
@DoNotStrip
|
|
281
297
|
public abstract void removeListeners(double count);
|
|
298
|
+
|
|
299
|
+
@ReactMethod
|
|
300
|
+
@DoNotStrip
|
|
301
|
+
public abstract void createRadarSession(Promise promise);
|
|
282
302
|
}
|