From 690a60f4ad02ee083c30ff55805581dba630dae4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 Oct 2017 11:34:13 +0100 Subject: [PATCH] fix from prod for payment modules --- modules/paybox/direct_paiement.php | 78 +++++++++++++++++++++ modules/paypal/express_checkout/payment.php | 15 ++-- 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/modules/paybox/direct_paiement.php b/modules/paybox/direct_paiement.php index 3888929c..73ebb16a 100644 --- a/modules/paybox/direct_paiement.php +++ b/modules/paybox/direct_paiement.php @@ -355,6 +355,84 @@ switch ($code_reponse) case '99999': $error .= 'Payment waiting confirmation from the issuer
'."\n"; break; + + case '00100': + $error .= 'Transaction approved or successfully processed.
'."\n"; + break; + case '00101': + case '00102': + $error .= 'Contact the card issuer
'."\n"; + break; + case '00103': + $error .= 'Invalid retailer
'."\n"; + break; + case '00104': + $error .= 'Keep the card
'."\n"; + break; + case '00105': + $error .= 'Do not honor
'."\n"; + break; + case '00107': + $error .= 'Keep the card, special conditions
'."\n"; + break; + case '00108': + $error .= 'Approve after holder identification
'."\n"; + break; + case '00112': + $error .= 'Invalid transaction
'."\n"; + break; + case '00113': + $error .= 'Invalid amount
'."\n"; + break; + case '00114': + $error .= 'Invalid holder number
'."\n"; + break; + case '00115': + $error .= 'Card issuer unknown
'."\n"; + break; + case '00117': + $error .= 'Client cancellation
'."\n"; + break; + case '00119': + $error .= 'Repeat the transaction later
'."\n"; + break; + case '00120': + $error .= 'Error in reply (error in the server’s domain).
'."\n"; + break; + case '00124': + $error .= 'File update not withstood
'."\n"; + break; + case '00125': + $error .= 'Impossible to situate the record in the file
'."\n"; + break; + case '00126': + $error .= 'Record duplicated, former record replaced
'."\n"; + break; + case '00127': + $error .= 'Error in ‘edit’ in file update field
'."\n"; + break; + case '00128': + $error .= 'Access to file denied
'."\n"; + break; + case '00129': + $error .= 'File update impossible
'."\n"; + break; + case '00130': + $error .= 'Error in format
'."\n"; + break; + case '00133': + $error .= 'Expired card
'."\n"; + break; + case '00138': + $error .= 'Too many attempts at secret code.
'."\n"; + break; + case '00151': + $error .= 'provision insuffisante.
'."\n"; + break; + case '00159': + $error .= 'Suspicion of fraud.
'."\n"; + break; + case '00000': default: $error .= 'Successful operation
'."\n\n"; diff --git a/modules/paypal/express_checkout/payment.php b/modules/paypal/express_checkout/payment.php index 20185209..cf0609b1 100755 --- a/modules/paypal/express_checkout/payment.php +++ b/modules/paypal/express_checkout/payment.php @@ -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'];