Fix connection tab settings when using live account

This commit is contained in:
Narek Zakarian 2022-08-25 18:58:54 +04:00
parent 6496a202a3
commit 64a0f0af77
2 changed files with 9 additions and 5 deletions

View file

@ -157,7 +157,11 @@ return function ( ContainerInterface $container, array $fields ): array {
'ppcp_disconnect_production' => array(
'title' => __( 'Disconnect from PayPal', 'woocommerce-paypal-payments' ),
'type' => 'ppcp-text',
'text' => '<button type="button" class="button ppcp-disconnect production">' . esc_html__( 'Disconnect', 'woocommerce-paypal-payments' ) . '</button>',
'text' => sprintf(
'<p>%1$s <span class="dashicons dashicons-yes"></span></p><p><button type="button" class="button ppcp-disconnect production">%2$s</button></p>',
esc_html__( 'Status: Connected', 'woocommerce-paypal-payments' ),
esc_html__( 'Disconnect Account', 'woocommerce-paypal-payments' )
),
'screens' => array(
State::STATE_ONBOARDED,
),
@ -341,7 +345,6 @@ return function ( ContainerInterface $container, array $fields ): array {
'screens' => array(
State::STATE_ONBOARDED,
),
'state_from' => Environment::SANDBOX,
'requirements' => array(),
'gateway' => 'connection',
'description' => __( 'See which features are available.', 'woocommerce-paypal-payments' ),
@ -387,7 +390,6 @@ return function ( ContainerInterface $container, array $fields ): array {
'screens' => array(
State::STATE_ONBOARDED,
),
'state_from' => Environment::SANDBOX,
'requirements' => array(),
'gateway' => 'connection',
'description' => __( 'See which features are available.', 'woocommerce-paypal-payments' ),

View file

@ -2170,9 +2170,10 @@ return array(
: $enable_dcc_url;
return sprintf(
'<p>%1$s %2$s</p><p><a target="_blank" href="%3$s" class="button">%4$s</a></p>',
'<p>%1$s %2$s</p><p><a target="%3$s" href="%4$s" class="button">%5$s</a></p>',
$dcc_enabled ? $enabled_status_text : $disabled_status_text,
$dcc_enabled ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no"></span>',
$dcc_enabled ? '_self' : '_blank',
esc_url( $dcc_button_url ),
esc_html( $dcc_button_text )
);
@ -2204,9 +2205,10 @@ return array(
: esc_html__( 'Enable Pay Upon Invoice', 'woocommerce-paypal-payments' );
return sprintf(
'<p>%1$s %2$s</p><p><a target="_blank" href="%3$s" class="button">%4$s</a></p>',
'<p>%1$s %2$s</p><p><a target="%3$s" href="%4$s" class="button">%5$s</a></p>',
$pui_enabled ? $enabled_status_text : $disabled_status_text,
$pui_enabled ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no"></span>',
$pui_enabled ? '_self' : '_blank',
esc_url( $pui_button_url ),
esc_html( $pui_button_text )
);