| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin notice: Square connection error |
| 4 |
* |
| 5 |
* @author David Bisset |
| 6 |
* @package Charitable/Admin View/Settings |
| 7 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 |
* @since 1.0.0 |
| 10 |
* @version 1.0.0 |
| 11 |
* @version 1.8.8.6 |
| 12 |
*/ |
| 13 |
|
| 14 |
// Exit if accessed directly. |
| 15 |
if ( ! defined( 'ABSPATH' ) ) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
$charitable_settings_url = add_query_arg( |
| 20 |
array( |
| 21 |
'page' => 'charitable-settings', |
| 22 |
'tab' => 'gateways', |
| 23 |
'group' => 'gateways_square_core', |
| 24 |
), |
| 25 |
admin_url( 'admin.php' ) |
| 26 |
); |
| 27 |
|
| 28 |
$charitable_message = $view_args['message']; |
| 29 |
$charitable_status_code = $view_args['status_code']; |
| 30 |
|
| 31 |
if ( $charitable_status_code === '401' ) { |
| 32 |
$charitable_message = 'Charitable has been disconnected from your Square account. Please reconnect to continue accepting payments.'; |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
?> |
| 37 |
|
| 38 |
<?php |
| 39 |
printf( |
| 40 |
wp_kses( |
| 41 |
/* translators: %1$s: error message, %2$s: opening link tag, %3$s: closing link tag */ |
| 42 |
__( '<strong>Charitable:</strong> Important! %1$s %2$sReconnect to Square%3$s', 'charitable' ), |
| 43 |
array( |
| 44 |
'strong' => array(), |
| 45 |
) |
| 46 |
), |
| 47 |
esc_html( $charitable_message ), |
| 48 |
'<br><a href="' . esc_url( $charitable_settings_url ) . '" class="button button-primary charitable-admin-notice-square-connection-error" style="margin-top: 10px; background-color: #fc9a2a; border-color: #fc9a2a;">', |
| 49 |
'</a>' |
| 50 |
); |
| 51 |
?> |
| 52 |
|