import {createContext} from 'react';
import {InitializePayment, PaystackCallbacks, PaystackProps} from './types';

type IPaystackContext = PaystackCallbacks & {
  config: PaystackProps;
  initializePayment: InitializePayment;
};

const PaystackContext = createContext<IPaystackContext>({
  config: {} as PaystackProps,
  initializePayment: () => null,
  onSuccess: () => null,
  onCancel: () => null,
  onClose: () => null,
  onError: () => null,
  onLoad: () => null,
});

export default PaystackContext;
