#PARAS DOCS-expire-checkout-session

1 messages ยท Page 1 of 1 (latest)

royal prawn
pure linden
#

it's loading

royal prawn
#

HI there ๐Ÿ‘‹ those appear to be two separate things.

What version of our node.js sdk are you using?

pure linden
#

  
 const session = await stripe.checkout.sessions.retrieve(id);
  if (!session) return res.redirect("/premium")
  const mode = session.payment_status
   if (mode === "paid") {
    await stripe.checkout.sessions.expire(id); 

      }
 
 res.redirect(`/dashboard/`);
 



})

royal prawn
#

Can you double check that, the latest version is only 8.210.0?

pure linden
#

@royal prawn when a successfull payment happen it just loading won't redirect

#

if i remove session expire line it works fine

royal prawn
#

Thank you, wanted to confirm you were on a new enough version to have the expire function. Oh, are you trying to expire already completed sessions?

pure linden
royal prawn
#

Ah, so that won't work as only open sessions can be expired. Is that function not throwing an error when you try to pass it an already completed session?

pure linden
pure linden
royal prawn
royal prawn
#

Just tested and confirmed, that expire function should be raising an error if you try to use it to expire an already completed session.