🐛 Fix wrong currency being stored for subscription (#1213)

This commit is contained in:
Luke Vella 2024-07-21 17:12:38 +01:00 committed by GitHub
parent 318775726b
commit 3cf777815b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,7 +125,7 @@ async function stripeApiHandler(req: NextApiRequest, res: NextApiResponse) {
id: subscription.id,
active: isActive,
priceId: price.id,
currency: price.currency ?? null,
currency: subscription.currency ?? null,
createdAt: toDate(subscription.created),
periodStart: toDate(subscription.current_period_start),
periodEnd: toDate(subscription.current_period_end),
@ -133,7 +133,7 @@ async function stripeApiHandler(req: NextApiRequest, res: NextApiResponse) {
update: {
active: isActive,
priceId: price.id,
currency: price.currency ?? null,
currency: subscription.currency ?? null,
createdAt: toDate(subscription.created),
periodStart: toDate(subscription.current_period_start),
periodEnd: toDate(subscription.current_period_end),