added message payments in admin menu

This commit is contained in:
asus
2024-03-27 17:18:14 +01:00
parent a0018c903b
commit dd0d4dfbeb
13 changed files with 229 additions and 34 deletions

View File

@@ -10,6 +10,7 @@ if (!defined('ABSPATH')) {
function set_paypal_options_CIPF($is_sandbox, $client_id, $client_secret) {
PLGNTLS_class::debug_infos();
$option_paypal = PLGNTLS_class::OPTION_PAYPAL;
@@ -72,4 +73,46 @@ function get_paypal_api_base_url_CIPF() {
/*
* OPTIONS MESSAGES PAIMENT
*
*/
function set_payment_messages_option_CIPF($success, $failure) {
PLGNTLS_class::debug_infos();
$option_payment = PLGNTLS_class::OPTION_PAYMENT;
$option_data = array();
$option_data['success'] = $success;
$option_data['failure'] = $failure;
update_option($option_payment['_name'], serialize($option_data), '', 'no');
}
function get_payment_messages_option_CIPF() {
PLGNTLS_class::debug_infos();
$option_payment = PLGNTLS_class::OPTION_PAYMENT;
$payment_option_serialized = get_option($option_payment['_name']);
if (false === $payment_option_serialized) {
add_option($option_payment['_name'], serialize($option_payment['_default']), '', 'no');
$payment_option_serialized = get_option($option_payment['_name']);
}
return unserialize($payment_option_serialized);
}
function get_payment_message_success_CIPF() {
PLGNTLS_class::debug_infos();
$payment_option = get_payment_messages_option_CIPF();
return $payment_option['success'];
}
function get_payment_message_failure_CIPF() {
PLGNTLS_class::debug_infos();
$payment_option = get_payment_messages_option_CIPF();
return $payment_option['failure'];
}
?>