forked from sorokin0andrey/react-native-google-pay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
48 lines (42 loc) · 1.4 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
type EnvironmentType = number
export type AllowedCardNetworkType = 'AMEX' | 'DISCOVER' | 'JCB' | 'MASTERCARD' | 'VISA'
export type AllowedCardAuthMethodsType = 'PAN_ONLY' | 'CRYPTOGRAM_3DS'
export type tokenizationSpecificationType = 'PAYMENT_GATEWAY' | 'DIRECT'
export interface RequestDataType {
cardPaymentMethod: {
tokenizationSpecification: {
type: tokenizationSpecificationType
/** only with type: PAYMENT_GATEWAY */
gateway?: string
/** only with type: PAYMENT_GATEWAY */
gatewayMerchantId?: string
/** only with gateway: stripe */
stripe?: {
publishableKey: string
version: string
}
/** only with type: DIRECT */
publicKey?: string
}
allowedCardNetworks: AllowedCardNetworkType[]
allowedCardAuthMethods: AllowedCardAuthMethodsType[]
}
transaction: {
totalPrice: string
totalPriceStatus: string
currencyCode: string
countryCode?: string
}
merchantName: string
}
declare class GooglePay {
static ENVIRONMENT_TEST: EnvironmentType
static ENVIRONMENT_PRODUCTION: EnvironmentType
static setEnvironment: (environment: EnvironmentType) => void
static isReadyToPay: (
allowedCardNetworks: AllowedCardNetworkType[],
allowedCardAuthMethods: AllowedCardAuthMethodsType[]
) => Promise<boolean>
static requestPayment: (requestData: RequestDataType) => Promise<string>
}
export { GooglePay }