From 86859e4f584708a58db423211de7c288b16ff708 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 6 Oct 2022 20:55:39 +1100 Subject: [PATCH 1/6] Add key to account transformer --- app/Transformers/AccountTransformer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 46bce69240ed..914ae641c5f7 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -53,6 +53,7 @@ class AccountTransformer extends EntityTransformer { return [ 'id' => (string) $this->encodePrimaryKey($account->id), + 'key' => (string) $this->account->key, 'default_url' => config('ninja.app_url'), 'plan' => $account->getPlan(), 'plan_term' => (string) $account->plan_terms, From 73ae9ea89f38e54231c29124de533bd98310ebb0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 6 Oct 2022 21:08:15 +1100 Subject: [PATCH 2/6] Add key to account transformer --- app/Transformers/AccountTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 914ae641c5f7..7739c6a84805 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -53,7 +53,7 @@ class AccountTransformer extends EntityTransformer { return [ 'id' => (string) $this->encodePrimaryKey($account->id), - 'key' => (string) $this->account->key, + 'key' => (string) $account->key, 'default_url' => config('ninja.app_url'), 'plan' => $account->getPlan(), 'plan_term' => (string) $account->plan_terms, From 8ace213c40a7c217931100db4d15aa935f571e53 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 7 Oct 2022 07:41:17 +1100 Subject: [PATCH 3/6] minor updates for htmlengine --- app/Utils/HtmlEngine.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index dae1e0f8ad25..47da35455d9f 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -148,6 +148,7 @@ class HtmlEngine if ($this->entity_string == 'invoice' || $this->entity_string == 'recurring_invoice') { $data['$entity'] = ['value' => '', 'label' => ctrans('texts.invoice')]; $data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')]; + $data['$invoice'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')]; $data['$number_short'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number_short')]; $data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms), $this->client) ?: '', 'label' => ctrans('texts.invoice_terms')]; $data['$terms'] = &$data['$entity.terms']; From db9ed2c8ebd2d913e5552179243e40c94ad4e064 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 7 Oct 2022 08:20:07 +1100 Subject: [PATCH 4/6] Fixes for forte payment driver --- app/PaymentDrivers/Forte/ACH.php | 2 +- app/PaymentDrivers/Forte/CreditCard.php | 3 ++- app/Utils/Traits/MakesInvoiceValues.php | 6 +++--- .../views/portal/ninja2020/gateways/forte/ach/pay.blade.php | 4 ++-- .../ninja2020/gateways/forte/credit_card/pay.blade.php | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/PaymentDrivers/Forte/ACH.php b/app/PaymentDrivers/Forte/ACH.php index 62193cfcc95d..21c30530250e 100644 --- a/app/PaymentDrivers/Forte/ACH.php +++ b/app/PaymentDrivers/Forte/ACH.php @@ -89,7 +89,7 @@ class ACH public function paymentResponse($request) { - $payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail(); + $payment_hash = PaymentHash::where('hash', $request->input('payment_hash'))->firstOrFail(); try { $curl = curl_init(); diff --git a/app/PaymentDrivers/Forte/CreditCard.php b/app/PaymentDrivers/Forte/CreditCard.php index 88d8007780d2..2ff3b94f3e85 100644 --- a/app/PaymentDrivers/Forte/CreditCard.php +++ b/app/PaymentDrivers/Forte/CreditCard.php @@ -54,6 +54,7 @@ class CreditCard public function authorizeView(array $data) { + $data['gateway'] = $this->forte; return render('gateways.forte.credit_card.authorize', $data); } @@ -82,7 +83,7 @@ class CreditCard $this->forte->payment_hash->data = array_merge((array) $this->forte->payment_hash->data, $data); $this->forte->payment_hash->save(); - $data['gateway'] = $this; + $data['gateway'] = $this->forte; return render('gateways.forte.credit_card.pay', $data); } diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 055b7698bf09..ab020712c33f 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -301,9 +301,9 @@ trait MakesInvoiceValues $data[$key][$table_type.'.description'] = Helpers::processReservedKeywords($item->notes, $entity); $data[$key][$table_type.".{$_table_type}1"] = strlen($item->custom_value1) > 1 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}1", $item->custom_value1, $entity) : ''; - $data[$key][$table_type.".{$_table_type}2"] = strlen($item->custom_value1) > 2 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}2", $item->custom_value2, $entity) : ''; - $data[$key][$table_type.".{$_table_type}3"] = strlen($item->custom_value1) > 3 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}3", $item->custom_value3, $entity) : ''; - $data[$key][$table_type.".{$_table_type}4"] = strlen($item->custom_value1) > 4 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}4", $item->custom_value4, $entity) : ''; + $data[$key][$table_type.".{$_table_type}2"] = strlen($item->custom_value2) > 2 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}2", $item->custom_value2, $entity) : ''; + $data[$key][$table_type.".{$_table_type}3"] = strlen($item->custom_value3) > 3 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}3", $item->custom_value3, $entity) : ''; + $data[$key][$table_type.".{$_table_type}4"] = strlen($item->custom_value4) > 4 ? $helpers->formatCustomFieldValue($this->company->custom_fields, "{$_table_type}4", $item->custom_value4, $entity) : ''; if ($item->quantity > 0 || $item->cost > 0) { $data[$key][$table_type.'.quantity'] = Number::formatValueNoTrailingZeroes($item->quantity, $entity_currency); diff --git a/resources/views/portal/ninja2020/gateways/forte/ach/pay.blade.php b/resources/views/portal/ninja2020/gateways/forte/ach/pay.blade.php index 5dbb93fbd246..400c1833948d 100644 --- a/resources/views/portal/ninja2020/gateways/forte/ach/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/forte/ach/pay.blade.php @@ -1,14 +1,14 @@ @extends('portal.ninja2020.layout.payments', ['gateway_title' => 'Bank Transfer', 'card_title' => 'Bank Transfer']) @section('gateway_head') - + @endsection @section('gateway_content')
@csrf - + diff --git a/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php b/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php index 1cceb137f39c..1e20311e7c45 100644 --- a/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/forte/credit_card/pay.blade.php @@ -1,7 +1,7 @@ @extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.payment_type_credit_card'), 'card_title' => ctrans('texts.payment_type_credit_card')]) @section('gateway_head') - + @@ -14,7 +14,7 @@ - + @@ -41,7 +41,7 @@ @endsection @section('gateway_footer') - @if($gateway->forte->company_gateway->getConfigField('testMode')) + @if($gateway->company_gateway->getConfigField('testMode')) @else From 31f4e61c1fd3b4eae5d802af70ad2aeddae57ae5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 7 Oct 2022 10:10:10 +1100 Subject: [PATCH 5/6] Fixes for subscription renewals --- app/Models/Account.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Models/Account.php b/app/Models/Account.php index 915a3ac979b8..6bed655af7fe 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -59,6 +59,8 @@ class Account extends BaseModel 'user_agent', 'platform', 'set_react_as_default_ap', + 'inapp_transaction_id', + 'num_users', ]; /** From e245f7157789876a235c8caa2383c263a05f9e6c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 7 Oct 2022 10:23:45 +1100 Subject: [PATCH 6/6] v5.5.28 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 7c3659f6ecd1..bd097b3f5b32 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.5.27 \ No newline at end of file +5.5.28 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index bb9761e97d3f..cd87907d3913 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.5.27', - 'app_tag' => '5.5.27', + 'app_version' => '5.5.28', + 'app_tag' => '5.5.28', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),