I Have written a shipping method (name:X) and a payment method(name:Y) for drupal commerce. the problem is that I want to force user to pay with Y if he selects X and I want to disable other payment methods on this condition.
it can manually be done with rules! but I want to programmatically add this limit. how can I do it? is there a hook or something else?