-
Notifications
You must be signed in to change notification settings - Fork 21
/
index.d.ts
74 lines (64 loc) · 1.98 KB
/
index.d.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
declare module '@ekreative/react-native-braintree' {
export interface BraintreeResponse {
nonce: string;
deviceData: string;
}
export interface BraintreeOptions {
clientToken: string;
amount: string;
currencyCode: string;
}
export interface Run3DSecureCheckOptions
extends Omit<BraintreeOptions, 'currencyCode' | 'clientToken'> {
nonce: string;
/* Pass clientToken if previously no RNBraintree methods were run. */
clientToken?: string;
/* Provide as many of the following fields as possible. */
email?: string;
firstname?: string;
lastname?: string;
phoneNumber?: string;
streetAddress?: string;
streetAddress2?: string;
city?: string;
region?: string;
postalCode?: string;
countryCode?: string;
}
export interface TokenizeCardOptions {
clientToken: string;
number: string;
expirationMonth: string;
expirationYear: string;
cvv: string;
postalCode?: string;
}
export interface RunApplePayOptions extends BraintreeOptions {
companyName: string;
}
export interface PayPalOptions extends BraintreeOptions {
userAction?: 'commit';
appLinkReturnUrl?: string,
}
export interface PayPalBillingAgreementOptions {
clientToken: string;
description?: string;
localeCode?: string;
}
// Export
interface RNBraintreeModule {
showPayPalModule(options: PayPalOptions): Promise<BraintreeResponse>;
runGooglePay(options: BraintreeOptions): Promise<BraintreeResponse>;
run3DSecureCheck(
options: Run3DSecureCheckOptions,
): Promise<BraintreeResponse>;
tokenizeCard(options: TokenizeCardOptions): Promise<BraintreeResponse>;
runApplePay(options: RunApplePayOptions): Promise<BraintreeResponse>;
requestPayPalBillingAgreement(
options: PayPalBillingAgreementOptions,
): Promise<BraintreeResponse>;
getDeviceData(clientToken: string): Promise<string>;
}
const RNBraintree: RNBraintreeModule;
export default RNBraintree;
}