Title: Does refund feature work?
Last modified: May 19, 2020

---

# Does refund feature work?

 *  Resolved [Pengyi Wang](https://wordpress.org/support/users/rocwing/)
 * (@rocwing)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/)
 * Every time when we click ‘refund $x.xx via Square’, it will show a failed message“
   Could not find original transaction tender. Please refund this transaction from
   your Square dashboard.”
    I checked the plugin source codes, it will throw this
   message when it can’t pull the transaction from Square. I also checked the database,
   it seems all the information is there like: _wc_square_credit_card_square_location_id,
   _wc_square_credit_card_authorization_code etc.. Does refund feature work? Has
   anyone refunded successfully?
 * Thanks!
    Pengyi

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

 *  [Elvira K.](https://wordpress.org/support/users/treibalen/)
 * (@treibalen)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12859729)
 * Hi there Pengyi,
 * I’m sorry to hear that you’re seeing issues with Square refunds!
 * I did try it on my test site where I have Square configured in Sandbox mode and
   my refund went through just fine.
 * To determine why it’s happening, can you please follow these steps:
 * – Enable logging in WooCommerce > Settings > Payments > Square: [https://d.pr/i/SwW3xc](https://d.pr/i/SwW3xc)
   –
   Place a test order on your site. You can create a test product with $1 price 
   to do that. – Refund this order. – Check logs for this refund in WooCommerce 
   > Status > Logs > choose `square_credit_card` from the drop-down: [https://d.pr/i/eNZDfM](https://d.pr/i/eNZDfM)
 * Please remove all the personal and sensitive information from the logs and use
   [https://pastebin.com/](https://pastebin.com/) to share them here.
 * Enjoy the rest of your day and stay safe!
 *  Thread Starter [Pengyi Wang](https://wordpress.org/support/users/rocwing/)
 * (@rocwing)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12869191)
 * Hi Elvira,
    Thank you for your reply! I followed your instructions, here is what
   I got: [https://pastebin.com/xj8SwyaC](https://pastebin.com/xj8SwyaC) It seems
   just a 500 error Any advice?
 * Thank you very much!
    Pengyi
 *  Thread Starter [Pengyi Wang](https://wordpress.org/support/users/rocwing/)
 * (@rocwing)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12869285)
 * Hi Elvira,
 * When I enable log, it doesn’t show “Could not find original transaction tender.
   Please refund this transaction from your Square dashboard” message anymore, but
   keep show a spin icon.
    The problem is when I go back to check the order, it 
   show ‘Refunded’. But actually it’s not when I check it on our square dashboard.
 * I hope it help to troubleshoot the issue.
 * Thanks,
    Pengyi
 *  [Elvira K.](https://wordpress.org/support/users/treibalen/)
 * (@treibalen)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12869379)
 * Hi there [@rocwing](https://wordpress.org/support/users/rocwing/),
 * Thank you for running the test for me and for the logs provided!
 * Indeed, I see `500 Internal Server Error` in Square response. Can you please 
   try to re-connect Square in WooCommerce > Settings > Square and try again?
 * If it doesn’t help, please confirm that you see the same behaviour with all plugins
   except for WooCommerce and Square disabled and Storefront theme as active?
 * Let me know how that goes!
 *  Thread Starter [Pengyi Wang](https://wordpress.org/support/users/rocwing/)
 * (@rocwing)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12869502)
 * Hi [@treibalen](https://wordpress.org/support/users/treibalen/),
 * Thank you for your help!
    Re-connect Square doesn’t work, I’ve done that before.
   I disabled all other plugins on our staging site, it’s still the same issue. 
   We don’t have issues to process the payment, just refund.
 * Do you mean `500 Internal Server Error` is from Square? Do you know if there 
   is a way I can check on Square to see more details for this request, like logs,
   so we can know why it’s an error?
 * Pengyi
 *  [Elvira K.](https://wordpress.org/support/users/treibalen/)
 * (@treibalen)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12869588)
 * Hi there [@rocwing](https://wordpress.org/support/users/rocwing/),
 * Thanks for all the troubleshooting you did so far!
 * According to Square API docs, this error happens when `Square encountered an 
   unexpected error processing the request` – [https://developer.squareup.com/docs/build-basics/handling-errors#http-protocol-status-codes](https://developer.squareup.com/docs/build-basics/handling-errors#http-protocol-status-codes)
 * Can you please reach out to Square support to find why this response was sent?
   They might indeed have some logs on their end: [https://squareup.com/help/us/en/](https://squareup.com/help/us/en/)
 * Please keep me posted on their response!
 *  Thread Starter [Pengyi Wang](https://wordpress.org/support/users/rocwing/)
 * (@rocwing)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12874217)
 * Hi [@treibalen](https://wordpress.org/support/users/treibalen/) ,
 * Finally I figured it out!
    Our orders are placed through WooCommerce APIs, there
   are three values we need put in meta_data, so Woocommmerce square plugin can 
   use it to refund.
 * But I believe for the code below:
    [https://pastebin.com/jc2j0Y2B](https://pastebin.com/jc2j0Y2B)
   If it can return the real error reason(for example, no trans_id or can’t find
   transactions etc..), it will be very helpful to troubleshot the issue.
 * Regards,
    Pengyi
 *  [Elvira K.](https://wordpress.org/support/users/treibalen/)
 * (@treibalen)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12875182)
 * Hi there [@rocwing](https://wordpress.org/support/users/rocwing/),
 * Great sleuthing here!
 * From the code, I see that `_wc_square_credit_card_square_location_id` and `_wc_square_credit_card_authorization_code`
   are required. Which is the third meta_data that you had to add to process the
   refund?
 * I’ll submit an Enhancement request as soon as I can replicate the issue.
 * Looking forward to hearing back from you!
 *  Thread Starter [Pengyi Wang](https://wordpress.org/support/users/rocwing/)
 * (@rocwing)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12875607)
 * Hi [@treibalen](https://wordpress.org/support/users/treibalen/)
    It’s `wc_square_credit_card_charge_captured`,
   or it will try to void the payment, but it will return an error, something like‘…
   can’t find trans_id in this location_id…’
 *     ```
       // if captures are supported and the order has an authorized, but not captured charge, void it instead
       		if ( $this->supports_voids() && ! $this->get_capture_handler()->is_order_captured( $order ) ) {
       			return $this->process_void( $order );
       		}
       ```
   
 * Pengyi
 *  [Elvira K.](https://wordpress.org/support/users/treibalen/)
 * (@treibalen)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12931463)
 * Hi there [@rocwing](https://wordpress.org/support/users/rocwing/) ,
 * I cleared `wc_square_credit_card_charge_captured` meta key for one of my orders
   paid with Square and received the following error instead:
 * `Square Void Failed: BAD_REQUEST - Not a delay capture transaction.`
 * Which makes sense since now it doesn’t see that the charge was captured.
 * Since I can’t replicate this issue with orders placed via site front-end (not
   API), I will close the thread.
 * Enjoy the rest of your day and stay safe!

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

The topic ‘Does refund feature work?’ is closed to new replies.

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

 * 10 replies
 * 2 participants
 * Last reply from: [Elvira K.](https://wordpress.org/support/users/treibalen/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/does-refund-feature-work/#post-12931463)
 * Status: resolved