@voxepay/checkout 0.2.0 → 0.3.0

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.
package/dist/types.d.ts CHANGED
@@ -5,8 +5,12 @@
5
5
  * Configuration for initializing VoxePay
6
6
  */
7
7
  export interface VoxePayConfig {
8
- /** Your VoxePay API key (starts with pk_live_ or pk_test_) */
8
+ /** Your VoxePay API key (e.g., vxp_live_xxxxx) */
9
9
  apiKey: string;
10
+ /** Your VoxePay organization ID */
11
+ organizationId: string;
12
+ /** API base URL (defaults to https://devpay.voxepay.app) */
13
+ baseUrl?: string;
10
14
  /** Theme mode: 'dark' (default), 'light', or 'auto' (follows system) */
11
15
  theme?: 'dark' | 'light' | 'auto';
12
16
  /** Locale for formatting (e.g., 'en-US', 'en-NG') */
@@ -57,6 +61,8 @@ export interface CheckoutOptions {
57
61
  description?: string;
58
62
  /** Customer's email address (optional, for receipts) */
59
63
  customerEmail?: string;
64
+ /** Customer's phone number */
65
+ customerPhone?: string;
60
66
  /** Additional metadata to attach to the payment */
61
67
  metadata?: Record<string, unknown>;
62
68
  /** Payment methods to show. Defaults to ['card', 'bank_transfer'] */
@@ -65,6 +71,12 @@ export interface CheckoutOptions {
65
71
  bankTransferDetails?: BankTransferDetails;
66
72
  /** Callback to request bank transfer details dynamically (called when user selects bank transfer) */
67
73
  onBankTransferRequested?: () => Promise<BankTransferDetails>;
74
+ /** @internal SDK config passed from VoxePaySDK to modal */
75
+ _sdkConfig?: {
76
+ apiKey: string;
77
+ organizationId: string;
78
+ baseUrl?: string;
79
+ };
68
80
  /** Callback when payment succeeds */
69
81
  onSuccess: (result: PaymentResult) => void;
70
82
  /** Callback when payment fails */
@@ -0,0 +1,21 @@
1
+ export interface AuthDataParams {
2
+ version: string;
3
+ pan: string;
4
+ pin: string;
5
+ expiryDate: string;
6
+ cvv: string;
7
+ }
8
+ /**
9
+ * Generates encrypted auth data for card payment
10
+ * @param params - Card details for encryption
11
+ * @returns Base64 encoded encrypted auth data
12
+ */
13
+ export declare const generateAuthData: ({ version, pan, pin, expiryDate, cvv, }: AuthDataParams) => Promise<string>;
14
+ /**
15
+ * Converts MM/YY format to YYMM format required by API
16
+ */
17
+ export declare const formatExpiryForApi: (expiry: string) => string;
18
+ /**
19
+ * Removes spaces and formatting from PAN
20
+ */
21
+ export declare const cleanPan: (pan: string) => string;