forked from naoufal/react-native-payments
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathReactNativePayments.h
32 lines (26 loc) · 1.76 KB
/
ReactNativePayments.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@import UIKit;
@import PassKit;
@import AddressBook;
#import <React/RCTBridgeModule.h>
#import "GatewayManager.h"
@interface ReactNativePayments : NSObject <RCTBridgeModule, PKPaymentAuthorizationViewControllerDelegate>
@property (nonatomic, strong) RCTResponseSenderBlock callback;
@property (nonatomic, strong) PKPaymentRequest *paymentRequest;
@property (nonatomic, strong) NSDictionary *initialOptions;
@property (nonatomic, strong) GatewayManager *gatewayManager;
@property BOOL *hasGatewayParameters;
@property (nonatomic, strong) PKPaymentAuthorizationViewController *viewController;
@property (nonatomic, copy) void (^completion)(PKPaymentAuthorizationStatus);
@property (nonatomic, copy) void (^shippingContactCompletion)(PKPaymentAuthorizationStatus, NSArray<PKShippingMethod *> * _Nonnull, NSArray<PKPaymentSummaryItem *> * _Nonnull);
@property (nonatomic, copy) void (^shippingMethodCompletion)(PKPaymentAuthorizationStatus, NSArray<PKPaymentSummaryItem *> * _Nonnull);
@property (nonatomic, copy) void (^paymentMethodCompletion)(NSArray<PKPaymentSummaryItem *> * _Nonnull);
// Private methods
- (NSArray *_Nonnull)getSupportedNetworksFromMethodData:(NSDictionary *_Nonnull)methodData;
- (NSArray<PKPaymentSummaryItem *> *_Nonnull)getPaymentSummaryItemsFromDetails:(NSDictionary *_Nonnull)details;
- (NSArray<PKShippingMethod *> *_Nonnull)getShippingMethodsFromDetails:(NSDictionary *_Nonnull)details;
- (PKPaymentSummaryItem *_Nonnull)convertDisplayItemToPaymentSummaryItem:(NSDictionary *_Nonnull)displayItem;
- (PKShippingMethod *_Nonnull)convertShippingOptionToShippingMethod:(NSDictionary *_Nonnull)shippingOption;
- (void)handleUserAccept:(PKPayment *_Nonnull)payment
paymentToken:(NSString *_Nullable)token;
- (void)handleGatewayError:(NSError *_Nonnull)error;
@end