diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php index 7243d84c4..314d29e26 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php @@ -452,6 +452,43 @@ class PayUponInvoice { } } ); + + add_action( + 'add_meta_boxes', + function( $post_type ) { + if ( $post_type === 'shop_order' ) { + $post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_STRING ); + $order = wc_get_order( $post_id ); + if ( $order->get_payment_method() === 'ppcp-pay-upon-invoice-gateway' ) { + $instructions = $order->get_meta( 'ppcp_ratepay_payment_instructions_payment_reference' ); + if ( $instructions ) { + add_meta_box( + 'ppcp_pui_ratepay_payment_instructions', + __( 'RatePay payment instructions', 'woocommerce-paypal-payments' ), + function() { + $payment_reference = $instructions[0] ?? ''; + $bic = $instructions[1]->bic ?? ''; + $bank_name = $instructions[1]->bank_name ?? ''; + $iban = $instructions[1]->iban ?? ''; + $account_holder_name = $instructions[1]->account_holder_name ?? ''; + + echo ''; + }, + $post_type, + 'side', + 'high' + ); + } + } + } + } + ); } /** diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 72bb3fb08..64e16f16c 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -23,6 +23,7 @@ +