Patches for Rotessa

This commit is contained in:
David Bomba 2025-06-10 08:38:39 +10:00
parent 590e911c2a
commit cc8894cf5c
4 changed files with 9 additions and 27 deletions

View File

@ -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.');

View File

@ -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

View File

@ -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
];

View File

@ -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;