Filtering a Payment Method in Magento
When Magento is checking to see if a payment method is “available” it dispatches an event called
payment_method_is_active
passing in a StdClass
that holds a local variable called isAvailable
.
We only need to change this variable in our own custom logic to affect wether or not the method is available.
Here is how.
In your config.xml (assuming you already have a module set up)
In Model/Observer.php
Of course if (rand(1,10) == 5) {
is absurd and only there to highlight how easy it is to affect the
availability of a payment method.
Like this post? Share it :)