Jump to content

Recommended Posts

Bonjour,

 

j'utilise la version 1.4.5.1 et j'ai procédé à tous les conseils trouvé sur le forum concernant le bug so colissimo.

Malheureusement j'ai encore cette erreur: "une erreur s'est produite lors de l'étape transporteur: Signature invalide"

 

pouvez-vous m'aider svp :)

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 2 weeks later...
  • 1 month later...

Bonjour, au cas ou ça puisse servir :

 

fichier socolissimo.php pour la signature aller

/*
  $signature = $this->make_key(substr($this->lower($params['address']->lastname),0,34),
   (int)(Configuration::Get('SOCOLISSIMO_PREPARATION_TIME')),
   number_format((float)($params['cart']->getOrderShippingCost($carrierSo->id, true)), 2, ',', ''),
   (int)($params['address']->id_customer),(int)($params['address']->id));
  */
  $orderId = $this->formatOrderId((int)($params['address']->id));

  $uidTransporteur = $carrierSo->id;
  $inputsForSignature = array(
   'pudoFOId' => Configuration::get('SOCOLISSIMO_ID'),
   'ceName' => substr($this->lower($params['address']->lastname),0, 34),
   'dyPreparationTime' => (int)(Configuration::Get('SOCOLISSIMO_PREPARATION_TIME')),
   'dyForwardingCharges' => number_format((float)($params['cart']->getOrderShippingCost($carrierSo->id)), 2, ',', ''),
   'trClientNumber' => $this->upper((int)($params['address']->id_customer)),
   'orderId' => $orderId,
   'numVersion' => '3.0',
   'ceCivility' => $cecivility,
   'ceFirstName' => substr($this->lower($params['address']->firstname),0,29),
   'ceCompanyName' => substr($this->upper($params['address']->company),0,38),
   'ceAdress3'  => substr($this->upper($params['address']->address1),0,38),
   'ceAdress4' => substr($this->upper($params['address']->address2),0,38),
   'ceZipCode' => $params['address']->postcode,
   'ceTown' => substr($this->upper($params['address']->city),0,32),
   'ceEmail' => $params['cookie']->email,
   'cePhoneNumber' => str_replace(array(' ', '.', '-', ',', ';', '+', '/', '\\', '+', '(', ')'),'',$params['address']->phone_mobile),
   'dyWeight' => ((float)($params['cart']->getTotalWeight()) * 1000),
   'trParamPlus' => $uidTransporteur.'|0|undefined',
   'trReturnUrlKo' => htmlentities($this->url,ENT_NOQUOTES, 'UTF-8'),
   'trReturnUrlOk' => htmlentities($this->url,ENT_NOQUOTES, 'UTF-8')
  );


  $stringToEncode = '';
  foreach($inputsForSignature as $inputTemp){
   $stringToEncode .= $inputTemp;
   }
  $signature = sha1($stringToEncode.Configuration::get('SOCOLISSIMO_KEY'));

 

fichier validation.php pour le retour :

$validReturn = array(
'PUDOFOID',
'CENAME',
'DYPREPARATIONTIME',
'DYFORWARDINGCHARGES',
'TRCLIENTNUMBER',
'TRORDERNUMBER',
'ORDERID',
'CECIVILITY',
'CEFIRSTNAME',
'CECOMPANYNAME',
'CEADRESS1',
'CEADRESS2',
'CEADRESS3',
'CEADRESS4',
'CEZIPCODE',
'CETOWN',
'DELIVERYMODE',
'CEDELIVERYINFORMATION',
'CEEMAIL',
'CEPHONENUMBER',
'CEDOORCODE1',
'CEDOORCODE2',
'CEENTRYPHONE',
'TRPARAMPLUS',
'TRADERCOMPANYNAME',
'ERRORCODE',
'ERR_CENAME',
'ERR_CEFIRSTNAME',
'ERR_CECOMPANYNAME',
'ERR_CEADRESS1',
'ERR_CEADRESS2',
'ERR_CEADRESS3',
'ERR_CEADRESS4',
'ERR_CETOWN',
'ERR_CEDOORCODE1',
'ERR_CEDOORCODE2',
'ERR_CEENTRYPHONE',
'ERR_CEDELIVERYINFORMATION',
'ERR_CEEMAIL',
'ERR_CEPHONENUMBER',
'ERR_TRCLIENTNUMBER',
'ERR_TRORDERNUMBER',
'ERR_TRPARAMPLUS',
'ERR_CECIVILITY',
'ERR_DYWEIGHT',
'ERR_DYPREPARATIONTIME',
'TRRETURNURLKO'
);
$stringToEncode = '';
foreach($validReturn as $returnToEncodeKey){
if(isset($_REQUEST[$returnToEncodeKey])) $stringToEncode .= $_REQUEST[$returnToEncodeKey];
}

$signatureTEST = sha1($stringToEncode.Configuration::get('SOCOLISSIMO_KEY'));

 

et plus bas, dans le test de la signature :

// if ($return['SIGNATURE'] === socolissimo::make_key($return['CENAME'],(float)($return['DYPREPARATIONTIME']),$return['DYFORWARDINGCHARGES'],$return['TRCLIENTNUMBER'], $return['ORDERID']))
 if ($return['SIGNATURE'] === $signatureTEST)
 {....

 

 

j'utilise aussi la version 1.4.5.1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...