#bilal-paymentintent-apiversion

1 messages · Page 1 of 1 (latest)

molten quailBOT
visual tapir
#

Hi there

#

Yes if there is a Charge associated with it

#

You would expand the latest_charge

junior canyon
#

On test env its charging successfully and in the response object it doesn't have latest_charge attribute ?

visual tapir
#

Can you provide the example PaymentIntent you are looking at?

junior canyon
#

{ "id": "pi_3N8PgGKv7Wi3E5yl2kK5pR9E", "object": "payment_intent", "amount": 30000, "amount_details": { "tip": {} }, "automatic_payment_methods": null, "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", "client_secret": "pi_3N8PgGKv7Wi3E5yl2kK5pR9E_secret_G3nej1RlDI4mNxV5F5fPuQ22g", "confirmation_method": "automatic", "created": 1684250452, "currency": "cad", "description": null, "last_payment_error": null, "livemode": false, "next_action": null, "payment_method": "pm_1N8PgrKv7Wi3E5ylzJUr22Ha", "payment_method_types": [ "card" ], "processing": null, "receipt_email": null, "setup_future_usage": null, "shipping": null, "source": null, "status": "succeeded" }
this is the response I'm getting.

visual tapir
#

Yeah that is your client-side response

#

We don't share all the data client-side since there is sensitive data that we don't want to expose

junior canyon
#

One more question, When I retrieved the PaymentIntent I got the charge object and in charge object it is showing last4 than what is the purpose of expanding response ['latest_charge'] ?

visual tapir
#

I'm not sure what you mean exactly?

#

If you don't expand latest_charge then we only respond with the Charge ID

#

Not the details, which is what will include the last4

junior canyon
#

In the snap if you see I didn't expanded the latest_charge but i got the last4 in the charge attribute .My question was so why do we need to expand the latest_charge ?

molten quailBOT
visual tapir
#

Ah because you are on an older API version.

#

So you are seeing the charges hash which was removed on the newest API version

#

So yeah, if you stay with that API version then you don't need to expand latest_charge

wise mountain
#

bilal-paymentintent-apiversion

visual tapir
junior canyon
#

Got it .
Will use the 2022-11-15 version .
Thankyou 🙂

visual tapir
#

Sure!