出售交易,以多个用户在同一时间与Braintree随着PHP


Sale transaction to multiple users at once with Braintree along with PHP

这是否可能与Braintree(支付网关)以及PHP一起为所有用户同时进行销售交易?就像我想做销售交易只有当最低数量的用户订阅。

这是我想用的:

// 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,
                ]
            ));
}

nonce只能使用一次,因此唯一可行的方法是使用支付方法令牌,您必须从每个客户的结果对象返回该令牌。

相关文章: