@waffo/pancake-ts 0.3.3 → 0.4.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.
@@ -640,12 +640,14 @@ Authenticated checkout — the merchant provides buyer identity. The SDK issues
640
640
 
641
641
  Internally calls `POST /v1/actions/auth/issue-session-token` and `POST /v1/actions/checkout/create-session` in parallel.
642
642
 
643
+ `buyerIdentity` is for order attribution and trial tracking only — it is not rendered on the checkout page. To pre-fill the email field on the checkout form, pass `buyerEmail` explicitly.
644
+
643
645
  ```typescript
644
- // One-time product with buyer identity
646
+ // One-time product with buyer identity (checkout page email field stays empty)
645
647
  const result = await client.checkout.authenticated.create({
646
648
  productId: "PROD_xxx",
647
649
  currency: "USD",
648
- buyerIdentity: "customer@example.com",
650
+ buyerIdentity: "userIdInYourSystem",
649
651
  successUrl: "https://example.com/thank-you",
650
652
  });
651
653
  // => redirect buyer to result.checkoutUrl (includes #token=...)
@@ -654,7 +656,8 @@ const result = await client.checkout.authenticated.create({
654
656
  const subResult = await client.checkout.authenticated.create({
655
657
  productId: "PROD_yyy",
656
658
  currency: "USD",
657
- buyerIdentity: "customer@example.com",
659
+ buyerIdentity: "userIdInYourSystem",
660
+ buyerEmail: "customer@example.com",
658
661
  withTrial: true,
659
662
  billingDetail: { country: "US", isBusiness: false, state: "CA", postcode: "94105" },
660
663
  });
@@ -662,19 +665,19 @@ const subResult = await client.checkout.authenticated.create({
662
665
 
663
666
  **Parameters `AuthenticatedCheckoutParams`**:
664
667
 
665
- | Field | Type | Required | Description |
666
- | ------------------ | ------------------------ | -------- | --------------------------------------------------------------- |
667
- | `productId` | `string` | Yes | Product ID (product type is auto-detected server-side) |
668
- | `currency` | `string` | Yes | Currency code (ISO 4217) |
669
- | `buyerIdentity` | `string` | Yes | Buyer identity (email or merchant-defined identifier) |
670
- | `buyerEmail` | `string` | No | Pre-filled buyer email (defaults to `buyerIdentity`) |
671
- | `billingDetail` | `BillingDetail` | No | Pre-filled billing details (country, tax ID, etc.) |
672
- | `priceSnapshot` | `PriceInfo` | No | Price snapshot override (reads from DB if omitted) |
673
- | `withTrial` | `boolean` | No | Enable trial period (subscription only) |
674
- | `successUrl` | `string` | No | Redirect URL after successful payment |
675
- | `expiresInSeconds` | `number` | No | Session expiry in seconds (default: 45 minutes) |
676
- | `darkMode` | `boolean` | No | Dark mode override (true=dark, false=light, omit=store default) |
677
- | `metadata` | `Record<string, string>` | No | Custom metadata |
668
+ | Field | Type | Required | Description |
669
+ | ------------------ | ------------------------ | -------- | --------------------------------------------------------------------- |
670
+ | `productId` | `string` | Yes | Product ID (product type is auto-detected server-side) |
671
+ | `currency` | `string` | Yes | Currency code (ISO 4217) |
672
+ | `buyerIdentity` | `string` | Yes | Buyer identity (email or merchant-defined identifier) |
673
+ | `buyerEmail` | `string` | No | Pre-fill checkout page email field (independent from `buyerIdentity`) |
674
+ | `billingDetail` | `BillingDetail` | No | Pre-filled billing details (country, tax ID, etc.) |
675
+ | `priceSnapshot` | `PriceInfo` | No | Price snapshot override (reads from DB if omitted) |
676
+ | `withTrial` | `boolean` | No | Enable trial period (subscription only) |
677
+ | `successUrl` | `string` | No | Redirect URL after successful payment |
678
+ | `expiresInSeconds` | `number` | No | Session expiry in seconds (default: 45 minutes) |
679
+ | `darkMode` | `boolean` | No | Dark mode override (true=dark, false=light, omit=store default) |
680
+ | `metadata` | `Record<string, string>` | No | Custom metadata |
678
681
 
679
682
  **Returns `AuthenticatedCheckoutResult`**:
680
683
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waffo/pancake-ts",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript SDK for Waffo Pancake API (Merchant API Key authentication)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",