gpt4 book ai didi

stripe-payments - 我如何使用 Stripe 进行部分捕获

转载 作者:行者123 更新时间:2023-12-02 21:04:47 27 4
gpt4 key购买 nike

我尝试用 Stripe 进行部分捕获。

首先我授权 12000 然后我捕获一部分

curl https://api.stripe.com/v1/charges/{chargeId}/capture \
-u key
-d amount=250
-X POST

紧接着(为了测试)我做同样的事情

    curl https://api.stripe.com/v1/charges/{chargeId}/capture \
-u key
-d amount=250
-X POST

第一个成功,第二个失败

{
"error": {
"type": "invalid_request_error",
"message": "Charge ch_18092DHwc58lFNepWa5maML7 has already been captured."
}
}

我做错了什么,因为我无法获取剩余资金

附注我开始在 stripe.net 中这样做,我遇到了同样的问题。然后排除 stripe.net 是我直接在终端尝试的错误来源

最佳答案

您只能捕获一次授权交易 - 即使它只是部分捕获。根据Stripe support :

If you want to charge less than the initial amount, you can pass in the amount parameter and we’ll refund the rest back to the customer.

(强调)

您会在仪表板上注意到部分捕获的交易显示剩余资金已退还。

另一种方法是保存客户的卡并根据需要创建费用。

关于stripe-payments - 我如何使用 Stripe 进行部分捕获,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36622487/

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