Framework Adapters
Astro
Payments and Checkouts made dead simple with Astro
pnpm install @polar-sh/astro zod
Checkout
Create a Checkout handler which takes care of redirections.
Query Params
Pass query params to this route.
- productId (or productPriceId)
?productId=xxx
- productPriceId (or productId)
?productPriceId=xxx
- customerId (optional)
?productId=xxx&customerId=xxx
- customerEmail (optional)
?productId=xxx&[[email protected]](/cdn-cgi/l/email-protection)
- customerName (optional)
?productId=xxx&customerName=Jane
- metadata (optional)
URL-Encoded JSON string
Customer Portal
Create a customer portal where your customer can view orders and subscriptions.
Webhooks
A simple utility which resolves incoming webhook payloads by signing the webhook secret properly.
Payload Handlers
The Webhook handler also supports granular handlers for easy integration.
- onCheckoutCreated: (payload) =>
- onCheckoutUpdated: (payload) =>
- onOrderCreated: (payload) =>
- onSubscriptionCreated: (payload) =>
- onSubscriptionUpdated: (payload) =>
- onSubscriptionActive: (payload) =>
- onSubscriptionCanceled: (payload) =>
- onSubscriptionRevoked: (payload) =>
- onProductCreated: (payload) =>
- onProductUpdated: (payload) =>
- onOrganizationUpdated: (payload) =>
- onBenefitCreated: (payload) =>
- onBenefitUpdated: (payload) =>
- onBenefitGrantCreated: (payload) =>
- onBenefitGrantUpdated: (payload) =>
- onBenefitGrantRevoked: (payload) =>
Was this page helpful?