Pret pour les tests

This commit is contained in:
Michael RICOIS 2013-11-14 08:01:11 +00:00
parent 4be1e0a960
commit ceca8dc894
5 changed files with 26 additions and 21 deletions

View File

@ -135,7 +135,7 @@ class ReportController extends Zend_Controller_Action
//Passage à la page suivante //Passage à la page suivante
$url = $this->view->url(array( $url = $this->view->url(array(
'controller' => 'report', 'controller' => 'report',
'action' => 'deliver', //paiement 'action' => 'paiement', //deliver, paiement
'id' => $form->getValue('cmdId'), 'id' => $form->getValue('cmdId'),
), null, true); ), null, true);
$this->redirect($url); $this->redirect($url);

View File

@ -6,10 +6,6 @@
<?php if ( $this->CmdID ) {?> <?php if ( $this->CmdID ) {?>
<form name="commande" action="" method="">
<input type="hidden" name="cmdId" value="<?=$this->CmdID?>" />
<input type="hidden" name="siren" value="<?=$this->siren?>" />
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@ -37,18 +33,20 @@
<?php if ($this->PayboxValues) {?> <?php if ($this->PayboxValues) {?>
<form method="" action="post"> <form method="post" action="<?=$this->PayboxUrl?>">
<?php foreach ( $this->PayboxValues as $field) {?> <?php foreach ( $this->PayboxValues as $field) {?>
<input type="hidden" name="<?=$field['name']?>" value="<?=$field['value']?>" /> <input type="hidden" name="<?=$field['name']?>" value="<?=$field['value']?>" />
<?php }?> <?php }?>
<div>
</form>
Une fois le paiement effectué merci de cliquer sur le bouton "Retour boutique" afin de Une fois le paiement effectué merci de cliquer sur le bouton "Retour boutique" afin de
consulter vos documents. consulter vos documents.
</div>
<input type="submit" class="btn btn-primary" value="Paiement"/>
</form>
<?php }?> <?php }?>
@ -56,8 +54,6 @@
</div> </div>
</form>
<?php } else {?> <?php } else {?>
<div class="alert alert-danger"><strong>Erreur !</strong> </div> <div class="alert alert-danger"><strong>Erreur !</strong> </div>

View File

@ -11,6 +11,8 @@ class Paybox_Config
protected $SERVER; protected $SERVER;
protected $URL_PAIEMENT;
public function __construct() public function __construct()
{ {
if (APPLICATION_ENV == 'production') { if (APPLICATION_ENV == 'production') {
@ -47,7 +49,7 @@ class Paybox_Config
if($server_status == "OK"){ if($server_status == "OK"){
//Le serveur est prêt et les services opérationnels //Le serveur est prêt et les services opérationnels
$serveurOK = $serveur; $serveurOK = $serveur;
$this->PAIEMENT_URL = $serveur['url']; $this->URL_PAIEMENT = $serveur['url'];
return true; return true;
break; break;
} }

View File

@ -5,9 +5,9 @@ class Paybox_Response
protected $sign; protected $sign;
protected $errCode; protected $errCode = 0;
protected $errLabel; protected $errLabel = 'Erreur inconnue.';
public function __construct(){} public function __construct(){}
@ -17,6 +17,9 @@ class Paybox_Response
*/ */
public function setData($values) public function setData($values)
{ {
if ( !array_key_exists('sign', $values) )
return;
//Set and remove the sign //Set and remove the sign
$this->setSign($values['sign']); $this->setSign($values['sign']);
unset($values['sign']); unset($values['sign']);
@ -48,6 +51,12 @@ class Paybox_Response
*/ */
protected function isDataSign() protected function isDataSign()
{ {
if ($this->data === null)
return false;
if ($this->sign === null)
return false;
$fp = fopen(__DIR__ . '/pubkey.pem', 'r'); $fp = fopen(__DIR__ . '/pubkey.pem', 'r');
$cert = fread($fp, 8192); $cert = fread($fp, 8192);
fclose($fp); fclose($fp);
@ -76,7 +85,7 @@ class Paybox_Response
*/ */
protected function checkEta($code) protected function checkEta($code)
{ {
if ( intval($code) == 0 ) { if ( intval($code) === 0 ) {
return true; return true;
} }

View File

@ -149,8 +149,6 @@ class Paybox_System extends Paybox_Config
'PBX_TIME', 'PBX_TIME',
); );
protected $URL_PAIEMENT;
protected $URL_PARAMETERS; protected $URL_PARAMETERS;
public function __construct() { public function __construct() {
@ -219,12 +217,12 @@ class Paybox_System extends Paybox_Config
{ {
if ( !empty($withReturnUrl) ) { if ( !empty($withReturnUrl) ) {
$this->setReturnUrl($withReturnUrl); $this->setReturnUrl($withReturnUrl);
$this->stackfields = $this->stackfields + array( $this->stackfields = array_merge($this->stackfields, array(
'PBX_EFFECTUE', 'PBX_EFFECTUE',
'PBX_REFUSE', 'PBX_REFUSE',
'PBX_ATTENTE', 'PBX_ATTENTE',
'PBX_ANNULE', 'PBX_ANNULE',
); ));
} }
$dateTime = date('c'); $dateTime = date('c');
@ -258,7 +256,7 @@ class Paybox_System extends Paybox_Config
{ {
$this->checkservers(); $this->checkservers();
if ( !empty($this->URL_PAEIMENT) ) { if ( !empty($this->URL_PAIEMENT) ) {
return $this->URL_PAIEMENT; return $this->URL_PAIEMENT;
} }