#nate!
1 messages · Page 1 of 1 (latest)
Hi there
hi there
No those are not parameters of the PaymentIntent object
how can i get it?
You would collect those separately if you are using a custom integration
And you can store them on the Customer object or as metadata for the PaymentIntent or in your own database
i dont wanna collect anything
i want to see the users email when this happens
anda send him an email
like this
@stiff gate
Well you would have to collect the users email for it to be returned in the webhook
For some PaymentMethods it will indeed be collected via Payment Element for instance
in here
Ahh okay so you are using Checkout
Sorry, when you said PaymentIntent I assumed you were using a custom flow
So the email is stored on the PaymentMethod's billing_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
im not
using
checkou
t
in checkout i can't get the webhook thingy
Do you have an example PaymentIntent from your account that I can look at?
wdym
?
{
"id": "evt_3MwPEzG89Ysy6SxP08ni4v6o",
"object": "event",
"api_version": "2022-11-15",
"created": 1681388827,
"data": {
"object": {
"id": "pi_3MwPEzG89Ysy6SxP03y4bIGz",
"object": "payment_intent",
"amount": 500,
"amount_capturable": 0,
"amount_details": {
"tip": {
}
},
"amount_received": 500,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "p",
"confirmation_method": "automatic",
"created": 1681388825,
"currency": "usd",
"customer": null,
"description": null,
"invoice": null,
"last_payment_error": null,
"latest_charge": "ch_3MwPEzG89Ysy6SxP0wupBFVL",
"livemode": false,
"metadata": {
},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1MwPEzG89Ysy6SxPPQMKwTTa",
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": "req_RSOU1QNI8sTPsa",
"idempotency_key": "92d0a2b4-4945-47dc-9495-cc0f2f1237e8"
},
"type": "payment_intent.succeeded"
}
@stiff gate here
Thanks give me one sec to look
Okay yeah so you are using Stripe Checkout as I noted. That means the email is associated with the billing_details of the PaymentMethod. So you can either retrieve the PaymentIntent again when you receive the webhook and expand latest_charge (in which case you will see billing_details within payment_method_data or you can retrieve the PaymentMethod directly.
so
event.data.object.lates_charge?
thats jus treturning me this
@stiff gate ch_3MwPEzG89Ysy6SxP0wupBFVL
You need to retrieve the PaymentIntent using https://stripe.com/docs/api/payment_intents/retrieve and expand latest_charge when you do that. Are you familiar with expansion?
If not, take a read through https://stripe.com/docs/expand
i don't understnad
what do i use to return that
what do i give there
You want the event.data.object.id to retrieve the PaymentIntent. Then you use { expand: ['latest_charge'] }
See https://stripe.com/docs/api/expanding_objects for an example
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
why are custom fields not inside this
Because custom fields are associated with the Checkout Session object
So you would want to listen for checkout_session.completed if you want custom fiels
is there any other way around
this
To get custom fields?
yes
where is the value
checkout
?
@stiff gate this only runs when the checkout is succesfull right?
Not sure what you are referring to with "where is the value checkout"
And what only runs?
nvm that
The Webhook?
yes
i only get this when user pays
and i recieve the payment
@stiff gate ??????
I am helping multiple people at once, you will need to be patient.
Yes these webhooks will only fire after a Checkout Session is completed
when i recieve the payment
right?
Yes