#0xzoltaneth_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1284059137214513162
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
I'd be happy with a non-elegant solution as well, ie. getting an email from Stripe to my email address and getting the customer email and the paid amount in there and in that case I couldn build an automation from there.
Any customer
Any customer pays
And I'd like to collect their email address and paid amount so that I can add them to their course
obviously automatically
So I need to use API probably
Actually I can grab the amount they pay easily from "amount received"
However their emails are not captured
I am asking for a Customer ID to understand how you're collecting emails, so I can suggest how you can automate it.
Ok where can I grab one?
PaymentIntent ID is also fine
pi_xxx
The email address probably lives on the Customer object that you can find attached to the PaymentIntent.
pi_3PyUWzCeIDajNZL71Svw9qe2
You get a receipt_email on the PaymentIntent object.
But also you can find billing_details[email] on the related Charge object. You can find the Charge via PaymentIntent.latest_charge.
Cool thanks I just found it!
Now I cant find the name of the customer
Can you help plls
I should be able to grab the name as well, in this case it was Czére Zoltán
It's on the Charge object, billing_details[name]
I can see it should be on there...
Its just not there, this is everything it captures
I can't see name: Czére Zoltán anywhere
just so you know this is a payment intent webhook
That's a PaymentIntent object. You need to make an extra call to retrieve the Charge using the ID in latest_charge: https://docs.stripe.com/api/charges/retrieve
k let me try
Cool, thank you!!
Pls bear with me a moment to check if everything is captured
If Event Type=charge.succeeded that means payment succeeded, right?
Yes, but I would recommend only listening to one event, e.g. payment_intent.succeeded. The Charge one is more low-level.
As a rule of thumb, if you create a PaymentIntent, listen to payment_intent.succeeded event.
You can get all the extra information you need by making a few extra API calls, or using expand: https://docs.stripe.com/expand
Happy to help.