Title: Error when I refund.
Last modified: July 6, 2023

---

# Error when I refund.

 *  Resolved [Libby](https://wordpress.org/support/users/nomadbd/)
 * (@nomadbd)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-when-i-refund/)
 * Hello.
   As the title, the plugin will error when i refound the order in current
   version. Thereis the error massage below. Thank for help.
 *     ```wp-block-code
       WordPress版本6.2.2
       目前启用的主题：Blocksy（1.8.94 版本）
       当前插件：Payment Gateway Based Fees and Discounts for WooCommerce（版本2.10.2）
       PHP版本8.1.9
   
   
   
       错误详情
       ============
       错误类型E_ERROR发生在文件/var/www/shop/wp-content/plugins/checkout-fees-for-woocommerce/includes/class-alg-wc-order-fees.php的114行。错误信息：Uncaught
       Error: Call to undefined method
       Automattic\WooCommerce\Admin\Overrides\OrderRefund::get_payment_method()
       in /var/www/shop/wp-content/plugins/checkout-fees-for-woocommerce/includes/class-alg-wc-order-fees.php:114
       Stack trace:
       #0 /var/www/shop/wp-includes/class-wp-hook.php(310):
       Alg_WC_Order_Fees->alg_wc_cf_update_order_fees()
       #1 /var/www/shop/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
       #2 /var/www/shop/wp-includes/plugin.php(517): WP_Hook->do_action()
       #3 /var/www/shop/wp-includes/post.php(4715): do_action()
       #4 /var/www/shop/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php(97):
       wp_insert_post()
       #5 /var/www/shop/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186):
       Abstract_WC_Order_Data_Store_CPT->create()
       #6 /var/www/shop/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(214):
       WC_Data_Store->create()
       #7 /var/www/shop/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(1849):
       WC_Abstract_Order->save()
       #8 /var/www/shop/wp-content/plugins/woocommerce/includes/wc-order-functions.php(605):
       WC_Abstract_Order->update_taxes()
       #9 /var/www/shop/wp-content/plugins/woocommerce/includes/wc-order-functions.php(842):
       wc_create_refund()
       #10 /var/www/shop/wp-includes/class-wp-hook.php(310): wc_order_fully_refunded()
       #11 /var/www/shop/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
       #12 /var/www/shop/wp-includes/plugin.php(517): WP_Hook->do_action()
       #13 /var/www/shop/wp-content/plugins/woocommerce/includes/class-wc-order.php(387):
       do_action()
       #14 /var/www/shop/wp-content/plugins/woocommerce/includes/class-wc-order.php(245):
       WC_Order->status_transition()
       #15 /var/www/shop/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php(699):
       WC_Order->save()
       #16 /var/www/shop/wp-includes/class-wp-hook.php(310):
       WC_Meta_Box_Order_Data::save()
       #17 /var/www/shop/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
       #18 /var/www/shop/wp-includes/plugin.php(517): WP_Hook->do_action()
       #19 /var/www/shop/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php(258):
       do_action()
       #20 /var/www/shop/wp-includes/class-wp-hook.php(310):
       WC_Admin_Meta_Boxes->save_meta_boxes()
       #21 /var/www/shop/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
       #22 /var/www/shop/wp-includes/plugin.php(517): WP_Hook->do_action()
       #23 /var/www/shop/wp-includes/post.php(4715): do_action()
       #24 /var/www/shop/wp-includes/post.php(4817): wp_insert_post()
       #25 /var/www/shop/wp-admin/includes/post.php(439): wp_update_post()
       #26 /var/www/shop/wp-admin/post.php(227): edit_post()
       #27 {main}
         thrown
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [tychesoftwares](https://wordpress.org/support/users/tychesoftwares/)
 * (@tychesoftwares)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-when-i-refund/#post-16879998)
 * Hi [@nomadbd](https://wordpress.org/support/users/nomadbd/),
 * Thank you for bringing the issue to our attention. 
   I’ve been able to replicate
   this bug at our end too. Rest assured, I have already escalated the matter to
   the appropriate team, who will be working diligently to fix it promptly.By a 
   rough estimate, it should be fixed by Monday, but we will keep you updated on
   the progress anyway.I’ll appreciate your patience.
 *  Plugin Author [tychesoftwares](https://wordpress.org/support/users/tychesoftwares/)
 * (@tychesoftwares)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-when-i-refund/#post-16880251)
 * Hi [@nomadbd](https://wordpress.org/support/users/nomadbd/),
   We have the issue
   fixed & I am sending you a patch file to address this issue.
    1. You can download the code patch from this link – [https://www.dropbox.com/scl/fi/t6hboyodhzfz1tox6i0ml/class-alg-wc-order-fees.php?rlkey=538qu03v16yr4nz4vu9wnyuxt&dl=0](https://www.dropbox.com/scl/fi/t6hboyodhzfz1tox6i0ml/class-alg-wc-order-fees.php?rlkey=538qu03v16yr4nz4vu9wnyuxt&dl=0)
    2. After downloading the file, you can replace with the original file at /wp-content/
       plugins/checkout-fees-for-woocommerce/includes/ folder.
    3. The patch makes the necessary changes to fix the bug and has been tested thoroughly.
       But please make sure you take a backup before replacing the file.
       Please let
       me know if you have any questions or issues with the patch.
 *  Thread Starter [Libby](https://wordpress.org/support/users/nomadbd/)
 * (@nomadbd)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-when-i-refund/#post-16880384)
 * Hello [@tychesoftwares](https://wordpress.org/support/users/tychesoftwares/) 
   
   The code patch is work in my case. No more error when I refund.
 * Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error when I refund.’ is closed to new replies.

 * ![](https://ps.w.org/checkout-fees-for-woocommerce/assets/icon-256x256.jpg?rev
   =2818154)
 * [Payment Gateway Based Fees and Discounts for WooCommerce](https://wordpress.org/plugins/checkout-fees-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/checkout-fees-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/checkout-fees-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/checkout-fees-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/checkout-fees-for-woocommerce/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Libby](https://wordpress.org/support/users/nomadbd/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/error-when-i-refund/#post-16880384)
 * Status: resolved