gembapay 1.2.0 → 1.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/README.md CHANGED
@@ -13,7 +13,7 @@ Accept credit cards (via Stripe) and PayPal through a single API. Funds settle d
13
13
 
14
14
  - **One API, two payment methods** — Stripe (cards/Apple Pay/Google Pay) and PayPal
15
15
  - **Direct settlement** — Payments route straight into your own Stripe or PayPal account
16
- - **86+ currencies** — Price in any supported currency
16
+ - **51+ currencies** — Price in any supported currency
17
17
  - **Test mode built-in** — Stripe and PayPal sandbox environments for development
18
18
  - **TypeScript support** — Full type definitions included
19
19
  - **Zero dependencies** — Uses only Node.js built-in modules
@@ -71,7 +71,7 @@ res.redirect(payment.paymentUrl);
71
71
  const status = await gembapay.getPaymentStatus('ORDER-456');
72
72
 
73
73
  console.log(status.status); // 'completed'
74
- console.log(status.network); // 'bsc', 'stripe', 'paypal', etc.
74
+ console.log(status.network); // 'stripe', 'paypal'
75
75
  ```
76
76
 
77
77
  ### Webhook Verification
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gembapay",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "GembaPay \u2014 unified payment gateway for Stripe card payments and PayPal. Funds settle directly to the merchant.",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
package/src/index.d.ts CHANGED
@@ -15,7 +15,7 @@ declare module 'gembapay' {
15
15
  orderId: string;
16
16
  /** Payment amount */
17
17
  amount: number;
18
- /** Currency code — 86+ supported (default: 'USD') */
18
+ /** Currency code — 51+ supported (default: 'USD') */
19
19
  currency?: string;
20
20
  /** Payment description */
21
21
  description?: string;
@@ -39,22 +39,27 @@ declare module 'gembapay' {
39
39
  network: 'stripe' | 'paypal';
40
40
  paymentProvider: 'stripe' | 'paypal';
41
41
  payment?: {
42
- txHash?: string;
42
+ reference?: string;
43
43
  tokenSymbol?: string;
44
44
  tokenAmount?: string;
45
45
  };
46
46
  }
47
47
 
48
+ /** Stripe may add other values over time - treat unknown ones like 'card'. */
49
+ export type PaymentMethod = 'card' | 'apple_pay' | 'google_pay' | 'link' | (string & {});
50
+
48
51
  export interface WebhookEvent {
49
52
  event: 'payment.completed' | 'payment.failed';
50
53
  testMode?: boolean;
51
54
  payment: {
52
55
  orderId: string;
53
- txHash?: string;
56
+ reference?: string;
54
57
  network: string;
55
58
  usdAmount: number;
56
59
  tokenAmount?: string;
57
60
  paymentProvider?: string;
61
+ /** How the customer paid. null for PayPal and payments recorded before 2026-10-21. */
62
+ paymentMethod?: PaymentMethod | null;
58
63
  };
59
64
  timestamp: string;
60
65
  }
package/src/index.js CHANGED
@@ -43,7 +43,7 @@ class GembaPay {
43
43
  * @param {Object} params
44
44
  * @param {string} params.orderId - Your unique order identifier
45
45
  * @param {number} params.amount - Payment amount
46
- * @param {string} [params.currency='USD'] - Currency code (86+ supported)
46
+ * @param {string} [params.currency='USD'] - Currency code (51+ supported)
47
47
  * @param {string} [params.description] - Payment description
48
48
  * @returns {Promise<Object>} Payment request with paymentUrl
49
49
  */