request->input('amount',100); $type = $this->request->input('type','standard'); $payment = $type === 'premium' ? $this->premiumPaymentGateway : $this->standardPaymentGateway; $payRes = $payment->processPayment($amount); $refundRes = $payment->processRefund($amount); $refundPreRes = $this->premiumPaymentGateway->processRefund($amount); $payPreRes = $this->premiumPaymentGateway->processPayment($amount); return $this->return->success('success',[ 'pay_res' => $payRes, 'refund_res' => $refundRes, 'refund_pre_res' => $refundPreRes, 'pay_pre_res' => $payPreRes, ]); } }