#Dov

1 messages · Page 1 of 1 (latest)

near scaffoldBOT
hollow cave
#

Hello! can you share the Checkout Session id? it'd look like cs_test_...

somber wing
#

Sure, it's cs_live_a1PNx1AoZqr3pQRz0BAnvNufI9zIaiyszxBK8ksQsvxgjH95HPXbwZFtNY

hollow cave
somber wing
#

Where have I put it then?

somber wing
#

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.

hollow cave
#
$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',
]);
somber wing
#

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.

hollow cave
#

you can create your own key value pairs

#

the code i provided is just an example

somber wing
#

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.

hollow cave
somber wing
#

Oh, I was looking at the event detail.

#

So upon a successful payment the metadata shown there will be present?

hollow cave
#

yes, that's right. can you share the event id you're looking at?

somber wing
#

pi_3LjxYOGovY9Qvzsj1a8qrGHx

#

Mind you, this was cancelled as I am just testing.

hollow cave
#

event id starts with evt_

#

or maybe you can share what's the event name?

somber wing
#

Nope, just shows this: