fix: add aggregator while payIn
This commit is contained in:
parent
03940b4a85
commit
94cb623d4f
|
@ -79,7 +79,7 @@ class CinetpayController extends Controller
|
||||||
public function pay(Request $request)
|
public function pay(Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'aggregator_id' => 'required|integer',
|
// 'aggregator_id' => 'required|integer',
|
||||||
'amount' => 'required|numeric|min:5',
|
'amount' => 'required|numeric|min:5',
|
||||||
'currency' => 'required|string|size:3',
|
'currency' => 'required|string|size:3',
|
||||||
// 'payment_method' => 'nullable|string|in:ALL,MOBILE_MONEY,CREDIT_CARD,WALLET',
|
// 'payment_method' => 'nullable|string|in:ALL,MOBILE_MONEY,CREDIT_CARD,WALLET',
|
||||||
|
@ -96,6 +96,8 @@ class CinetpayController extends Controller
|
||||||
'reason' => 'required|string'
|
'reason' => 'required|string'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$aggregator = PaymentAggregator::where('name','like','%cinetpay%')->firstOrFail();
|
||||||
|
|
||||||
$transaction_id = $this->getTransactionID();
|
$transaction_id = $this->getTransactionID();
|
||||||
$payment_method = 'ALL';
|
$payment_method = 'ALL';
|
||||||
$amount = $request->input('amount');
|
$amount = $request->input('amount');
|
||||||
|
@ -140,7 +142,7 @@ class CinetpayController extends Controller
|
||||||
if ($responseCode == 200) {
|
if ($responseCode == 200) {
|
||||||
|
|
||||||
PaymentTransaction::create([
|
PaymentTransaction::create([
|
||||||
'aggregator_id' => $request->input('aggregator_id'),
|
'aggregator_id' => $aggregator->id,
|
||||||
"currency" => $request->input('currency'),
|
"currency" => $request->input('currency'),
|
||||||
"transaction_id" => $transaction_id,
|
"transaction_id" => $transaction_id,
|
||||||
"amount" => $amount,
|
"amount" => $amount,
|
||||||
|
|
|
@ -45,16 +45,17 @@ class PaymentController extends Controller
|
||||||
|
|
||||||
if($payment_method == PaymentMethod::CARD){
|
if($payment_method == PaymentMethod::CARD){
|
||||||
$aggregator = PaymentAggregator::where('name','like','%stripe%')->firstOrFail();
|
$aggregator = PaymentAggregator::where('name','like','%stripe%')->firstOrFail();
|
||||||
$data = $request->all();
|
|
||||||
$request = new Request();
|
|
||||||
$request->merge(array_merge($data,[
|
|
||||||
'payment_method' => PaymentMethod::CARD,
|
|
||||||
'aggregator_id' => $aggregator->id
|
|
||||||
]));
|
|
||||||
}else{
|
}else{
|
||||||
$aggregator = PaymentAggregator::where('status',1)->firstOrFail();
|
$aggregator = PaymentAggregator::where('status',1)->firstOrFail();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = $request->all();
|
||||||
|
$request = new Request();
|
||||||
|
$request->merge(array_merge($data,[
|
||||||
|
'aggregator_id' => $aggregator->id
|
||||||
|
]));
|
||||||
|
|
||||||
switch (strtolower($aggregator->name)) {
|
switch (strtolower($aggregator->name)) {
|
||||||
case 'yoomee':
|
case 'yoomee':
|
||||||
return app(YoomeeController::class)->pay($request);
|
return app(YoomeeController::class)->pay($request);
|
||||||
|
|
Loading…
Reference in New Issue