mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge pull request #873 from woocommerce/PCP-899-pui-payment-instructions-printed-in-the-refund-email
PUI payment instructions printed in the refund email (899)
This commit is contained in:
commit
074a6f761f
1 changed files with 9 additions and 3 deletions
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
namespace WooCommerce\PayPalCommerce\WcGateway\Gateway\PayUponInvoice;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use WC_Email;
|
||||
use WC_Order;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PayUponInvoiceOrderEndpoint;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Factory\CaptureFactory;
|
||||
|
@ -266,8 +267,13 @@ class PayUponInvoice {
|
|||
|
||||
add_action(
|
||||
'woocommerce_email_before_order_table',
|
||||
function( WC_Order $order, bool $sent_to_admin ) {
|
||||
if ( ! $sent_to_admin && PayUponInvoiceGateway::ID === $order->get_payment_method() && $order->has_status( 'processing' ) ) {
|
||||
function( WC_Order $order, bool $sent_to_admin, bool $plain_text, WC_Email $email ) {
|
||||
if (
|
||||
! $sent_to_admin
|
||||
&& PayUponInvoiceGateway::ID === $order->get_payment_method()
|
||||
&& $order->has_status( 'processing' )
|
||||
&& $email->id === 'customer_processing_order'
|
||||
) {
|
||||
$this->logger->info( "Adding Ratepay payment instructions to email for order #{$order->get_id()}." );
|
||||
|
||||
$instructions = $order->get_meta( 'ppcp_ratepay_payment_instructions_payment_reference' );
|
||||
|
@ -318,7 +324,7 @@ class PayUponInvoice {
|
|||
}
|
||||
},
|
||||
10,
|
||||
2
|
||||
4
|
||||
);
|
||||
|
||||
add_filter(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue