fixed error in prof state for renew card

This commit is contained in:
asus
2024-03-19 22:47:00 +01:00
parent d264e6c321
commit 1248c2339d
5 changed files with 13 additions and 39 deletions

View File

@@ -91,4 +91,3 @@ add_action('wp_enqueue_scripts', 'payment_page_scripts_CIPF');
?>

View File

@@ -28,7 +28,7 @@ function prof_after_form_CIPF($form_id, $post_array, $form_type) {
* reset cgv
*
*/
update_field($acf_cgv['_key'], array(""), $acf_id);
update_field($acf_cgv['_name'], array(""), $acf_id);
/*

View File

@@ -125,6 +125,7 @@ function prof_profil_check_CIPF() {
/*
* in case event didn't fire, change account to expire here
* also check for waiting transfert : valid -> invalid
*
*/
if (card_date_exists_CIPF()) {
@@ -132,6 +133,9 @@ function prof_profil_check_CIPF() {
if (!is_account_expired_CIPF()) {
set_account_expired_CIPF();
}
if (is_account_waiting_valid_CIPF()) {
set_account_waiting_invalid_CIPF();
}
}
}
}

View File

@@ -14,16 +14,14 @@ if (!defined('ABSPATH')) {
* 1. new . 'nouveau prof' -> ok 1/1 : [1: at inscription - ok]
* 2. to_pay . 'doit payer' -> ko 3/4 : [1: after form & new - ok], [2: after form choose paypal & expired - ok], [3: after payment failed - ok], [4: after transfert failed - ko]
* 3. valid . 'carte valide' -> ko 1/2 : [1: after payment success - ok], [2: after transfert success - ko]
* 4. expired . 'carte expiree' -> ko 1/2 : [1: when prof access profil & expired - ok], [2: when event card expired fire - ko]
* 4. waiting_invalid . 'en attente invalide' -> ko 3/4 : [1: after form choose transfert & expired - ok], [2: after card changes to expired & was waiting valid - ok], [3: verify at prof profil page - ok], [4: when event for expire fire - ko]
* 5. waiting_valid . 'en attente valide' -> ok 1/1 : [1: after form choose transfert & not expired - ok]
* 6. expired . 'carte expiree' -> ko 1/2 : [1: when prof access profil & expired - ok], [2: when event card expired fire - ko]
*
* [/] etat carte ('etat_carte') :
* - 'Commande' -> ok 1/1 : [1: at inscription - ok]
* - 'Renouvellement' -> ko 1/1 : [1: after succees payement - ok]
*
* [/] etat virement ('etat_virement') :
* - 'en attente' -> ko 0/1 : [1: after form validation $ transfert choose - ok]
* - 'reçu' -> ko 0/1 : [1: after admin change it from front - ko]
*
* [ ] activation du compte ('compte-actif') :
* - 'Actif' -> equivalent a etat compte [3] carte valide
* - 'Inactif' -> equivalent a etat compte [2] doit payer
@@ -62,6 +60,9 @@ function get_field_init_CIPF($acf_field_name, $acf_id) {
$default = $acf_object['default_value'];
if (empty($default)) {
$choices = $acf_object['choices'];
if (!is_array($choices)) {
return false;
}
$default = reset($choices);
}
update_field($acf_field_name, $default, $acf_id);
@@ -213,7 +214,7 @@ function is_card_new_CIPF($user_id = null) {
}
function is_card_renew_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
$acf_card_payment_method = PLGNTLS_class::ACF_CARD_PAYMENT_METHOD;
$acf_card_state = PLGNTLS_class::ACF_CARD_STATE;
return is_acf_state_CIPF($user_id, $acf_card_state, 'renew');
}
function set_card_new_CIPF($user_id = null) {
@@ -223,7 +224,7 @@ function set_card_new_CIPF($user_id = null) {
}
function set_card_renew_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
$acf_card_payment_method = PLGNTLS_class::ACF_CARD_PAYMENT_METHOD;
$acf_card_state = PLGNTLS_class::ACF_CARD_STATE;
set_acf_state_CIPF($user_id, $acf_card_state, 'renew');
}
@@ -314,35 +315,6 @@ function set_payment_nothing_CIPF($user_id = null) {
/*
* etat virement ('etat_virement') :
* - 'en attente'
* - 'reçu'
*
*/
function is_transfert_waiting_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
$acf_transfert_state = PLGNTLS_class::ACF_TRANSFERT_STATE;
return is_acf_state_CIPF($user_id, $acf_transfert_state, 'waiting');
}
function is_transfert_done_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
$acf_transfert_state = PLGNTLS_class::ACF_TRANSFERT_STATE;
return is_acf_state_CIPF($user_id, $acf_transfert_state, 'done');
}
function set_transfert_waiting_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
$acf_transfert_state = PLGNTLS_class::ACF_TRANSFERT_STATE;
set_acf_state_CIPF($user_id, $acf_transfert_state, 'waiting');
}
function set_transfert_done_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
$acf_transfert_state = PLGNTLS_class::ACF_TRANSFERT_STATE;
set_acf_state_CIPF($user_id, $acf_transfert_state, 'done');
}
/*