mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 18:00:15 +08:00
Add update status note for capture denied
This commit is contained in:
parent
51001c388e
commit
e1cd7d5ad1
3 changed files with 16 additions and 9 deletions
|
@ -5,8 +5,8 @@ document.addEventListener(
|
|||
if(data.payer_action && data.payer_action !== '') {
|
||||
const width = screen.width / 2;
|
||||
const height = screen.height / 2;
|
||||
const left = (screen.width / 2) - (width / 2);
|
||||
const top = (screen.height / 2) - (height / 2);
|
||||
const left = width - (width / 2);
|
||||
const top = height - (height / 2);
|
||||
window.open(
|
||||
data.payer_action,
|
||||
'_blank',
|
||||
|
|
|
@ -113,14 +113,16 @@ class OXXO {
|
|||
);
|
||||
|
||||
add_filter(
|
||||
'woocommerce_available_payment_gateways',
|
||||
function( $available_gateways ) {
|
||||
if ( array_key_exists( OXXOGateway::ID, $available_gateways ) ) {
|
||||
$available_gateways[ OXXOGateway::ID ]->order_button_text = __( 'Pay with OXXO', 'woocommerce-paypal-payments' );
|
||||
'ppcp_payment_capture_reversed_webhook_update_status_note',
|
||||
function( $note, $wc_order, $event_type ) {
|
||||
if ( $wc_order->get_payment_method() === OXXOGateway::ID && $event_type === 'PAYMENT.CAPTURE.DENIED' ) {
|
||||
$note = __( 'OXXO voucher has expired or the buyer didn\'t complete the payment successfully.', 'woocommerce-paypal-payments' );
|
||||
}
|
||||
|
||||
return $available_gateways;
|
||||
}
|
||||
return $note;
|
||||
},
|
||||
10,
|
||||
2
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue