コード例 #1
0
 /**
  * send the eWAY payment request and retrieve and parse the response
  *
  * @return GFEwayResponse
  * @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 = GFEwayPlugin::curlSendRequest($url, $xml, $this->sslVerifyPeer);
     } catch (GFEwayCurlException $e) {
         throw new GFEwayException("Error posting eWAY payment to {$url}: " . $e->getMessage());
     }
     $response = new GFEwayResponse();
     $response->loadResponseXML($responseXML);
     return $response;
 }
 /**
  * send the eWAY payment request and retrieve and parse the response
  *
  * @return GFEwayRecurringResponse
  * @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 = GFEwayPlugin::curlSendRequest($url, $xml, $this->sslVerifyPeer);
     } catch (GFEwayCurlException $e) {
         throw new GFEwayException("Error posting eWAY recurring payment to {$url}: " . $e->getMessage());
     }
     $response = new GFEwayRecurringResponse();
     $response->loadResponseXML($responseXML);
     return $response;
 }