Files
calendar/packages/app-store/stripepayment/lib/client/createPaymentLink.ts
T
Omar LópezGitHubalannnckodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
02425702d1 Fixes/stripe improvements (#5698)
* Enables require confirmation after payment its made

* Various Stripe improvements

* Use constant

* Merge branch 'main' into fixes/stripe-improvements

* Update getStripeAppKeys.ts

* submodule sync

* Submodule sync

* Revert

* Update apps/web/components/booking/BookingListItem.tsx

Co-authored-by: alannnc <alannnc@gmail.com>

Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-12-21 20:31:09 +00:00

20 lines
537 B
TypeScript

import { stringify } from "querystring";
import { WEBSITE_URL } from "@calcom/lib/constants";
export type Maybe<T> = T | undefined | null;
export function createPaymentLink(opts: {
paymentUid: string;
name?: Maybe<string>;
date?: Maybe<string>;
email?: Maybe<string>;
absolute?: boolean;
}): string {
const { paymentUid, name, email, date, absolute = true } = opts;
let link = "";
if (absolute) link = WEBSITE_URL;
const query = stringify({ date, name, email });
return link + `/payment/${paymentUid}?${query}`;
}