[英]Sale transaction to multiple users at once with Braintree along with PHP
Is this possible with Braintree(payment gateway) along with PHP to make a sale transaction for all the users at once. 使用Braintree(支付网关)和PHP可以一次为所有用户进行销售交易吗? Like i want to make sale transaction only when minimum number of users are subscribed. 就像我想仅在最小用户数时进行销售交易。
Here is the which I am trying to use: 这是我尝试使用的:
// Make a sale transaction for all the users at once.
for ($x = 0; $x <= count($users); $x++) {
$result = \Braintree\Transaction::sale(array(
'amount' => Session::get('price'),
'paymentMethodNonce' => $request->payment_method_nonce,
'customer' => [
'id' => $user->id,
],
'options' => [
'submitForSettlement' => True,
]
));
}
随机数只能使用一次,因此唯一可行的方法是使用付款方式令牌,您必须从每个客户的结果对象中返回该令牌。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.