Can anyone help me? I migrate form v2 to v3 checkout.
how can I send my custom description order in stripe dashboard description column?
now I get only the payment id pi_1IrhQALKfdoxxl3X07seJ5anto
with old API by description I would do:
JavaScript
x
$charge = StripeCharge::create(array(
"amount" => $_POST['amount'],
"currency" => "EUR",
"description" => "Order #".$_POST["order"],
"source" => $token,
));
with the new API :
JavaScript
$stripe->checkout->sessions->create([
'success_url' => 'https://example.com/success',
'cancel_url' => 'https://example.com/cancel',
'payment_method_types' => ['card'],
'line_items' => [
[
'price' => 'price_H5ggYwtDq4fbrJ',
'quantity' => 2,
],
],
'mode' => 'payment',
]);
Thank you
Advertisement
Answer
according to the stripe documentation : https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-description
JavaScript
$stripe->checkout->sessions->create([
'success_url' => 'https://example.com/success',
'cancel_url' => 'https://example.com/cancel',
'payment_method_types' => ['card'],
'line_items' => [
[
'price' => 'price_H5ggYwtDq4fbrJ',
'quantity' => 2,
],
],
'mode' => 'payment',
'payment_intent_data' => [
'description' => "Order #".$_POST["order"]
]
]);