#wullvie

1 messages ยท Page 1 of 1 (latest)

charred wigeonBOT
mossy bronze
#

hey two-shoes

vale flower
#

Which payload are you getting? The one that's returned after a Checkout Session is created? Or the one that comes from a webhook event?

#

p.s. hello ๐Ÿ‘‹

mossy bronze
#

hah

#

haha*

#

so im looking at both

#

i create the checkout session, and take the user to the URL

#

and pull the session "id" for reference later

#

but the payment_intent value is null both on creation and after a successful payment

vale flower
#

Can you post the Request ID for the Checkout Session creation event or the checkout.session.completed event?

Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request

mossy bronze
#

one sec

#

evt_1MMFM2LSnwxNkMW9oFRonuYw

#

this is the event id for "A Checkout Session was completed"

#

does it matter that it's in test mode?

#

seems the PI is still null there as well

#

in the events console

vale flower
#

Ahhh, that's because this was a Checkout Session that was created in subscription mode. You'll want to get the Payment Intent from the Invoice in this case

mossy bronze
#

ok so i can pull the invoice object using the in_lskdjfsldkf id, and grab the info from there?

#

unless you can think of an easier way - i'm essentially just trying to find a way to verify the payment AFTER completion and store this reference in our database, using any ID from the checkout

vale flower
#

AHhh, okay. That's basically for tracking fulfillment right? In other words you only want to update your database once a payment is successful via a Checkout Session?

mossy bronze
#

bingo

#

so once the redirect returns the user to our application, and the payment was successful, we just want to store an ID that we can use to track / verify the subscription in the future

vale flower
#

Got it. Okay, in that case, you can either get the Invoice using the Invoice ID in the Checkout Session object and look at invoice.status to see if it has been paid: https://stripe.com/docs/api/invoices/object#invoice_object-status

Or you can simply setup a webhook endpoint to listen for invoice.paid.

#

Depends on your setup and preferences though

mossy bronze
#

ok cool - using that invoice id will definitely get us what we're looking for. we'll see about setting up a hook as well but at least the inv. id will work great

#

thanks so much for the help - much appreciated and keep up the great work. having this dev discord is the best