#adil

1 messages · Page 1 of 1 (latest)

thick galleonBOT
versed flax
#

What does a 'payment ID' look like?

cedar valve
#

pi_3NRZJVSCq3EU2irS1ZWuYk50

versed flax
cedar valve
#

I am using session checkout url field comes empty

versed flax
#

That will include the receipt_url field

cedar valve
#

where not found the object

#

please give me proper reference

#

how to get the receipt url with the payment id

versed flax
#

I just explained how. You need to 'expand' the latest_charge field on your Payment Intent, you can do that by retrieving the Payment Intent via the API, and passing the expand: ['latest_charge'] parameter

cedar valve
#

the latest charge is not working with the payment intent retreiw

#

i am using this $paymentId = 'PAYMENT_ID'; // Replace with the actual payment ID

$paymentIntent = PaymentIntent::retrieve($paymentId);
$charges = $paymentIntent->charges->data;
#

this give me No such payment_intent: 'pi_3NRZJVSCq3EU2irS1ZWuYk50'"

versed flax
cedar valve
#

pi_3NTfI7HySlJzISBO1klJ9A9C

versed flax
#

That's not the ID of the API request. And that's also a different ID to the one you shared in the error

#

Is it pi_3NRZJVSCq3EU2irS1ZWuYk50 or pi_3NTfI7HySlJzISBO1klJ9A9C

cedar valve
#

check this one this is the latest one generated pi_3NTfI7HySlJzISBO1klJ9A9C

#

This is the payment ID

#

I only need receipt URL

versed flax
#

Ok, then use this code:

PaymentIntent::retrieve({
  id: $paymentId,
  expand: ['latest_charge']
});
#

Then in the response, you'll have a latest_charge.receipt_url field

cedar valve
#

let me check