@adyen/react-native
Version:
Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native
58 lines • 2.72 kB
TypeScript
import React, { ReactNode } from 'react';
import { AdyenComponent } from './core/AdyenNativeModules';
import { AdyenError, PaymentMethodsResponse, SessionConfiguration, PaymentMethodData, PaymentDetailsData } from './core/types';
import { Configuration } from './core/configurations/Configuration';
import { AdyenActionComponent } from './core/AdyenNativeModules';
/**
* Returns AdyenCheckout context. This context allows you to initiate payment with Drop-in or any payment method available in `paymentMethods` collection.
*/
interface AdyenCheckoutContextType {
start: (typeName: string) => void;
config: Configuration;
paymentMethods?: PaymentMethodsResponse;
}
/**
* Returns AdyenCheckout context. This context allows you to initiate payment with Drop-in or any payment method available in `paymentMethods` collection.
*/
declare const useAdyenCheckout: () => AdyenCheckoutContextType;
/**
* Props for AdyenCheckout
*/
type AdyenCheckoutProps = {
/** Collection of all necessary configurations */
config: Configuration;
/** JSON response from Adyen API `\paymentMethods` */
paymentMethods?: PaymentMethodsResponse;
/** The payment session data from backend response. */
session?: SessionConfiguration;
/**
* Event callback, called when the shopper selects the Pay button and payment details are valid.
* @param data - The payment method data.
* @param component - The Adyen payment component.
* @param extra - Additional data (optional).
*/
onSubmit?: (data: PaymentMethodData, component: AdyenActionComponent, extra?: any) => void;
/**
* Event callback, called when payment about to be terminate.
* @param data - The payment method data.
* @param component - The Adyen payment component.
*/
onError: (error: AdyenError, component: AdyenComponent) => void;
/**
* Event callback, called when a payment method requires more details, for example for native 3D Secure 2, or native QR code payment methods.
* @param data - The payment method data.
* @param component - The Adyen payment component.
*/
onAdditionalDetails?: (data: PaymentDetailsData, component: AdyenActionComponent) => void;
/**
* Event callback, called when a shopper finishes the flow (Voucher payments only).
* @param component - The Adyen payment component.
*/
onComplete?: (result: string, component: AdyenComponent) => void;
/** Inner components */
children: ReactNode;
};
declare const AdyenCheckout: React.FC<AdyenCheckoutProps>;
export { AdyenCheckout, useAdyenCheckout };
export type { AdyenCheckoutContextType, AdyenCheckoutProps };
//# sourceMappingURL=AdyenCheckoutContext.d.ts.map