framepayments-react-native 2.2.1 → 3.0.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/FrameReactNative.podspec +44 -0
- package/Package.swift +47 -0
- package/README.md +64 -33
- package/android/build.gradle +9 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameCheckoutActivity.kt +18 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameFlowActivity.kt +16 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameGooglePayActivity.kt +0 -3
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameOnboardingActivity.kt +2 -5
- package/android/src/main/java/com/framepayments/reactnativeframe/FrameSDKModule.kt +13 -11
- package/ios/ApplePayPresenter.swift +1 -4
- package/ios/FramePreloader.h +23 -0
- package/ios/FrameSDKBridge.m +17 -17
- package/ios/FrameSDKBridge.swift +109 -54
- package/lib/native.d.ts +12 -2
- package/lib/native.d.ts.map +1 -1
- package/lib/native.js +18 -18
- package/lib/types.d.ts +12 -6
- package/lib/types.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/__tests__/native.test.ts +60 -74
- package/src/native.ts +37 -34
- package/src/types.ts +12 -6
- package/ios/FrameReactNative.podspec +0 -32
- package/lib/__tests__/native.test.d.ts +0 -32
- package/lib/__tests__/native.test.d.ts.map +0 -1
- package/lib/__tests__/native.test.js +0 -101
- package/lib/components/FrameApplePayButton.d.ts +0 -30
- package/lib/components/FrameApplePayButton.d.ts.map +0 -1
- package/lib/components/FrameApplePayButton.js +0 -42
- package/lib/components/FrameGooglePayButton.d.ts +0 -28
- package/lib/components/FrameGooglePayButton.d.ts.map +0 -1
- package/lib/components/FrameGooglePayButton.js +0 -24
- package/lib/components/index.d.ts +0 -5
- package/lib/components/index.d.ts.map +0 -1
- package/lib/components/index.js +0 -2
package/ios/FrameSDKBridge.m
CHANGED
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
#import <React/RCTBridgeModule.h>
|
|
9
9
|
#import "FrameVCHelper.h"
|
|
10
10
|
|
|
11
|
-
// Import
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
#
|
|
16
|
-
#import "
|
|
17
|
-
#elif __has_include(<
|
|
18
|
-
#import <
|
|
11
|
+
// Import the FrameReactNative pod's auto-generated Swift header so this Obj-C
|
|
12
|
+
// file can reach the Swift `ObjCFrameSDKBridge` class. CocoaPods generates
|
|
13
|
+
// "FrameReactNative-Swift.h" from the pod's Swift sources during the pod's
|
|
14
|
+
// build phase.
|
|
15
|
+
#if __has_include("FrameReactNative-Swift.h")
|
|
16
|
+
#import "FrameReactNative-Swift.h"
|
|
17
|
+
#elif __has_include(<FrameReactNative/FrameReactNative-Swift.h>)
|
|
18
|
+
#import <FrameReactNative/FrameReactNative-Swift.h>
|
|
19
19
|
#else
|
|
20
|
-
#error "Swift
|
|
20
|
+
#error "FrameReactNative-Swift.h not found. The Frame React Native pod's Swift code did not generate its module header — check that pod install ran cleanly."
|
|
21
21
|
#endif
|
|
22
22
|
|
|
23
23
|
@interface FrameSDKModule : NSObject <RCTBridgeModule>
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
RCT_EXTERN_METHOD(initialize:(NSString *)secretKey
|
|
29
29
|
publishableKey:(NSString *)publishableKey
|
|
30
30
|
debugMode:(BOOL)debugMode
|
|
31
|
+
applePayMerchantId:(id)applePayMerchantId
|
|
32
|
+
googlePayMerchantId:(id)googlePayMerchantId
|
|
31
33
|
theme:(NSDictionary *)theme
|
|
32
34
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
33
35
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
@@ -45,7 +47,6 @@ RCT_EXTERN_METHOD(presentCart:(id)accountId
|
|
|
45
47
|
|
|
46
48
|
RCT_EXTERN_METHOD(presentOnboarding:(id)accountId
|
|
47
49
|
capabilities:(NSArray *)capabilities
|
|
48
|
-
applePayMerchantId:(id)applePayMerchantId
|
|
49
50
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
50
51
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
51
52
|
|
|
@@ -53,7 +54,6 @@ RCT_EXTERN_METHOD(presentApplePay:(NSString *)ownerType
|
|
|
53
54
|
ownerId:(NSString *)ownerId
|
|
54
55
|
amount:(nonnull NSNumber *)amount
|
|
55
56
|
currency:(NSString *)currency
|
|
56
|
-
merchantId:(NSString *)merchantId
|
|
57
57
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
58
58
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
59
59
|
|
|
@@ -68,8 +68,8 @@ RCT_EXTERN_METHOD(presentApplePay:(NSString *)ownerType
|
|
|
68
68
|
return YES;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
- (void)initialize:(NSString *)secretKey publishableKey:(NSString *)publishableKey debugMode:(BOOL)debugMode theme:(NSDictionary *)theme resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject {
|
|
72
|
-
[[[ObjCFrameSDKBridge alloc] init] initialize:secretKey publishableKey:publishableKey debugMode:debugMode theme:theme resolver:resolve rejecter:reject];
|
|
71
|
+
- (void)initialize:(NSString *)secretKey publishableKey:(NSString *)publishableKey debugMode:(BOOL)debugMode applePayMerchantId:(id)applePayMerchantId googlePayMerchantId:(id)googlePayMerchantId theme:(NSDictionary *)theme resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject {
|
|
72
|
+
[[[ObjCFrameSDKBridge alloc] init] initialize:secretKey publishableKey:publishableKey debugMode:debugMode applePayMerchantId:applePayMerchantId googlePayMerchantId:googlePayMerchantId theme:theme resolver:resolve rejecter:reject];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
- (void)presentCheckout:(id)accountId amount:(NSNumber *)amount resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject {
|
|
@@ -95,19 +95,19 @@ RCT_EXTERN_METHOD(presentApplePay:(NSString *)ownerType
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
- (void)presentOnboarding:(id)accountId capabilities:(NSArray *)capabilities
|
|
98
|
+
- (void)presentOnboarding:(id)accountId capabilities:(NSArray *)capabilities resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject {
|
|
99
99
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
100
100
|
UIViewController *topVC = FrameGetTopViewController();
|
|
101
101
|
if (!topVC) {
|
|
102
102
|
reject(@"NO_ROOT_VC", @"Could not find root view controller to present onboarding", nil);
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
[[[ObjCFrameSDKBridge alloc] init] presentOnboardingFrom:topVC accountId:accountId capabilities:capabilities
|
|
105
|
+
[[[ObjCFrameSDKBridge alloc] init] presentOnboardingFrom:topVC accountId:accountId capabilities:capabilities resolver:resolve rejecter:reject];
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
- (void)presentApplePay:(NSString *)ownerType ownerId:(NSString *)ownerId amount:(NSNumber *)amount currency:(NSString *)currency
|
|
110
|
-
[[[ObjCFrameSDKBridge alloc] init] presentApplePay:ownerType ownerId:ownerId amount:amount.intValue currency:currency
|
|
109
|
+
- (void)presentApplePay:(NSString *)ownerType ownerId:(NSString *)ownerId amount:(NSNumber *)amount currency:(NSString *)currency resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject {
|
|
110
|
+
[[[ObjCFrameSDKBridge alloc] init] presentApplePay:ownerType ownerId:ownerId amount:amount.intValue currency:currency resolver:resolve rejecter:reject];
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
@end
|
package/ios/FrameSDKBridge.swift
CHANGED
|
@@ -20,11 +20,21 @@ public class FrameSDKBridge: NSObject {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
@objc public
|
|
23
|
-
func initialize(_ secretKey: String, publishableKey: String, debugMode: Bool, theme: NSDictionary?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
23
|
+
func initialize(_ secretKey: String, publishableKey: String, debugMode: Bool, applePayMerchantId: NSObject?, googlePayMerchantId: NSObject?, theme: NSDictionary?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
24
24
|
DispatchQueue.main.async {
|
|
25
25
|
let themeDict = theme as? [String: Any] ?? [:]
|
|
26
26
|
let resolvedTheme = themeDict.isEmpty ? FrameTheme.default : FrameRNTheme.parse(themeDict)
|
|
27
|
-
|
|
27
|
+
// googlePayMerchantId is iOS-side ignored — frame-iOS has no Google Pay surface today.
|
|
28
|
+
// Accepted in the bridge signature so the JS Frame.initialize() API stays cross-platform.
|
|
29
|
+
_ = googlePayMerchantId
|
|
30
|
+
let applePayMerchantIdString = applePayMerchantId as? String
|
|
31
|
+
FrameNetworking.shared.initializeWithAPIKey(
|
|
32
|
+
secretKey,
|
|
33
|
+
publishableKey: publishableKey,
|
|
34
|
+
applePayMerchantId: applePayMerchantIdString,
|
|
35
|
+
theme: resolvedTheme,
|
|
36
|
+
debugMode: debugMode
|
|
37
|
+
)
|
|
28
38
|
resolve(nil)
|
|
29
39
|
}
|
|
30
40
|
}
|
|
@@ -52,15 +62,14 @@ public class FrameSDKBridge: NSObject {
|
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
@objc public
|
|
55
|
-
func presentOnboarding(from viewController: UIViewController, accountId: NSObject?, capabilities: NSArray,
|
|
65
|
+
func presentOnboarding(from viewController: UIViewController, accountId: NSObject?, capabilities: NSArray, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
56
66
|
let parsedCapabilities = parseCapabilities(capabilities)
|
|
57
67
|
let accountIdString = accountId as? String
|
|
58
|
-
|
|
59
|
-
presentOnboardingOnMain(from: viewController, accountId: accountIdString, capabilities: parsedCapabilities, applePayMerchantId: merchantIdString, resolve: resolve, reject: reject)
|
|
68
|
+
presentOnboardingOnMain(from: viewController, accountId: accountIdString, capabilities: parsedCapabilities, resolve: resolve, reject: reject)
|
|
60
69
|
}
|
|
61
70
|
|
|
62
71
|
@objc public
|
|
63
|
-
func presentApplePay(_ ownerType: String, ownerId: String, amount: Int, currency: String,
|
|
72
|
+
func presentApplePay(_ ownerType: String, ownerId: String, amount: Int, currency: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
64
73
|
DispatchQueue.main.async {
|
|
65
74
|
Task { @MainActor in
|
|
66
75
|
let owner: ApplePayPresenter.Owner
|
|
@@ -75,8 +84,9 @@ public class FrameSDKBridge: NSObject {
|
|
|
75
84
|
reject("INVALID_OWNER", "owner.id must be non-empty", nil)
|
|
76
85
|
return
|
|
77
86
|
}
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
let configuredMerchantId = FrameNetworking.shared.applePayMerchantId ?? ""
|
|
88
|
+
guard !configuredMerchantId.isEmpty else {
|
|
89
|
+
reject("INVALID_MERCHANT_ID", "Apple Pay merchant ID is not configured. Pass `applePayMerchantId` to Frame.initialize().", nil)
|
|
80
90
|
return
|
|
81
91
|
}
|
|
82
92
|
guard ApplePayPresenter.canMakePayments() else {
|
|
@@ -94,7 +104,6 @@ public class FrameSDKBridge: NSObject {
|
|
|
94
104
|
amount: amount,
|
|
95
105
|
currency: currency,
|
|
96
106
|
owner: owner,
|
|
97
|
-
merchantId: merchantId,
|
|
98
107
|
resolve: { resolve($0) },
|
|
99
108
|
reject: { code, message, error in reject(code, message, error) }
|
|
100
109
|
)
|
|
@@ -106,27 +115,34 @@ public class FrameSDKBridge: NSObject {
|
|
|
106
115
|
// MARK: - Private helpers
|
|
107
116
|
|
|
108
117
|
private func presentCheckoutOnMain(from top: UIViewController, accountId: String, amount: Int, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
109
|
-
|
|
110
|
-
|
|
118
|
+
// Single dismiss delegate guards against double-resolve. The native FrameCheckoutView now
|
|
119
|
+
// emits `.cancelled` on its own .onDisappear and the bridge's
|
|
120
|
+
// `presentationControllerDidDismiss` ALSO fires on swipe-down — the delegate's `didFinish`
|
|
121
|
+
// guard prevents the double-resolve.
|
|
122
|
+
let delegate = CheckoutDismissDelegate(resolve: resolve, reject: reject)
|
|
123
|
+
let checkoutView = FrameCheckoutView(
|
|
111
124
|
accountId: accountId,
|
|
112
125
|
paymentAmount: amount,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
onResult: { [weak top, delegate] result in
|
|
127
|
+
switch result {
|
|
128
|
+
case .completed(let id):
|
|
129
|
+
delegate.finish(.success(id))
|
|
130
|
+
case .cancelled:
|
|
131
|
+
delegate.finish(.cancel)
|
|
132
|
+
case .failed:
|
|
133
|
+
delegate.finish(.failure)
|
|
121
134
|
}
|
|
135
|
+
top?.dismiss(animated: true)
|
|
122
136
|
}
|
|
123
|
-
)
|
|
137
|
+
)
|
|
138
|
+
let hosting = UIHostingController(rootView: checkoutView)
|
|
124
139
|
hosting.modalPresentationStyle = UIModalPresentationStyle.pageSheet
|
|
125
140
|
if let sheet = hosting.sheetPresentationController {
|
|
126
141
|
sheet.detents = [UISheetPresentationController.Detent.large()]
|
|
127
142
|
}
|
|
143
|
+
objc_setAssociatedObject(hosting, &checkoutDismissKey, delegate, .OBJC_ASSOCIATION_RETAIN)
|
|
128
144
|
top.present(hosting, animated: true) {
|
|
129
|
-
hosting.presentationController?.delegate =
|
|
145
|
+
hosting.presentationController?.delegate = delegate
|
|
130
146
|
}
|
|
131
147
|
}
|
|
132
148
|
|
|
@@ -161,19 +177,22 @@ public class FrameSDKBridge: NSObject {
|
|
|
161
177
|
}
|
|
162
178
|
|
|
163
179
|
private func presentCartOnMain(from top: UIViewController, accountId: String, cartItems: [RNFrameCartItem], shippingAmountInCents: Int, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
164
|
-
// Single dismiss delegate guards against double-resolve
|
|
165
|
-
//
|
|
166
|
-
//
|
|
180
|
+
// Single dismiss delegate guards against double-resolve. The native FrameCartView's own
|
|
181
|
+
// .onDisappear emits `.cancelled`, and the bridge's `presentationControllerDidDismiss`
|
|
182
|
+
// also fires on swipe-down — the delegate's `didFinish` guard prevents re-resolve.
|
|
167
183
|
let delegate = CartDismissDelegate(resolve: resolve, reject: reject)
|
|
168
184
|
let cartView = FrameCartView(
|
|
169
185
|
accountId: accountId,
|
|
170
186
|
cartItems: cartItems,
|
|
171
187
|
shippingAmountInCents: shippingAmountInCents,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
188
|
+
onResult: { [weak top, delegate] result in
|
|
189
|
+
switch result {
|
|
190
|
+
case .completed(let id):
|
|
191
|
+
delegate.finish(.success(id))
|
|
192
|
+
case .cancelled:
|
|
176
193
|
delegate.finish(.cancel)
|
|
194
|
+
case .failed:
|
|
195
|
+
delegate.finish(.failure)
|
|
177
196
|
}
|
|
178
197
|
top?.dismiss(animated: true)
|
|
179
198
|
}
|
|
@@ -189,21 +208,23 @@ public class FrameSDKBridge: NSObject {
|
|
|
189
208
|
}
|
|
190
209
|
}
|
|
191
210
|
|
|
192
|
-
private func presentOnboardingOnMain(from top: UIViewController, accountId: String?, capabilities: [FrameObjects.Capabilities],
|
|
193
|
-
// Build the dismiss delegate up-front so
|
|
194
|
-
// instance directly. Earlier shape declared `var delegate: …!` and assigned
|
|
195
|
-
// it AFTER constructing OnboardingContainerView; the onComplete closure
|
|
196
|
-
// captured the local by reference, so any path that fired the callback
|
|
197
|
-
// before assignment landed on a nil delegate and silently no-op'd via `?.`.
|
|
211
|
+
private func presentOnboardingOnMain(from top: UIViewController, accountId: String?, capabilities: [FrameObjects.Capabilities], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
212
|
+
// Build the dismiss delegate up-front so onResult captures a non-nil instance directly.
|
|
198
213
|
let delegate = OnboardingDismissDelegate(resolve: resolve)
|
|
199
214
|
|
|
200
215
|
let hosting = OnboardingHostingController(
|
|
201
216
|
rootView: OnboardingContainerView(
|
|
202
217
|
accountId: accountId,
|
|
203
218
|
requiredCapabilities: capabilities,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
219
|
+
onResult: { [delegate, weak top] result in
|
|
220
|
+
switch result {
|
|
221
|
+
case .completed(let id):
|
|
222
|
+
delegate.finish(.completed(paymentMethodId: id.isEmpty ? nil : id))
|
|
223
|
+
case .cancelled:
|
|
224
|
+
delegate.finish(.cancelled)
|
|
225
|
+
case .failed:
|
|
226
|
+
delegate.finish(.cancelled)
|
|
227
|
+
}
|
|
207
228
|
top?.dismiss(animated: true)
|
|
208
229
|
}
|
|
209
230
|
)
|
|
@@ -231,29 +252,49 @@ public class FrameSDKBridge: NSObject {
|
|
|
231
252
|
}
|
|
232
253
|
}
|
|
233
254
|
|
|
234
|
-
// MARK: -
|
|
255
|
+
// MARK: - OnboardingHostingController
|
|
256
|
+
|
|
257
|
+
private final class OnboardingHostingController<V: View>: UIHostingController<V> {}
|
|
235
258
|
|
|
236
|
-
|
|
237
|
-
var didComplete = false
|
|
238
|
-
var onCancel: (() -> Void)?
|
|
239
|
-
private var cancelled = false
|
|
259
|
+
// MARK: - Delegates
|
|
240
260
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
261
|
+
private final class CheckoutDismissDelegate: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
262
|
+
enum Outcome {
|
|
263
|
+
case success(String)
|
|
264
|
+
case failure
|
|
265
|
+
case cancel
|
|
245
266
|
}
|
|
246
|
-
}
|
|
247
267
|
|
|
248
|
-
|
|
268
|
+
private let resolve: RCTPromiseResolveBlock
|
|
269
|
+
private let reject: RCTPromiseRejectBlock
|
|
270
|
+
private var didFinish = false
|
|
249
271
|
|
|
250
|
-
|
|
272
|
+
init(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
273
|
+
self.resolve = resolve
|
|
274
|
+
self.reject = reject
|
|
275
|
+
}
|
|
251
276
|
|
|
252
|
-
|
|
277
|
+
func finish(_ outcome: Outcome) {
|
|
278
|
+
guard !didFinish else { return }
|
|
279
|
+
didFinish = true
|
|
280
|
+
DispatchQueue.main.async { [resolve, reject] in
|
|
281
|
+
switch outcome {
|
|
282
|
+
case .success(let transferId): resolve(transferId)
|
|
283
|
+
case .failure: reject("PAYMENT_FAILED", "Checkout did not produce a transfer id", nil)
|
|
284
|
+
case .cancel: reject("USER_CANCELED", "User dismissed checkout without completing payment", nil)
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
|
|
290
|
+
finish(.cancel)
|
|
291
|
+
}
|
|
292
|
+
}
|
|
253
293
|
|
|
254
294
|
private final class CartDismissDelegate: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
255
295
|
enum Outcome {
|
|
256
296
|
case success(String)
|
|
297
|
+
case failure
|
|
257
298
|
case cancel
|
|
258
299
|
}
|
|
259
300
|
|
|
@@ -272,6 +313,7 @@ private final class CartDismissDelegate: NSObject, UIAdaptivePresentationControl
|
|
|
272
313
|
DispatchQueue.main.async { [resolve, reject] in
|
|
273
314
|
switch outcome {
|
|
274
315
|
case .success(let transferId): resolve(transferId)
|
|
316
|
+
case .failure: reject("PAYMENT_FAILED", "Cart checkout did not produce a transfer id", nil)
|
|
275
317
|
case .cancel: reject("USER_CANCELED", "User dismissed cart without completing checkout", nil)
|
|
276
318
|
}
|
|
277
319
|
}
|
|
@@ -283,6 +325,11 @@ private final class CartDismissDelegate: NSObject, UIAdaptivePresentationControl
|
|
|
283
325
|
}
|
|
284
326
|
|
|
285
327
|
private final class OnboardingDismissDelegate: NSObject, UIAdaptivePresentationControllerDelegate {
|
|
328
|
+
enum Outcome {
|
|
329
|
+
case completed(paymentMethodId: String?)
|
|
330
|
+
case cancelled
|
|
331
|
+
}
|
|
332
|
+
|
|
286
333
|
let resolve: RCTPromiseResolveBlock
|
|
287
334
|
weak var hostingController: UIViewController?
|
|
288
335
|
var didFinish = false
|
|
@@ -291,11 +338,18 @@ private final class OnboardingDismissDelegate: NSObject, UIAdaptivePresentationC
|
|
|
291
338
|
self.resolve = resolve
|
|
292
339
|
}
|
|
293
340
|
|
|
294
|
-
func finish(
|
|
341
|
+
func finish(_ outcome: Outcome) {
|
|
295
342
|
guard !didFinish else { return }
|
|
296
343
|
didFinish = true
|
|
297
|
-
DispatchQueue.main.async { [resolve
|
|
298
|
-
|
|
344
|
+
DispatchQueue.main.async { [resolve] in
|
|
345
|
+
switch outcome {
|
|
346
|
+
case .completed(let paymentMethodId):
|
|
347
|
+
var payload: [String: Any] = ["status": "completed"]
|
|
348
|
+
if let paymentMethodId { payload["paymentMethodId"] = paymentMethodId }
|
|
349
|
+
resolve(payload)
|
|
350
|
+
case .cancelled:
|
|
351
|
+
resolve(["status": "cancelled"])
|
|
352
|
+
}
|
|
299
353
|
}
|
|
300
354
|
}
|
|
301
355
|
|
|
@@ -304,9 +358,10 @@ private final class OnboardingDismissDelegate: NSObject, UIAdaptivePresentationC
|
|
|
304
358
|
// callback to the Onboarding host's delegate. Only treat dismissal of the
|
|
305
359
|
// Onboarding hosting controller itself as a cancellation.
|
|
306
360
|
guard presentationController.presentedViewController === hostingController else { return }
|
|
307
|
-
finish(
|
|
361
|
+
finish(.cancelled)
|
|
308
362
|
}
|
|
309
363
|
}
|
|
310
364
|
|
|
365
|
+
private var checkoutDismissKey: UInt8 = 0
|
|
311
366
|
private var cartDismissKey: UInt8 = 0
|
|
312
367
|
private var onboardingDismissKey: UInt8 = 0
|
package/lib/native.d.ts
CHANGED
|
@@ -6,6 +6,18 @@ export declare function initialize(options: {
|
|
|
6
6
|
secretKey: string;
|
|
7
7
|
publishableKey: string;
|
|
8
8
|
debugMode?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Apple Pay merchant ID configured in your Apple Developer account. Applied to every
|
|
11
|
+
* Apple Pay surface (presentApplePay, the bundled checkout's wallet row, the
|
|
12
|
+
* onboarding wallet attach button). iOS-only — ignored on Android.
|
|
13
|
+
*/
|
|
14
|
+
applePayMerchantId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Google Pay merchant ID from the Google Pay & Wallet Console. Applied to every
|
|
17
|
+
* Google Pay surface (presentGooglePay, the bundled checkout's wallet row, the
|
|
18
|
+
* onboarding wallet attach button). Android-only — ignored on iOS.
|
|
19
|
+
*/
|
|
20
|
+
googlePayMerchantId?: string;
|
|
9
21
|
/**
|
|
10
22
|
* Optional theme applied SDK-wide to Frame's reusable iOS components
|
|
11
23
|
* (checkout, cart, onboarding). Pass any subset — unspecified tokens fall
|
|
@@ -41,8 +53,6 @@ export declare function presentCart(options: {
|
|
|
41
53
|
export declare function presentOnboarding(options: {
|
|
42
54
|
accountId?: string | null;
|
|
43
55
|
capabilities?: OnboardingCapability[];
|
|
44
|
-
applePayMerchantId?: string | null;
|
|
45
|
-
googlePayMerchantId?: string | null;
|
|
46
56
|
}): Promise<OnboardingResult>;
|
|
47
57
|
/**
|
|
48
58
|
* Presents the Apple Pay sheet and creates a charge from the resulting wallet
|
package/lib/native.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAiCjB,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAA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,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBhF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlF"}
|
package/lib/native.js
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { NativeModules, Platform } from 'react-native';
|
|
5
5
|
import { ErrorCodes } from './errors';
|
|
6
|
+
const LINKING_ERROR = `The package 'framepayments-react-native' doesn't seem to be linked. Make sure you have run 'pod install' (iOS) or rebuilt the app (Android).`;
|
|
7
|
+
const FrameSDK = NativeModules.FrameSDK
|
|
8
|
+
? NativeModules.FrameSDK
|
|
9
|
+
: new Proxy({}, {
|
|
10
|
+
get() {
|
|
11
|
+
throw new Error(LINKING_ERROR);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
6
14
|
/**
|
|
7
15
|
* Throw a coded error from synchronous JS validation. Mirrors the `code`/`message`
|
|
8
16
|
* shape that native rejections produce so consumers can catch `e.code === 'INVALID_*'`
|
|
@@ -15,14 +23,6 @@ function throwCoded(code, message) {
|
|
|
15
23
|
}
|
|
16
24
|
// theme is iOS-only today: frame-android does not yet have a matching theme API,
|
|
17
25
|
// so the field is accepted on both platforms but ignored on Android until it does.
|
|
18
|
-
const LINKING_ERROR = `The package 'framepayments-react-native' doesn't seem to be linked. Make sure you have run 'pod install' (iOS) or rebuilt the app (Android).`;
|
|
19
|
-
const FrameSDK = NativeModules.FrameSDK
|
|
20
|
-
? NativeModules.FrameSDK
|
|
21
|
-
: new Proxy({}, {
|
|
22
|
-
get() {
|
|
23
|
-
throw new Error(LINKING_ERROR);
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
26
|
let isInitialized = false;
|
|
27
27
|
export function initialize(options) {
|
|
28
28
|
if (!options?.secretKey) {
|
|
@@ -34,7 +34,7 @@ export function initialize(options) {
|
|
|
34
34
|
if (options.theme !== undefined && (typeof options.theme !== 'object' || Array.isArray(options.theme))) {
|
|
35
35
|
throwCoded(ErrorCodes.INIT_FAILED, 'Frame.initialize: theme must be an object');
|
|
36
36
|
}
|
|
37
|
-
return wrapPromise(FrameSDK.initialize(options.secretKey, options.publishableKey, options.debugMode ?? false, options.theme ?? null)).then(() => {
|
|
37
|
+
return wrapPromise(FrameSDK.initialize(options.secretKey, options.publishableKey, options.debugMode ?? false, options.applePayMerchantId ?? null, options.googlePayMerchantId ?? null, options.theme ?? null)).then(() => {
|
|
38
38
|
isInitialized = true;
|
|
39
39
|
});
|
|
40
40
|
}
|
|
@@ -89,10 +89,7 @@ export function presentCart(options) {
|
|
|
89
89
|
}
|
|
90
90
|
export function presentOnboarding(options) {
|
|
91
91
|
guardInitialized();
|
|
92
|
-
|
|
93
|
-
return wrapPromise(FrameSDK.presentOnboarding(options.accountId ?? null, options.capabilities ?? [], options.applePayMerchantId ?? null));
|
|
94
|
-
}
|
|
95
|
-
return wrapPromise(FrameSDK.presentOnboarding(options.accountId ?? null, options.capabilities ?? [], options.googlePayMerchantId ?? null));
|
|
92
|
+
return wrapPromise(FrameSDK.presentOnboarding(options.accountId ?? null, options.capabilities ?? []));
|
|
96
93
|
}
|
|
97
94
|
/**
|
|
98
95
|
* Presents the Apple Pay sheet and creates a charge from the resulting wallet
|
|
@@ -104,16 +101,16 @@ export function presentOnboarding(options) {
|
|
|
104
101
|
*/
|
|
105
102
|
export function presentApplePay(options) {
|
|
106
103
|
guardInitialized();
|
|
104
|
+
if (Platform.OS !== 'ios') {
|
|
105
|
+
throwCoded('PLATFORM_UNSUPPORTED', 'Frame.presentApplePay is iOS-only; use presentGooglePay on Android.');
|
|
106
|
+
}
|
|
107
107
|
if (!options?.owner || (options.owner.type !== 'customer' && options.owner.type !== 'account')) {
|
|
108
108
|
throwCoded(ErrorCodes.INVALID_OWNER, 'Frame.presentApplePay requires owner: { type: "customer" | "account", id: string }');
|
|
109
109
|
}
|
|
110
110
|
if (!options.owner.id) {
|
|
111
111
|
throwCoded(ErrorCodes.INVALID_OWNER, 'Frame.presentApplePay requires owner.id');
|
|
112
112
|
}
|
|
113
|
-
|
|
114
|
-
throwCoded(ErrorCodes.INVALID_MERCHANT_ID, 'Frame.presentApplePay requires merchantId');
|
|
115
|
-
}
|
|
116
|
-
return wrapPromise(FrameSDK.presentApplePay(options.owner.type, options.owner.id, options.amount, options.currency ?? 'usd', options.merchantId));
|
|
113
|
+
return wrapPromise(FrameSDK.presentApplePay(options.owner.type, options.owner.id, options.amount, options.currency ?? 'usd'));
|
|
117
114
|
}
|
|
118
115
|
/**
|
|
119
116
|
* Presents Google Pay and creates a charge from the resulting wallet payment method.
|
|
@@ -124,11 +121,14 @@ export function presentApplePay(options) {
|
|
|
124
121
|
*/
|
|
125
122
|
export function presentGooglePay(options) {
|
|
126
123
|
guardInitialized();
|
|
124
|
+
if (Platform.OS !== 'android') {
|
|
125
|
+
throwCoded('PLATFORM_UNSUPPORTED', 'Frame.presentGooglePay is Android-only; use presentApplePay on iOS.');
|
|
126
|
+
}
|
|
127
127
|
if (!options?.owner || (options.owner.type !== 'customer' && options.owner.type !== 'account')) {
|
|
128
128
|
throwCoded(ErrorCodes.INVALID_OWNER, 'Frame.presentGooglePay requires owner: { type: "customer" | "account", id: string }');
|
|
129
129
|
}
|
|
130
130
|
if (!options.owner.id) {
|
|
131
131
|
throwCoded(ErrorCodes.INVALID_OWNER, 'Frame.presentGooglePay requires owner.id');
|
|
132
132
|
}
|
|
133
|
-
return wrapPromise(FrameSDK.presentGooglePay(options.amountCents, options.owner.type, options.owner.id, options.currencyCode ?? 'USD'
|
|
133
|
+
return wrapPromise(FrameSDK.presentGooglePay(options.amountCents, options.owner.type, options.owner.id, options.currencyCode ?? 'USD'));
|
|
134
134
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -79,7 +79,12 @@ export type WalletOwner = {
|
|
|
79
79
|
};
|
|
80
80
|
/** @deprecated Use {@link WalletOwner}. Retained as an alias for source compatibility. */
|
|
81
81
|
export type ApplePayOwner = WalletOwner;
|
|
82
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Options for Frame.presentApplePay.
|
|
84
|
+
*
|
|
85
|
+
* The Apple Pay merchant ID is set once at `Frame.initialize({ applePayMerchantId })`. There is
|
|
86
|
+
* no per-call merchant ID parameter — the SDK reads it from the singleton at present time.
|
|
87
|
+
*/
|
|
83
88
|
export interface PresentApplePayOptions {
|
|
84
89
|
/** Payment amount in cents. */
|
|
85
90
|
amount: number;
|
|
@@ -87,10 +92,13 @@ export interface PresentApplePayOptions {
|
|
|
87
92
|
currency?: string;
|
|
88
93
|
/** Customer or account that owns the resulting payment method and charge. */
|
|
89
94
|
owner: WalletOwner;
|
|
90
|
-
/** Apple Pay merchant ID configured in your Apple Developer account. */
|
|
91
|
-
merchantId: string;
|
|
92
95
|
}
|
|
93
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Options for Frame.presentGooglePay.
|
|
98
|
+
*
|
|
99
|
+
* The Google Pay merchant ID is set once at `Frame.initialize({ googlePayMerchantId })`. There
|
|
100
|
+
* is no per-call merchant ID parameter — the SDK reads it from the singleton at present time.
|
|
101
|
+
*/
|
|
94
102
|
export interface PresentGooglePayOptions {
|
|
95
103
|
/** Payment amount in cents. */
|
|
96
104
|
amountCents: number;
|
|
@@ -98,8 +106,6 @@ export interface PresentGooglePayOptions {
|
|
|
98
106
|
owner: WalletOwner;
|
|
99
107
|
/** ISO 4217 currency code. Defaults to 'USD'. */
|
|
100
108
|
currencyCode?: string;
|
|
101
|
-
/** Optional override for the Google Pay merchant ID. */
|
|
102
|
-
googlePayMerchantId?: string;
|
|
103
109
|
}
|
|
104
110
|
/**
|
|
105
111
|
* Theming for Frame's reusable iOS components (checkout, cart, onboarding).
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,2CAA2C;AAC3C,MAAM,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,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,0BAA0B,CAAC,EAAE,eAAe,CAAC;IAC7C,+BAA+B,CAAC,EAAE,eAAe,CAAC;IAClD,8BAA8B,CAAC,EAAE,eAAe,CAAC;CAClD;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framepayments-react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "React Native SDK for Frame Payments - modal checkout and cart, with API usage via frame-node.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -31,7 +31,11 @@
|
|
|
31
31
|
"homepage": "https://github.com/Frame-Payments/frame-react-native#readme",
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": "*",
|
|
34
|
-
"react-native": ">=0.
|
|
34
|
+
"react-native": ">=0.81.0"
|
|
35
|
+
},
|
|
36
|
+
"frameNativeVersions": {
|
|
37
|
+
"ios": "2.2.3",
|
|
38
|
+
"android": "2.0.9"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@types/jest": "^29.5.0",
|
|
@@ -54,6 +58,8 @@
|
|
|
54
58
|
"lib",
|
|
55
59
|
"ios",
|
|
56
60
|
"android",
|
|
61
|
+
"FrameReactNative.podspec",
|
|
62
|
+
"Package.swift",
|
|
57
63
|
"README.md",
|
|
58
64
|
"LICENSE"
|
|
59
65
|
],
|