Updated it to send the days instead of the date

This commit is contained in:
Tiago Ribeiro
2023-10-14 09:49:23 +01:00
parent 1a588b3cb6
commit 7da5884490

View File

@@ -24,9 +24,8 @@ export async function POST(request: Request) {
const email = idChecker.data["customer_details"]["email"]; const email = idChecker.data["customer_details"]["email"];
const days = productChecker.data["metadata"]["expiry_days"]; const days = productChecker.data["metadata"]["expiry_days"];
const expiryDate = moment(new Date()).add(days, "days").toDate();
await axios.post("https://encoach.com/api/stripe", {expiryDate, email, key: process.env.STRIPE_SECRET, checkout: id}); await axios.post(process.env.WEBHOOK_URL || "", {days, email, key: process.env.STRIPE_SECRET, checkout: id});
return Response.json({error: null, ok: true}); return Response.json({error: null, ok: true});
} catch (e) { } catch (e) {