@voxepay/checkout 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,63 @@
1
+ /**
2
+ * VoxePay Payment API Client
3
+ * Handles communication with the VoxePay payment gateway
4
+ */
5
+ export interface InitiatePaymentRequest {
6
+ organizationId: string;
7
+ transactionRef: string;
8
+ customerId?: string;
9
+ customerEmail?: string;
10
+ customerPhone?: string;
11
+ amount: number;
12
+ currency: string;
13
+ paymentMethod: 'CARD' | 'BANK_TRANSFER';
14
+ authData: string;
15
+ narration?: string;
16
+ }
17
+ export interface InitiatePaymentResponse {
18
+ paymentId: string;
19
+ transactionId: string;
20
+ transactionRef: string;
21
+ status: string;
22
+ message: string;
23
+ eciFlag?: string;
24
+ [key: string]: unknown;
25
+ }
26
+ export interface ValidateOTPRequest {
27
+ paymentId: string;
28
+ otp: string;
29
+ transactionId: string;
30
+ eciFlag?: string;
31
+ organizationId: string;
32
+ }
33
+ export interface ValidateOTPResponse {
34
+ status: string;
35
+ message: string;
36
+ paymentId: string;
37
+ transactionRef?: string;
38
+ amount?: number;
39
+ currency?: string;
40
+ [key: string]: unknown;
41
+ }
42
+ export interface ResendOTPRequest {
43
+ transactionRef: string;
44
+ organizationId: string;
45
+ }
46
+ export declare class VoxePayApiClient {
47
+ private apiKey;
48
+ private baseUrl;
49
+ constructor(apiKey: string, baseUrl?: string);
50
+ private request;
51
+ /**
52
+ * Initiate a card payment
53
+ */
54
+ initiatePayment(data: InitiatePaymentRequest): Promise<InitiatePaymentResponse>;
55
+ /**
56
+ * Validate OTP for a payment
57
+ */
58
+ validateOTP(data: ValidateOTPRequest): Promise<ValidateOTPResponse>;
59
+ /**
60
+ * Resend OTP for a payment
61
+ */
62
+ resendOTP(data: ResendOTPRequest): Promise<void>;
63
+ }
@@ -24,12 +24,17 @@ export interface ModalState {
24
24
  transferTimer: number;
25
25
  transferTimerInterval: number | null;
26
26
  bankTransferDetails: BankTransferDetails | null;
27
+ paymentId: string | null;
28
+ transactionId: string | null;
29
+ transactionRef: string | null;
30
+ eciFlag: string | null;
27
31
  }
28
32
  export declare class VoxePayModal {
29
33
  private options;
30
34
  private state;
31
35
  private container;
32
36
  private overlay;
37
+ private apiClient;
33
38
  constructor(options: CheckoutOptions);
34
39
  /**
35
40
  * Open the checkout modal