/** * send the eWAY payment request and retrieve and parse the response * @return EwayPaymentsStoredResponse * @param string $xml eWAY payment request as an XML document, per eWAY specifications */ private function sendPayment($xml) { // use sandbox if not from live website $url = $this->isLiveSite ? self::REALTIME_API_LIVE : self::REALTIME_API_SANDBOX; // execute the cURL request, and retrieve the response try { $responseXML = EwayPaymentsPlugin::curlSendRequest($url, $xml, $this->sslVerifyPeer); } catch (EwayPaymentsException $e) { throw new EwayPaymentsException("Error posting eWAY payment to $url: " . $e->getMessage()); } $response = new EwayPaymentsStoredResponse(); $response->loadResponseXML($responseXML); return $response; }
/** * send the eWAY payment request and retrieve and parse the response * * @return EwayPaymentsResponse * @param string $xml eWAY payment request as an XML document, per eWAY specifications */ private function sendPayment($xml) { // select endpoint URL, use sandbox if not from live website if (!empty($this->customerCountryCode)) { // use Beagle anti-fraud endpoints $url = $this->isLiveSite ? self::REALTIME_BEAGLE_API_LIVE : self::REALTIME_BEAGLE_API_SANDBOX; } else if (empty($this->cardVerificationNumber)) { // no CVN -- do these endpoints still work? $url = $this->isLiveSite ? self::REALTIME_API_LIVE : self::REALTIME_API_SANDBOX; } else { // normal Direct Payments endpoints with CVN verification $url = $this->isLiveSite ? self::REALTIME_CVN_API_LIVE : self::REALTIME_CVN_API_SANDBOX; } // execute the cURL request, and retrieve the response try { $responseXML = EwayPaymentsPlugin::curlSendRequest($url, $xml, $this->sslVerifyPeer); } catch (EwayPaymentsException $e) { throw new EwayPaymentsException("Error posting eWAY payment to $url: " . $e->getMessage()); } $response = new EwayPaymentsResponse(); $response->loadResponseXML($responseXML); return $response; }