fix payment paybox with new error code from prod

This commit is contained in:
root 2017-05-24 12:04:47 +02:00
parent 6bedf15606
commit f2e1d87de9
2 changed files with 11 additions and 5 deletions

View File

@ -193,7 +193,7 @@ $values = array(
// payment success
if ((!isset($autorisation[1]) || empty($autorisation[1])))
if ((!isset($autorisation) || empty($autorisation)))
{
if (in_array($_SERVER['REMOTE_ADDR'], $authorized_ip)) {
mail('marion@antadis.com', '[BBB] ERREUR Reponse paybox direct', http_build_query($data, '', '&'));
@ -202,7 +202,7 @@ if ((!isset($autorisation[1]) || empty($autorisation[1])))
die('No autorisation number');
}
// Wrong authorization number in live mode
if ($autorisation[1] == 'XXXXXX' && $test_mode === 1) {
if ($autorisation == 'XXXXXX' && $test_mode === 1) {
$error .= '- error payment - wrong authorization number <br>'."\n";
}
@ -257,7 +257,7 @@ $total_paid = $values['m'] / 100;
if ($test_mode === 0)
{
if (empty($error) && $code_reponse[1] == '00000')
if (empty($error) && $code_reponse == '00000')
{
$error = '***TEST*** : Validated Payment <br>'."\n";
$statut = _PS_OS_PAYMENT_;
@ -270,7 +270,7 @@ if ($test_mode === 0)
}
elseif ($test_mode === 1)
{
if ($code_reponse[1] == '00000' && empty($error)){
if ($code_reponse == '00000' && empty($error)){
$statut = _PS_OS_PAYMENT_;
}
else
@ -279,7 +279,7 @@ elseif ($test_mode === 1)
}
}
switch ($code_reponse[1])
switch ($code_reponse)
{
case '00001':
$error .= 'Connection to the authorization center failed or an internal error occurred <br>'."\n";
@ -308,6 +308,9 @@ switch ($code_reponse[1])
case '00015':
$error .= 'Payment already done<br>'."\n";
break;
case '00105':
$error .= 'Error 00105<br>'."\n";
break;
case '00016':
$error .= 'Subscriber already exists<br>'."\n";
break;

View File

@ -296,6 +296,9 @@ switch ($pbx_error)
case '00138':
$error .= 'Too many attempts at secret code.<br>'."\n";
break;
case '00151':
$error .= 'provision insuffisante.<br>'."\n";
break;
case '00159':
$error .= 'Suspicion of fraud.<br>'."\n";
break;