From 18ae6e53691aad658d467900b9cb2adfdc3a84a7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 4 May 2024 08:32:43 +1000 Subject: [PATCH] Add billable prop --- .github/workflows/react_release.yml | 2 +- .github/workflows/release.yml | 2 +- app/Export/CSV/BaseExport.php | 1 + app/Jobs/Ninja/SendReminders.php | 1 - .../Authentication/ClientRegisterService.php | 4 ++-- app/Models/Quote.php | 1 + .../Authorize/AuthorizeTransaction.php | 15 +++++++++++---- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/react_release.yml b/.github/workflows/react_release.yml index e152890d2a68..2f8a3f8cfc62 100644 --- a/.github/workflows/react_release.yml +++ b/.github/workflows/react_release.yml @@ -64,7 +64,7 @@ jobs: - name: Build project run: | shopt -s dotglob - tar --exclude='public/storage' --exclude='.htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/react-invoiceninja.tar * + tar --exclude='public/storage' --exclude='./htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/react-invoiceninja.tar * - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8204134564c3..57ce9b8eb625 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,7 +74,7 @@ jobs: run: | zip -r /home/runner/work/invoiceninja/invoiceninja.zip .* -x "../*" shopt -s dotglob - tar --exclude='public/storage' --exclude='.htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/invoiceninja.tar * + tar --exclude='public/storage' --exclude='./htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/invoiceninja.tar * - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') diff --git a/app/Export/CSV/BaseExport.php b/app/Export/CSV/BaseExport.php index 84c003d7c0ba..c43223fc8f96 100644 --- a/app/Export/CSV/BaseExport.php +++ b/app/Export/CSV/BaseExport.php @@ -448,6 +448,7 @@ class BaseExport 'custom_value4' => 'task.custom_value4', 'status' => 'task.status_id', 'project' => 'task.project_id', + 'billable' => 'task.billable', ]; protected array $forced_client_fields = [ diff --git a/app/Jobs/Ninja/SendReminders.php b/app/Jobs/Ninja/SendReminders.php index c50dabe8641d..f04e6f114538 100644 --- a/app/Jobs/Ninja/SendReminders.php +++ b/app/Jobs/Ninja/SendReminders.php @@ -232,7 +232,6 @@ class SendReminders implements ShouldQueue } $invoice->service()->touchReminder($template)->save(); - // $invoice->save(); } /** diff --git a/app/Livewire/BillingPortal/Authentication/ClientRegisterService.php b/app/Livewire/BillingPortal/Authentication/ClientRegisterService.php index 1e6a60a6b672..f04f2b3ca1e1 100644 --- a/app/Livewire/BillingPortal/Authentication/ClientRegisterService.php +++ b/app/Livewire/BillingPortal/Authentication/ClientRegisterService.php @@ -42,11 +42,11 @@ class ClientRegisterService } foreach ($rules as $field => $properties) { - if ($field === 'email') { + if ($field == 'email') { $rules[$field] = array_merge($rules[$field], ['email:rfc', 'max:191', Rule::unique('client_contacts')->where('company_id', $this->company->id)]); } - if ($field === 'current_password' || $field === 'password') { + if ($field == 'current_password' || $field == 'password') { $rules[$field] = array_merge($rules[$field], ['string', 'min:6', 'confirmed']); } } diff --git a/app/Models/Quote.php b/app/Models/Quote.php index cf2d27afe2e2..5a1d73391ab8 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -164,6 +164,7 @@ class Quote extends BaseModel protected $casts = [ // 'date' => 'date:Y-m-d', + 'tax_data' => 'object', 'due_date' => 'date:Y-m-d', 'partial_due_date' => 'date:Y-m-d', 'line_items' => 'object', diff --git a/app/PaymentDrivers/Authorize/AuthorizeTransaction.php b/app/PaymentDrivers/Authorize/AuthorizeTransaction.php index 84e8b0e60e92..ec55465d6015 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeTransaction.php +++ b/app/PaymentDrivers/Authorize/AuthorizeTransaction.php @@ -13,15 +13,16 @@ namespace App\PaymentDrivers\Authorize; use App\Models\Invoice; -use App\PaymentDrivers\AuthorizePaymentDriver; use App\Utils\Traits\MakesHash; -use net\authorize\api\contract\v1\CreateTransactionRequest; -use net\authorize\api\contract\v1\ExtendedAmountType; -use net\authorize\api\contract\v1\OpaqueDataType; +use App\PaymentDrivers\Authorize\FDSReview; use net\authorize\api\contract\v1\OrderType; +use App\PaymentDrivers\AuthorizePaymentDriver; use net\authorize\api\contract\v1\PaymentType; use net\authorize\api\contract\v1\SettingType; +use net\authorize\api\contract\v1\OpaqueDataType; +use net\authorize\api\contract\v1\ExtendedAmountType; use net\authorize\api\contract\v1\TransactionRequestType; +use net\authorize\api\contract\v1\CreateTransactionRequest; use net\authorize\api\controller\CreateTransactionController; /** @@ -143,6 +144,12 @@ class AuthorizeTransaction nlog(' Code : '.$tresponse->getMessages()[0]->getCode()); nlog(' Description : '.$tresponse->getMessages()[0]->getDescription()); nlog(print_r($tresponse->getMessages()[0], 1)); + + if($tresponse->getResponseCode() == "4"){ + //notify user that this transaction is being held under FDS review: + FDSReview::dispatch((string)$tresponse->getTransId(), $this->authorize->payment_hash, $this->authorize->company_gateway->company->db); + } + } else { nlog('Transaction Failed '); if ($tresponse->getErrors() != null) {