Posted: September 14, 2020 at 1:12 pm
I have 2 Paypal accounts and I want to automatically choose one or the other depending on logic based on cart contents.
I want to be able to choose which payment of 2 PaypalPro gateways I send customers to based on the contents of their cart.
I have customized the checkout to allow an “Admin-only” checkout and that has worked well.
However, right now, I see only 1 PaypalPro payment method here:
I would like to be able to duplicate this payment method and create a new name and have it show up in the admin listing with a name like “Paypal Pro 2” – the idea is that I just need a place to store the API key and secret and it seems as if duplicating and creating a new name would be pretty easy.
Are there any issues I should be aware of before I start this process?
Thank you in advance for any sage advice.
You can do some of this using the Payment Methods Pro add-on:
So you could start by taking a look into how that add-on works.
It basically allows you to create multiple ‘instances’ of a payment method and set it on specific events. However, you can’t use that add-on with MER as you could have Event A with PayPal Payment Method 1 assigned to it, then Event B with PayPal Payment Method 2 assigned to…. what do you use when both Event A and B are assigned to the cart?
Oh, right PMP.
So, it looks like it was considered and then not pursued because there wasn’t a clear use case.
I do, in fact, use and enjoy the MER add-on and I am happy to set up some logic here to allow assigning a default gateway when the checkout is “confused” because of events that are assigned to sell through different gateways.
What would be an efficient and sustainable (ie hooks) way to remove this “error” check? I could just hack the code but it is my experience that you guys have created a lot of options for devs to hook into.