mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 03:02:14 +01:00 
			
		
		
		
	Validation des paiements faites par les admins
This commit is contained in:
		@@ -46,13 +46,13 @@ class Pay {
 | 
			
		||||
 | 
			
		||||
        ensure($payment->getValidationStatus() == ValidationStatus::NOT_READY, "Un paiement est déjà initié.");
 | 
			
		||||
        ensure($this->method != PaymentMethod::NOT_PAID, "Vous n'avez pas payé.");
 | 
			
		||||
        ensure($this->method == PaymentMethod::SCHOLARSHIP || ($this->infos != null && sizeof($this->infos) > 0), "Merci d'indiquer des informations pour retrouver votre paiement.");
 | 
			
		||||
        ensure($this->method == PaymentMethod::SCHOLARSHIP || ($this->infos != null && strlen($this->infos) > 0), "Merci d'indiquer des informations pour retrouver votre paiement.");
 | 
			
		||||
        ensure($this->method != PaymentMethod::SCHOLARSHIP || ($this->scholarship != null && !$this->scholarship["error"]), "Si vous êtes boursier, vous devez indiquer votre notifcation de bourse (une erreur est survenue).");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function submit()
 | 
			
		||||
    {
 | 
			
		||||
        global $DB, $LOCAL_PATH, $payment, $tournament;
 | 
			
		||||
        global $DB, $LOCAL_PATH, $payment, $user, $team, $tournament;
 | 
			
		||||
 | 
			
		||||
        $payment->setMethod($this->method);
 | 
			
		||||
        $payment->setAmount($this->method == PaymentMethod::SCHOLARSHIP ? 0 : $tournament->getPrice());
 | 
			
		||||
@@ -72,6 +72,8 @@ class Pay {
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
            $payment->setTransactionInfos($this->infos);
 | 
			
		||||
 | 
			
		||||
        Mailer::requestPaymentValidation($user, $team, $tournament, $payment);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user