Stripe checkout:仪表板中的描述而不是 pi

Stripe checkout: description in dashboard instead of pi

谁能帮帮我?我将表单 v2 迁移到 v3 结帐。

如何在条带仪表板描述列中发送我的自定义描述订单? 现在我只得到付款 ID pi_1IrhQALKfdoxxl3X07seJ5anto

用旧的 API 根据描述我会做:

$charge = \Stripe\Charge::create(array(
    "amount" => $_POST['amount'],
    "currency" => "EUR",
    "description" => "Order #".$_POST["order"],
    "source" => $token,
));

与新 API :

    $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',
]);

谢谢

根据条纹文档:https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-description

$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"]
  ]
]);