Skip to content

Instantly share code, notes, and snippets.

@cjavilla-stripe
Last active June 17, 2020 17:51
Show Gist options
  • Save cjavilla-stripe/96f7b98170b2ad8685dfa67bc56d22b8 to your computer and use it in GitHub Desktop.
Save cjavilla-stripe/96f7b98170b2ad8685dfa67bc56d22b8 to your computer and use it in GitHub Desktop.
const f = async () => {
try {
const res = await stripe.billingPortal.sessions.create({
customer: cus,
return_url: 'https://pay.cjavilla.com'
})
return {
statusCode: 200,
body: JSON.stringify(res),
};
} catch(e) {
return {
statusCode: 422,
body: JSON.stringify(e),
};
}
};
f();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment