/** * This function sends auth data to the EndPointUrl OpenPayU * @access public * @param string $doc * @param integer $merchantPosId * @param string $signatureKey * @param string $algorithm * @return string * @throws OpenPayU_Exception_Configuration * @deprecated */ public static function sendOpenPayuDocumentAuth($doc, $merchantPosId, $signatureKey, $algorithm = 'MD5') { if (empty(self::$openPayuEndPointUrl)) { throw new OpenPayU_Exception_Configuration('OpenPayUNetwork::$openPayuEndPointUrl is empty'); } if (empty($signatureKey)) { throw new OpenPayU_Exception_Configuration('Merchant Signature Key should not be null or empty.'); } if (empty($merchantPosId)) { throw new OpenPayU_Exception_Configuration('MerchantPosId should not be null or empty.'); } $tosigndata = $doc . $signatureKey; $xml = urlencode($doc); $signature = ''; if ($algorithm == 'MD5') { $signature = md5($tosigndata); } else { if ($algorithm == 'SHA') { $signature = sha1($tosigndata); } else { if ($algorithm == 'SHA-256' || $algorithm == 'SHA256' || $algorithm == 'SHA_256') { $signature = hash('sha256', $tosigndata); } } } $authData = 'sender=' . $merchantPosId . ';signature=' . $signature . ';algorithm=' . $algorithm . ';content=DOCUMENT'; if (!self::isCurlInstalled()) { throw new OpenPayU_Exception_Configuration('curl is not available'); } return OpenPayU::sendDataAuth(self::$openPayuEndPointUrl, 'DOCUMENT=' . $xml, $authData); }