mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Ensure instructions email is not send on refunds
This commit is contained in:
parent
33bd09e745
commit
950ae2eeb1
1 changed files with 7 additions and 1 deletions
|
@ -258,7 +258,13 @@ class PayUponInvoice {
|
||||||
add_action(
|
add_action(
|
||||||
'woocommerce_email_before_order_table',
|
'woocommerce_email_before_order_table',
|
||||||
function( WC_Order $order, bool $sent_to_admin ) {
|
function( WC_Order $order, bool $sent_to_admin ) {
|
||||||
if ( ! $sent_to_admin && PayUponInvoiceGateway::ID === $order->get_payment_method() && $order->has_status( 'processing' ) ) {
|
$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING ) ?? '';
|
||||||
|
if (
|
||||||
|
! $sent_to_admin
|
||||||
|
&& PayUponInvoiceGateway::ID === $order->get_payment_method()
|
||||||
|
&& $order->has_status( 'processing' )
|
||||||
|
&& ( $action && $action !== 'woocommerce_refund_line_items' )
|
||||||
|
) {
|
||||||
$this->logger->info( "Adding Ratepay payment instructions to email for order #{$order->get_id()}." );
|
$this->logger->info( "Adding Ratepay payment instructions to email for order #{$order->get_id()}." );
|
||||||
|
|
||||||
$instructions = $order->get_meta( 'ppcp_ratepay_payment_instructions_payment_reference' );
|
$instructions = $order->get_meta( 'ppcp_ratepay_payment_instructions_payment_reference' );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue