From cc8894cf5c5f979764a8326cc17c3786fa2c2901 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 10 Jun 2025 08:38:39 +1000 Subject: [PATCH] Patches for Rotessa --- .../ClientPortal/PaymentMethodController.php | 2 +- app/Models/Client.php | 28 ++----------------- app/Models/CompanyGateway.php | 2 +- lang/en/texts.php | 4 +++ 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/PaymentMethodController.php b/app/Http/Controllers/ClientPortal/PaymentMethodController.php index 5b63b8c891..32ecb139e7 100644 --- a/app/Http/Controllers/ClientPortal/PaymentMethodController.php +++ b/app/Http/Controllers/ClientPortal/PaymentMethodController.php @@ -181,7 +181,7 @@ class PaymentMethodController extends Controller } if (in_array(request()->query('method'), [GatewayType::BANK_TRANSFER, GatewayType::DIRECT_DEBIT, GatewayType::SEPA, GatewayType::ACSS])) { - return $client_contact->client->getBankTransferGateway(); + return $client_contact->client->getBankTransferGateway(true); //Required to allow rotessa to be used when adding a payment method. } abort(404, 'Gateway not found.'); diff --git a/app/Models/Client.php b/app/Models/Client.php index 32c1627541..43dafa6df8 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -665,7 +665,7 @@ class Client extends BaseModel implements HasLocalePreference //todo refactor this - it is only searching for existing tokens - public function getBankTransferGateway(): ?CompanyGateway + public function getBankTransferGateway($is_add_payment_method = false): ?CompanyGateway { $pms = $this->service()->getPaymentMethods(-1); @@ -719,7 +719,8 @@ class Client extends BaseModel implements HasLocalePreference if ($pm['gateway_type_id'] == GatewayType::ACSS) { $cg = CompanyGateway::query()->find($pm['company_gateway_id']); - if ($cg && $cg->gateway_key != '91be24c7b792230bced33e930ac61676' && $cg->fees_and_limits->{GatewayType::ACSS}->is_enabled) { + //supports a weird edge case where we need to allow rotessa to be used when adding a payment method. + if ($cg && ($is_add_payment_method || $cg->gateway_key != '91be24c7b792230bced33e930ac61676') && $cg->fees_and_limits->{GatewayType::ACSS}->is_enabled) { return $cg; } } @@ -826,29 +827,6 @@ class Client extends BaseModel implements HasLocalePreference return null; - - - - // if ($this->currency()->code == 'USD') { - // return GatewayType::BANK_TRANSFER; - // } - - // if ($this->currency()->code == 'EUR') { - // return GatewayType::SEPA; - // } - - // //Special handler for GoCardless - // if($this->currency()->code == 'CAD' && ($this->getBankTransferGateway()->gateway_key == 'b9886f9257f0c6ee7c302f1c74475f6c') ?? false) { - // return GatewayType::DIRECT_DEBIT; - // } - - // if (in_array($this->currency()->code, ['EUR', 'GBP','DKK','SEK','AUD','NZD','USD'])) { - // return GatewayType::DIRECT_DEBIT; - // } - - // if(in_array($this->currency()->code, ['CAD'])) { - // return GatewayType::ACSS; - // } } public function getCurrencyCode(): string diff --git a/app/Models/CompanyGateway.php b/app/Models/CompanyGateway.php index 4bacfc382b..12125bcbd0 100644 --- a/app/Models/CompanyGateway.php +++ b/app/Models/CompanyGateway.php @@ -157,7 +157,7 @@ class CompanyGateway extends BaseModel 'hxd6gwg3ekb9tb3v9lptgx1mqyg69zu9' => 322, '80af24a6a691230bbec33e930ab40666' => 323, 'vpyfbmdrkqcicpkjqdusgjfluebftuva' => 324, //BTCPay - '91be24c7b792230bced33e930ac61676' => 325, + '91be24c7b792230bced33e930ac61676' => 325, //Rotessa 'wbhf02us6owgo7p4nfjd0ymssdshks4d' => 326, //Blockonomics 'b67581d804dbad1743b61c57285142ad' => 327, //Powerboard ]; diff --git a/lang/en/texts.php b/lang/en/texts.php index 082a7d0d61..06f276c422 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5586,6 +5586,10 @@ $lang = array( 'docuninja' => 'DocuNinja', 'pro_rata' => 'Pro Rata', 'change_docuninja_plan' => 'Change DocuNinja Plan', + 'downgrade_end_of_cycle' => 'Your plan will automatically downgrade at the end of the current billing cycle.', + 'docuninja_change_users' => 'New DocuNinja user limit', + 'docuninja_disable_warning' => 'This will remove all access to your DocuNinja account.', + 'docuninja_downgrade_info' => 'Your user limit will automatically be reduced at the end of the current billing cycle.', ); return $lang;