#romas

1 messages · Page 1 of 1 (latest)

sharp bronzeBOT
paper robin
#

Can you share a cs_xxx ID?

shut solstice
#

hold on

#

cs_test_a1d2OmZTANhCRnF4qA6vFkJJFBJarLZrVAi8zVPzKFSsYi1Nke9rfsmazw

#

this is the latest

paper robin
#

Can you help me understand the connection between the Checkout Session and the Invoice?

shut solstice
#

Well, I want to implement this logic:

  1. Customer goes to invoice;
  2. Selects credit card as payment and redirected to Stripe checkout;
  3. Enters cc details and submits payment;

Now, at this step I need to lock invoice in my internal system to deny user any payment with different gateways until cc payment clears out.

  1. After successful payment invoice unlocks (payment_intent.succeeded or checkout.session.completed)
paper robin
#

Got it, taking a look!

#

The issue you have is that we don't create a Payment Intent (and therefore the payment_intent.created event isn't fire) until the customer attempts a payment, not on session creation.

shut solstice
#

ooo, so only on checkout session completed payment_intent could see session metadata?

#

ha, so only by customer ref id payment intent is related to checkout.session ?

paper robin
shut solstice
#

How would you implement my desired logic? What event would you listen on webhooks to make my desired "lock"?

paper robin
#

Hmm, thinking

shut solstice
#

any thoughts?

paper robin
#

Oops, sorry

#

Have you considered 'locking' the invoice synchronously on successful creation of the Checkout Session?

#

You can then unlock it when it expires, listening for the checkout.session.expired event

shut solstice
#

if checkout.session->id != false than lock ?

#

good idea

#

and simple to

#

love KISS approach 🙂

#

thank you