@stripe/stripe-react-native 0.64.0 → 0.64.1
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 +2 -2
- package/android/build.gradle +2 -2
- package/android/detekt/detekt-baseline.xml +81 -0
- package/android/detekt/detekt.gradle +45 -0
- package/android/detekt/detekt.yml +722 -0
- package/android/gradle.properties +4 -4
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +5 -1
- package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementView.kt +26 -0
- package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementViewManager.kt +42 -0
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +105 -49
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +72 -12
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetManager.kt +8 -4
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +26 -11
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +14 -5
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +6 -2
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherManager.kt +2 -2
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +7 -4
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementViewManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt +8 -4
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +9 -3
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +110 -29
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +250 -12
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +6 -2
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerSessionProvider.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/CheckoutAddressUpdate.kt +45 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/CheckoutMappers.kt +101 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +4 -2
- package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +5 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +29 -17
- package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +2 -1
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java +6 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java +2 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerDelegate.java +35 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerInterface.java +18 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +44 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +3 -3
- package/android/src/test/java/com/reactnativestripesdk/mappers/MappersTest.kt +60 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +38 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/PaymentOptionDisplayDataMapperTest.kt +9 -4
- package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutMappersTest.kt +89 -0
- package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutTestFixtures.java +49 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewController.swift +6 -8
- package/ios/CurrencySelectorElementManager.m +9 -0
- package/ios/CurrencySelectorElementManager.swift +12 -0
- package/ios/CurrencySelectorElementView.swift +24 -0
- package/ios/Mappers+Checkout.swift +193 -0
- package/ios/Mappers.swift +0 -5
- package/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +16 -2
- package/ios/NewArch/StripeCurrencySelectorElementComponentView.h +10 -0
- package/ios/NewArch/StripeCurrencySelectorElementComponentView.mm +75 -0
- package/ios/PaymentMethodMessagingElementConfig.swift +6 -3
- package/ios/PaymentMethodMessagingElementView.swift +19 -0
- package/ios/StripeSdk.mm +123 -0
- package/ios/StripeSdkImpl+Checkout.swift +308 -0
- package/ios/StripeSdkImpl+Embedded.swift +108 -27
- package/ios/StripeSdkImpl+PaymentSheet.swift +18 -2
- package/ios/StripeSdkImpl.swift +3 -93
- package/jest/mock.js +14 -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/CurrencySelectorElement.js +2 -0
- package/lib/commonjs/components/CurrencySelectorElement.js.map +1 -0
- package/lib/commonjs/components/PaymentMethodMessagingElement.js +2 -0
- package/lib/commonjs/components/PaymentMethodMessagingElement.js.map +1 -0
- 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/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/useCheckout.js +2 -0
- package/lib/commonjs/hooks/useCheckout.js.map +1 -0
- package/lib/commonjs/hooks/useOnramp.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.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/NativeCurrencySelectorElement.js +2 -0
- package/lib/commonjs/specs/NativeCurrencySelectorElement.js.map +1 -0
- 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 +1 -1
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js.map +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/commonjs/types/Checkout.js +2 -0
- package/lib/commonjs/types/Checkout.js.map +1 -0
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +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/CurrencySelectorElement.js +2 -0
- package/lib/module/components/CurrencySelectorElement.js.map +1 -0
- package/lib/module/components/PaymentMethodMessagingElement.js +2 -0
- package/lib/module/components/PaymentMethodMessagingElement.js.map +1 -0
- 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/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/useCheckout.js +2 -0
- package/lib/module/hooks/useCheckout.js.map +1 -0
- package/lib/module/hooks/useOnramp.js +1 -1
- package/lib/module/hooks/useOnramp.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.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/NativeCurrencySelectorElement.js +2 -0
- package/lib/module/specs/NativeCurrencySelectorElement.js.map +1 -0
- 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 +1 -1
- package/lib/module/specs/NativePaymentMethodMessagingElement.js.map +1 -1
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/module/types/Checkout.js +2 -0
- package/lib/module/types/Checkout.js.map +1 -0
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/typescript/src/components/CurrencySelectorElement.d.ts +62 -0
- package/lib/typescript/src/components/CurrencySelectorElement.d.ts.map +1 -0
- package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts +41 -0
- package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +11 -0
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCheckout.d.ts +21 -0
- package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useOnramp.d.ts +1 -0
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts +25 -0
- package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts +5 -1
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts +1 -6
- package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts.map +1 -1
- 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/Checkout.d.ts +336 -0
- package/lib/typescript/src/types/Checkout.d.ts.map +1 -0
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +36 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentMethod.d.ts +1 -5
- package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +22 -6
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts +16 -1
- package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts.map +1 -1
- package/package.json +21 -7
- package/src/components/CurrencySelectorElement.tsx +95 -0
- package/src/components/PaymentMethodMessagingElement.tsx +109 -0
- package/src/events.ts +11 -0
- package/src/functions.ts +30 -1
- package/src/hooks/useCheckout.tsx +207 -0
- package/src/hooks/useOnramp.tsx +9 -3
- package/src/index.tsx +4 -0
- package/src/specs/NativeCurrencySelectorElement.ts +35 -0
- package/src/specs/NativeEmbeddedPaymentElement.ts +12 -2
- package/src/specs/NativePaymentMethodMessagingElement.ts +0 -7
- package/src/specs/NativeStripeSdkModule.ts +58 -1
- package/src/types/Checkout.ts +377 -0
- package/src/types/EmbeddedPaymentElement.tsx +117 -26
- package/src/types/PaymentMethod.ts +0 -6
- package/src/types/PaymentSheet.ts +29 -6
- package/src/types/components/PaymentMethodMessagingElementComponent.tsx +17 -1
- package/stripe-react-native.podspec +8 -8
- package/android/spotless.gradle +0 -19
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import UIKit
|
|
3
|
+
|
|
4
|
+
/// Minimal stub so the JS-side `CurrencySelectorElement` codegen mapping
|
|
5
|
+
/// resolves at app launch. The real implementation (hosting
|
|
6
|
+
/// `Checkout.CurrencySelectorView`, height reporting, session observation)
|
|
7
|
+
/// lives on the full-feature branch and will replace this once that lands.
|
|
8
|
+
@objc(StripeCurrencySelectorElementContainerView)
|
|
9
|
+
public class StripeCurrencySelectorElementContainerView: UIView {
|
|
10
|
+
@objc public var sessionKey: String?
|
|
11
|
+
|
|
12
|
+
@objc public var disabled: Bool = false
|
|
13
|
+
|
|
14
|
+
@objc public var onHeightChange: RCTDirectEventBlock?
|
|
15
|
+
|
|
16
|
+
public override init(frame: CGRect) {
|
|
17
|
+
super.init(frame: frame)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@available(*, unavailable)
|
|
21
|
+
required init?(coder _: NSCoder) {
|
|
22
|
+
fatalError("init(coder:) has not been implemented")
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Mappers+Checkout.swift
|
|
3
|
+
// stripe-react-native
|
|
4
|
+
//
|
|
5
|
+
// Created by Nick Porter on 4/29/26.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
@_spi(CheckoutSessionsPreview) import StripePaymentSheet
|
|
10
|
+
|
|
11
|
+
extension Mappers {
|
|
12
|
+
class func mapFromCheckoutState(_ state: Checkout.State) -> NSDictionary {
|
|
13
|
+
return [
|
|
14
|
+
"status": state.isLoading ? "loading" : "loaded",
|
|
15
|
+
"session": mapFromCheckoutSession(state.session),
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class func mapFromCheckoutSession(_ session: any Checkout.Session) -> NSDictionary {
|
|
20
|
+
let result = NSMutableDictionary()
|
|
21
|
+
result["id"] = session.id
|
|
22
|
+
result["paymentStatus"] = mapFromCheckoutPaymentStatus(session.paymentStatus)
|
|
23
|
+
result["livemode"] = session.livemode
|
|
24
|
+
result["lineItems"] = session.lineItems.map(mapFromCheckoutLineItem)
|
|
25
|
+
result["shippingOptions"] = session.shippingOptions.map(mapFromCheckoutShippingOption)
|
|
26
|
+
result["discounts"] = session.discounts.map(mapFromCheckoutDiscount)
|
|
27
|
+
|
|
28
|
+
if let status = mapFromCheckoutStatus(session.status) {
|
|
29
|
+
result["status"] = status
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if let currency = session.currency {
|
|
33
|
+
result["currency"] = currency
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if let totals = session.totals {
|
|
37
|
+
result["totals"] = mapFromCheckoutTotals(totals)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if let customerId = session.customerId {
|
|
41
|
+
result["customerId"] = customerId
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if let customerEmail = session.customerEmail {
|
|
45
|
+
result["customerEmail"] = customerEmail
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if let billingAddress = session.billingAddress {
|
|
49
|
+
result["billingAddress"] = mapFromCheckoutAddressUpdate(billingAddress)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if let shippingAddress = session.shippingAddress {
|
|
53
|
+
result["shippingAddress"] = mapFromCheckoutAddressUpdate(shippingAddress)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return result
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
class func mapFromCheckoutAddressUpdate(_ addressUpdate: Checkout.AddressUpdate) -> NSDictionary {
|
|
60
|
+
let result = NSMutableDictionary()
|
|
61
|
+
result["address"] = mapFromCheckoutAddress(addressUpdate.address)
|
|
62
|
+
|
|
63
|
+
if let name = addressUpdate.name {
|
|
64
|
+
result["name"] = name
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if let phone = addressUpdate.phone {
|
|
68
|
+
result["phone"] = phone
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return result
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private class func mapFromCheckoutAddress(_ address: Checkout.Address) -> NSDictionary {
|
|
75
|
+
let result = NSMutableDictionary()
|
|
76
|
+
result["country"] = address.country
|
|
77
|
+
|
|
78
|
+
if let line1 = address.line1 {
|
|
79
|
+
result["line1"] = line1
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if let line2 = address.line2 {
|
|
83
|
+
result["line2"] = line2
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if let city = address.city {
|
|
87
|
+
result["city"] = city
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if let state = address.state {
|
|
91
|
+
result["state"] = state
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if let postalCode = address.postalCode {
|
|
95
|
+
result["postalCode"] = postalCode
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return result
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private class func mapFromCheckoutTotals(_ totals: Checkout.Totals) -> NSDictionary {
|
|
102
|
+
return [
|
|
103
|
+
"subtotal": totals.subtotal,
|
|
104
|
+
"total": totals.total,
|
|
105
|
+
"due": totals.due,
|
|
106
|
+
"discount": totals.discount,
|
|
107
|
+
"shipping": totals.shipping,
|
|
108
|
+
"tax": totals.tax,
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private class func mapFromCheckoutLineItem(_ lineItem: Checkout.LineItem) -> NSDictionary {
|
|
113
|
+
return [
|
|
114
|
+
"id": lineItem.id,
|
|
115
|
+
"name": lineItem.name,
|
|
116
|
+
"quantity": lineItem.quantity,
|
|
117
|
+
"unitAmount": lineItem.unitAmount,
|
|
118
|
+
"currency": lineItem.currency,
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private class func mapFromCheckoutShippingOption(_ shippingOption: Checkout.ShippingOption) -> NSDictionary {
|
|
123
|
+
return [
|
|
124
|
+
"id": shippingOption.id,
|
|
125
|
+
"displayName": shippingOption.displayName,
|
|
126
|
+
"amount": shippingOption.amount,
|
|
127
|
+
"currency": shippingOption.currency,
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private class func mapFromCheckoutDiscount(_ discount: Checkout.Discount) -> NSDictionary {
|
|
132
|
+
let result = NSMutableDictionary()
|
|
133
|
+
result["coupon"] = mapFromCheckoutCoupon(discount.coupon)
|
|
134
|
+
result["amount"] = discount.amount
|
|
135
|
+
|
|
136
|
+
if let promotionCode = discount.promotionCode {
|
|
137
|
+
result["promotionCode"] = promotionCode
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return result
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
private class func mapFromCheckoutCoupon(_ coupon: Checkout.Coupon) -> NSDictionary {
|
|
144
|
+
let result = NSMutableDictionary()
|
|
145
|
+
result["id"] = coupon.id
|
|
146
|
+
|
|
147
|
+
if let name = coupon.name {
|
|
148
|
+
result["name"] = name
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if let percentOff = coupon.percentOff {
|
|
152
|
+
result["percentOff"] = percentOff
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if let amountOff = coupon.amountOff {
|
|
156
|
+
result["amountOff"] = amountOff
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return result
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private class func mapFromCheckoutStatus(_ status: Checkout.Status?) -> String? {
|
|
163
|
+
switch status {
|
|
164
|
+
case .open:
|
|
165
|
+
return "open"
|
|
166
|
+
case .complete:
|
|
167
|
+
return "complete"
|
|
168
|
+
case .expired:
|
|
169
|
+
return "expired"
|
|
170
|
+
case .unknown:
|
|
171
|
+
return "unknown"
|
|
172
|
+
case nil:
|
|
173
|
+
return nil
|
|
174
|
+
@unknown default:
|
|
175
|
+
return "unknown"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
private class func mapFromCheckoutPaymentStatus(_ paymentStatus: Checkout.PaymentStatus) -> String {
|
|
180
|
+
switch paymentStatus {
|
|
181
|
+
case .paid:
|
|
182
|
+
return "paid"
|
|
183
|
+
case .unpaid:
|
|
184
|
+
return "unpaid"
|
|
185
|
+
case .noPaymentRequired:
|
|
186
|
+
return "noPaymentRequired"
|
|
187
|
+
case .unknown:
|
|
188
|
+
return "unknown"
|
|
189
|
+
@unknown default:
|
|
190
|
+
return "unknown"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
package/ios/Mappers.swift
CHANGED
|
@@ -297,7 +297,6 @@ class Mappers {
|
|
|
297
297
|
case STPPaymentMethodType.billie: return "Billie"
|
|
298
298
|
case STPPaymentMethodType.multibanco: return "Multibanco"
|
|
299
299
|
case STPPaymentMethodType.OXXO: return "Oxxo"
|
|
300
|
-
case STPPaymentMethodType.UPI: return "Upi"
|
|
301
300
|
case STPPaymentMethodType.afterpayClearpay: return "AfterpayClearpay"
|
|
302
301
|
case STPPaymentMethodType.klarna: return "Klarna"
|
|
303
302
|
case STPPaymentMethodType.USBankAccount: return "USBankAccount"
|
|
@@ -330,7 +329,6 @@ class Mappers {
|
|
|
330
329
|
case "Billie": return STPPaymentMethodType.billie
|
|
331
330
|
case "Multibanco": return STPPaymentMethodType.multibanco
|
|
332
331
|
case "Oxxo": return STPPaymentMethodType.OXXO
|
|
333
|
-
case "Upi": return STPPaymentMethodType.UPI
|
|
334
332
|
case "AfterpayClearpay": return STPPaymentMethodType.afterpayClearpay
|
|
335
333
|
case "Klarna": return STPPaymentMethodType.klarna
|
|
336
334
|
case "WeChatPay": return STPPaymentMethodType.weChatPay
|
|
@@ -701,9 +699,6 @@ class Mappers {
|
|
|
701
699
|
"SepaDebit": sepaDebit,
|
|
702
700
|
"BacsDebit": bacsDebit,
|
|
703
701
|
"AuBecsDebit": auBECSDebit,
|
|
704
|
-
"Upi": [
|
|
705
|
-
"vpa": paymentMethod.upi?.vpa
|
|
706
|
-
],
|
|
707
702
|
"USBankAccount": USBankAccount,
|
|
708
703
|
]
|
|
709
704
|
return method
|
|
@@ -48,14 +48,28 @@ using namespace facebook::react;
|
|
|
48
48
|
RCTEmbeddedPaymentElementViewHandleCommand(self, commandName, args);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
#pragma mark - Shared Codegen Commands
|
|
52
|
+
|
|
53
|
+
// These commands are declared on the shared `NativeEmbeddedPaymentElement`
|
|
54
|
+
// component spec because Android targets its mounted Compose view directly.
|
|
55
|
+
// iOS does not handle EPE actions through this view: the view only hosts
|
|
56
|
+
// `StripeSdkImpl.shared.embeddedInstance.view`, while create/update/confirm/
|
|
57
|
+
// clear are routed through `StripeSdkImpl` module methods. The no-op methods
|
|
58
|
+
// keep the generated Fabric command protocol satisfied on iOS.
|
|
51
59
|
- (void)clearPaymentOption
|
|
52
60
|
{
|
|
53
|
-
// Android only.
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
- (void)confirm
|
|
57
64
|
{
|
|
58
|
-
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
- (void)update:(NSString *)intentConfigurationJson
|
|
68
|
+
{
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
- (void)updateWithCheckout:(NSString *)sessionKey
|
|
72
|
+
{
|
|
59
73
|
}
|
|
60
74
|
|
|
61
75
|
#pragma mark - RCTComponentViewProtocol
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#import "StripeCurrencySelectorElementComponentView.h"
|
|
2
|
+
|
|
3
|
+
#import <react/renderer/components/rnstripe/ComponentDescriptors.h>
|
|
4
|
+
#import <react/renderer/components/rnstripe/EventEmitters.h>
|
|
5
|
+
#import <react/renderer/components/rnstripe/Props.h>
|
|
6
|
+
#import <react/renderer/components/rnstripe/RCTComponentViewHelpers.h>
|
|
7
|
+
|
|
8
|
+
#import <React/RCTConversions.h>
|
|
9
|
+
#import <React/RCTFabricComponentsPlugins.h>
|
|
10
|
+
|
|
11
|
+
#import "StripeNewArchConversions.h"
|
|
12
|
+
#import "StripeSwiftInterop.h"
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
@interface StripeCurrencySelectorElementComponentView () <RCTStripeCurrencySelectorElementViewProtocol>
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation StripeCurrencySelectorElementComponentView {
|
|
20
|
+
StripeCurrencySelectorElementContainerView *_view;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Needed because of this: https://github.com/facebook/react-native/pull/37274
|
|
24
|
+
+ (void)load
|
|
25
|
+
{
|
|
26
|
+
[super load];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
30
|
+
{
|
|
31
|
+
if (self = [super initWithFrame:frame]) {
|
|
32
|
+
static const auto defaultProps = std::make_shared<const StripeCurrencySelectorElementProps>();
|
|
33
|
+
_props = defaultProps;
|
|
34
|
+
[self prepareView];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
- (void)prepareView
|
|
41
|
+
{
|
|
42
|
+
_view = [[StripeCurrencySelectorElementContainerView alloc] initWithFrame:self.frame];
|
|
43
|
+
self.contentView = _view;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (void)updateProps:(const facebook::react::Props::Shared &)props
|
|
47
|
+
oldProps:(const facebook::react::Props::Shared &)oldProps
|
|
48
|
+
{
|
|
49
|
+
const auto &newViewProps = *std::static_pointer_cast<const StripeCurrencySelectorElementProps>(props);
|
|
50
|
+
|
|
51
|
+
_view.sessionKey = RCTNSStringFromStringNilIfEmpty(newViewProps.sessionKey);
|
|
52
|
+
_view.disabled = newViewProps.disabled;
|
|
53
|
+
|
|
54
|
+
[super updateProps:props oldProps:oldProps];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#pragma mark - RCTComponentViewProtocol
|
|
58
|
+
|
|
59
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
60
|
+
{
|
|
61
|
+
return concreteComponentDescriptorProvider<StripeCurrencySelectorElementComponentDescriptor>();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (void)prepareForRecycle
|
|
65
|
+
{
|
|
66
|
+
[super prepareForRecycle];
|
|
67
|
+
[self prepareView];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@end
|
|
71
|
+
|
|
72
|
+
Class<RCTComponentViewProtocol> StripeCurrencySelectorElementCls(void)
|
|
73
|
+
{
|
|
74
|
+
return StripeCurrencySelectorElementComponentView.class;
|
|
75
|
+
}
|
|
@@ -29,10 +29,13 @@ internal class PaymentMethodMessagingElementConfig {
|
|
|
29
29
|
|
|
30
30
|
// Parse font
|
|
31
31
|
if let fontParams = params["font"] as? NSDictionary {
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let size = fontParams["size"] as? CGFloat
|
|
33
|
+
let family = fontParams["family"] as? String
|
|
34
|
+
|
|
35
|
+
if let family = family, let customFont = UIFont(name: family, size: size ?? UIFont.systemFontSize) {
|
|
35
36
|
appearance.font = customFont
|
|
37
|
+
} else if let size = size {
|
|
38
|
+
appearance.font = UIFont.systemFont(ofSize: size)
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -21,6 +21,9 @@ public class PaymentMethodMessagingElementContainerView: UIView, UIGestureRecogn
|
|
|
21
21
|
private var appearanceConfig: PaymentMethodMessagingElement.Appearance?
|
|
22
22
|
private var lastConfig: NSDictionary?
|
|
23
23
|
|
|
24
|
+
// Used to track height updates
|
|
25
|
+
private var previousHeight: CGFloat?
|
|
26
|
+
|
|
24
27
|
@objc var appearance: NSDictionary? {
|
|
25
28
|
didSet {
|
|
26
29
|
if let appearance = appearance {
|
|
@@ -67,6 +70,19 @@ public class PaymentMethodMessagingElementContainerView: UIView, UIGestureRecogn
|
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
|
|
73
|
+
public override func layoutSubviews() {
|
|
74
|
+
super.layoutSubviews()
|
|
75
|
+
|
|
76
|
+
// Calculate our natural height
|
|
77
|
+
let desiredHeight = systemLayoutSizeFitting(CGSize(width: frame.width, height: UIView.layoutFittingCompressedSize.height)).height
|
|
78
|
+
|
|
79
|
+
// Notify if changed
|
|
80
|
+
if desiredHeight != previousHeight {
|
|
81
|
+
StripeSdkImpl.shared.emitter?.emitPaymentMethodMessagingElementDidUpdateHeight(["height": desiredHeight])
|
|
82
|
+
self.previousHeight = desiredHeight
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
70
86
|
private func attachPaymentElementIfAvailable() {
|
|
71
87
|
removePaymentMethodMessagingElement()
|
|
72
88
|
guard let messagingElement = messagingInstance else {
|
|
@@ -76,7 +92,10 @@ public class PaymentMethodMessagingElementContainerView: UIView, UIGestureRecogn
|
|
|
76
92
|
let messagingElementView = messagingElement.view
|
|
77
93
|
addSubview(messagingElementView)
|
|
78
94
|
messagingElementView.translatesAutoresizingMaskIntoConstraints = false
|
|
95
|
+
let height = self.messagingInstance?.view.systemLayoutSizeFitting(CGSize(width: self.messagingInstance?.view.bounds.width ?? 0, height: UIView.layoutFittingCompressedSize.height)).height
|
|
96
|
+
self.previousHeight = height ?? 0
|
|
79
97
|
|
|
98
|
+
StripeSdkImpl.shared.emitter?.emitPaymentMethodMessagingElementDidUpdateHeight(["height": height ?? 0])
|
|
80
99
|
NSLayoutConstraint.activate([
|
|
81
100
|
messagingElementView.topAnchor.constraint(equalTo: topAnchor),
|
|
82
101
|
messagingElementView.leadingAnchor.constraint(equalTo: leadingAnchor),
|
package/ios/StripeSdk.mm
CHANGED
|
@@ -263,6 +263,111 @@ RCT_EXPORT_METHOD(handleURLCallback:(nonnull NSString *)url
|
|
|
263
263
|
[StripeSdkImpl.shared handleURLCallback:url resolver:resolve rejecter:reject];
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
RCT_EXPORT_METHOD(initCheckoutSession:(nonnull NSString *)clientSecret
|
|
267
|
+
configuration:(nonnull NSDictionary *)configuration
|
|
268
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
269
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
270
|
+
{
|
|
271
|
+
[StripeSdkImpl.shared initCheckoutSession:clientSecret
|
|
272
|
+
configuration:configuration
|
|
273
|
+
resolver:resolve
|
|
274
|
+
rejecter:reject];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
RCT_EXPORT_METHOD(checkoutUpdateShippingAddress:(nonnull NSString *)sessionKey
|
|
278
|
+
address:(nonnull NSDictionary *)address
|
|
279
|
+
name:(NSString *_Nullable)name
|
|
280
|
+
phone:(NSString *_Nullable)phone
|
|
281
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
282
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
283
|
+
{
|
|
284
|
+
[StripeSdkImpl.shared checkoutUpdateShippingAddress:sessionKey
|
|
285
|
+
address:address
|
|
286
|
+
name:name
|
|
287
|
+
phone:phone
|
|
288
|
+
resolver:resolve
|
|
289
|
+
rejecter:reject];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
RCT_EXPORT_METHOD(checkoutUpdateBillingAddress:(nonnull NSString *)sessionKey
|
|
293
|
+
address:(nonnull NSDictionary *)address
|
|
294
|
+
name:(NSString *_Nullable)name
|
|
295
|
+
phone:(NSString *_Nullable)phone
|
|
296
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
297
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
298
|
+
{
|
|
299
|
+
[StripeSdkImpl.shared checkoutUpdateBillingAddress:sessionKey
|
|
300
|
+
address:address
|
|
301
|
+
name:name
|
|
302
|
+
phone:phone
|
|
303
|
+
resolver:resolve
|
|
304
|
+
rejecter:reject];
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
RCT_EXPORT_METHOD(checkoutApplyPromotionCode:(nonnull NSString *)sessionKey
|
|
308
|
+
code:(nonnull NSString *)code
|
|
309
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
310
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
311
|
+
{
|
|
312
|
+
[StripeSdkImpl.shared checkoutApplyPromotionCode:sessionKey
|
|
313
|
+
code:code
|
|
314
|
+
resolver:resolve
|
|
315
|
+
rejecter:reject];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
RCT_EXPORT_METHOD(checkoutRemovePromotionCode:(nonnull NSString *)sessionKey
|
|
319
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
320
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
321
|
+
{
|
|
322
|
+
[StripeSdkImpl.shared checkoutRemovePromotionCode:sessionKey
|
|
323
|
+
resolver:resolve
|
|
324
|
+
rejecter:reject];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
RCT_EXPORT_METHOD(checkoutUpdateLineItemQuantity:(nonnull NSString *)sessionKey
|
|
328
|
+
lineItemId:(nonnull NSString *)lineItemId
|
|
329
|
+
quantity:(double)quantity
|
|
330
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
331
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
332
|
+
{
|
|
333
|
+
[StripeSdkImpl.shared checkoutUpdateLineItemQuantity:sessionKey
|
|
334
|
+
lineItemId:lineItemId
|
|
335
|
+
quantity:quantity
|
|
336
|
+
resolver:resolve
|
|
337
|
+
rejecter:reject];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
RCT_EXPORT_METHOD(checkoutSelectShippingOption:(nonnull NSString *)sessionKey
|
|
341
|
+
id:(nonnull NSString *)identifier
|
|
342
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
343
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
344
|
+
{
|
|
345
|
+
[StripeSdkImpl.shared checkoutSelectShippingOption:sessionKey
|
|
346
|
+
id:identifier
|
|
347
|
+
resolver:resolve
|
|
348
|
+
rejecter:reject];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
RCT_EXPORT_METHOD(checkoutUpdateTaxId:(nonnull NSString *)sessionKey
|
|
352
|
+
type:(nonnull NSString *)type
|
|
353
|
+
value:(nonnull NSString *)value
|
|
354
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
355
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
356
|
+
{
|
|
357
|
+
[StripeSdkImpl.shared checkoutUpdateTaxId:sessionKey
|
|
358
|
+
type:type
|
|
359
|
+
value:value
|
|
360
|
+
resolver:resolve
|
|
361
|
+
rejecter:reject];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
RCT_EXPORT_METHOD(checkoutRefresh:(nonnull NSString *)sessionKey
|
|
365
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
366
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
367
|
+
{
|
|
368
|
+
[StripeSdkImpl.shared checkoutRefresh:sessionKey resolver:resolve rejecter:reject];
|
|
369
|
+
}
|
|
370
|
+
|
|
266
371
|
RCT_EXPORT_METHOD(initCustomerSheet:(nonnull NSDictionary *)params
|
|
267
372
|
customerAdapterOverrides:(nonnull NSDictionary *)customerAdapterOverrides
|
|
268
373
|
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
@@ -448,6 +553,17 @@ RCT_EXPORT_METHOD(createEmbeddedPaymentElement:(nonnull NSDictionary *)intentCon
|
|
|
448
553
|
reject:reject];
|
|
449
554
|
}
|
|
450
555
|
|
|
556
|
+
RCT_EXPORT_METHOD(createEmbeddedPaymentElementWithCheckout:(nonnull NSString *)sessionKey
|
|
557
|
+
configuration:(nonnull NSDictionary *)configuration
|
|
558
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
559
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
560
|
+
{
|
|
561
|
+
[StripeSdkImpl.shared createEmbeddedPaymentElementWithCheckout:sessionKey
|
|
562
|
+
configuration:configuration
|
|
563
|
+
resolve:resolve
|
|
564
|
+
reject:reject];
|
|
565
|
+
}
|
|
566
|
+
|
|
451
567
|
RCT_EXPORT_METHOD(confirmEmbeddedPaymentElement:(NSInteger)viewTag
|
|
452
568
|
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
453
569
|
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
@@ -462,6 +578,13 @@ RCT_EXPORT_METHOD(updateEmbeddedPaymentElement:(NSDictionary *)intentConfig
|
|
|
462
578
|
[StripeSdkImpl.shared updateEmbeddedPaymentElement:intentConfig resolve:resolve reject:reject];
|
|
463
579
|
}
|
|
464
580
|
|
|
581
|
+
RCT_EXPORT_METHOD(updateEmbeddedPaymentElementWithCheckout:(nonnull NSString *)sessionKey
|
|
582
|
+
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
583
|
+
reject:(nonnull RCTPromiseRejectBlock)reject)
|
|
584
|
+
{
|
|
585
|
+
[StripeSdkImpl.shared updateEmbeddedPaymentElementWithCheckout:sessionKey resolve:resolve reject:reject];
|
|
586
|
+
}
|
|
587
|
+
|
|
465
588
|
RCT_EXPORT_METHOD(clearEmbeddedPaymentOption:(NSInteger)viewTag
|
|
466
589
|
resolve:(nonnull RCTPromiseResolveBlock)resolve
|
|
467
590
|
reject:(nonnull RCTPromiseRejectBlock)reject)
|