Can anyone help me with this?
I am experiencing an issue during the checkout process where the payment session URL expires within a few minutes, displaying the error message “This link has expired. This means that your payment has already been processed or your session has expired.” As a result, customers are not redirected to the provided success_url after a successful payment, causing confusion and leading to refund requests.
`
const session = await stripe.checkout.sessions.create({
mode: "subscription",
payment_method_collection:"if_required",
line_items: [
{
price: `${product.default_price}`,
quantity: 1,
},
],
currency: currency,
allow_promotion_codes: true,
success_url: `${success_url}?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: cancel_url,
...ref,
customer_email: user?.dataValues?.email,
subscription_data: {
metadata: {
plan_id: plan_id,
user_id: id,
},
},
});`