Skip to content

Commit 01f3f2f

Browse files
mliberatoreTwigz
andauthored
CryptoOnramp: Minimal Migration to iOS SDK 25.0.0 (#2198)
* Updates to iOS 25.0.0 SDK * Removes giropay references * Fixes migration of `paymentMethodTypes: [NSNumber]` to `paymentMethodTypes: [STPPaymentMethodType]` Release notes: > [Changed] STPPaymentIntent.paymentMethodTypes and STPSetupIntent.paymentMethodTypes now return [STPPaymentMethodType] instead of [NSNumber] in Swift for better ergonomics. * Migrates `authorizationResultHandler` which now accepts one parameter and returns async by using a continuation. * Merge branch 'master' into 0.52.0-crypto-onramp-2-private-beta * Fix some @_spi imports * Fix placeholder function when not using onramp --------- Co-authored-by: Twig <[email protected]>
1 parent 6e6a308 commit 01f3f2f

File tree

6 files changed

+72
-87
lines changed

6 files changed

+72
-87
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Get started with our [📚 integration guides](https://stripe.com/docs/payments/
2323

2424
**Native UI**: We provide native screens and elements to securely collect payment details on Android and iOS.
2525

26-
**PaymentSheet**: [Learn how to integrate](https://stripe.com/docs/payments/accept-a-payment) PaymentSheet, our new pre-built payments UI for mobile apps. PaymentSheet lets you accept cards, Apple Pay, Google Pay, and much more out of the box and also supports saving & reusing payment methods. PaymentSheet currently accepts the following payment methods: Card, Apple Pay, Google Pay, SEPA Debit, Bancontact, Billie, iDEAL, EPS, P24, Afterpay/Clearpay, Klarna, Giropay, and ACH.
26+
**PaymentSheet**: [Learn how to integrate](https://stripe.com/docs/payments/accept-a-payment) PaymentSheet, our new pre-built payments UI for mobile apps. PaymentSheet lets you accept cards, Apple Pay, Google Pay, and much more out of the box and also supports saving & reusing payment methods. PaymentSheet currently accepts the following payment methods: Card, Apple Pay, Google Pay, SEPA Debit, Bancontact, Billie, iDEAL, EPS, P24, Afterpay/Clearpay, Klarna, and ACH.
2727

2828
#### Recommended usage
2929

example/ios/Podfile.lock

Lines changed: 61 additions & 61 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.25.0):
1689-
- StripeApplePay (= 24.25.0)
1690-
- StripeCore (= 24.25.0)
1691-
- StripePayments (= 24.25.0)
1692-
- StripePaymentsUI (= 24.25.0)
1693-
- StripeUICore (= 24.25.0)
1688+
- Stripe (25.0.0):
1689+
- StripeApplePay (= 25.0.0)
1690+
- StripeCore (= 25.0.0)
1691+
- StripePayments (= 25.0.0)
1692+
- StripePaymentsUI (= 25.0.0)
1693+
- StripeUICore (= 25.0.0)
16941694
- stripe-react-native (0.52.0-crypto-onramp-2-private-beta.2):
16951695
- DoubleConversion
16961696
- glog
@@ -1734,12 +1734,12 @@ PODS:
17341734
- ReactCodegen
17351735
- ReactCommon/turbomodule/bridging
17361736
- ReactCommon/turbomodule/core
1737-
- Stripe (~> 24.25.0)
1738-
- StripeApplePay (~> 24.25.0)
1739-
- StripeFinancialConnections (~> 24.25.0)
1740-
- StripePayments (~> 24.25.0)
1741-
- StripePaymentSheet (~> 24.25.0)
1742-
- StripePaymentsUI (~> 24.25.0)
1737+
- Stripe (~> 25.0.0)
1738+
- StripeApplePay (~> 25.0.0)
1739+
- StripeFinancialConnections (~> 25.0.0)
1740+
- StripePayments (~> 25.0.0)
1741+
- StripePaymentSheet (~> 25.0.0)
1742+
- StripePaymentsUI (~> 25.0.0)
17431743
- Yoga
17441744
- stripe-react-native/NewArch (0.52.0-crypto-onramp-2-private-beta.2):
17451745
- DoubleConversion
@@ -1783,7 +1783,7 @@ PODS:
17831783
- ReactCommon/turbomodule/bridging
17841784
- ReactCommon/turbomodule/core
17851785
- stripe-react-native/Core
1786-
- StripeCryptoOnramp (~> 24.25.0)
1786+
- StripeCryptoOnramp (~> 25.0.0)
17871787
- Yoga
17881788
- stripe-react-native/Tests (0.52.0-crypto-onramp-2-private-beta.2):
17891789
- DoubleConversion
@@ -1806,42 +1806,42 @@ PODS:
18061806
- ReactCommon/turbomodule/bridging
18071807
- ReactCommon/turbomodule/core
18081808
- Yoga
1809-
- StripeApplePay (24.25.0):
1810-
- StripeCore (= 24.25.0)
1811-
- StripeCameraCore (24.25.0):
1812-
- StripeCore (= 24.25.0)
1813-
- StripeCore (24.25.0)
1814-
- StripeCryptoOnramp (24.25.0):
1815-
- StripeApplePay (= 24.25.0)
1816-
- StripeCore (= 24.25.0)
1817-
- StripeIdentity (= 24.25.0)
1818-
- StripePayments (= 24.25.0)
1819-
- StripePaymentSheet (= 24.25.0)
1820-
- StripePaymentsUI (= 24.25.0)
1821-
- StripeUICore (= 24.25.0)
1822-
- StripeFinancialConnections (24.25.0):
1823-
- StripeCore (= 24.25.0)
1824-
- StripeUICore (= 24.25.0)
1825-
- StripeIdentity (24.25.0):
1826-
- StripeCameraCore (= 24.25.0)
1827-
- StripeCore (= 24.25.0)
1828-
- StripeUICore (= 24.25.0)
1829-
- StripePayments (24.25.0):
1830-
- StripeCore (= 24.25.0)
1831-
- StripePayments/Stripe3DS2 (= 24.25.0)
1832-
- StripePayments/Stripe3DS2 (24.25.0):
1833-
- StripeCore (= 24.25.0)
1834-
- StripePaymentSheet (24.25.0):
1835-
- StripeApplePay (= 24.25.0)
1836-
- StripeCore (= 24.25.0)
1837-
- StripePayments (= 24.25.0)
1838-
- StripePaymentsUI (= 24.25.0)
1839-
- StripePaymentsUI (24.25.0):
1840-
- StripeCore (= 24.25.0)
1841-
- StripePayments (= 24.25.0)
1842-
- StripeUICore (= 24.25.0)
1843-
- StripeUICore (24.25.0):
1844-
- StripeCore (= 24.25.0)
1809+
- StripeApplePay (25.0.0):
1810+
- StripeCore (= 25.0.0)
1811+
- StripeCameraCore (25.0.0):
1812+
- StripeCore (= 25.0.0)
1813+
- StripeCore (25.0.0)
1814+
- StripeCryptoOnramp (25.0.0):
1815+
- StripeApplePay (= 25.0.0)
1816+
- StripeCore (= 25.0.0)
1817+
- StripeIdentity (= 25.0.0)
1818+
- StripePayments (= 25.0.0)
1819+
- StripePaymentSheet (= 25.0.0)
1820+
- StripePaymentsUI (= 25.0.0)
1821+
- StripeUICore (= 25.0.0)
1822+
- StripeFinancialConnections (25.0.0):
1823+
- StripeCore (= 25.0.0)
1824+
- StripeUICore (= 25.0.0)
1825+
- StripeIdentity (25.0.0):
1826+
- StripeCameraCore (= 25.0.0)
1827+
- StripeCore (= 25.0.0)
1828+
- StripeUICore (= 25.0.0)
1829+
- StripePayments (25.0.0):
1830+
- StripeCore (= 25.0.0)
1831+
- StripePayments/Stripe3DS2 (= 25.0.0)
1832+
- StripePayments/Stripe3DS2 (25.0.0):
1833+
- StripeCore (= 25.0.0)
1834+
- StripePaymentSheet (25.0.0):
1835+
- StripeApplePay (= 25.0.0)
1836+
- StripeCore (= 25.0.0)
1837+
- StripePayments (= 25.0.0)
1838+
- StripePaymentsUI (= 25.0.0)
1839+
- StripePaymentsUI (25.0.0):
1840+
- StripeCore (= 25.0.0)
1841+
- StripePayments (= 25.0.0)
1842+
- StripeUICore (= 25.0.0)
1843+
- StripeUICore (25.0.0):
1844+
- StripeCore (= 25.0.0)
18451845
- Yoga (0.0.0)
18461846

18471847
DEPENDENCIES:
@@ -2160,18 +2160,18 @@ SPEC CHECKSUMS:
21602160
RNCPicker: cfb51a08c6e10357d9a65832e791825b0747b483
21612161
RNScreens: 0d4cb9afe052607ad0aa71f645a88bb7c7f2e64c
21622162
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
2163-
Stripe: fe028a764ff6cc0b4884ffd1e3adfda8263d331b
2164-
stripe-react-native: 911ee9a5080cb881ef7d2e62f2f54b99cd52e600
2165-
StripeApplePay: b2477e350368474b33f2d6325f7de53794d2f859
2166-
StripeCameraCore: d8299643920f3645502267e0d329407dc1270685
2167-
StripeCore: b3f991ef10e45ab2fa841e0a732825d795b2379e
2168-
StripeCryptoOnramp: 233cd26a54b30529af789b43b8ce41390dfd24d3
2169-
StripeFinancialConnections: 92079b12dfe6453ab296ecc9e4cdf2b069015345
2170-
StripeIdentity: ddda6449f701ea0ecd9d294725aedcd7138841ed
2171-
StripePayments: 57e26426162008338436b9df0f4a96a125fa4f9e
2172-
StripePaymentSheet: 048eff784e164a79c2e5f3e13e5b1dbe2130a812
2173-
StripePaymentsUI: c15edfc7d7a8ac6d8547af5a990517aa9ccfdbb0
2174-
StripeUICore: 55ebd4a7a2c12600645526bfdd6e5bd8ea1c5335
2163+
Stripe: 319b0923b2d03e7f07805db481b6656b19e159db
2164+
stripe-react-native: 81db25590c5a59940f0ec3714ddf69559ffc1473
2165+
StripeApplePay: 09bbe6a24d2cd4c37b2422fdd6e18f2be9f37e02
2166+
StripeCameraCore: 322d85bf2e7d14e4ed863b6b4cf9204529cb1461
2167+
StripeCore: a671e360dc0ede1275e98a8c5b6e0b694509c611
2168+
StripeCryptoOnramp: 7cbfc84b7ee3edb38795bc318ff9ba210973c171
2169+
StripeFinancialConnections: ca68c5d0fb5fbfc53c9eee572997080c3b7e6b7f
2170+
StripeIdentity: 9c45fc0c6dafff74fea83eded5984f5e9d9229ce
2171+
StripePayments: f1fbddb747c62dca90810e69fecfaca45f31b667
2172+
StripePaymentSheet: 645a5787595c667c5ea6de8c47a809003e837a99
2173+
StripePaymentsUI: 719d201ab61087c974ed44cbd0d43c30d9276688
2174+
StripeUICore: a8f8f38daf0eddb8f6c43ac9d7f051290af9bf2a
21752175
Yoga: afd04ff05ebe0121a00c468a8a3c8080221cb14c
21762176

21772177
PODFILE CHECKSUM: 0e8d697b2e2384b55c224afb61b755b153a2962a

ios/Mappers.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ class Mappers {
291291
case STPPaymentMethodType.SEPADebit: return "SepaDebit"
292292
case STPPaymentMethodType.AUBECSDebit: return "AuBecsDebit"
293293
case STPPaymentMethodType.bacsDebit: return "BacsDebit"
294-
case STPPaymentMethodType.giropay: return "Giropay"
295294
case STPPaymentMethodType.przelewy24: return "P24"
296295
case STPPaymentMethodType.EPS: return "Eps"
297296
case STPPaymentMethodType.bancontact: return "Bancontact"
@@ -324,7 +323,6 @@ class Mappers {
324323
case "SepaDebit": return STPPaymentMethodType.SEPADebit
325324
case "AuBecsDebit": return STPPaymentMethodType.AUBECSDebit
326325
case "BacsDebit": return STPPaymentMethodType.bacsDebit
327-
case "Giropay": return STPPaymentMethodType.giropay
328326
case "P24": return STPPaymentMethodType.przelewy24
329327
case "Eps": return STPPaymentMethodType.EPS
330328
case "Bancontact": return STPPaymentMethodType.bancontact
@@ -844,7 +842,7 @@ class Mappers {
844842

845843

846844
let types = setupIntent.paymentMethodTypes.map {
847-
mapPaymentMethodType(type: STPPaymentMethodType.init(rawValue: Int(truncating: $0))!)
845+
mapPaymentMethodType(type: $0)
848846
}
849847

850848
intent.setValue(types, forKey: "paymentMethodTypes")

ios/PaymentMethodFactory.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ class PaymentMethodFactory {
3939
return try createBilliePaymentMethodParams()
4040
case STPPaymentMethodType.SEPADebit:
4141
return try createSepaPaymentMethodParams()
42-
case STPPaymentMethodType.giropay:
43-
return try createGiropayPaymentMethodParams()
4442
case STPPaymentMethodType.EPS:
4543
return try createEPSPaymentMethodParams()
4644
case STPPaymentMethodType.grabPay:
@@ -96,8 +94,6 @@ class PaymentMethodFactory {
9694
return nil
9795
case STPPaymentMethodType.OXXO:
9896
return nil
99-
case STPPaymentMethodType.giropay:
100-
return nil
10197
case STPPaymentMethodType.grabPay:
10298
return nil
10399
case STPPaymentMethodType.przelewy24:
@@ -303,16 +299,6 @@ class PaymentMethodFactory {
303299
return STPPaymentMethodParams(oxxo: params, billingDetails: billingDetails, metadata: metadata)
304300
}
305301

306-
private func createGiropayPaymentMethodParams() throws -> STPPaymentMethodParams {
307-
let params = STPPaymentMethodGiropayParams()
308-
309-
guard let billingDetails = billingDetailsParams else {
310-
throw PaymentMethodError.giropayPaymentMissingParams
311-
}
312-
313-
return STPPaymentMethodParams(giropay: params, billingDetails: billingDetails, metadata: metadata)
314-
}
315-
316302
private func createEPSPaymentMethodParams() throws -> STPPaymentMethodParams {
317303
let params = STPPaymentMethodEPSParams()
318304

@@ -419,7 +405,6 @@ enum PaymentMethodError: Error {
419405
case bancontactPaymentMissingParams
420406
case billiePaymentMissingParams
421407
case sepaPaymentMissingParams
422-
case giropayPaymentMissingParams
423408
case p24PaymentMissingParams
424409
case afterpayClearpayPaymentMissingParams
425410
// Klarna no longer requires email and country in billing details
@@ -434,8 +419,6 @@ extension PaymentMethodError: LocalizedError {
434419
switch self {
435420
case .cardPaymentMissingParams:
436421
return NSLocalizedString("Card details not complete", comment: "Create payment error")
437-
case .giropayPaymentMissingParams:
438-
return NSLocalizedString("You must provide billing details", comment: "Create payment error")
439422
case .idealPaymentMissingParams:
440423
return NSLocalizedString("You must provide bank name", comment: "Create payment error")
441424
case .p24PaymentMissingParams:

ios/StripeSdkImpl+PaymentSheet.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,16 @@ extension StripeSdkImpl {
404404
RCTMakeAndLogError(error.localizedDescription, nil, nil)
405405
}
406406
return request
407-
}, authorizationResultHandler: { result, completion in
407+
}, authorizationResultHandler: { result in
408408
if applePayParams.object(forKey: "setOrderTracking") != nil {
409-
self.orderTrackingHandler = (result, completion)
410-
self.emitter?.emitOnOrderTrackingCallback()
409+
return await withCheckedContinuation { continuation in
410+
self.orderTrackingHandler = (result: result, handler: { updatedResult in
411+
continuation.resume(returning: updatedResult)
412+
})
413+
self.emitter?.emitOnOrderTrackingCallback()
414+
}
411415
} else {
412-
completion(result)
416+
return result
413417
}
414418
})
415419
}

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.25.0'
5+
stripe_version = '~> 25.0.0'
66

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

0 commit comments

Comments
 (0)