fix from prod for payment modules

This commit is contained in:
root 2017-10-30 11:34:13 +01:00
parent 1585057079
commit 690a60f4ad
2 changed files with 86 additions and 7 deletions

View File

@ -355,6 +355,84 @@ switch ($code_reponse)
case '99999':
$error .= 'Payment waiting confirmation from the issuer<br>'."\n";
break;
case '00100':
$error .= 'Transaction approved or successfully processed.<br>'."\n";
break;
case '00101':
case '00102':
$error .= 'Contact the card issuer<br>'."\n";
break;
case '00103':
$error .= 'Invalid retailer<br>'."\n";
break;
case '00104':
$error .= 'Keep the card<br>'."\n";
break;
case '00105':
$error .= 'Do not honor<br>'."\n";
break;
case '00107':
$error .= 'Keep the card, special conditions<br>'."\n";
break;
case '00108':
$error .= 'Approve after holder identification<br>'."\n";
break;
case '00112':
$error .= 'Invalid transaction<br>'."\n";
break;
case '00113':
$error .= 'Invalid amount<br>'."\n";
break;
case '00114':
$error .= 'Invalid holder number<br>'."\n";
break;
case '00115':
$error .= 'Card issuer unknown<br>'."\n";
break;
case '00117':
$error .= 'Client cancellation<br>'."\n";
break;
case '00119':
$error .= 'Repeat the transaction later<br>'."\n";
break;
case '00120':
$error .= 'Error in reply (error in the servers domain).<br>'."\n";
break;
case '00124':
$error .= 'File update not withstood<br>'."\n";
break;
case '00125':
$error .= 'Impossible to situate the record in the file<br>'."\n";
break;
case '00126':
$error .= 'Record duplicated, former record replaced<br>'."\n";
break;
case '00127':
$error .= 'Error in edit in file update field<br>'."\n";
break;
case '00128':
$error .= 'Access to file denied<br>'."\n";
break;
case '00129':
$error .= 'File update impossible<br>'."\n";
break;
case '00130':
$error .= 'Error in format<br>'."\n";
break;
case '00133':
$error .= 'Expired card<br>'."\n";
break;
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;
case '00000':
default:
$error .= '<b>Successful operation</b><br>'."\n\n";

View File

@ -179,7 +179,7 @@ if ($request_type && $ppec->type) {
// @ANTADIS - if id_billing make transaction
if ($id_billing_to_use != 0) {
if($ppec->DoReferenceTransaction($id_billing_to_use) === false){
return Tools::redirectLink($ppec->context->link->getPageLink('order.php').'?step=3&cgv=1&paypal_error=1');
return Tools::redirectLink($ppec->context->link->getPageLink('order.php').'?step=3&cgv=1&paypal_amt=1');
}
$amount_match = $ppec->rightPaymentProcess();
@ -240,12 +240,13 @@ elseif (!empty($ppec->token) && ($ppec->token == $token) && ($ppec->payer_id = $
if ($ppec->hasSucceedRequest() && !empty($ppec->token))
{
// Check token validity
if(isset($ppec->result['TIMESTAMP']) && !empty($ppec->result['TIMESTAMP'])){
$validity_time = strtotime($ppec->result['TIMESTAMP']);
if($validity_time < time()){
return Tools::redirectLink($ppec->context->link->getPageLink('order.php').'?step=3&cgv=1&paypal_error=1');
}
}
// if(isset($ppec->result['TIMESTAMP']) && !empty($ppec->result['TIMESTAMP'])){
// $validity_time = strtotime($ppec->result['TIMESTAMP']);
// $hours = time() + (3 * 60 * 60);
// if($validity_time < $hours){
// return Tools::redirectLink($ppec->context->link->getPageLink('order.php').'?step=3&cgv=1&paypal_expire=1');
// }
// }
$address = $customer = null;
$email = $ppec->result['EMAIL'];