Skip to content

Commit fdec15c

Browse files
committed
Show API key settings button even no gateway available
1 parent e01deac commit fdec15c

File tree

4 files changed

+44
-19
lines changed

4 files changed

+44
-19
lines changed

includes/admin/monei-cc-settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'top_link' => array(
2525
'title' => '',
2626
'type' => 'title',
27-
'description' => '<a href="' . $settings_link . '" class="button">' . __( 'Go to MONEI Api key Settings', 'monei' ) . '</a>',
27+
'description' => '<a href="' . $settings_link . '" class="button">' . __( 'Go to MONEI API key Settings', 'monei' ) . '</a>',
2828
'id' => 'cc_monei_top_link',
2929
),
3030
'enabled' => array(

src/Templates/NoticeGatewayNotAvailable.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@
55
class NoticeGatewayNotAvailable implements TemplateInterface {
66

77
public function render( $data ): void {
8-
?>
8+
$settings_link = esc_url(
9+
admin_url(
10+
add_query_arg(
11+
array(
12+
'page' => 'wc-settings',
13+
'tab' => 'monei_settings',
14+
),
15+
'admin.php'
16+
)
17+
)
18+
);
19+
?>
20+
<a class="button" href="<?php echo esc_url( $settings_link );?>"><?php esc_html_e( 'Go to MONEI API key Settings', 'monei' )?></a>
921

10-
<div class="inline error">
22+
<div class="inline error">
1123
<p>
1224
<strong><?php esc_html_e( 'Gateway Disabled', 'monei' ); ?></strong>: <?php esc_html_e( 'MONEI only support EUROS, USD & GBP currencies.', 'monei' ); ?>
1325
</p>

src/Templates/NoticeGatewayNotAvailableApi.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
class NoticeGatewayNotAvailableApi implements TemplateInterface {
66

77
public function render( $data ): void {
8-
$settings_link = esc_url(
9-
admin_url(
10-
add_query_arg(
11-
array(
12-
'page' => 'wc-settings',
13-
'tab' => 'monei_settings',
14-
),
15-
'admin.php'
16-
)
17-
)
18-
);
19-
?>
8+
$settings_link = esc_url(
9+
admin_url(
10+
add_query_arg(
11+
array(
12+
'page' => 'wc-settings',
13+
'tab' => 'monei_settings',
14+
),
15+
'admin.php'
16+
)
17+
)
18+
);
19+
?>
20+
<a class="button" href="<?php echo esc_url( $settings_link );?>"><?php esc_html_e( 'Go to MONEI API key Settings', 'monei' )?></a>
2021

21-
<div class="inline error">
22+
<div class="inline error">
2223
<p>
2324
<strong><?php esc_html_e( 'Gateway Disabled', 'monei' ); ?></strong>: <?php esc_html_e( 'MONEI API key or Account ID is missing.', 'monei' ); ?>
2425
<a href="<?php echo esc_url( $settings_link ); ?>"><?php esc_html_e( 'Go to MONEI API Key Settings', 'monei' ); ?></a>

src/Templates/NoticeGatewayNotEnabledMonei.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,25 @@
55
class NoticeGatewayNotEnabledMonei implements TemplateInterface {
66

77
public function render( $data ): void {
8-
?>
8+
$settings_link = esc_url(
9+
admin_url(
10+
add_query_arg(
11+
array(
12+
'page' => 'wc-settings',
13+
'tab' => 'monei_settings',
14+
),
15+
'admin.php'
16+
)
17+
)
18+
);
19+
?>
20+
<a class="button" href="<?php echo esc_url( $settings_link );?>"><?php esc_html_e( 'Go to MONEI API key Settings', 'monei' )?></a>
921

1022
<div class="inline error">
1123
<p>
12-
<strong><?php esc_html_e( 'Gateway Disabled', 'monei' ); ?></strong>: <?php esc_html_e( 'The selected payment method is not active in the MONEI dashboard.', 'monei' ); ?>
24+
<strong><?php esc_html_e( 'Gateway Disabled', 'monei' ); ?></strong>: <?php esc_html_e( 'The selected payment method is not active in the MONEI dashboard. Or API key is incorrect', 'monei' ); ?>
1325
<a href="https://dashboard.monei.com/?action=signIn"><?php esc_html_e( 'Go to your MONEI Dashboard to activate it', 'monei' ); ?></a>
14-
</p>
26+
</p>
1527
</div>
1628
<?php
1729
}

0 commit comments

Comments
 (0)