-
Notifications
You must be signed in to change notification settings - Fork 267
/
Copy pathNativeStripeSdk.tsx
60 lines (57 loc) · 1.94 KB
/
NativeStripeSdk.tsx
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
import { NativeModules } from 'react-native';
import type {
PaymentMethodCreateParams,
ThreeDSecureConfigurationParams,
PaymentIntent,
PaymentMethod,
ApplePay,
SetupIntent,
PaymentSheet,
ConfirmSetupIntent,
InitialiseParams,
Card,
} from './types';
type NativeStripeSdkType = {
initialise(params: InitialiseParams): Promise<void>;
createPaymentMethod(
data: PaymentMethodCreateParams.Params,
options: PaymentMethodCreateParams.Options
): Promise<PaymentMethod>;
handleCardAction(paymentIntentClientSecret: string): Promise<PaymentIntent>;
confirmPaymentMethod(
paymentIntentClientSecret: string,
data: PaymentMethodCreateParams.Params,
options: PaymentMethodCreateParams.Options
): Promise<PaymentIntent>;
configure3dSecure(params: ThreeDSecureConfigurationParams): void;
isApplePaySupported(): Promise<boolean>;
presentApplePay(params: ApplePay.PresentParams): Promise<void>;
confirmApplePayPayment(clientSecret: string): Promise<void>;
updateApplePaySummaryItems(
summaryItems: ApplePay.CartSummaryItem[],
errorAddressFields: Array<{
field: ApplePay.AddressFields;
message?: string;
}>
): Promise<void>;
confirmSetupIntent(
paymentIntentClientSecret: string,
data: ConfirmSetupIntent.Params,
options: ConfirmSetupIntent.Options
): Promise<SetupIntent>;
retrievePaymentIntent(clientSecret: string): Promise<PaymentIntent>;
initPaymentSheet(
params: PaymentSheet.SetupParams
): Promise<PaymentSheet.PaymentOption | undefined>;
presentPaymentSheet(
params?: PaymentSheet.PresentParams
): Promise<{
paymentOption?: PaymentSheet.PaymentOption;
}>;
confirmPaymentSheetPayment(): Promise<void>;
createTokenForCVCUpdate(cvc: string): Promise<string>;
handleURLCallback(url: string): Promise<boolean>;
createToken(params: Card.CreateTokenParams): Promise<Card.Token>;
};
const { StripeSdk } = NativeModules;
export default StripeSdk as NativeStripeSdkType;