Title: Finish order without Payment Method
Last modified: August 30, 2016

---

# Finish order without Payment Method

 *  [incorporate](https://wordpress.org/support/users/incorporate/)
 * (@incorporate)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/finish-order-without-payment-method/)
 * Hello,
 * I am trying to modify the behavior of finish shop. If I have some condition I
   unset the payment methods, and this works fine, but it give me an ERROR “invalid
   payment method” and I can’t finish the order.
 * This his the function who unset the payment methods.
 * add_filter(‘woocommerce_available_payment_gateways’, ‘payment_gateway_disable_country’);
 * function payment_gateway_disable_country($available_gateways) {
 *  global $woocommerce;
 *  if (($woocommerce->customer->get_country() <> ‘PT’ && $woocommerce->customer-
   >get_shipping_country() <> ‘PT’)) {
 *  unset($available_gateways[‘bacs’]);
    unset($available_gateways[‘cheque’]); unset(
   $available_gateways[‘authorize’] ); return; }
 *  if (($woocommerce->customer->get_country() <> ‘ES’ && $woocommerce->customer-
   >get_shipping_country() <> ‘ES’)) {
 *  unset($available_gateways[‘bacs’]);
    unset($available_gateways[‘cheque’]); unset(
   $available_gateways[‘authorize’] ); return; } return $available_gateways; }
 * Do you know how can cross this problem?
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

The topic ‘Finish order without Payment Method’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [incorporate](https://wordpress.org/support/users/incorporate/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/finish-order-without-payment-method/)
 * Status: not resolved