Jump to content

Gateways Country Filter


Blesta Addons

Recommended Posts

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 .

Link to comment
Share on other sites

  • 3 weeks later...

A configurable white/black-list would probably be nice to have for filtering what clients can see and use certain gateways. We've had requests not only for filtering by country/state/province, but also for specific clients themselves, or for specific packages. This filtering can be a little difficult to manage though, since you may create order forms that many clients are unable to use to make payments because all the gateways have been disabled. We'd have to display that better in some location.

Based on your example, the expectation when calling GatewayManager::getAll is to retrieve all gateways, so it's unlikely we would update this to allow filtering by event. Having a separate method, like GatewayManager::search($options), would be better.

Link to comment
Share on other sites

On 5/30/2018 at 5:08 PM, Tyson said:

Based on your example, the expectation when calling GatewayManager::getAll is to retrieve all gateways, so it's unlikely we would update this to allow filtering by event. Having a separate method, like GatewayManager::search($options), would be better.

doesn't matter for me the way, but the result is the goal . so any other method/way to achieve the task are welcome .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...