diff --git a/application/controllers/ReportController.php b/application/controllers/ReportController.php index e9d13fe..6711af4 100644 --- a/application/controllers/ReportController.php +++ b/application/controllers/ReportController.php @@ -135,7 +135,7 @@ class ReportController extends Zend_Controller_Action //Passage à la page suivante $url = $this->view->url(array( 'controller' => 'report', - 'action' => 'deliver', //paiement + 'action' => 'paiement', //deliver, paiement 'id' => $form->getValue('cmdId'), ), null, true); $this->redirect($url); diff --git a/application/views/scripts/report/paiement.phtml b/application/views/scripts/report/paiement.phtml index 2c575c0..b0ed6ee 100644 --- a/application/views/scripts/report/paiement.phtml +++ b/application/views/scripts/report/paiement.phtml @@ -6,10 +6,6 @@ CmdID ) {?> -
- - -
@@ -37,18 +33,20 @@ PayboxValues) {?> - + PayboxValues as $field) {?> - - - - +
Une fois le paiement effectué merci de cliquer sur le bouton "Retour boutique" afin de consulter vos documents. +
+ + + + @@ -56,8 +54,6 @@
- -
Erreur !
diff --git a/library/Paybox/Config.php b/library/Paybox/Config.php index 4417db4..ac0fd59 100644 --- a/library/Paybox/Config.php +++ b/library/Paybox/Config.php @@ -11,6 +11,8 @@ class Paybox_Config protected $SERVER; + protected $URL_PAIEMENT; + public function __construct() { if (APPLICATION_ENV == 'production') { @@ -47,7 +49,7 @@ class Paybox_Config if($server_status == "OK"){ //Le serveur est prêt et les services opérationnels $serveurOK = $serveur; - $this->PAIEMENT_URL = $serveur['url']; + $this->URL_PAIEMENT = $serveur['url']; return true; break; } diff --git a/library/Paybox/Response.php b/library/Paybox/Response.php index 9120fa0..ba5cb03 100644 --- a/library/Paybox/Response.php +++ b/library/Paybox/Response.php @@ -5,9 +5,9 @@ class Paybox_Response protected $sign; - protected $errCode; + protected $errCode = 0; - protected $errLabel; + protected $errLabel = 'Erreur inconnue.'; public function __construct(){} @@ -17,6 +17,9 @@ class Paybox_Response */ public function setData($values) { + if ( !array_key_exists('sign', $values) ) + return; + //Set and remove the sign $this->setSign($values['sign']); unset($values['sign']); @@ -48,6 +51,12 @@ class Paybox_Response */ protected function isDataSign() { + if ($this->data === null) + return false; + + if ($this->sign === null) + return false; + $fp = fopen(__DIR__ . '/pubkey.pem', 'r'); $cert = fread($fp, 8192); fclose($fp); @@ -76,7 +85,7 @@ class Paybox_Response */ protected function checkEta($code) { - if ( intval($code) == 0 ) { + if ( intval($code) === 0 ) { return true; } diff --git a/library/Paybox/System.php b/library/Paybox/System.php index c99ec34..36a7953 100644 --- a/library/Paybox/System.php +++ b/library/Paybox/System.php @@ -149,8 +149,6 @@ class Paybox_System extends Paybox_Config 'PBX_TIME', ); - protected $URL_PAIEMENT; - protected $URL_PARAMETERS; public function __construct() { @@ -219,12 +217,12 @@ class Paybox_System extends Paybox_Config { if ( !empty($withReturnUrl) ) { $this->setReturnUrl($withReturnUrl); - $this->stackfields = $this->stackfields + array( + $this->stackfields = array_merge($this->stackfields, array( 'PBX_EFFECTUE', 'PBX_REFUSE', 'PBX_ATTENTE', 'PBX_ANNULE', - ); + )); } $dateTime = date('c'); @@ -258,7 +256,7 @@ class Paybox_System extends Paybox_Config { $this->checkservers(); - if ( !empty($this->URL_PAEIMENT) ) { + if ( !empty($this->URL_PAIEMENT) ) { return $this->URL_PAIEMENT; }