#arielbo-webhook-billing_details
1 messages · Page 1 of 1 (latest)
Hi 👋 can you elaborate a bit?
hello toby
I will need to listening "billing_details": { maybe do you have one event to do this with payment_intent ?
its possible ?
Are you referring to the billing_details on the Charge object:
https://stripe.com/docs/api/charges/object#charge_object-billing_details
the billing_details from the Payment Method object:
https://stripe.com/docs/api/payment_methods/object#payment_method_object-billing_details
or possibly something else?
I put the data in stripe.confirmPayment and now I want to recovery with event with webhooks
Gotcha, you're probably looking for the details on the associated Charge object then.
With the Payment Intent ID you get from the webhook Event, you can use this endpoint to list Charge objects and provide the ID of the Payment Intent in the payment_intent field to filter the results to just Charges associated with that Payment Intent.
https://stripe.com/docs/api/charges/list
Then you can find pull the billing_details from the Charge object.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
how can I recovery this data? $stripe->charges->all(['limit' => 3]);
I have Payment Intent ID but how can I recovery with charges ?
maybe $stripe->charges->Payment Intent ID ?
Im using php
You provide the Payment Intent ID in the payment_intent field.
Yes but where?
You can use the limit included in the snippet as a framework. Change the limit parameter name to payment_intent to change what parameter you're providing, then change the 3 to a string with the ID of your Payment Intent.
$stripe->charges->all(['payment_intent' => Payment Intent ID]); ?
And this works in my webhook ?
// Handle the event
switch ($event->type)
{
// Handle the event
case 'payment_intent.succeeded':
$stripe->charges->all(['payment_intent' => Payment Intent ID]); ?
....
That looks right, once you replace Payment Intent ID with a string containing the ID of your Payment Intent.
let me try
arielbo-webhook-billing_details
works
Stripe\Collection JSON: {
"object": "list",
"data": [
{
"id": "ch_3adfasfasdf",
"object": "charge",
"amount": 877,
"amount_captured": 877,
"amount_refunded": 0,
No please your help how can I access to this ?
$pi = $stripe->charges->all(['payment_intent' => $paymentIntentID]);
echo $billing_details = $pi->data->billing_details;
not work
Did you try pointing to the first element of data since it is an array?
Hi 👋
I'm stepping in for @fast warren . What is it you are trying to access?
As my colleague stated, data is an array so you cannot access data->amount
You will need to access an element in the array first
yes but is rare the response of stripe
object(Stripe\Charge)#5240 (47) {
["id"]=>
string(27) "ch_3MSEEfHHulAmiNnD1n1wjglO"
["object"]=>
string(6) "charge"
["amount"]=>
int(877)
["amount_captured"]=>
int(877)
["amount_refunded"]=>
int(0)
as you can see
You are talking about this response, correct?
Stripe\Collection JSON: {
"object": "list",
"data": [
{
"id": "ch_3adfasfasdf",
"object": "charge",
"amount": 877,
"amount_captured": 877,
"amount_refunded": 0,
You should be able to examine the response from the API and determine what method you need to use to access the data
its ok ..
Im access like
$pi = $stripe->charges->all(['payment_intent' => $paymentIntentID]);
$bd = (object) $pi->data[0];
$user_nombre_bi = $bd->billing_details->name;
works good !
thanks for your help
I don-t understand why your event payment_intent.succeeded dont send all data of the payment intent in success, its not practice, but with charges object works good
another how can I update metada in this same event ?
payment intent update ?
is possible ?
If you want to update the metadata on the Payment Intent you can update the Payment Intent when you receive the payment_intent.succeeded event.
https://stripe.com/docs/api/payment_intents/update#update_payment_intent-metadata
$stripe->paymentIntents->update(
$paymentIntentID,
['metadata' => ['Nombre' => $user_nombre,
'User Email' => $user_email,
'Teléfono' => $user_telefono]]
); NOT work
I need to add metadata in payment_intent.succeeded event can I do this with update?
You cannot add metadata to the event but if you add metadata to the Payment Intent prior to the payment completing, then that metadata will be present in the Payment Intent object that is sent in the payment_intent.succeeded event
good answer
not update
maybe i'm doing something wrong ? in my query please could you help me
Can you share the request ID for the failed API request?
Sorry that's not what I'm looking for. You said the Payment Intent Update API call is failing. Can you share the request ID for that API request?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_IBNuvnCj0rAM16
That request was successful and set the s_name property. What about this didn't work?
It seems to have been updated but it doesn't show up in the webbooks