@xbenjii/react-native-braintree-dropin-ui 2.0.0 → 2.1.0
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/LICENSE +21 -21
- package/README.md +365 -365
- package/RNBraintreeDropIn.podspec +22 -22
- package/android/build.gradle +50 -50
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInModule.java +318 -265
- package/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInPackage.java +27 -27
- package/index.js +5 -5
- package/index.js.flow +42 -42
- package/ios/RNBraintreeDropIn.h +40 -40
- package/ios/RNBraintreeDropIn.m +309 -280
- package/ios/RNBraintreeDropIn.xcodeproj/project.pbxproj +291 -291
- package/ios/RNBraintreeDropIn.xcworkspace/contents.xcworkspacedata +8 -8
- package/package.json +34 -34
- package/react-native.config.js +13 -13
package/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { NativeModules } from 'react-native';
|
2
|
-
|
3
|
-
const { RNBraintreeDropIn } = NativeModules;
|
4
|
-
|
5
|
-
export default RNBraintreeDropIn;
|
1
|
+
import { NativeModules } from 'react-native';
|
2
|
+
|
3
|
+
const { RNBraintreeDropIn } = NativeModules;
|
4
|
+
|
5
|
+
export default RNBraintreeDropIn;
|
package/index.js.flow
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
type ShowOptions = {|
|
2
|
-
clientToken: string,
|
3
|
-
threeDSecure?: {|
|
4
|
-
amount: number,
|
5
|
-
|},
|
6
|
-
vaultManager?: boolean,
|
7
|
-
cardDisabled?: boolean,
|
8
|
-
googlePay?: boolean,
|
9
|
-
orderTotal?: string,
|
10
|
-
currencyCode?: string,
|
11
|
-
googlePayMerchantId?: string,
|
12
|
-
payPal?: boolean,
|
13
|
-
applePay?: boolean,
|
14
|
-
merchantIdentifier?: string,
|
15
|
-
countryCode?: string,
|
16
|
-
merchantName?: string,
|
17
|
-
darkTheme?: boolean,
|
18
|
-
fontFamily?: string,
|
19
|
-
boldFontFamily?: string,
|
20
|
-
|};
|
21
|
-
|
22
|
-
type CardInfo = {|
|
23
|
-
number: string,
|
24
|
-
expirationMonth: string,
|
25
|
-
expirationYear: string,
|
26
|
-
cvv: string,
|
27
|
-
postalCode: string,
|
28
|
-
|};
|
29
|
-
|
30
|
-
type ShowResult = {|
|
31
|
-
nonce: string,
|
32
|
-
description: string,
|
33
|
-
type: string,
|
34
|
-
isDefault: boolean,
|
35
|
-
deviceData: string,
|
36
|
-
|};
|
37
|
-
|
38
|
-
declare module.exports: {
|
39
|
-
show: (options: ShowOptions) => Promise<ShowResult>,
|
40
|
-
fetchMostRecentPaymentMethod: (clientToken: string) => Promise<ShowResult>,
|
41
|
-
tokenizeCard: (clientToken: string, cardInfo: CardInfo) => Promise<string>,
|
42
|
-
};
|
1
|
+
type ShowOptions = {|
|
2
|
+
clientToken: string,
|
3
|
+
threeDSecure?: {|
|
4
|
+
amount: number,
|
5
|
+
|},
|
6
|
+
vaultManager?: boolean,
|
7
|
+
cardDisabled?: boolean,
|
8
|
+
googlePay?: boolean,
|
9
|
+
orderTotal?: string,
|
10
|
+
currencyCode?: string,
|
11
|
+
googlePayMerchantId?: string,
|
12
|
+
payPal?: boolean,
|
13
|
+
applePay?: boolean,
|
14
|
+
merchantIdentifier?: string,
|
15
|
+
countryCode?: string,
|
16
|
+
merchantName?: string,
|
17
|
+
darkTheme?: boolean,
|
18
|
+
fontFamily?: string,
|
19
|
+
boldFontFamily?: string,
|
20
|
+
|};
|
21
|
+
|
22
|
+
type CardInfo = {|
|
23
|
+
number: string,
|
24
|
+
expirationMonth: string,
|
25
|
+
expirationYear: string,
|
26
|
+
cvv: string,
|
27
|
+
postalCode: string,
|
28
|
+
|};
|
29
|
+
|
30
|
+
type ShowResult = {|
|
31
|
+
nonce: string,
|
32
|
+
description: string,
|
33
|
+
type: string,
|
34
|
+
isDefault: boolean,
|
35
|
+
deviceData: string,
|
36
|
+
|};
|
37
|
+
|
38
|
+
declare module.exports: {
|
39
|
+
show: (options: ShowOptions) => Promise<ShowResult>,
|
40
|
+
fetchMostRecentPaymentMethod: (clientToken: string) => Promise<ShowResult>,
|
41
|
+
tokenizeCard: (clientToken: string, cardInfo: CardInfo) => Promise<string>,
|
42
|
+
};
|
package/ios/RNBraintreeDropIn.h
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
@import UIKit;
|
2
|
-
@import PassKit;
|
3
|
-
|
4
|
-
#if __has_include("RCTBridgeModule.h")
|
5
|
-
#import "RCTBridgeModule.h"
|
6
|
-
#else
|
7
|
-
#import <React/RCTBridgeModule.h>
|
8
|
-
#endif
|
9
|
-
|
10
|
-
#import "BraintreeCore.h"
|
11
|
-
#import "BraintreeDropIn.h"
|
12
|
-
#import "BTCardNonce.h"
|
13
|
-
#import "BTDataCollector.h"
|
14
|
-
|
15
|
-
#import "BraintreeApplePay.h"
|
16
|
-
|
17
|
-
@interface RNBraintreeDropIn : NSObject <RCTBridgeModule, PKPaymentAuthorizationViewControllerDelegate>
|
18
|
-
|
19
|
-
@property (nonatomic, strong) UIViewController *_Nonnull reactRoot;
|
20
|
-
|
21
|
-
// Retain your `BTDataCollector` instance for your entire application lifecycle.
|
22
|
-
@property (nonatomic, strong) BTDataCollector *_Nonnull dataCollector;
|
23
|
-
|
24
|
-
@property (nonatomic, strong) BTAPIClient *_Nonnull braintreeClient;
|
25
|
-
|
26
|
-
@property (nonatomic, strong) PKPaymentRequest *_Nonnull paymentRequest;
|
27
|
-
|
28
|
-
@property (nonatomic, strong) PKPaymentAuthorizationViewController *_Nonnull viewController;
|
29
|
-
|
30
|
-
@property (nonatomic, strong) NSString * _Nonnull deviceDataCollector;
|
31
|
-
|
32
|
-
@property (nonatomic) RCTPromiseResolveBlock _Nonnull resolve;
|
33
|
-
|
34
|
-
@property (nonatomic) RCTPromiseRejectBlock _Nonnull reject;
|
35
|
-
|
36
|
-
@property (nonatomic, assign) BOOL applePayAuthorized;
|
37
|
-
|
38
|
-
+ (void)resolvePayment:(BTDropInResult* _Nullable)result deviceData:(NSString * _Nonnull)deviceDataCollector resolver:(RCTPromiseResolveBlock _Nonnull)resolve;
|
39
|
-
|
40
|
-
@end
|
1
|
+
@import UIKit;
|
2
|
+
@import PassKit;
|
3
|
+
|
4
|
+
#if __has_include("RCTBridgeModule.h")
|
5
|
+
#import "RCTBridgeModule.h"
|
6
|
+
#else
|
7
|
+
#import <React/RCTBridgeModule.h>
|
8
|
+
#endif
|
9
|
+
|
10
|
+
#import "BraintreeCore.h"
|
11
|
+
#import "BraintreeDropIn.h"
|
12
|
+
#import "BTCardNonce.h"
|
13
|
+
#import "BTDataCollector.h"
|
14
|
+
|
15
|
+
#import "BraintreeApplePay.h"
|
16
|
+
|
17
|
+
@interface RNBraintreeDropIn : NSObject <RCTBridgeModule, PKPaymentAuthorizationViewControllerDelegate>
|
18
|
+
|
19
|
+
@property (nonatomic, strong) UIViewController *_Nonnull reactRoot;
|
20
|
+
|
21
|
+
// Retain your `BTDataCollector` instance for your entire application lifecycle.
|
22
|
+
@property (nonatomic, strong) BTDataCollector *_Nonnull dataCollector;
|
23
|
+
|
24
|
+
@property (nonatomic, strong) BTAPIClient *_Nonnull braintreeClient;
|
25
|
+
|
26
|
+
@property (nonatomic, strong) PKPaymentRequest *_Nonnull paymentRequest;
|
27
|
+
|
28
|
+
@property (nonatomic, strong) PKPaymentAuthorizationViewController *_Nonnull viewController;
|
29
|
+
|
30
|
+
@property (nonatomic, strong) NSString * _Nonnull deviceDataCollector;
|
31
|
+
|
32
|
+
@property (nonatomic) RCTPromiseResolveBlock _Nonnull resolve;
|
33
|
+
|
34
|
+
@property (nonatomic) RCTPromiseRejectBlock _Nonnull reject;
|
35
|
+
|
36
|
+
@property (nonatomic, assign) BOOL applePayAuthorized;
|
37
|
+
|
38
|
+
+ (void)resolvePayment:(BTDropInResult* _Nullable)result deviceData:(NSString * _Nonnull)deviceDataCollector resolver:(RCTPromiseResolveBlock _Nonnull)resolve;
|
39
|
+
|
40
|
+
@end
|