/** * This function sends data to the EndPointUrl OpenPayU * @access public * @deprecated * @param string $doc * @return string * @throws OpenPayU_Exception_Configuration */ public static function sendOpenPayuDocument($doc) { if (empty(self::$openPayuEndPointUrl)) { throw new OpenPayU_Exception_Configuration('OpenPayUNetwork::$openPayuEndPointUrl is empty'); } if (!self::isCurlInstalled()) { throw new OpenPayU_Exception_Configuration('cURL is not available'); } $xml = urlencode($doc); return OpenPayU::sendData(self::$openPayuEndPointUrl, 'DOCUMENT=' . $xml); }
public static function getAccessTokenOnly($oauth_client_name, $oauth_client_secret) { $params = 'client_id=' . $oauth_client_name . '&client_secret=' . $oauth_client_secret . '&grant_type=client_credentials'; $response = OpenPayU::sendData(OpenPayUNetwork::$openPayuEndPointUrl, $params); $resp_json = json_decode($response); OpenPayU::addOutputConsole('oauth response', $response); $access_token = $resp_json->{'access_token'}; if (empty($access_token)) { throw new Exception('access_token is empty, error: ' . $response); } return $access_token; }
/** * This function sends data to the EndPointUrl OpenPayU * @access public * @param string $doc * @return string $response */ public static function sendOpenPayuDocument($doc) { if (empty(OpenPayUNetwork::$openPayuEndPointUrl)) { throw new Exception('OpenPayUNetwork::$openPayuEndPointUrl is empty'); } $response = ''; $xml = urlencode($doc); if (OpenPayUNetwork::isCurlInstalled()) { $response = OpenPayU::sendData(OpenPayUNetwork::$openPayuEndPointUrl, 'DOCUMENT=' . $xml); } else { throw new Exception('cURL is not available'); } return $response; }