Hide C.o.d Offline Payment From Pay Order Again


May i know how to Hide C.O.D offline payment from pay order again on order detail page? i don't want customer to choose offline payment again. i want them to choose online payment.

Thank You

you can use the 'get_payments' or 'get_payments_post' hook to exclude payment methods you don't want returned based on whatever logic you desire. Note that you might have to look at 'runtime.mode' to see if it is 'repay' since that info is not available via either of the get payments hooks.