diff --git a/app/Classes/General/Eloquent/Filters/OwnerIdNotIn.php b/app/Classes/General/Eloquent/Filters/OwnerIdNotIn.php new file mode 100644 index 00000000..97c7dcba --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/OwnerIdNotIn.php @@ -0,0 +1,20 @@ +whereNotIn('owner_id', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Transactions/ControllersLogic/CreatePaymentTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/CreatePaymentTransactionLogic.php index ff7c89ee..9535c04f 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/CreatePaymentTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/CreatePaymentTransactionLogic.php @@ -83,7 +83,7 @@ class CreatePaymentTransactionLogic extends AbstractControllerLogic $payment_method = PaymentMethodType::PAYMENT_GATEWAY; $billPlzBill = $this->createsBillplzBill->execute( $company_module->name, - $company_module->employees()->first()->email ?? '', + (app()->environment(['production'])) ? $company_module->employees()->first()->email : '', 'This payment is for the invoice number . ' . $invoice_transaction->bill_no, $amount, $billNumber, diff --git a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue index b38d09c3..0dee1870 100644 --- a/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/forms/PaymentFormComponent.vue @@ -109,6 +109,11 @@ } this.error = ''; }, + successHandler(response){ + if (response.payload.data.payment_method === 5) { + window.location.href = this.route('billplz.bill', response.payload.data.payment_reference) + '?auto_submit=true'; + } + } }, mixins: [formHandler] } diff --git a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue index 8a759b4e..a822b542 100644 --- a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue @@ -102,7 +102,7 @@
- + diff --git a/routes/web.php b/routes/web.php index 9407d990..e4a20254 100644 --- a/routes/web.php +++ b/routes/web.php @@ -420,3 +420,8 @@ Route::get('/payment-and-billing', function () { return view('pages.paymentAndBilling'); })->name('admin.payment-and-billing'); Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list'); + +Route::get('billplz/bills/{bill_no}', function($bill_no){ + return redirect(env('BILLPLZ_BASE_URL').'/bills/'.$bill_no); + })->name('billplz.bill'); + \ No newline at end of file