export interface IPaymentGateway {
  requestPayment(requestPaymentParams: IRequestPaymentParams): Promise<IRequestPaymentData>;
  verifyPayment(verifyPaymentParam: IPaymentVerifyParams): Promise<IPaymentVerifyData>;
  getPaymentUrl(authority: string): string;
}

export interface IRequestPaymentParams {
  amount: number;
  merchantId: string;
  domain: string;
  orderId: string;
}

export interface IRequestPaymentData {
  transactionId: string;
}

export interface IPaymentVerifyParams {
  amount: number;
  merchantId: string;
  transactionId: string;
}

export interface IPaymentVerifyData {
  success: boolean;
  referenceId: string;
  cardPan?: string;
  raw: Record<string, any>;
}
////////////////////////// Zarinpal API v4 //////////////////////////
export interface IZarinpalRequestPayment {
  amount: number;
  merchant_id: string;
  description: string;
  callback_url: string;
  metadata?: {
    order_id?: string;
    mobile?: string;
    email?: string;
  };
  referrer_id?: string;
  currency: 'IRT';
}
export interface IZarinpalPaymentResponse {
  data: {
    code: number;
    message: string;
    authority: string;
    fee_type: string;
    fee: number;
  };
  errors: unknown[];
}
export interface IZarinpalVerifyRequest {
  merchant_id: string;
  amount: number;
  authority: string;
}
export interface IZarinpalVerifyResponse {
  data: {
    code: number;
    message: string;
    card_hash: string;
    card_pan: string;
    ref_id: number;
    fee_type: string;
    fee: number;
  };
  errors: unknown[];
}
