Is this possible with Braintree(payment gateway) along with PHP to make a sale transaction for all the users at once. 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,
]
));
}