#karsh-pi-products
1 messages ยท Page 1 of 1 (latest)
Hey! Right now you can't pass product data/line items with Payment Intents. Just a flat amount value
Hey thanks for the reply. So that means I'll just have to make my own logic parallel to the payment intent, am I right?
Or should I be using a different stripe flow
Are you using our Products/Prices APIs?
(with my own logic I mean I simply send an array with the products being bought when submitting the payment form. Then save the id of that transaction (somehow?) so I can link the webhook back to that payment)
Hmm is that an or or question ๐ ? I'm not sure to be honest
(using a low-code tool to integrate stripe, so I'm not coding everything from scratch)
Can you share a Payment Intent ID or something? I can check your account
Yep, taking a look!
Seems like you just have your own product data elsewhere and you're calculating the amount value in your app?
Hmm right now yes, but I literally just made an empty 'products' table. So I can consider to make them in stripe. Would that be helpful in my current situation?
You could use our Products and Prices APIs, but they aren't really compatible with Payment Intents right now. You'd instead use them with Checkout
Oh okay in that case I think I got to stick with payment intents. As I want a custom check out flow
I feel like I'm missing something obvious. I'm basically following these steps https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements but am missing how to link that particular payment to a list of products
Your best option is to likely use the metadata parameter on the PI: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ahh that would be great. Looking at the link you sent me...
I can simply send something like
[customer_id: 503, productID_1: 53394, productID_2: 53233]
And then when I retrieve this webhook I know which customer bought + which products.
Correct?
Yep, exactly. Alternatively you could have an external orders object in your database that you create and use as a reference for the PaymentIntent
That sounds interesting, could you expand on that a little bit? I don't grasp it completely yet
Some more work at your end but you'd create an order at checkout in your database which stores reference to the products, customer, etc. Then pass the ID of that object when creating the Payment Intent with Stripe as a reference
Got it! Any advantage to that?
Well then you have an order history separate from Stripe
But this is really outside the remit of Stripe so it's up to you and your business! ๐
Got it! Thanks, this should be enough to get me going ๐
Np!