#Abishek

1 messages · Page 1 of 1 (latest)

turbid saddleBOT
bright sparrow
#

Can you show me the code that you are using when you get that error?

#

It sounds like you are trying to access charges on a PaymentIntent object that does not have a charges property

#

It sounds like your API code may be using one of our recent API versions where the charges array was replaced by the latest_charge property

scenic rock
#

do I need to upgrade the API?

bright sparrow
#

You can either change your code to work with that latest_charge property or you can change the API version that you are making calls with to a version that is 2022-08-01 or earlier

scenic rock
#

ok, so how do I get the receipt url from the PaymentIntent?

#

I see there is the property called latest_charge

#

do I need to retrieve the charge and then look up the receipt url?

bright sparrow
#

receipt_email is on the charge object the https://stripe.com/docs/api/charges/object#charge_object-receipt_url
So when retrieving the payment intent, you can expand latest_charge and then access the URL at latest_charge.receipt_url on the intent https://stripe.com/docs/expand

Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.

scenic rock
#

ok, tried that, get this error

This property cannot be expanded 
(latest_charge.receipt_url).
#

This is just test data and here is the request data

#

I am currently on API - 2022-11-15

bright sparrow
#

You only need to expand latest_charge

scenic rock
#

ah ok

bright sparrow
#

That will cause the entire charge object to be included in the response

#

Which include the receipt URL