| 1 |
<?php |
| 2 |
|
| 3 |
namespace Monei\Templates; |
| 4 |
|
| 5 |
class NoticeApiKeyRejected implements TemplateInterface { |
| 6 |
|
| 7 |
/** |
| 8 |
* @param array $data Carries 'until': Unix timestamp of the next automatic retry. |
| 9 |
*/ |
| 10 |
public function render( $data ): void { |
| 11 |
$settings_link = admin_url( |
| 12 |
add_query_arg( |
| 13 |
array( |
| 14 |
'page' => 'wc-settings', |
| 15 |
'tab' => 'monei_settings', |
| 16 |
), |
| 17 |
'admin.php' |
| 18 |
) |
| 19 |
); |
| 20 |
$retry_at = wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), (int) $data['until'] ); |
| 21 |
?> |
| 22 |
<div class="notice notice-error"> |
| 23 |
<p> |
| 24 |
<strong><?php esc_html_e( 'MONEI rejected the API key.', 'monei' ); ?></strong> |
| 25 |
<?php esc_html_e( 'MONEI payment methods may be missing from the checkout until the key is corrected.', 'monei' ); ?> |
| 26 |
<?php |
| 27 |
printf( |
| 28 |
/* translators: %s: date and time of the next automatic retry. */ |
| 29 |
esc_html__( 'The plugin will ask MONEI again at %s, or as soon as the MONEI settings are saved.', 'monei' ), |
| 30 |
esc_html( $retry_at ) |
| 31 |
); |
| 32 |
?> |
| 33 |
<a href="<?php echo esc_url( $settings_link ); ?>"><?php esc_html_e( 'Go to MONEI API Key Settings', 'monei' ); ?></a> |
| 34 |
</p> |
| 35 |
</div> |
| 36 |
<?php |
| 37 |
} |
| 38 |
} |
| 39 |
|