コード例 #1
0
  }
  /**
 * generates and returns crypt V3 value
 * 
 * @param KwixoXMLElement $order
 * @return string
 */
  public function generateCryptV3(KwixoControl $order)
  {
      $siteid = $this->getSiteId();
      $montant = urlencode($order->getOneElementByTagName('montant')->nodeValue);
      $email = urlencode($order->getOneElementByTagNameAndAttribute('utilisateur', 'type', 'facturation')->getOneElementByTagName('email')->nodeValue);
      $refid = urlencode($order->getOneElementByTagName('refid')->nodeValue);
      $datecom = urlencode($order->getOneElementByTagName('datecom')->nodeValue);
      $options = $order->getOneElementByTagName('options-paiement');
      $type = urlencode($options->getAttribute('type'));
      $rnp = urlencode($options->getAttribute('comptant-rnp'));
      $offert = urlencode($options->getAttribute('comptant-rnp-offert'));
      $data = "MerchantID={$siteid}&RefID={$refid}&Montant={$montant}&Email={$email}&DateCommande={$datecom}&op.type={$type}&op.rnp=" . (!is_null($rnp) ? $rnp : '') . "&op.offert=" . (!is_null($offert) ? $offert : '');
      $crypt = hash_hmac('SHA512', $data, $this->getAuthkey());
      return $crypt;
  }
  /**
 * generates and returns crypt V2 value
 * 
 * @param KwixoControl $order
 * @return string
 */
  public function generateCryptV2(FianetKwixoControl $order)
  {
      $MD5 = new KwixoMD5();