fix: error in pay method
This commit is contained in:
parent
c83b178be9
commit
fa3d1af0da
|
@ -38,10 +38,10 @@ class PaymentController extends Controller
|
|||
{
|
||||
$this->validate($request, [
|
||||
'payment_method' => 'nullable|string',
|
||||
'aggregator_id' => 'required_without:payment_method|integer|exists:payment_aggregators,id',
|
||||
// 'aggregator_id' => 'required_without:payment_method|integer|exists:payment_aggregators,id',
|
||||
]);
|
||||
|
||||
$payment_method = $request->input('payment_method');
|
||||
$payment_method = $request->input('payment_method', PaymentMethod::CARD);
|
||||
|
||||
if($payment_method == PaymentMethod::CARD){
|
||||
$aggregator = PaymentAggregator::where('name','like','%stripe%')->firstOrFail();
|
||||
|
@ -52,7 +52,7 @@ class PaymentController extends Controller
|
|||
'aggregator_id' => $aggregator->id
|
||||
]));
|
||||
}else{
|
||||
$aggregator = PaymentAggregator::findOrFail($request->input('aggregator_id'));
|
||||
$aggregator = PaymentAggregator::where('status',1)->firstOrFail();
|
||||
}
|
||||
|
||||
switch (strtolower($aggregator->name)) {
|
||||
|
|
Loading…
Reference in New Issue