@waffo/pancake-ts 0.4.1 → 0.5.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/CHANGELOG.md +25 -0
- package/README.md +18 -10
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/docs/webhook-guide.md +60 -8
- package/package.json +1 -1
package/docs/webhook-guide.md
CHANGED
|
@@ -366,14 +366,66 @@ Both APIs share the same underlying verification logic and resolution chain.
|
|
|
366
366
|
|
|
367
367
|
### `WebhookEventData`
|
|
368
368
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
|
374
|
-
|
|
|
375
|
-
| `
|
|
376
|
-
| `
|
|
369
|
+
All events include the **Order**, **Amount**, and **Product** sections. Additional sections are conditionally present based on event type.
|
|
370
|
+
|
|
371
|
+
**Order fields** (always present):
|
|
372
|
+
|
|
373
|
+
| Field | Type | Required | Description |
|
|
374
|
+
| ------------------------------- | -------- | -------- | ----------------------------------------------------------------- |
|
|
375
|
+
| `orderId` | `string` | Yes | Associated order ID |
|
|
376
|
+
| `orderStatus` | `string` | No | Order status (e.g., `"completed"`, `"active"`, `"canceling"`) |
|
|
377
|
+
| `buyerEmail` | `string` | Yes | Buyer email address |
|
|
378
|
+
| `merchantProvidedBuyerIdentity` | `string` | No | Merchant-provided buyer identity from checkout session |
|
|
379
|
+
| `currency` | `string` | Yes | Currency code (ISO 4217) |
|
|
380
|
+
| `billingDetail` | `object` | No | Billing/shipping address (structured object) |
|
|
381
|
+
| `orderMetadata` | `object` | No | Order-level metadata from checkout session (flat key-value pairs) |
|
|
382
|
+
|
|
383
|
+
**Amount fields** (always present):
|
|
384
|
+
|
|
385
|
+
| Field | Type | Required | Description |
|
|
386
|
+
| ----------- | -------- | -------- | --------------------------------------------------------------------------------- |
|
|
387
|
+
| `amount` | `string` | Yes | Amount in display format (e.g., `"29.00"` for $29.00 USD, `"4500"` for ¥4500 JPY) |
|
|
388
|
+
| `taxAmount` | `string` | Yes | Tax amount in display format (e.g., `"2.90"`) |
|
|
389
|
+
| `taxRate` | `number` | No | Tax rate as decimal (e.g., `0.1` for 10%) |
|
|
390
|
+
| `taxName` | `string` | No | Tax name (e.g., `"Consumption Tax"`) |
|
|
391
|
+
| `subtotal` | `string` | No | Subtotal as display string (before tax) |
|
|
392
|
+
| `total` | `string` | No | Total as display string (after tax) |
|
|
393
|
+
|
|
394
|
+
**Product fields** (always present):
|
|
395
|
+
|
|
396
|
+
| Field | Type | Required | Description |
|
|
397
|
+
| -------------------- | -------- | -------- | ------------------------------------------------------------- |
|
|
398
|
+
| `productName` | `string` | Yes | Product name |
|
|
399
|
+
| `productDescription` | `string` | No | Product description |
|
|
400
|
+
| `productMetadata` | `object` | No | Product-level metadata set when creating/updating the product |
|
|
401
|
+
|
|
402
|
+
**Payment fields** (present for `order.completed`, `subscription.payment_succeeded`):
|
|
403
|
+
|
|
404
|
+
| Field | Type | Description |
|
|
405
|
+
| ---------------------- | -------- | -------------------------------------------------- |
|
|
406
|
+
| `paymentId` | `string` | Payment ID |
|
|
407
|
+
| `paymentStatus` | `string` | Payment status (e.g., `"succeeded"`, `"failed"`) |
|
|
408
|
+
| `paymentMethod` | `string` | Payment method type (e.g., `"card"`) |
|
|
409
|
+
| `paymentLast4` | `string` | Last 4 digits of payment instrument |
|
|
410
|
+
| `paymentFailureReason` | `string` | Payment failure reason (present when failed) |
|
|
411
|
+
| `paymentDate` | `string` | Payment date (ISO 8601 date, e.g., `"2026-04-18"`) |
|
|
412
|
+
|
|
413
|
+
**Subscription fields** (present for `subscription.*` events):
|
|
414
|
+
|
|
415
|
+
| Field | Type | Description |
|
|
416
|
+
| -------------------- | -------- | --------------------------------------------------------------------- |
|
|
417
|
+
| `billingPeriod` | `string` | Billing period: `"weekly"`, `"monthly"`, `"quarterly"`, `"yearly"` |
|
|
418
|
+
| `currentPeriodStart` | `string` | Current billing period start date (ISO 8601) |
|
|
419
|
+
| `currentPeriodEnd` | `string` | Current billing period end date (ISO 8601) |
|
|
420
|
+
| `canceledAt` | `string` | Subscription cancellation timestamp (ISO 8601, present when canceled) |
|
|
421
|
+
|
|
422
|
+
**Refund fields** (present for `refund.succeeded`, `refund.failed`):
|
|
423
|
+
|
|
424
|
+
| Field | Type | Description |
|
|
425
|
+
| ----------------- | -------- | ----------------------------------------- |
|
|
426
|
+
| `refundStatus` | `string` | Refund status (`"succeeded"`, `"failed"`) |
|
|
427
|
+
| `refundReason` | `string` | Refund reason |
|
|
428
|
+
| `refundCreatedAt` | `string` | Refund creation timestamp (ISO 8601) |
|
|
377
429
|
|
|
378
430
|
## Event Types
|
|
379
431
|
|