MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / createCustomerPortalUrl

Function createCustomerPortalUrl

packages/server/src/lib/polar.ts:71–81  ·  view source on GitHub ↗
({
  customerExternalId,
  requestUrl,
}: CreateCheckoutUrlParams)

Source from the content-addressed store, hash-verified

69};
70
71export async function createCustomerPortalUrl({
72 customerExternalId,
73 requestUrl,
74}: CreateCheckoutUrlParams) {
75 const result = await polar.customerSessions.create({
76 externalCustomerId: customerExternalId,
77 returnUrl: new URL("/billing/success", requestUrl).toString(),
78 });
79
80 return result.customerPortalUrl;
81};
82
83export async function getAvailableCreditsBalance(customerExternalId: string) {
84 try {

Callers 1

billing.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected