#marlon2k

1 messages · Page 1 of 1 (latest)

covert geyserBOT
open bison
#

Are you using both Payment Intent and Checkout Sessions, or just Checkout Session only?

obsidian sky
#

Tried Zapiers direct integration too. Missing it there too.

#

Both

#

If it matters, this is when I'm purchasing a product through a payment link

#

@open bison

open bison
#

Payment Intent is a direct custom payment integration and no product/price details is set. Payment Intent will only charge to the amount set in the request that Stripe does not have product information with Payment Intent integration. No product data will be available.

For Checkout Session, it's possible to get the product information with Retrieve Checkout Session API by expanding line_items:

obsidian sky
#

@open bison I ended up creating an invoice upon payment and I have the product info & quantity there. However I'm still missing 1 thing that I can't retrieve from invoice data or charge data.

#

On the payment link I have a custom field. This custom field answer is not coming through.

#

How can I get that?

open bison
#

Can you share the example invoice ID (in_xxx) or Checkout Session (cs_xxx), so that I can check how your integration works?

obsidian sky
#

in_1NepOzH3dtB8toVXoHRe1nqV

#

charge ID ch_3NepM5H3dtB8toVX16qU8S58

#

checkout session I dont have that

#

@open bison

#

this is the field I need

open bison
#

The value of custom field will only be available in Checkout Session object, but not Invoice object.

The correct way to get product information and custom field is by using checkout.session.completed events. After receiving checkout.session.completed event, an additional Retrieve Checkout Session API should be made with expanding line_items.data.price.product field. You will be able to find:

obsidian sky
#

"After checkout.session.completed event, an additional Retrieve Checkout Session API should be made with expanding line_items.data.price.product field."

@open bison how do I do this?

open bison
obsidian sky
#

@open bison Is checkout session Id in this format? cs_live_xxxxxxxxx

open bison
#

Yes, correct!

obsidian sky
#

Ok thank you, and how do I get my secret key for authorization header?

#

nvm found it

open bison
obsidian sky
#

its not showing in the logs

open bison
#

Do you have the full error message? It might be the error thrown from Zapier, but not Stripe

obsidian sky
#

Thats what its showing me

#

And in Stripe in the logs I cant even see it coming through as a request

open bison
#

It looks like it doesn't reach Stripe. If it reaches to Stripe, it should be shown in the logs page

obsidian sky
#

yeah its not reaching

#

can you check my screenshot abvoe and see if you spot any erorrs in my GET checkout session request?

obsidian sky
#

yes thats it, sorry idk why I couldnt find it

open bison
#

Can you remove all the query parameters from the request?

obsidian sky
#

i have none already

#

oh wait

#

I need to use custom request

open bison
#

Somehow Zapier includes other query parameters in the request

obsidian sky
#

fixed it its working now

#

thank you!!

#

@open bison If I trigger on checkout session completed, does that mean only successful payments will trigger the webhook?

open bison
#

Yes

obsidian sky
#

thanks a lot

#

you were rly helpful, I was talking with support for 4 hours today and didn't get anywhere near a solution 🙂

open bison
#

No problem! Happy to help 😄

obsidian sky
#

so 1 more thing

#

@open bison so i need to expand the line items so i can see the product name and quantity in my retrieve checkout session request

#

how do I do this?

#

could you please send me JSON string I need to include in the data?

open bison
#

Thanks for waiting! Discord is busy now

#

so i need to expand the line items so i can see the product name and quantity in my retrieve checkout session request
It should look something like: expand: ['line_items.data.price.product']

obsidian sky
#

sorry thats not working

#

im reading the articles but really having a hard time understanding

open bison
#

I don't know how Zapier works and how their format should be like.

#

How about following?

{
  expand: ['line_items.data.price.product']
}
obsidian sky
#

thats json right?

open bison
#

Yup, this is JSON body with curly bracket

#

If it still doesn't work, I'd recommend checking with Zapier since they control your integration with Stripe that we don't know how it works

obsidian sky
#

Yeah still not working. Its Zapier but its a fully custom request - not a direct integration.

#

Like a postman

#

Does the expand stuff need to go in the data field or headers?

open bison
#

Stripe uses form-encoded (not JSON) request bodies [0]. I'm not too sure how Zapier maps the one shown in your UI to Stripe's request body.

[0] https://stripe.com/docs/api

obsidian sky
#

Is there any specific request I can make using payment intent ID or charge ID and pull the product info from there?

open bison
#

No! It's only possible through Checkout Session ID

obsidian sky
#

or an additioanl request using the checkout session ID

#

yeah this is what zapier is saying:

open bison
#

or an additioanl request using the checkout session ID
Isn't that we have been discussed about using Checkout Session Retrieval API?

open bison
obsidian sky
open bison
#

This is the example using curl

#

Not JSON

#

Stripe can't help much with sending request from Zapier UI

obsidian sky
#

ah im bashing my head over this hah

#

oh wait

open bison
#

This channel is for direct technical integration with Stripe. For third-party integration, I'd recommend reaching out to their Support

obsidian sky
#

i think i got it

#

yep i got it done

#

🥳

#

thanks