gpt4 book ai didi

stripe-payments - Stripe 支付 'client_reference_id'

转载 作者:行者123 更新时间:2023-12-04 08:55:33 30 4
gpt4 key购买 nike

我正在与 Stripe Payment Gateway 集成——API 的最新版本。
除了“client_reference_id”没有传递给 webhook 或事务(没有出现在日志中)之外,这一切都在工作 - 我需要这个来更新数据库中的订单。
我的代码是:

$session = \Stripe\Checkout\Session::create([
'billing_address_collection' => 'required',
'payment_method_types' => ['card'],
'line_items' => [[
'amount' => 1011,
'currency' => 'GBP',
'name' => 'Purchase',
'description' => 'test',
'quantity' => 1,
]],
'client_reference_id' => 'TEST1111223',
'mode' => 'payment',
'success_url' => 'https://example.com/success',
'cancel_url' => 'https://example.com/cancel'
]);
根据文档,这应该通过: https://stripe.com/docs/api/checkout/sessions/create
难道我做错了什么?
其他人问了同样的问题,但没有得到回答: The "client_reference_id" argument is not passed

最佳答案

引用 Checkout session 的唯一字符串。这可以是客户 ID、购物车 ID 或类似名称。它包含在 checkout.session.completed webhook 中,可用于完成购买。
来源 https://stripe.com/docs/js/checkout/redirect_to_checkout

关于stripe-payments - Stripe 支付 'client_reference_id',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63850669/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com