Allow GatewayType\SEPA to show on methods page

This commit is contained in:
Benjamin Beganović 2021-10-19 18:05:27 +02:00
parent 33e2c5d054
commit 0d20e75636
2 changed files with 13 additions and 1 deletions

View File

@ -152,7 +152,7 @@ class PaymentMethodController extends Controller
return $gateway = auth()->user()->client->getCreditCardGateway();
}
if (request()->query('method') == GatewayType::BANK_TRANSFER) {
if (in_array(request()->query('method'), [GatewayType::BANK_TRANSFER, GatewayType::SEPA])) {
return $gateway = auth()->user()->client->getBankTransferGateway();
}

View File

@ -518,6 +518,18 @@ class Client extends BaseModel implements HasLocalePreference
}
if ($this->currency()->code == 'EUR' && in_array(GatewayType::SEPA, array_column($pms, 'gateway_type_id'))) {
foreach ($pms as $pm) {
if ($pm['gateway_type_id'] == GatewayType::SEPA) {
$cg = CompanyGateway::find($pm['company_gateway_id']);
if ($cg && $cg->fees_and_limits->{GatewayType::SEPA}->is_enabled) {
return $cg;
}
}
}
}
return null;
}