({
customerExternalId,
requestUrl,
}: CreateCheckoutUrlParams)
| 55 | }; |
| 56 | |
| 57 | export async function createCheckoutUrl({ |
| 58 | customerExternalId, |
| 59 | requestUrl, |
| 60 | }: CreateCheckoutUrlParams) { |
| 61 | const result = await polar.checkouts.create({ |
| 62 | products: [getPolarProductId()], |
| 63 | successUrl: new URL("/billing/success", requestUrl).toString(), |
| 64 | externalCustomerId: customerExternalId, |
| 65 | metadata: { source: "nightcode-cli" }, |
| 66 | }); |
| 67 | |
| 68 | return result.url; |
| 69 | }; |
| 70 | |
| 71 | export async function createCustomerPortalUrl({ |
| 72 | customerExternalId, |
no test coverage detected