Skip to content

Commit 130ac95

Browse files
lng-stripeTwigz
andauthored
[onramp] Configure with crypto customer ID (#2138)
* don't recreate OnrampCoordinator * add cryptoCustomerId configuration param * Adds the cryptoCostumerId parameter to onramp coordinator creation * Update iOS SDK, fix typo * bump android 21.27.0 --------- Co-authored-by: Twig <aharris.1990@gmail.com>
1 parent e718aca commit 130ac95

File tree

6 files changed

+73
-72
lines changed

6 files changed

+73
-72
lines changed

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ StripeSdk_compileSdkVersion=30
33
StripeSdk_targetSdkVersion=28
44
StripeSdk_minSdkVersion=21
55
# Keep StripeSdk_stripeVersion in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/android/gradle.properties
6-
StripeSdk_stripeVersion=21.26.0
6+
StripeSdk_stripeVersion=21.27.0

android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ class OnrampSdkModule(
104104
config: ReadableMap,
105105
promise: Promise,
106106
) {
107-
if (onrampCoordinator != null && onrampPresenter != null) {
108-
promise.resolveVoid()
109-
return
110-
}
111-
112107
val application =
113108
currentActivity?.application ?: (reactApplicationContext.applicationContext as? Application)
114109
if (application == null) {
@@ -117,7 +112,7 @@ class OnrampSdkModule(
117112
}
118113

119114
val coordinator =
120-
OnrampCoordinator
115+
onrampCoordinator ?: OnrampCoordinator
121116
.Builder()
122117
.build(application, SavedStateHandle())
123118
.also { this.onrampCoordinator = it }
@@ -133,12 +128,14 @@ class OnrampSdkModule(
133128

134129
val displayName = config.getString("merchantDisplayName") ?: ""
135130

131+
val cryptoCustomerId = config.getString("cryptoCustomerId")
132+
136133
val configuration =
137134
OnrampConfiguration(
138135
merchantDisplayName = displayName,
139136
publishableKey = publishableKey,
140-
stripeAccountId = stripeAccountId,
141137
appearance = appearance,
138+
cryptoCustomerId = cryptoCustomerId,
142139
)
143140

144141
val configureResult = coordinator.configure(configuration)

example/ios/Podfile.lock

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,12 +1685,12 @@ PODS:
16851685
- ReactCommon/turbomodule/core
16861686
- Yoga
16871687
- SocketRocket (0.7.1)
1688-
- Stripe (24.23.1):
1689-
- StripeApplePay (= 24.23.1)
1690-
- StripeCore (= 24.23.1)
1691-
- StripePayments (= 24.23.1)
1692-
- StripePaymentsUI (= 24.23.1)
1693-
- StripeUICore (= 24.23.1)
1688+
- Stripe (24.24.0):
1689+
- StripeApplePay (= 24.24.0)
1690+
- StripeCore (= 24.24.0)
1691+
- StripePayments (= 24.24.0)
1692+
- StripePaymentsUI (= 24.24.0)
1693+
- StripeUICore (= 24.24.0)
16941694
- stripe-react-native (0.51.0):
16951695
- DoubleConversion
16961696
- glog
@@ -1734,12 +1734,12 @@ PODS:
17341734
- ReactCodegen
17351735
- ReactCommon/turbomodule/bridging
17361736
- ReactCommon/turbomodule/core
1737-
- Stripe (~> 24.23.1)
1738-
- StripeApplePay (~> 24.23.1)
1739-
- StripeFinancialConnections (~> 24.23.1)
1740-
- StripePayments (~> 24.23.1)
1741-
- StripePaymentSheet (~> 24.23.1)
1742-
- StripePaymentsUI (~> 24.23.1)
1737+
- Stripe (~> 24.24.0)
1738+
- StripeApplePay (~> 24.24.0)
1739+
- StripeFinancialConnections (~> 24.24.0)
1740+
- StripePayments (~> 24.24.0)
1741+
- StripePaymentSheet (~> 24.24.0)
1742+
- StripePaymentsUI (~> 24.24.0)
17431743
- Yoga
17441744
- stripe-react-native/NewArch (0.51.0):
17451745
- DoubleConversion
@@ -1783,7 +1783,7 @@ PODS:
17831783
- ReactCommon/turbomodule/bridging
17841784
- ReactCommon/turbomodule/core
17851785
- stripe-react-native/Core
1786-
- StripeCryptoOnramp (~> 24.23.1)
1786+
- StripeCryptoOnramp (~> 24.24.0)
17871787
- Yoga
17881788
- stripe-react-native/Tests (0.51.0):
17891789
- DoubleConversion
@@ -1806,42 +1806,42 @@ PODS:
18061806
- ReactCommon/turbomodule/bridging
18071807
- ReactCommon/turbomodule/core
18081808
- Yoga
1809-
- StripeApplePay (24.23.1):
1810-
- StripeCore (= 24.23.1)
1811-
- StripeCameraCore (24.23.1):
1812-
- StripeCore (= 24.23.1)
1813-
- StripeCore (24.23.1)
1814-
- StripeCryptoOnramp (24.23.1):
1815-
- StripeApplePay (= 24.23.1)
1816-
- StripeCore (= 24.23.1)
1817-
- StripeIdentity (= 24.23.1)
1818-
- StripePayments (= 24.23.1)
1819-
- StripePaymentSheet (= 24.23.1)
1820-
- StripePaymentsUI (= 24.23.1)
1821-
- StripeUICore (= 24.23.1)
1822-
- StripeFinancialConnections (24.23.1):
1823-
- StripeCore (= 24.23.1)
1824-
- StripeUICore (= 24.23.1)
1825-
- StripeIdentity (24.23.1):
1826-
- StripeCameraCore (= 24.23.1)
1827-
- StripeCore (= 24.23.1)
1828-
- StripeUICore (= 24.23.1)
1829-
- StripePayments (24.23.1):
1830-
- StripeCore (= 24.23.1)
1831-
- StripePayments/Stripe3DS2 (= 24.23.1)
1832-
- StripePayments/Stripe3DS2 (24.23.1):
1833-
- StripeCore (= 24.23.1)
1834-
- StripePaymentSheet (24.23.1):
1835-
- StripeApplePay (= 24.23.1)
1836-
- StripeCore (= 24.23.1)
1837-
- StripePayments (= 24.23.1)
1838-
- StripePaymentsUI (= 24.23.1)
1839-
- StripePaymentsUI (24.23.1):
1840-
- StripeCore (= 24.23.1)
1841-
- StripePayments (= 24.23.1)
1842-
- StripeUICore (= 24.23.1)
1843-
- StripeUICore (24.23.1):
1844-
- StripeCore (= 24.23.1)
1809+
- StripeApplePay (24.24.0):
1810+
- StripeCore (= 24.24.0)
1811+
- StripeCameraCore (24.24.0):
1812+
- StripeCore (= 24.24.0)
1813+
- StripeCore (24.24.0)
1814+
- StripeCryptoOnramp (24.24.0):
1815+
- StripeApplePay (= 24.24.0)
1816+
- StripeCore (= 24.24.0)
1817+
- StripeIdentity (= 24.24.0)
1818+
- StripePayments (= 24.24.0)
1819+
- StripePaymentSheet (= 24.24.0)
1820+
- StripePaymentsUI (= 24.24.0)
1821+
- StripeUICore (= 24.24.0)
1822+
- StripeFinancialConnections (24.24.0):
1823+
- StripeCore (= 24.24.0)
1824+
- StripeUICore (= 24.24.0)
1825+
- StripeIdentity (24.24.0):
1826+
- StripeCameraCore (= 24.24.0)
1827+
- StripeCore (= 24.24.0)
1828+
- StripeUICore (= 24.24.0)
1829+
- StripePayments (24.24.0):
1830+
- StripeCore (= 24.24.0)
1831+
- StripePayments/Stripe3DS2 (= 24.24.0)
1832+
- StripePayments/Stripe3DS2 (24.24.0):
1833+
- StripeCore (= 24.24.0)
1834+
- StripePaymentSheet (24.24.0):
1835+
- StripeApplePay (= 24.24.0)
1836+
- StripeCore (= 24.24.0)
1837+
- StripePayments (= 24.24.0)
1838+
- StripePaymentsUI (= 24.24.0)
1839+
- StripePaymentsUI (24.24.0):
1840+
- StripeCore (= 24.24.0)
1841+
- StripePayments (= 24.24.0)
1842+
- StripeUICore (= 24.24.0)
1843+
- StripeUICore (24.24.0):
1844+
- StripeCore (= 24.24.0)
18451845
- Yoga (0.0.0)
18461846

18471847
DEPENDENCIES:
@@ -2160,19 +2160,19 @@ SPEC CHECKSUMS:
21602160
RNCPicker: cfb51a08c6e10357d9a65832e791825b0747b483
21612161
RNScreens: 0d4cb9afe052607ad0aa71f645a88bb7c7f2e64c
21622162
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
2163-
Stripe: 948b5ebd036f500c9ec51ae9ee6c8aa2b6bc0156
2164-
stripe-react-native: 1b94ee8d08759a89c45d92b8cda47d99ffe74d47
2165-
StripeApplePay: 6bfbe79124691915465418a153a9836f8e932e46
2166-
StripeCameraCore: f3cc4ff68f67bf7f0544eba67534d0d2e22a4f52
2167-
StripeCore: 0be322592533ce7bdecd73a1a1cdd0885e45f614
2168-
StripeCryptoOnramp: 121cb8837f8201a808fd4bad62741875eba3d512
2169-
StripeFinancialConnections: a592331f05c57611f2ef85b7645f7282b37326da
2170-
StripeIdentity: 10238e67da3055d58cdb556c508384114dc31467
2171-
StripePayments: 7f60cef4c470cedd37559e80f31317d6d983c346
2172-
StripePaymentSheet: ad829836486d856b9445cbe5a332038a517328f1
2173-
StripePaymentsUI: ff267b46ed98548c6be69702b880beef34924641
2174-
StripeUICore: 2840e4f8a32403b0cc7d4d0209e9b6aa168cb26a
2175-
Yoga: 9b7fb56e7b08cde60e2153344fa6afbd88e5d99f
2163+
Stripe: 64849211528185870444d8ca696eeab40bdcacce
2164+
stripe-react-native: 7e5254793501cbd2e11cd38a9f9da12208f31446
2165+
StripeApplePay: 1e65bbf41e4844a02b0dff60cb56c8d37261e53d
2166+
StripeCameraCore: e0b7d463d4d55b730675821c5c90ef1f3f7a528b
2167+
StripeCore: 63f2337bceb55db0095c5e29a61cfad33a61963c
2168+
StripeCryptoOnramp: e640a4f337bf6fccaa474e6d9ac5f340b341fbf9
2169+
StripeFinancialConnections: 2b2b2c9c0ed71ad22a038b3a4caf73ca5128dae2
2170+
StripeIdentity: adbca8ff3e2027b48f1d61453aca8e302b932b32
2171+
StripePayments: 7a994f28bedd16bc0e4eb9091d2811425adaa6af
2172+
StripePaymentSheet: 82477c8b000ba6446d2294106e3f4f96fc043ea8
2173+
StripePaymentsUI: 8302dfe8094abb32cd2e0998a5b601164216d9db
2174+
StripeUICore: defd03b91fd5fb2838c59284e697b8da9cef0db0
2175+
Yoga: afd04ff05ebe0121a00c468a8a3c8080221cb14c
21762176

21772177
PODFILE CHECKSUM: 0e8d697b2e2384b55c224afb61b755b153a2962a
21782178

ios/StripeSdkImpl.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,9 +1176,11 @@ public class StripeSdkImpl: NSObject, UIAdaptivePresentationControllerDelegate {
11761176
LinkAppearance()
11771177
}
11781178

1179+
let cryptoCustomerId = config["cryptoCustomerId"] as? String
1180+
11791181
Task {
11801182
do {
1181-
cryptoOnrampCoordinator = try await CryptoOnrampCoordinator.create(appearance: appearance)
1183+
cryptoOnrampCoordinator = try await CryptoOnrampCoordinator.create(appearance: appearance, cryptoCustomerID: cryptoCustomerId)
11821184
resolve([:]) // Return empty object on success
11831185
} catch {
11841186
let errorResult = Errors.createError(ErrorType.Failed, error)

src/types/Onramp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export type Configuration = {
1212
merchantDisplayName: string;
1313
/** Appearance overrides for Stripe-provided UI used during onramp. */
1414
appearance: LinkAppearance;
15+
/** The identifier of the Stripe crypto customer object. */
16+
cryptoCustomerId?: string;
1517
};
1618

1719
/**

stripe-react-native.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require 'json'
22

33
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
44
# Keep stripe_version in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/stripe-identity-react-native.podspec
5-
stripe_version = '~> 24.23.1'
5+
stripe_version = '~> 24.24.0'
66

77
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
88

0 commit comments

Comments
 (0)