Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter refunded status #681

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

JStockton-Kishmish
Copy link

Issue: #590


Description

Apply the woocommerce_order_fully_refunded_status filter to allow using wc_refund_payment() for voiding a transaction programmatically. The only issue that I see with doing so currently is that the order status gets changed which, in my case, I do not want.

Steps to Test

Create 2 orders both using the Paypal gateway in authorize mode . Refund them by calling the following script:

<?php
require_once('wp-load.php');

$order_1 = wc_get_order(1234); // Replace 1234 with the post_ID of the first order
$order_2 = wc_get_order(1235); // Replace 1235 with the post_ID of the second order

wc_refund_payment($order_1);
add_filter('woocommerce_order_fully_refunded_status', '__return_false');
wc_refund_payment($order_2);

Observe that $order_1 is now in the refunded status whereas $order_2 remained in the status it was at in the beginning, but both authorizations were voided in Paypal.

Changelog Entry

Allow filtering of refunded status on voids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant