UNPKG

@stripe/stripe-react-native

Version:
51 lines (50 loc) 4.63 kB
import type { PaymentMethod, PaymentIntent, PaymentSheet, CreatePaymentMethodResult, RetrievePaymentIntentResult, RetrieveSetupIntentResult, ConfirmPaymentResult, HandleNextActionResult, HandleNextActionForSetupResult, ConfirmSetupIntentResult, CreateTokenForCVCUpdateResult, StripeError, InitPaymentSheetResult, PresentPaymentSheetResult, ConfirmPaymentSheetPaymentResult, SetupIntent, CreateTokenResult, Token, VerifyMicrodepositsParams, VerifyMicrodepositsForPaymentResult, VerifyMicrodepositsForSetupResult, CollectBankAccountForSetupResult, CollectBankAccountForPaymentResult, CanAddCardToWalletParams, CanAddCardToWalletResult, FinancialConnections, PlatformPay, PlatformPayError } from '../types'; /** * useStripe hook */ export declare function useStripe(): { retrievePaymentIntent: (clientSecret: string) => Promise<RetrievePaymentIntentResult>; retrieveSetupIntent: (clientSecret: string) => Promise<RetrieveSetupIntentResult>; confirmPayment: (paymentIntentClientSecret: string, data?: PaymentIntent.ConfirmParams | undefined, options?: PaymentIntent.ConfirmOptions) => Promise<ConfirmPaymentResult>; createPaymentMethod: (data: PaymentMethod.CreateParams, options?: PaymentMethod.CreateOptions) => Promise<CreatePaymentMethodResult>; handleNextAction: (paymentIntentClientSecret: string, returnURL?: string | undefined) => Promise<HandleNextActionResult>; handleNextActionForSetup: (setupIntentClientSecret: string, returnURL?: string | undefined) => Promise<HandleNextActionForSetupResult>; confirmSetupIntent: (paymentIntentClientSecret: string, data: SetupIntent.ConfirmParams, options?: SetupIntent.ConfirmOptions) => Promise<ConfirmSetupIntentResult>; createTokenForCVCUpdate: (cvc: string) => Promise<CreateTokenForCVCUpdateResult>; handleURLCallback: (url: string) => Promise<boolean>; confirmPaymentSheetPayment: () => Promise<ConfirmPaymentSheetPaymentResult>; presentPaymentSheet: (options?: PaymentSheet.PresentOptions | undefined) => Promise<PresentPaymentSheetResult>; initPaymentSheet: (params: PaymentSheet.SetupParams) => Promise<InitPaymentSheetResult>; createToken: (params: Token.CreateParams) => Promise<CreateTokenResult>; collectBankAccountForPayment: (clientSecret: string, params: PaymentMethod.CollectBankAccountParams) => Promise<CollectBankAccountForPaymentResult>; collectBankAccountForSetup: (clientSecret: string, params: PaymentMethod.CollectBankAccountParams) => Promise<CollectBankAccountForSetupResult>; verifyMicrodepositsForPayment: (clientSecret: string, params: VerifyMicrodepositsParams) => Promise<VerifyMicrodepositsForPaymentResult>; verifyMicrodepositsForSetup: (clientSecret: string, params: VerifyMicrodepositsParams) => Promise<VerifyMicrodepositsForSetupResult>; canAddCardToWallet: (params: CanAddCardToWalletParams) => Promise<CanAddCardToWalletResult>; collectBankAccountToken: (clientSecret: string, params?: PaymentMethod.CollectBankAccountTokenParams | undefined) => Promise<FinancialConnections.TokenResult>; collectFinancialConnectionsAccounts: (clientSecret: string, params?: FinancialConnections.CollectFinancialConnectionsAccountsParams | undefined) => Promise<FinancialConnections.SessionResult>; /** * You must call this method when the user logs out from your app. This will ensure that * any persisted authentication state in the PaymentSheet, such as authentication cookies, * is also cleared during logout. */ resetPaymentSheetCustomer: () => Promise<null>; isPlatformPaySupported: (params?: { googlePay?: PlatformPay.IsGooglePaySupportedParams | undefined; } | undefined) => Promise<boolean>; confirmPlatformPaySetupIntent: (clientSecret: string, params: PlatformPay.ConfirmParams) => Promise<PlatformPay.ConfirmSetupIntentResult>; confirmPlatformPayPayment: (clientSecret: string, params: PlatformPay.ConfirmParams) => Promise<PlatformPay.ConfirmPaymentResult>; dismissPlatformPay: () => Promise<boolean>; createPlatformPayPaymentMethod: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.PaymentMethodResult>; createPlatformPayToken: (params: PlatformPay.PaymentMethodParams) => Promise<PlatformPay.TokenResult>; updatePlatformPaySheet: (params: { applePay: { cartItems: Array<PlatformPay.CartSummaryItem>; shippingMethods: Array<PlatformPay.ShippingMethod>; errors: Array<PlatformPay.ApplePaySheetError>; }; }) => Promise<{ error?: StripeError<PlatformPayError>; }>; openPlatformPaySetup: () => Promise<void>; };