@xbenjii/react-native-braintree-dropin-ui 2.5.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -21
- package/README.md +377 -377
- package/RNBraintreeDropIn.podspec +22 -22
- package/android/build.gradle +111 -110
- package/android/gradle/wrapper/gradle-wrapper.properties +8 -8
- package/android/gradle.properties +15 -15
- package/android/gradlew.bat +92 -92
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/xbenjii/RNBraintreeDropIn/RNBraintreeDropInModule.java +366 -366
- package/android/src/main/java/com/xbenjii/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 +352 -352
- package/ios/RNBraintreeDropIn.xcodeproj/project.pbxproj +291 -291
- package/ios/RNBraintreeDropIn.xcworkspace/contents.xcworkspacedata +8 -8
- package/package.json +38 -38
- package/react-native.config.js +13 -13
@@ -1,27 +1,27 @@
|
|
1
|
-
package com.xbenjii.RNBraintreeDropIn;
|
2
|
-
|
3
|
-
import java.util.Arrays;
|
4
|
-
import java.util.Collections;
|
5
|
-
import java.util.List;
|
6
|
-
|
7
|
-
import com.facebook.react.ReactPackage;
|
8
|
-
import com.facebook.react.bridge.NativeModule;
|
9
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
10
|
-
import com.facebook.react.uimanager.ViewManager;
|
11
|
-
import com.facebook.react.bridge.JavaScriptModule;
|
12
|
-
public class RNBraintreeDropInPackage implements ReactPackage {
|
13
|
-
@Override
|
14
|
-
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
15
|
-
return Arrays.<NativeModule>asList(new RNBraintreeDropInModule(reactContext));
|
16
|
-
}
|
17
|
-
|
18
|
-
// Deprecated from RN 0.47
|
19
|
-
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
20
|
-
return Collections.emptyList();
|
21
|
-
}
|
22
|
-
|
23
|
-
@Override
|
24
|
-
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
25
|
-
return Collections.emptyList();
|
26
|
-
}
|
27
|
-
}
|
1
|
+
package com.xbenjii.RNBraintreeDropIn;
|
2
|
+
|
3
|
+
import java.util.Arrays;
|
4
|
+
import java.util.Collections;
|
5
|
+
import java.util.List;
|
6
|
+
|
7
|
+
import com.facebook.react.ReactPackage;
|
8
|
+
import com.facebook.react.bridge.NativeModule;
|
9
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
10
|
+
import com.facebook.react.uimanager.ViewManager;
|
11
|
+
import com.facebook.react.bridge.JavaScriptModule;
|
12
|
+
public class RNBraintreeDropInPackage implements ReactPackage {
|
13
|
+
@Override
|
14
|
+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
15
|
+
return Arrays.<NativeModule>asList(new RNBraintreeDropInModule(reactContext));
|
16
|
+
}
|
17
|
+
|
18
|
+
// Deprecated from RN 0.47
|
19
|
+
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
20
|
+
return Collections.emptyList();
|
21
|
+
}
|
22
|
+
|
23
|
+
@Override
|
24
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
25
|
+
return Collections.emptyList();
|
26
|
+
}
|
27
|
+
}
|
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
|