diff --git a/library/Paybox/Response.php b/library/Paybox/Response.php index 9af6fff..0cac638 100644 --- a/library/Paybox/Response.php +++ b/library/Paybox/Response.php @@ -9,6 +9,8 @@ class Paybox_Response protected $errLabel = 'Impossible de valider le paiement.'; + protected $values = array(); + public function __construct(){} /** @@ -24,6 +26,8 @@ class Paybox_Response $this->setSign($values['sign']); unset($values['sign']); + $this->values = $values; + //Concat datas with & $this->data = ''; $i = 0; @@ -88,11 +92,12 @@ class Paybox_Response /** * Vérifie le code retour - * @param string $code * @return boolean */ - protected function checkEta($code) + protected function checkEta() { + $code = $this->values['eta']; + if ( intval($code) === 0 ) { return true; } @@ -144,10 +149,9 @@ class Paybox_Response Opération en attente de validation par l’émetteur du moyen de paiement. */ - default: $this->errCode = 0; - $this->errLabel = 'Echec'; + $this->errLabel = 'Validation du paiement incorrect'; } return false; @@ -177,6 +181,7 @@ class Paybox_Response //eta:E;id:R;type:P;pays:Y;mt:M;auto:A;idtrans:S;sign:K + return false; } /**