small improvements in handling prof states :

- card date validation now uses direct card duration, not a parameter
- checker for both types of transfert valid and invalid
- mv checks for transfert and date expiration in specific functions
This commit is contained in:
asus
2024-03-21 16:10:07 +01:00
parent 782ae1b1d8
commit 66fbbfd586
7 changed files with 115 additions and 51 deletions

View File

@@ -22,10 +22,6 @@ if (!defined('ABSPATH')) {
* - 'Commande' -> ok 1/1 : [1: at inscription - ok]
* - 'Renouvellement' -> ko 1/1 : [1: after succees payement - ok]
*
* [ ] activation du compte ('compte-actif') :
* - 'Actif' -> equivalent a etat compte [3] carte valide
* - 'Inactif' -> equivalent a etat compte [2] doit payer
*
* [/] etat paiement ('etat_paiement') :
* - 'en_cours' -> ok 1/1 : [1: start payment - ok]
* - 'reussi' -> ok 1/1 : [1: after payment success - ok]
@@ -38,9 +34,10 @@ if (!defined('ABSPATH')) {
*
* [/] numero de carte ('numero_de_la_carte') -> ok 1/1 : [1: after payment & card is 'commande' - ok]
*
* [/] etat_virement -> ko 2/3 : [1: at form validation - ok], [2: check on profil page - ko], [3: when transfert is started, reset - ok]]
*
* [/] cgv
*
* [/] etat_virement -> ko 2/3 : [1: at form validation - ok], [2: check on profil page - ko], [3: when transfert is started, reset - ok]]
*
*/
@@ -167,6 +164,17 @@ function is_account_expired_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
return is_account_state_CIPF('expired', $user_id);
}
// additional : check both waitings
function is_account_waiting_transfert_CIPF($user_id = null) {
PLGNTLS_class::debug_infos();
if (is_account_waiting_valid_CIPF($user_id)) {
return true;
}
if (is_account_waiting_invalid_CIPF($user_id)) {
return true;
}
return false;
}
/*
* setters :
*/