UNPKG

react-isw-webpay

Version:

React integration for Interswitch WebPay payment gateway

45 lines (44 loc) 1.23 kB
import { PaymentRequest } from '../types'; /** * Creates a WebPay configuration object with environment-based settings */ /** * Validates a payment request object */ export declare const validatePaymentRequest: (request: PaymentRequest) => { isValid: boolean; errors: string[]; }; /** * Validates WebPay configuration */ export declare const validateWebPayConfig: (config: { merchantCode: string; payItemId: string; mode: string; scriptUrl?: string; }) => { isValid: boolean; errors: string[]; }; /** * Formats amount for display */ export declare const formatAmount: (amount: number, currency?: string, locale?: string) => string; /** * Generates a unique transaction reference */ export declare const generateTransactionRef: (prefix?: string) => string; /** * Converts amount to kobo (for NGN) or cents (for other currencies) */ export declare const convertToMinorUnits: (amount: number, currency?: string) => number; /** * Converts from kobo/cents back to major units */ export declare const convertFromMinorUnits: (amount: number) => number; export declare const validationPatterns: { readonly email: RegExp; readonly phone: RegExp; readonly transactionRef: RegExp; };