@waffo/pancake-ts 0.4.2 → 0.5.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.
- package/CHANGELOG.md +24 -0
- package/README.md +17 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js.map +1 -1
- package/docs/webhook-guide.md +61 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ All notable changes to `@waffo/pancake-ts` will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.5.1] - 2026-04-22
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`storeName` in `WebhookEventData`** — webhook payloads now include the store name in `data.storeName`. Always present for all transaction events.
|
|
12
|
+
|
|
13
|
+
## [0.5.0] - 2026-04-18
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Enriched `WebhookEventData`** — webhook payloads now include full transaction chain data. New optional fields organized by section:
|
|
18
|
+
- **Order**: `orderStatus`, `merchantProvidedBuyerIdentity`, `billingDetail`, `orderMetadata`
|
|
19
|
+
- **Amount**: `taxRate`, `taxName`, `subtotal`, `total`
|
|
20
|
+
- **Product**: `productDescription`, `productMetadata`
|
|
21
|
+
- **Payment** (payment events only): `paymentId`, `paymentStatus`, `paymentMethod`, `paymentLast4`, `paymentFailureReason`, `paymentDate`
|
|
22
|
+
- **Subscription** (subscription events only): `billingPeriod`, `currentPeriodStart`, `currentPeriodEnd`, `canceledAt`
|
|
23
|
+
- **Refund** (refund events only): `refundStatus`, `refundReason`, `refundCreatedAt`
|
|
24
|
+
- All new fields are optional — existing webhook handlers continue to work without changes.
|
|
25
|
+
|
|
26
|
+
### Documentation
|
|
27
|
+
|
|
28
|
+
- **Webhook guide** — updated `WebhookEventData` field reference with sectioned layout and conditional field documentation.
|
|
29
|
+
- **README** — expanded webhook verification example showing new fields.
|
|
30
|
+
|
|
7
31
|
## [0.4.2] - 2026-04-16
|
|
8
32
|
|
|
9
33
|
### Fixed
|
package/README.md
CHANGED
|
@@ -158,7 +158,7 @@ See [API Reference — Checkout](docs/api-reference.md#checkout) for full parame
|
|
|
158
158
|
|
|
159
159
|
## Webhook Verification
|
|
160
160
|
|
|
161
|
-
After a buyer completes payment, Waffo sends webhook events to your server. The SDK provides two ways to verify signatures:
|
|
161
|
+
After a buyer completes payment, Waffo sends webhook events to your server with rich data including order details, amounts, product info, and event-specific fields (payment, subscription, or refund). The SDK provides two ways to verify signatures:
|
|
162
162
|
|
|
163
163
|
### Standalone Function (built-in keys)
|
|
164
164
|
|
|
@@ -175,10 +175,17 @@ app.post("/webhooks", express.raw({ type: "application/json" }), (req, res) => {
|
|
|
175
175
|
|
|
176
176
|
switch (event.eventType) {
|
|
177
177
|
case WebhookEventType.OrderCompleted:
|
|
178
|
-
|
|
178
|
+
// Rich data: order, amount, product, payment fields
|
|
179
|
+
console.log(`Order ${event.data.orderId} completed — ${event.data.total} ${event.data.currency}`);
|
|
180
|
+
console.log(`Product: ${event.data.productName}, Buyer: ${event.data.buyerEmail}`);
|
|
181
|
+
if (event.data.orderMetadata) console.log("Metadata:", event.data.orderMetadata);
|
|
179
182
|
break;
|
|
180
183
|
case WebhookEventType.SubscriptionActivated:
|
|
181
184
|
console.log(`Subscription activated for ${event.data.buyerEmail}`);
|
|
185
|
+
console.log(`Period: ${event.data.billingPeriod}, ends ${event.data.currentPeriodEnd}`);
|
|
186
|
+
break;
|
|
187
|
+
case WebhookEventType.RefundSucceeded:
|
|
188
|
+
console.log(`Refund succeeded: ${event.data.refundReason}`);
|
|
182
189
|
break;
|
|
183
190
|
}
|
|
184
191
|
} catch {
|
|
@@ -213,7 +220,7 @@ const client = new WaffoPancake({
|
|
|
213
220
|
const event = client.webhooks.verify(rawBody, sig, { environment: "prod" });
|
|
214
221
|
```
|
|
215
222
|
|
|
216
|
-
See [Webhook Guide](docs/webhook-guide.md) for event types, dual-environment key architecture, key resolution chain, retry mechanism, and best practices.
|
|
223
|
+
See [Webhook Guide](docs/webhook-guide.md) for event types, `WebhookEventData` field reference, dual-environment key architecture, key resolution chain, retry mechanism, and best practices.
|
|
217
224
|
|
|
218
225
|
## Buyer Self-Service
|
|
219
226
|
|
|
@@ -446,12 +453,12 @@ try {
|
|
|
446
453
|
|
|
447
454
|
## Documentation
|
|
448
455
|
|
|
449
|
-
| Document | Content
|
|
450
|
-
| -------------------------------------- |
|
|
451
|
-
| [API Reference](docs/api-reference.md) | Complete method reference — parameters, return types, `BillingDetail` fields
|
|
452
|
-
| [GraphQL Guide](docs/graphql-guide.md) | Queries, filters, analytics, introspection, delivery logs
|
|
453
|
-
| [Webhook Guide](docs/webhook-guide.md) | Signature verification, event types, key resolution, retry mechanism
|
|
454
|
-
| [Changelog](CHANGELOG.md) | Version history and migration guides
|
|
456
|
+
| Document | Content |
|
|
457
|
+
| -------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
458
|
+
| [API Reference](docs/api-reference.md) | Complete method reference — parameters, return types, `BillingDetail` fields |
|
|
459
|
+
| [GraphQL Guide](docs/graphql-guide.md) | Queries, filters, analytics, introspection, delivery logs |
|
|
460
|
+
| [Webhook Guide](docs/webhook-guide.md) | Signature verification, event types, event data fields, key resolution, retry mechanism |
|
|
461
|
+
| [Changelog](CHANGELOG.md) | Version history and migration guides |
|
|
455
462
|
|
|
456
463
|
## Exports
|
|
457
464
|
|
|
@@ -485,7 +492,7 @@ try {
|
|
|
485
492
|
|
|
486
493
|
### Types
|
|
487
494
|
|
|
488
|
-
Key types: `WaffoPancakeConfig`, `AuthenticatedCheckoutParams`, `AuthenticatedCheckoutResult`, `AnonymousCheckoutParams`, `CheckoutSessionResult`, `Store`, `OnetimeProductDetail`, `SubscriptionProductDetail`, `WebhookEvent<T>`, `GraphQLResponse<T>`, and 30+ more. See [API Reference](docs/api-reference.md#types) for the full list.
|
|
495
|
+
Key types: `WaffoPancakeConfig`, `AuthenticatedCheckoutParams`, `AuthenticatedCheckoutResult`, `AnonymousCheckoutParams`, `CheckoutSessionResult`, `Store`, `OnetimeProductDetail`, `SubscriptionProductDetail`, `WebhookEvent<T>`, `WebhookEventData`, `GraphQLResponse<T>`, and 30+ more. `WebhookEventData` includes rich fields organized by section: order info, amounts, product, payment, subscription, and refund (conditional by event type). See [API Reference](docs/api-reference.md#types) for the full list.
|
|
489
496
|
|
|
490
497
|
## Development
|
|
491
498
|
|