import { NativeModules } from 'react-native';

interface PaymentParams {
  cardNumber: string;
  name: string;
  expiryMonth: string;
  expiryYear: string;
  cvv: string;
}

export enum Environment {
  PROD = 'prod',
  SANDBOX = 'sandbox',
}

interface ModuleConfig {
  publicKey: string;
  environment: Environment;
}

type PaymentCheckoutType = {
  initPayment: (
    config: ModuleConfig,
    paymentParams: PaymentParams
  ) => Promise<string>;
};

const { PaymentCheckout } = NativeModules;

export default PaymentCheckout as PaymentCheckoutType;
