Bonjour les amis :
Je suis encore débutant en PHP et je travail sur la conception d'un site internet E-commerce ..pour un projet de fin d'études
j'ai un probleme de paiement ..lorsque j'ajoute un article au panier je trouve ce message :
array (size=13)
'TIMESTAMP' => string '2015-07-23T00:10:58Z' (length=20)
'CORRELATIONID' => string '6b770883c37f4' (length=13)
'ACK' => string 'Failure' (length=7)
'VERSION' => string '124' (length=3)
'BUILD' => string '17485293' (length=8)
'L_ERRORCODE0' => string '10401' (length=5)
'L_ERRORCODE1' => string '10426' (length=5)
'L_SHORTMESSAGE0' => string 'Transaction refused because of an invalid argument. See additional error messages for details.' (length=94)
'L_SHORTMESSAGE1' => string 'Transaction refused because of an invalid argument. See additional error messages for details.' (length=94)
'L_LONGMESSAGE0' => string 'Order total is invalid.' (length=23)
'L_LONGMESSAGE1' => string 'Item total is invalid.' (length=22)
'L_SEVERITYCODE0' => string 'Error' (length=5)
'L_SEVERITYCODE1' => string 'Error' (length=5)
Code :
if($nbproduits <= 0){
echo'<tr><td></br><p style="font-size:18px;color:red;"> ...Panier vide !!</td></tr></p>';
}else{
$total = montantGlobal();
$totaltva = montantGlobaltva();
$livraison = 0;
$ttc = $totaltva + $livraison;
$paypal = new paypal();
$params = array(
'RETURNURL' => 'http://127.0.0.1/Site e-commerce/process.php',
'CANCELURL' => 'http://127.0.0.1/Site e-commerce/cancel.php',
'PAYMENTREQUEST_0_AMT' => $totaltva + $livraison,
'PAYMENTREQUEST_0_CURRENCYCODE' => 'EUR',
'PAYMENTREQUEST_0_ITEMAMT' => $ttc
);
$response = $paypal->request('SetExpressCheckout', $params);
if($response){
$paypal ='https://sandbox.paypal.com/websrc?cmd=_ ... mit&token=' .$response['TOKEN'].'';
}else{
var_dump($paypal->errors);
die('Erreur');
}
}