UNPKG

@adyen/react-native

Version:

Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native

22 lines (18 loc) 639 B
"use strict"; import { createContext, useContext } from 'react'; import { MISSING_CONTEXT_ERROR } from './constants'; /** * Shape of the AdyenCheckout context value. */ export const AdyenCheckoutContext = /*#__PURE__*/createContext(null); /** * Returns AdyenCheckout context. This context allows you to initiate payment with Drop-in or any payment method available in `paymentMethods` collection. */ export const useAdyenCheckout = () => { const context = useContext(AdyenCheckoutContext); if (context !== null) { return context; } throw new Error(MISSING_CONTEXT_ERROR); }; //# sourceMappingURL=useAdyenCheckout.js.map