manifold/web/lib/service/stripe.ts
Marshall Polaris 4700ceb14c
Refactor some backend-related stuff (#639)
* web/lib/firebase/api-call -> common/api, web/lib/firebase/api

* Reuse `APIError` type in server code

* Reuse `getFunctionUrl` in server code
2022-07-10 15:03:15 -07:00

13 lines
339 B
TypeScript

import { getFunctionUrl } from 'common/api'
export const checkoutURL = (
userId: string,
manticDollarQuantity: number,
referer = ''
) => {
const endpoint = getFunctionUrl('createcheckoutsession')
return `${endpoint}?userId=${userId}&manticDollarQuantity=${manticDollarQuantity}&referer=${encodeURIComponent(
referer
)}`
}