@ilands/payments 0.1.0-next.1 → 0.1.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/dist/base44.js +1 -1
- package/package.json +1 -1
package/dist/base44.js
CHANGED
|
@@ -20,7 +20,7 @@ export function buildBase44PaymentInstructions(options) {
|
|
|
20
20
|
"3. **Freeze immutable terms before checkout**: Always pass complete `terms` (`title`, `deliveryType`, `deliverySummary`, `refundPolicy`) and your local `merchantOrderId` to `ilands.payments.create(...)`. Never overwrite historical order terms when editing catalog descriptions later.",
|
|
21
21
|
`4. **Authoritative fulfillment only**: NEVER deliver files or grant entitlements based on return URL query parameters. Mount the webhook handler at \`${webhookPath}\` (TanStack Start server route by default, or legacy Deno backend function if upgrading a Vite SPA app), verify the raw request body via \`ilands.webhooks.verifyAndParse({ rawBody, signatureHeader })\`, and return HTTP 400 on missing or invalid signatures. Deliver ONLY after verified webhook delivery OR after your server calls \`ilands.payments.get(paymentId)\` and confirms \`status === "paid"\` with matching \`amountCents\` and \`merchantOrderId\`.`,
|
|
22
22
|
"5. **Idempotent delivery & evidence reporting**: Deduplicate fulfillment by `paymentId`. After delivering, ALWAYS call `ilands.deliveries.report(paymentId, ...)` (and for downloadable files, first upload an immutable copy via `ilands.deliveries.uploadArtifact(paymentId, { filename, contentType, bytes })`). Handle `payment.refunded` and `payment.dispute.closed` by revoking or adjusting entitlements.",
|
|
23
|
-
"6. **Guest recovery, mobile WebView & zero token leaks**: Persist the `receiptUrl` returned by `ilands.payments.create(...)` on your server order record and expose it to buyers on the order confirmation page so guests can recover orders and access iLands support without relying on browser localStorage. Always use `openCheckout` and `openReceipt` from `@ilands/payments/client` (`>= 0.1.0
|
|
23
|
+
"6. **Guest recovery, mobile WebView & zero token leaks**: Persist the `receiptUrl` returned by `ilands.payments.create(...)` on your server order record and expose it to buyers on the order confirmation page so guests can recover orders and access iLands support without relying on browser localStorage. Always use `openCheckout` and `openReceipt` from `@ilands/payments/client` (`>= 0.1.0`) and avoid `target=\"_blank\"` on checkout, receipt, or file download actions so iLands mobile App WebView users never get stuck. NEVER print `guestAccessToken`, full `receiptUrl?token=...`, or raw payment creation responses to console logs.",
|
|
24
24
|
`7. **Coexistence with \`@ilands/auth-*\` & \`*.ilands.world\` domains**: Keep \`${webhookPath}\` publicly reachable for signed \`POST\` requests authenticated ONLY via \`X-iLands-Signature\` (NEVER require user login/Bearer token on the webhook route). Build \`returnUrl\` and \`cancelUrl\` from the site's canonical origin (e.g. \`https://<slug>.ilands.world\`) so returning from Stripe Checkout stays on the same authenticated origin. For signed-in buyers, pass server-verified \`buyer: { siteUserId, email }\` and verify ownership server-side before returning orders or downloads (never trust unverified client \`userId\`).`,
|
|
25
25
|
"",
|
|
26
26
|
`API Base URL: \`${apiBaseUrl}\``,
|