#Dov
1 messages · Page 1 of 1 (latest)
Hello! can you share the Checkout Session id? it'd look like cs_test_...
Sure, it's cs_live_a1PNx1AoZqr3pQRz0BAnvNufI9zIaiyszxBK8ksQsvxgjH95HPXbwZFtNY
if you want the metadata to be on the corresponding PaymentIntent, you need to set it in payment_intent_data.metadata : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
Where have I put it then?
right now you're setting the metadata here : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata
I'm having a look at the moment.
Do you have an example of the structure/JSON I would be using here? I'm basing my payload off the example shown which is very basic.
$stripe->checkout->sessions->create([
'success_url' => 'https://example.com/success',
'cancel_url' => 'https://example.com/cancel',
'line_items' => [
[
'price' => 'price_...',
'quantity' => 2,
],
],
'payment_intent_data' => [
'metadata' => [
'orderid' => 'test'
]
],
'mode' => 'payment',
]);
Perfect, I'll play with this.
Nope, for whatever reason it's not being accepted.
cs_live_a1RQQUCZqGEJYcAQM0PQ5DRbOuReJBxJPB5UVFsEJJfm3018MYyzIPrlZ4
I have added the extra array to the payload.
Out of curiosity, the key doesn't need to say orderid does it? I'm going under the assumption we can create our own value pairs.
Ok, that's what I have done but it's not being received by the API.
'mode' => 'payment',
'metadata' => [
'currency' => 'aud',
'unit_amount' => $price,
'name' => $itemType.' order '.$docid,
],
'payment_intent_data' => [
'metadata' => [
'currency' => 'aud',
'unit_amount' => $price,
'name' => $itemType.' order '.$docid,
]
],
'client_reference_id' => $itemType.' order '.$docid,
The first array of metadata is showing.
what do you mean by it's not received by the API? I see it in the Dashboard here for the PaymentIntent : https://dashboard.stripe.com/payments/pi_3LjxYOGovY9Qvzsj1a8qrGHx
Oh, I was looking at the event detail.
So upon a successful payment the metadata shown there will be present?
yes, that's right. can you share the event id you're looking at?
Nope, just shows this: