#hero_cli-override
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1255641293212876931
📝 Have more to share? Add details, code, screenshots, videos, etc. below.
You could use either the --add flag or --override flag in your trigger command: https://docs.stripe.com/cli/trigger#trigger-add
These allow you to override/add properties/parameters to the Payment Intent as it's being created. So for example: if you have a Customer already, you can add them using --add payment_intent:customer=<some customer ID>: https://docs.stripe.com/api/payment_intents/object#payment_intent_object-customer
Oh wow, thanks for the fast answer! That’s exactly what I was looking for. I missed that part in the docs. Thank you.
Sure thing! Happy to help
Just one more question related to the payment intent data that I receive. How do I know the product or price ID for that payment? I see that the amount is listed, but that's not really specific. I need to know the exact product the customer ordered for internal logic in the backend.
There's no Price or Product on a Payment Intent. Are you referring to Payment Intents generated by Invoices?
Hmm, okay, maybe I'm misunderstanding something here. I'll try to explain my current setup. Maybe that will make it clearer.
On the website, customers have the option to order "Credits". If a customer wants to order, for example, 5 "Credits", a Stripe checkout session is created and the customer will be redirected to the Stripe-hosted checkout. After the payment is successful, the backend needs to receive that event and add the amount of credits to the customer's account.
The "Credits" are bundled into different products with varying prices depending on the amount, such as 1, 2, 5, 10, and so on.
That's why I need information about the exact product that was purchased by the customer.
Ah, okay, Is there a reason not to use checkout.session.completed instead?
https://docs.stripe.com/cli/trigger#trigger-event-checkout_session_completed
hero_cli-override