export declare type RaveCountry = 'NG' | 'GH' | 'KE' | 'ZA'; export declare type RaveCurrency = (T extends 'NG' ? 'NGN' | 'USD' | 'EUR' | 'GBP' | 'UGX' | 'TZS' : undefined) | (T extends 'GH' ? 'GHS' | 'USD' : undefined) | (T extends 'KE' ? 'KES' : undefined) | (T extends 'ZA' ? 'ZAR' : undefined) | (T extends any ? any : any); export interface RaveError { status: 'error'; message: string; data?: { code: string; message: string; }; } /** * PIN: only local MasterCard and verve cards use PIN as an auth model. * 3DSecure: only VISA CARD and some other MASTER CARD support 3DSecure */ export declare type RaveAuth = 'PIN' | '3DSecure' | 'AVS' | 'GTB_OTP' | 'VBVSECURECODE' | 'Noauth' | 'NOAUTH_INTERNATIONAL'; export declare type CardType = 'card' | 'recurring billing'; export declare type MobileMoneyType = 'MOBILEMONEYZM_TRANSACTION' | 'MOBILEMONEYGH_TRANSACTION' | 'MOBILEMONEYRW_TRANSACTION'; export declare type PaymentType = CardType | 'recurring billing' | 'ussd' | 'account' | 'mobilemoneygh'; export interface CardPaymentData { /** * Shared parameters */ country: T; currency: RaveCurrency; amount: string; email: string; phonenumber?: string; firstname?: string; lastname?: string; txRef: string; device_fingerprint?: string; IP: string; meta?: any[]; redirect_url?: string; /** * Card payload */ cardno: S extends 'card' | 'recurring billing' ? string : undefined; cvv: S extends 'card' | 'recurring billing' ? string : undefined; expirymonth: S extends 'card' | 'recurring billing' ? string : undefined; expiryyear: S extends 'card' | 'recurring billing' ? string : undefined; pin: S extends 'card' | 'recurring billing' ? string : undefined; suggested_auth: S extends 'card' | 'recurring billing' ? RaveAuth : undefined; charge_type?: (S extends 'card' ? 'preauth' | undefined : undefined) | (S extends 'recurring billing' ? 'preauth' : undefined); } export interface ChargeRequest { client: string; PBFPubKey: string; alg: string; } export interface ChargeResponse { /** * The status object inside the data object * is the right status to check for, possible values */ status: 'success' | 'failed' | 'pending' | 'success-pending-validation' | 'pending-validation'; message: string; data: { id: number; txRef: string; orderRef: string | null; amount: number; appfee: number; merchantfee: number; merchantbearsfee: number; flwRef: string; redirectUrl: string; device_fingerprint: string; settlement_token: string | null; charged_amount: number; cycle: 'one-time'; /** * This is the response code of the transaction, * it typically tells you when a transaction is successful * with a response code 00 or when the transaction requires validation 02 */ chargeResponseCode: '00' | '02'; chargeResponseMessage: string; authModelUsed: RaveAuth; currency: RaveCurrency; IP: string; narration: string; status: string; authurl: string; vbvrespmessage: string; vbvrespcode: string; acctvalrespmsg: string | null; acctvalrespcode: string | null; paymentType: PaymentType; paymentId: string; fraud_status: string; charge_type: string; is_live: 0 | 1; createdAt: Date; updatedAt: Date; deletedAt: Date | null; customerId: number; AccountId: number; customer: { id: number; phone: string | null; fullName: string; customertoken: string | null; email: string; createdAt: Date; updatedAt: Date; deletedAt: null; AccountId: number; }; /** * This object contains the instructions you are meant to show * to the customer so they know the next step to take, * it typically tells them how to validate the transaction. */ validateInstructions: { valparams: ['OTP']; instruction: 'Please validate with the OTP sent to your mobile or email'; }; }; } export interface ValidationPaymentPayload { PBFPubKey: string; transactionreference: string; otp: string; } export interface CardTransactionWebhookResponse { id: number; txRef: string; flwRef: string; orderRef: string; paymentPlan: string | null; createdAt: Date; amount: number; charged_amount: number; status: string; IP: string; currency: string; customer: { id: number; phone: string; fullName: string; customertoken: string | null; email: string; createdAt: Date; updatedAt: Date; deletedAt: null; AccountId: number; }; entity: { card6: string; card_last4: string; }; 'event.type': 'CARD_TRANSACTION' | 'MOBILEMONEYGH_TRANSACTION' | 'MPESA_TRANSACTION' | 'ACCOUNT_TRANSACTION' | 'Transfer' | 'BANK_TRANSFER_TRANSACTION'; } //# sourceMappingURL=types.d.ts.map