#ayushh_webhooks
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/1340920186047565915
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I am first creating a payment intent and then a checkout session
Just FYI, the email is empty. I am not taking any email from the customers. I want to use the email they used in the checkout session that
checkout.session.completed is only for Checkout Session. You are calling stripe.subscriptions.create so yes customer.subscription.created is what to expect
It only has customer: "cus_RmwsURaVWny88W"
So you want to call Retrieve Customer API, passing this Id in
Okay, lemme try it
the email is still null
"description": null,
"discount": null,
"email": null,
"id": "cus_RmwsURaVWny88W",
I want email from this checkout page
I submitted the payment but not sure if thats what you are talking about
I think the Invoice still hasn't been paid: https://dashboard.stripe.com/invoices/in_1QtMz0EcN4toC7LNwiMMKQms
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
how do I make the invoice paid?
Did you input the card and pressed "Pay now" from the Payment Elements?
yes
Maybe you used a different client secret? Because I don't see the PaymentIntent was confirmed
I used the client secret generated by the server
Ok can you share that's PaymentIntent Id? pi_xxx
ok wait
Take the log from here
console.log("Response data:", {
hasClientSecret: !!responseData.clientSecret,
error: responseData.error,
details: responseData.details,
});
pi_3QtNavEcN4toC7LN0X84t4SY_secret_SegBXm0pr66ZrbpfHtrtGoZpk
Okie, you can see this on your Dashboard: https://dashboard.stripe.com/payments/pi_3QtNavEcN4toC7LN0X84t4SY
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This hasn't been paid yet
Have you pressed on "Pay" with a test card?
I used the live keys
Please use the Test key and a test card, ie 4242
I cannot use the test keys as these keys were provided by the client
I mean, the environment is live
Without the test key how do you test your website? You can't use a Live card because it generate real transaction
lemme know what other debugging technique should i use?
You just need to pay the PaymentIntent, and a Test key would help.
am I not paying the payment intent?
Yes. I see the PaymentIntent is still waiting
is the code correct?
Seem to be correct, but you may want to expand the Payment Method's billing_details inside the PaymentIntent, which is only populated after the PaymentIntent is paid
okay I am making a transaction
hi
I got success message
@gentle silo evt_1QtOCYEcN4toC7LNFJzo2cqT
can you check this event id?
Sure looking..
This is a customer.updated event
Do you have a PaymentIntent Id (pi_xxx)?
pi_3QtOBqEcN4toC7LN0OvQAsvD_secret_4wTcDvfovUaGgE81Ek6dN2XuB
Thanks! This has a Payment Method
When you received payment_intent.succeeded, you can look at the payment_method field, it has an Id. Please call Retrieve Payment Intent and expand payment_method to see the email
This https://dashboard.stripe.com/events/evt_3QtOBqEcN4toC7LN0ZdPuzuZ
has pm_1QtOCUEcN4toC7LNHfIOZNAu
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
pi = stripe.PaymentIntent.retrieve("pi_3QtOBqEcN4toC7LN0OvQAsvD")
print(pi)
``` I want to see the email locally
is it possible?
You need the expand parameter
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
expand: ['payment_method']
Ok
I want to see what data i am getting when payment_intent.succeeded?
Yes, what data do you want to see?
I just want to extract email
when this payment_intent.succeeded event occurs
I created this for testing purposes only, I would like to handle the request through the nodejs webhook
should I just chane the
case "checkout.session.comleted"
``` to
case "payment_intent.succeeded
"
Yes
cool. thanks. will check it out.