Hi,
I would like to hide a payment gateway only when a customer tries to purchase an addon for a product, let me explain the scenario and the reason:
Scenario:
I have two payment gateways, they are not native or known as Paypal or Stripe, but they work well, so in summary they work like this:
Payment gateway 1: creates a recurring subscription, so the customer is automatically charged every month directly to their credit card.
Payment gateway 2: does not create a subscription, so the customer needs to access the invoice manually and pay.
Problem:
When a customer places the product and addon on the same order, everything works well, as a "plan is created with these items" and the gateway can always charge it.
When a customer places a product order first and only then chooses to place an order for an addon for that product, that's exactly my problem. That is, if at the time of ordering the addon he chooses the gateway that creates a subscription, he will receive an error and abandon the cart.
Possible solution:
I'm not sure if there are better ways to do it, but as a layman I think an alternative would be to create a hook to hide the recurring subscription gateway just at the checkout for an addon order.
So in the end it should behave like this:
For product orders, the two gateways appear normally (which is already the case today)
For orders for addons purchased later, hide one gateway.
I tried WHMCS support before, they just told me that they understand how useful this is, but that they don't have this option available (WOW - it seems so important and that could help so many people not to look at it).
So I found excellent articles here in the community written by Brian, but unfortunately I don't have the technical knowledge to create a hook with the condition "If it's a" normal "order, show both gateways. If the order is just for an addon later, hide one gateway and show another gateway ".
Note:
My WHMCS version is 7.10.2 and I use a Lagom theme for the client area.
Unfortunately my English is not good, so I'm sorry for the language barrier!
Any help or tip would be welcome!
Tks!