Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @cableboy,

    I’m sure it could be done and it seems like that code is one possible way to make it happen. If that code did work, adjusted for just two gateways, it may be possible though that customer A & B would both randomly get Gateway A. It randomly gives them a choice between all available options, in your case two gateways.

    Out of curiosity, why do you need this? ??

    Thread Starter cableboy

    (@cableboy)

    I’ve had bad experiences with payment gateways in the past and didn’t want to really on just one company.

    In the code I linked, do you by chance know what I would replace the ‘gateway1’, ‘gateway2’ with? I don’t see where they are originally defined.

        if ($thewinner == 1 ) {
            unset($gateways['gateway2']);
            unset($gateways['gateway3']);
    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @cableboy The code might work if you edit it correctly, however, the filter fires multiple times in the checkout page. This includes when the customer enters in their contact information.

    I wrote a much more simple solution, and this is what happens as I edit the zip code: https://cld.wthms.co/jhiEF7

    It might be easier to have two gateways enabled and allow customers to choose which they would like to use. Mind if I ask who you’re going with? Stripe is pretty reliable.

    If you’re interested in my code, it’s at the link below, but it’s suggested you don’t use it.
    https://gist.github.com/jessepearson/b802edd2881ed28aeba5480c0efdd205

    Thread Starter cableboy

    (@cableboy)

    I want to use Stripe and a NMI processor. Is there any way to run the roulette between only processors I set?

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @cableboy The example I gave only works on active gateways, I just happen to have all of those active in my store. If you only have two, it will randomly choose one of the two. The drawback is that it will literally change as they are filling in their address information, which is what I was trying to show in my screencast.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to rotate between two different credit card gateways?’ is closed to new replies.