mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Make string translatable and return json error when oxxo endpoint fail
This commit is contained in:
parent
1acd986083
commit
7d7f1f55d5
4 changed files with 10 additions and 8 deletions
|
@ -104,7 +104,7 @@ class OXXO {
|
|||
) {
|
||||
$payer_action = $order->get_meta( 'ppcp_oxxo_payer_action' ) ?? '';
|
||||
if ( $payer_action ) {
|
||||
echo '<p><a class="button" href="' . esc_url( $payer_action ) . '">OXXO voucher</a></p>';
|
||||
echo '<p><a class="button" href="' . esc_url( $payer_action ) . '" target="_blank">' . esc_html__( 'See OXXO voucher', 'woocommerce-paypal-payments' ) . '</a></p>';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -138,7 +138,7 @@ class OXXO {
|
|||
'ppcp_oxxo_payer_action',
|
||||
__( 'OXXO Voucher/Ticket', 'woocommerce-paypal-payments' ),
|
||||
function() use ( $payer_action ) {
|
||||
echo '<p><a class="button" href="' . esc_url( $payer_action ) . '" target="_blank">See OXXO voucher</a></p>';
|
||||
echo '<p><a class="button" href="' . esc_url( $payer_action ) . '" target="_blank">' . esc_html__( 'See OXXO voucher', 'woocommerce-paypal-payments' ) . '</a></p>';
|
||||
},
|
||||
$post_type,
|
||||
'side',
|
||||
|
@ -156,7 +156,7 @@ class OXXO {
|
|||
if ( $order->get_payment_method() === OXXOGateway::ID ) {
|
||||
$payer_action = $order->get_meta( 'ppcp_oxxo_payer_action' );
|
||||
if ( $payer_action ) {
|
||||
echo '<p><a class="button" href="' . esc_url( $payer_action ) . '" target="_blank">See OXXO voucher</a></p>';
|
||||
echo '<p><a class="button" href="' . esc_url( $payer_action ) . '" target="_blank">' . esc_html__( 'See OXXO voucher', 'woocommerce-paypal-payments' ) . '</a></p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,6 +140,9 @@ class OXXOEndpoint implements EndpointInterface {
|
|||
|
||||
$this->logger->error( $error );
|
||||
wc_add_notice( $error, 'error' );
|
||||
|
||||
wp_send_json_error( 'Could not get OXXO payer action.' );
|
||||
return false;
|
||||
}
|
||||
|
||||
WC()->session->set( 'ppcp_payer_action', $payer_action );
|
||||
|
|
|
@ -70,9 +70,8 @@ class OXXOGateway extends WC_Payment_Gateway {
|
|||
$this->method_title = __( 'OXXO', 'woocommerce-paypal-payments' );
|
||||
$this->method_description = __( 'OXXO is a Mexican chain of convenience stores.', 'woocommerce-paypal-payments' );
|
||||
|
||||
$gateway_settings = get_option( 'woocommerce_ppcp-oxxo-gateway_settings' );
|
||||
$this->title = $gateway_settings['title'] ?? $this->method_title;
|
||||
$this->description = $gateway_settings['description'] ?? __( 'OXXO allows you to pay bills and online purchases in-store with cash.', 'woocommerce-paypal-payments' );
|
||||
$this->title = $this->get_option( 'title' ) ?? $this->method_title;
|
||||
$this->description = $this->get_option( 'description' ) ?? __( 'OXXO allows you to pay bills and online purchases in-store with cash.', 'woocommerce-paypal-payments' );
|
||||
|
||||
$this->init_form_fields();
|
||||
$this->init_settings();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue