UNPKG

@onepaynpm/onepay-sdk

Version:

Official OnePay payment gateway SDK for JavaScript applications

64 lines 1.74 kB
export interface OnePayConfig { apiKey: string; authDomain: string; projectId: string; storageBucket: string; messagingSenderId: string; appId: string; } export interface PaymentData { currency: string; appid: string; hashToken: string; amount: number; orderReference: string; customerFirstName: string; customerLastName: string; customerPhoneNumber: string; customerEmail: string; transactionRedirectUrl: string; additionalData?: any; apptoken: string; } export interface DirectPaymentData { directGatewayURL: string; directTransactionId: string; } export interface SubscriptionData { currency: string; appid: string; name: string; amount: number; interval: 'day' | 'week' | 'month' | 'year'; interval_count: number; days_until_due: number; trial_period_days?: number; customer_details: { first_name: string; last_name: string; email: string; phone_number?: string; }; apptoken: string; } export interface PaymentResult { code: string; transaction_id: string; status: 'SUCCESS' | 'FAIL' | 'CLOSED'; } export interface PaymentEventDetail { transaction_id: string; status: string; } export interface OnePaySDKOptions { firebaseConfig?: OnePayConfig; apiBaseUrl?: string; debug?: boolean; } export type PaymentEventType = 'onePaySuccess' | 'onePayFail' | 'onePayClose'; export interface OnePayEventListeners { onSuccess?: (result: PaymentResult) => void; onFail?: (result: PaymentResult) => void; onClose?: (result: PaymentResult) => void; } //# sourceMappingURL=types.d.ts.map