【发布时间】:2018-07-29 20:38:48
【问题描述】:
我正在尝试找到一种方法让 Stripe 一次充电即可为多个项目充电。我想它看起来像这样:
$totalitems = [];
if ( $item1 == "true" ) {
$currentitem = array(
"amount" => 19999,
"currency" => "usd",
"description" => "Item 1",
"customer" => $customer->id,
);
array_push($totalitems, $currentitem);
}
if ( $item2 == "true" ) {
$currentitem = array(
"amount" => 29999,
"currency" => "usd",
"description" => "Item 2",
"customer" => $customer->id,
);
array_push($totalitems, $currentitem);
}
$charge = \Stripe\Charge::create([$totalitems]);
这仅对数组中的第一项收费。有没有办法一次为多件商品充电?
【问题讨论】:
标签: stripe-payments