Enable/Disable payments methods programatically
In my e-commerce I offer some coupons (via percentage/fixed amount coupons) that sometimes has 100% of the order total discount (resulting in a order with total = 0).
In this cases, i need to disable the default payment (paypal) and to enable another _special_ payment (that has to be disabled for normal orders).
We have the rule action "Enable payment method", but we dont have "Disable payment method", so I suppose I should keep all payment method disabled and enable them via a rule/action trigger.
Am I correct?
Precisation: I know there is
Precisation: I know there is a module about that (commerce no payment) but i would like to know the best practices to do this manually, becose i think i can have more flexibility.