protected function getAttemptInfo($isSave = false) { $xmlStructure = array('request' => array('action', 'meta', 'params' => array('order' => array('orderid')))); $xmlArray = $this->getMainRequestArray(self::ACTION_GET_ORDERSTATUS, $xmlStructure); $xmlArray['request']['params']['order']['orderid'] = $this->orderModel->order_id; $xml = HelperFormatted::array2xml($xmlArray); $ExternalData = new ExternalData(); $xmlResponse = $ExternalData->getData($this->_paymentOptions['curlUrl'], $xml); //fb($xmlArray); /* header("Content-type:text/xml; charset=utf-8"); echo $xmlResponse; die; */ if ($ExternalData->checkErrors()) { $this->_paymetnResponse->addError(substr($ExternalData->error, 6)); $this->_paymetnResponse->status = PaymentAPIResponse::ERROR_STATUS; return false; } $xmlResponseModel = simplexml_load_string($xmlResponse); $RESPONSE = $xmlResponseModel->REQUEST->RESPONSE; if ($RESPONSE->RESULT != 'OK') { $this->_paymetnResponse->status = PaymentAPIResponse::ERROR_STATUS; return false; } $this->attemptModel->status_note = $RESPONSE->STATUS->STATUSID; if ($isSave) { if ($RESPONSE->STATUS->PAYMENTREFERENCE && !$RESPONSE->STATUS->CUSTOMERACCOUNT->PAYMENTREFERENCE) { $RESPONSE->STATUS->CUSTOMERACCOUNT->PAYMENTREFERENCE = $RESPONSE->STATUS->PAYMENTREFERENCE; } $this->saveBankData($RESPONSE->STATUS->CUSTOMERACCOUNT); } $this->checkResponseStatusID($RESPONSE); return true; }
<?php /** * User: Anton Antonov * Date: 7/8/14 * Time: 10:56 AM */ include '../../application/components/ExternalData.php'; $url1 = 'https://ps.gcsip.nl/wdl/wdl'; $url2 = 'https://ps.gcsip.com/wdl/wdl'; $url = isset($_GET['real']) ? $url2 : $url1; $postdata = file_get_contents("php://input"); $ExternalData = new ExternalData(); $xmlResponse = $ExternalData->getData($url, $postdata); echo $xmlResponse;
die; } $createProfileAnswer = simplexml_load_string($createProfileAnswerXml); $RESPONSE = $createProfileAnswer->REQUEST->RESPONSE; if ($RESPONSE->ROW->PROFILETOKEN) { //$MANDATEID = $RESPONSE->ROW->MANDATEID; $PROFILETOKEN = (string) $RESPONSE->ROW->PROFILETOKEN; } else { $paymentModel->attempt++; $paymentModel->save(); $saveOrderModel->status = 'error'; $saveOrderModel->save(false); continue; } $xmlArray = array('request' => array('action' => '', 'meta' => array('merchantid' => '7760', 'ipaddress' => $_SERVER['SERVER_ADDR'], 'version' => '2.0'))); $ExternalData = new ExternalData(); $xmlArray['request']['action'] = 'INSERT_ORDERWITHPAYMENT'; $payment = array('paymentproductid' => $paymentMethod, 'amount' => $amount * 100, 'currencycode' => $paymentModel->currency, 'countrycode' => strtoupper($orderModel->country_id), 'languagecode' => $r1['lang_id'], 'returnurl' => $gcOptions['returnUrl'], 'PROFILETOKEN' => $PROFILETOKEN, 'MANDATE' => 'PRESENT'); foreach ($gcPaymentArray as $key => $value) { $payment[$key] = $value; } $params = array('order' => array('orderid' => $orderModel->order_id, 'amount' => $amount * 100, 'currencycode' => $paymentModel->currency, 'ipaddresscustomer' => $_SERVER['REMOTE_ADDR'], 'countrycode' => strtoupper($orderModel->country_id), 'languagecode' => $r1['lang_id'], 'merchantreference' => 'P' . $orderModel->order_id, 'firstname' => $orderModel->fname, 'surname' => $orderModel->lname, 'street' => $orderModel->address1, 'city' => $orderModel->city, 'zip' => $orderModel->zip, 'state' => $r1['state_name'] ? $r1['state_name'] : $orderModel->state_id, 'email' => $orderModel->email, 'descriptor' => $mainProduct->product_name, 'MANDATE' => 'PRESENT'), 'payment' => $payment); $xmlArray['request']['params'] = $params; $xml = Lib::array2xml($xmlArray); $answer = $ExternalData->getData($gcOptions['curlUrl'], $xml); $answerXml = simplexml_load_string($answer); if (false) { header("Content-type:text/xml; charset=utf-8"); echo $answer; die; }