我正在尝试以下操作并收到错误: 在第156行的/home/ubuntu/workspace/vendor/stripe/stripe-php/lib/ApiRequestor.php中为foreach()提供的参数无效
这是我的代码,我第一次授权$ 25.00,捕获为false。然后想用更少的$ 23.00捕获。样本不是很清楚。
$charge = \Stripe\Charge::create(array(
"amount" => 2500,
"currency" => "usd",
"capture" => false,
"customer" => $stripecustid));
$chargeid = $charge->id;
$ch = \Stripe\Charge::retrieve($chargeid);
$captured = $ch->capture(2300);
答案 0 :(得分:2)
这应该做你想要的:
$captured = $ch->capture(array(
"amount" => 2300
));
以下是"捕获费用的文档" API调用:https://stripe.com/docs/api#capture_charge