Compare commits

...

5 Commits

10 changed files with 28 additions and 21 deletions

View File

@ -125,7 +125,7 @@
"sanitize-html": "^2.10.0",
"schema-dts": "^1.1.0",
"short-uuid": "^4.2.0",
"stripe": "^9.16.0",
"stripe": "^14.5.0",
"superjson": "1.9.1",
"tailwindcss-radix": "^2.6.0",
"turndown": "^7.1.1",

View File

@ -70,5 +70,5 @@ export async function getStripeCustomerId(user: UserType): Promise<string> {
const stripePrivateKey = process.env.STRIPE_PRIVATE_KEY || "";
export const stripe = new Stripe(stripePrivateKey, {
apiVersion: "2020-08-27",
apiVersion: "2023-10-16",
});

View File

@ -26,7 +26,7 @@
"lodash": "^4.17.21",
"qs-stringify": "^1.2.1",
"react-i18next": "^12.2.0",
"stripe": "^9.16.0"
"stripe": "^14.5.0"
},
"devDependencies": {
"@calcom/types": "*"

View File

@ -38,7 +38,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const data: StripeData = { ...response, default_currency: "" };
if (response["stripe_user_id"]) {
const account = await stripe.accounts.retrieve(response["stripe_user_id"]);
data["default_currency"] = account.default_currency;
data["default_currency"] = account.default_currency || "";
}
await createOAuthAppCredential(

View File

@ -42,7 +42,7 @@ export class PaymentService implements IAbstractPaymentService {
this.credentials = null;
}
this.stripe = new Stripe(process.env.STRIPE_PRIVATE_KEY || "", {
apiVersion: "2020-08-27",
apiVersion: "2023-10-16",
});
}

View File

@ -30,7 +30,7 @@ export type StripeData = z.infer<typeof stripeDataSchema>;
/** Figure out a way to get this from the DB without too much wreckage. */
const stripePrivateKey = process.env.STRIPE_PRIVATE_KEY || "";
const stripe = new Stripe(stripePrivateKey, {
apiVersion: "2020-08-27",
apiVersion: "2023-10-16",
});
export default stripe;

View File

@ -19,7 +19,7 @@
"@calcom/types": "*",
"@stripe/react-stripe-js": "^1.10.0",
"@stripe/stripe-js": "^1.35.0",
"stripe": "^9.16.0",
"stripe": "^14.5.0",
"uuid": "^8.3.2",
"zod": "^3.22.2"
},

View File

@ -8,7 +8,7 @@ declare global {
const stripe =
globalThis.stripe ||
new Stripe(process.env.STRIPE_PRIVATE_KEY!, {
apiVersion: "2020-08-27",
apiVersion: "2023-10-16",
});
if (process.env.NODE_ENV !== "production") {

View File

@ -8,10 +8,8 @@ export const useCompatSearchParams = () => {
Object.getOwnPropertyNames(params).forEach((key) => {
searchParams.delete(key);
// Though useParams is supposed to return a string/string[] as the key's value but it is found to return undefined as well.
// Maybe it happens for pages dir when using optional catch-all routes.
const param = params[key] || "";
const paramArr = typeof param === "string" ? param.split("/") : param;
const param = params[key];
const paramArr = typeof param === "string" ? param.split("/") : Array.isArray(param) ? param : [];
paramArr.forEach((p) => {
searchParams.append(key, p);

View File

@ -3493,7 +3493,7 @@ __metadata:
lodash: ^4.17.21
qs-stringify: ^1.2.1
react-i18next: ^12.2.0
stripe: ^9.16.0
stripe: ^14.5.0
languageName: unknown
linkType: soft
@ -4342,7 +4342,7 @@ __metadata:
"@calcom/types": "*"
"@stripe/react-stripe-js": ^1.10.0
"@stripe/stripe-js": ^1.35.0
stripe: ^9.16.0
stripe: ^14.5.0
ts-node: ^10.9.1
uuid: ^8.3.2
zod: ^3.22.2
@ -4640,7 +4640,7 @@ __metadata:
sanitize-html: ^2.10.0
schema-dts: ^1.1.0
short-uuid: ^4.2.0
stripe: ^9.16.0
stripe: ^14.5.0
superjson: 1.9.1
tailwindcss: ^3.3.3
tailwindcss-animate: ^1.0.6
@ -4762,7 +4762,7 @@ __metadata:
remark: ^14.0.2
remark-html: ^14.0.1
remeda: ^1.24.1
stripe: ^9.16.0
stripe: ^14.5.0
tailwind-merge: ^1.13.2
tailwindcss: ^3.3.3
ts-node: ^10.9.1
@ -33380,6 +33380,15 @@ __metadata:
languageName: node
linkType: hard
"qs@npm:^6.11.0":
version: 6.11.2
resolution: "qs@npm:6.11.2"
dependencies:
side-channel: ^1.0.4
checksum: e812f3c590b2262548647d62f1637b6989cc56656dc960b893fe2098d96e1bd633f36576f4cd7564dfbff9db42e17775884db96d846bebe4f37420d073ecdc0b
languageName: node
linkType: hard
"qs@npm:~6.5.2":
version: 6.5.3
resolution: "qs@npm:6.5.3"
@ -37458,13 +37467,13 @@ __metadata:
languageName: node
linkType: hard
"stripe@npm:^9.16.0":
version: 9.16.0
resolution: "stripe@npm:9.16.0"
"stripe@npm:^14.5.0":
version: 14.5.0
resolution: "stripe@npm:14.5.0"
dependencies:
"@types/node": ">=8.1.0"
qs: ^6.10.3
checksum: d84eb9ef3fa0c50e1b62271bf822d3e9da22272ec7364ae8334db7277e42f657c42c10f6fa535c634c36081e17d1c8c5a1efc509b3747f84bfbe4cf2a94ade4b
qs: ^6.11.0
checksum: ad2f0205d1b0ce4691bf54dfd0953e197b2fb3c37c489e9f1799dfa75fbd21a49cb5ddb7bcf0a708242db565500ba494927e321aee91980f360c389a60048a0c
languageName: node
linkType: hard