diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index fe04f228..793d890e 100755 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -610,7 +610,8 @@ public function create_or_update_subscription($invoice_id,$invoice_status, $msg_ try { $id = $this->paymentModel->where('membership_id', $membership_id)->first()['id']; if ($id) { - $data['status'] = 9999; + $data['status'] = 999999; + $data['payment_status'] = "Approved"; $data['updated_by'] = (int)get_logged_user_id(); $this->paymentModel->update($id, $data); log_message('error', 'Payment Status Found and updated by User' . $data['updated_by']); diff --git a/app/Controllers/Payment.php b/app/Controllers/Payment.php index 4a902538..5dc4a216 100644 --- a/app/Controllers/Payment.php +++ b/app/Controllers/Payment.php @@ -118,7 +118,8 @@ class Payment extends BaseController 'order_id' => $ORDER_ID, 'scheme_id' => env('RENEWAL_SCHEME_ID'), 'amount' => $TXN_AMOUNT, - 'device' => $payment_method == "mobile"? "Mobile":"Web" + 'device' => $payment_method == "mobile"? "Mobile":"Web", + 'payment_status'=> 'Not Received' ]; $result = $this->paymentModel->insert($payment_status_data); if ($result){ @@ -186,6 +187,18 @@ public function payment_failure(){ $model4 = new TransactionModel(); $model4->insert($paramList); + // $insertId = $model4->insertID(); + $payment_status_id = $this->paymentModel->select('id')->where('order_id',$this->request->getVar('ORDERID'))->first()['id']; + // echo "payment status id :"; + // var_dump($payment_status_id);die(); + // $payement_status_update['status'] = $insertId; + $converted_status = ucfirst(strtolower(str_replace("TXN_", "", $this->request->getVar('STATUS')))); + $payement_status_update['payment_status'] = $converted_status; + + // $payement_status_update['status'] = $payment_status_id; + + $updated = $this->paymentModel->update($payment_status_id, $payement_status_update); + log_message('error', 'Payment Status Updated: ' . json_encode($updated)); return view('/payment_failure'); } @@ -345,6 +358,9 @@ public function payment_process() { // echo "payment status id :"; // var_dump($payment_status_id);die(); $payement_status_update['status'] = $insertId; + $converted_status = ucfirst(strtolower(str_replace("TXN_", "", $this->request->getVar('STATUS')))); + $payement_status_update['payment_status'] = $converted_status; + // $payement_status_update['status'] = $payment_status_id; $updated = $this->paymentModel->update($payment_status_id, $payement_status_update); diff --git a/app/Models/PaymentStatusModel.php b/app/Models/PaymentStatusModel.php index 0f2bb9cc..5a23330e 100644 --- a/app/Models/PaymentStatusModel.php +++ b/app/Models/PaymentStatusModel.php @@ -22,7 +22,8 @@ class PaymentStatusModel extends Model 'device', 'status', 'is_active', - 'order_id' + 'order_id', + 'payment_status' ]; diff --git a/app/Views/payment_status_table.php b/app/Views/payment_status_table.php index 1b7efcfd..6b35e71f 100644 --- a/app/Views/payment_status_table.php +++ b/app/Views/payment_status_table.php @@ -4,7 +4,9 @@