Updated it to send the days instead of the date
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user