Merge pull request #549 from DODMax/e-offline-pay
Allow offline payment when no gateway is defined
This commit is contained in:
commit
935170f256
|
|
@ -186,14 +186,14 @@ class EventCheckoutController extends Controller
|
|||
$paymentGateway = $activeAccountPaymentGateway;
|
||||
} else {
|
||||
$activeAccountPaymentGateway = $event->account->getGateway($event->account->payment_gateway_id);
|
||||
//if no payment gateway configured don't go to the next step and show user error
|
||||
if (empty($activeAccountPaymentGateway)) {
|
||||
//if no payment gateway configured and no offline pay, don't go to the next step and show user error
|
||||
if (empty($activeAccountPaymentGateway) && !$event->enable_offline_payments) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'No payment gateway configured',
|
||||
]);
|
||||
}
|
||||
$paymentGateway = $activeAccountPaymentGateway->payment_gateway;
|
||||
$paymentGateway = $activeAccountPaymentGateway ? $activeAccountPaymentGateway->payment_gateway : false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -389,7 +389,7 @@ class EventCheckoutController extends Controller
|
|||
break;
|
||||
default:
|
||||
Log::error('No payment gateway configured.');
|
||||
return repsonse()->json([
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'No payment gateway configured.'
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use App\Models\Order;
|
|||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
|
||||
class SendOrderNotification extends Job implements ShouldQueue
|
||||
{
|
||||
|
|
|
|||
|
|
@ -159,7 +159,13 @@
|
|||
@if($event->enable_offline_payments)
|
||||
<div class="offline_payment_toggle">
|
||||
<div class="custom-checkbox">
|
||||
<input data-toggle="toggle" id="pay_offline" name="pay_offline" type="checkbox" value="1">
|
||||
@if($payment_gateway === false)
|
||||
{{-- Force offline payment if no gateway --}}
|
||||
<input type="hidden" name="pay_offline" value="1">
|
||||
<input id="pay_offline" type="checkbox" value="1" checked disabled>
|
||||
@else
|
||||
<input data-toggle="toggle" id="pay_offline" name="pay_offline" type="checkbox" value="1">
|
||||
@endif
|
||||
<label for="pay_offline">@lang("Public_ViewEvent.pay_using_offline_methods")</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue