it would perfect if the gateways manager can make a country filter, or the order form, the idea is to provide gateway X to a specific users in country X . or to provide the gateways to all countries .this will not override the currency supported in gateway.
let say we have paypal that we will use for the curency USD. so now any users has usd as default currency can pay with paypal if selected in order form, now let say we want to prohibit users that are in pakistan, iran, irak, xxxx from using the paypal gateway even if they have usd as default currency, and allow only gateway X to be used .
it's a great features that will allow us to use specific gateways in some cases .
i think we have talked this option before but not sure where, but i have opened a new feature request
https://requests.blesta.com/topic/option-to-showhide-payments-gateways-per-country
if blesta has a event for GatewayManager.getAll(), that can return values , we can use a custom plugin with the new events created getAll(), something like in the Gatewaymanager
$this->Events->register('GatewayManager.getAll', ['EventsGatewayManagerCallback', 'getAll']);
$gateways_filtered = $this->Events->trigger(new EventObject('GatewayManager.getAll', ['gateways' => $gateways]));
// return data if the event ahs a data to return
if (!empty($gateways_filtered)) {
return $gateways_filtered;
}
return $gateways;
if blesta found the logic is pretty good, they can do it in so many others events like getAllInstalledNonmerchant() or in other models .