From 7dbe51bda91d370bcda8e070c01437bb1c66aad1 Mon Sep 17 00:00:00 2001 From: ahmedsophyudden Date: Fri, 8 Oct 2021 10:31:23 +0800 Subject: [PATCH] integrate create billplz bill with create booking payment, and a new billplz callback url --- .../Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php | 2 +- app/Classes/Modules/Billplzs/Services/CreatesBillplzBill.php | 2 +- .../bookings/forms/BookingPaymentQuotationComponent.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php index eb472ce5..8dece746 100644 --- a/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php +++ b/app/Classes/Modules/Billplzs/ControllersLogic/CallbackBillplzLogic.php @@ -72,7 +72,7 @@ class CallbackBillplzLogic extends AbstractControllerLogic $transaction = $this->fetchesTransaction->execute(['payment_reference' => $billplzXSignatureObject->getBillPlzId()]); - if($billPlz->state == 'paid') $this->updatesTransactionStatus->execute($transaction, ApprovalStatus::PENDING_VERIFICATION); + if($billPlz->state == 'paid') $this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED); return $this->response(['data' => $billPlz]); diff --git a/app/Classes/Modules/Billplzs/Services/CreatesBillplzBill.php b/app/Classes/Modules/Billplzs/Services/CreatesBillplzBill.php index bd97728e..7cf4bdef 100644 --- a/app/Classes/Modules/Billplzs/Services/CreatesBillplzBill.php +++ b/app/Classes/Modules/Billplzs/Services/CreatesBillplzBill.php @@ -10,7 +10,7 @@ class CreatesBillplzBill * @return \Illuminate\Database\Eloquent\Model * @throws \App\Classes\Exceptions\MalformedRequestException */ - public function execute(string $name, string $email, string $description, float $amount, string $billNumber, string $bankCode = '') { + public function execute(string $name, string $email, string $description, float $amount, string $billNumber, ?string $bankCode = null) { try{ $response = Http::withBasicAuth(config('billplz.api_key').':', '')->post(config('billplz.base_url').'/api/v3/bills', [ 'collection_id' => config('billplz.collection_id'), diff --git a/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue b/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue index 9efbe54c..b98d2762 100644 --- a/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue +++ b/resources/assets/vue/components/bookings/forms/BookingPaymentQuotationComponent.vue @@ -169,7 +169,7 @@ -
+