@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.
- package/CHANGELOG.md +25 -0
- package/README.md +8 -4
- package/dist/index.cjs +32 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +72 -61
- package/dist/index.d.ts +72 -61
- package/dist/index.js +32 -15
- package/dist/index.js.map +1 -1
- package/docs/api-reference.md +19 -16
- package/package.json +1 -1
package/docs/api-reference.md
CHANGED
|
@@ -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: "
|
|
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: "
|
|
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-
|
|
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
|
|