Файловый менеджер - Редактировать - /var/www/html/Query.zip
Ðазад
PK ! �L�K K QueryBatchDetailResponse.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\Common\Exception\InvalidResponseException; use Omnipay\Common\Message\AbstractRequest; /** * Authorize.Net AIM Response */ class QueryBatchDetailResponse extends AbstractQueryResponse { public function __construct(AbstractRequest $request, $data) { // Strip out the xmlns junk so that PHP can parse the XML $xml = preg_replace( '/<getTransactionListRequest[^>]+>/', '<getTransactionListRequest>', (string)$data ); try { $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOWARNING); } catch (\Exception $e) { throw new InvalidResponseException(); } if (!$xml) { throw new InvalidResponseException(); } parent::__construct($request, $xml); } public function isSuccessful() { return 1 === $this->getResultCode(); } public function getData() { return $this->xml2array($this->data->transactions, true)['transaction']; } } PK ! `$� � AIMPaymentPlanQueryRequest.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; /** * Authorize.Net AIM Authorize Request */ class AIMPaymentPlanQueryRequest extends AIMAbstractQueryRequest { protected $action = ''; protected $requestType = 'ARBGetSubscriptionRequest'; protected $recurringReference; /** * @return string */ public function getRecurringReference() { return $this->recurringReference; } /** * @param string $recurringReference */ public function setRecurringReference($recurringReference) { $this->recurringReference = $recurringReference; } /** * Get data to send. */ public function getData() { $data = $this->getBaseData(); $data->subscriptionId = $this->getRecurringReference(); return $data; } protected function addTransactionType(\SimpleXMLElement $data) { } public function sendData($data) { $headers = array('Content-Type' => 'text/xml; charset=utf-8'); $data = $data->saveXml(); $httpResponse = $this->httpClient->request('POST', $this->getEndpoint(), $headers, $data); return $this->response = new AIMPaymentPlanQueryResponse($this, $httpResponse->getBody()->getContents()); } } PK ! ��#A A QueryDetailRequest.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; /** * Authorize.Net AIM Authorize Request */ class QueryDetailRequest extends QueryBatchRequest { protected $action = ''; protected $requestType = 'getTransactionDetailsRequest'; protected $transactionReference; /** * Get data to send. */ public function getData() { $data = $this->getBaseData(); $data->transId = $this->getTransactionReference(); return $data; } public function sendData($data) { $headers = array('Content-Type' => 'text/xml; charset=utf-8'); $data = $data->saveXml(); $httpResponse = $this->httpClient->request('POST', $this->getEndpoint(), $headers, $data); return $this->response = new QueryDetailResponse($this, $httpResponse->getBody()->getContents()); } public function setTransactionReference($transactionReference) { $this->transactionReference = $transactionReference; } public function getTransactionReference() { return $this->transactionReference; } } PK ! sA��B B AbstractQueryResponse.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\Common\Message\AbstractRequest; use Omnipay\Common\Message\AbstractResponse; use Omnipay\Omnipay; /** * Authorize.Net AIM Response */ abstract class AbstractQueryResponse extends AbstractResponse { /** * http://bookofzeus.com/articles/convert-simplexml-object-into-php-array/ * * Convert a simpleXMLElement in to an array * * @todo this is duplicated from CIMAbstractResponse. Put somewhere shared. * * @param \SimpleXMLElement $xml * * @return array */ public function xml2array(\SimpleXMLElement $xml) { return json_decode(json_encode($xml), true); $arr = array(); foreach ($xml as $element) { $tag = $element->getName(); $e = get_object_vars($element); if (!empty($e)) { $arr[$tag][] = $element instanceof \SimpleXMLElement ? $this->xml2array($element) : $e; } else { $arr[$tag] = trim($element); } } return $arr; } } PK ! pl� � QueryDetailResponse.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\Common\Exception\InvalidResponseException; use Omnipay\Common\Message\AbstractRequest; use Omnipay\Omnipay; /** * Authorize.Net AIM Response */ class QueryDetailResponse extends AbstractQueryResponse { protected $planResponse; public function __construct(AbstractRequest $request, $data) { // Strip out the xmlns junk so that PHP can parse the XML $xml = preg_replace('/<getTransactionDetailsRequest[^>]+>/', '<getTransactionDetailsRequest>', (string)$data); try { $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOWARNING); } catch (\Exception $e) { throw new InvalidResponseException(); } if (!$xml) { throw new InvalidResponseException(); } parent::__construct($request, $xml); $this->transaction = $this->xml2array($this->data->transaction, true); } public function isSuccessful() { return 1 == $this->getResultCode(); } public function isRecurring() { return ($this->transaction['recurringBilling'] === 'true'); } public function getClientIp() { return $this->transaction['customerIP']; } /** * TransactionReference is the reference generated by the payment gateway. * * @return mixed */ public function getTransactionReference() { return $this->transaction['transId']; } /** * TransactionId is the reference set by the originating website. * * @return mixed */ public function getTransactionId() { return $this->transaction['order'][0]['invoiceNumber']; } public function getAmount() { return $this->transaction['settleAmount']; } public function getDescription() { return $this->transaction['order'][0]['description']; } /** * Get email. * * @return string */ public function getEmail() { return $this->transaction['customer'][0]['email']; } public function getResultCode() { return $this->transaction['responseCode']; } /** * Get the currency. * * Seems to onlys support USD. * * @return string */ public function getCurrency() { return 'USD'; } /** * Get first name. * * In practice this is billing first name. * * @return string */ public function getFirstName() { return $this->transaction['billTo'][0]['firstName']; } /** * Get the gateway generated id for the recurring transaction. */ public function getRecurringReference() { return $this->transaction['subscription'][0]['id']; } /** * Get the gateway generated id for the recurring transaction. */ public function getCustomerReference() { if (!$this->isRecurring()) { return ''; } if (!$this->planResponse) { /** @var \Omnipay\AuthorizeNet\AIMGateway $gateway */ $gateway = Omnipay::create('AuthorizeNet_AIM'); $gateway->setApiLoginId($this->request->getApiLoginId()); $gateway->setHashSecret($this->request->getHashSecret()); $gateway->setTransactionKey($this->request->getTransactionKey()); $data = array('recurringReference' => $this->getRecurringReference()); $this->planResponse = $gateway->paymentPlanQuery($data)->send(); } return $this->planResponse->getContactReference(); } /** * Get last name. * * In practice this is billing last name. * * @return string */ public function getLastName() { return $this->transaction['billTo'][0]['lastName']; } /** * Get credit card number. * * This is masked. Is this the correct parameter name. */ public function getNumber() { return $this->transaction['payment'][0]['creditCard'][0]['cardNumber']; } public function getType() { return $this->transaction['payment'][0]['creditCard'][0]['cardType']; } public function getBillingAddress1() { return $this->transaction['billTo'][0]['address']; } public function getBillingAddress2() { return ''; } public function getBillingCity() { return $this->transaction['billTo'][0]['city']; } public function getBillingPostcode() { return $this->transaction['billTo'][0]['zip']; } /** * Get billing address State. * * @todo consider if there should be other variants for full vs abbreviation. * * @return mixed */ public function getBillingState() { return $this->transaction['billTo'][0]['state']; } /** * Get billing address Country. * * @todo consider if there should be other variants for full vs abbreviation. * * @return mixed */ public function getBillingCountry() { return $this->transaction['billTo'][0]['country']; } /** * Get transaction date in UTC. * * @return string */ public function getSettlementDate() { return $this->transaction['batch'][0]['settlementTimeUTC']; } /** * Get settlement date in UTC. * * @return string */ public function getTransactionDate() { return $this->transaction['submitTimeUTC']; } } PK ! +8+Ԁ � QueryResponse.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\Omnipay; /** * Authorize.Net AIM Response */ class QueryResponse extends QueryBatchResponse { public function getData() { $data = parent::getData(); $result = array(); /** @var \Omnipay\AuthorizeNet\AIMGateway $gateway */ $gateway = Omnipay::create('AuthorizeNet_AIM'); if (!empty($data)) { foreach ($data as $batch) { // CHECKME: can these settings be moved to outside the loop? $gateway->setApiLoginId($this->request->getApiLoginId()); $gateway->setHashSecret($this->request->getHashSecret()); $gateway->setTransactionKey($this->request->getTransactionKey()); $gateway->setDeveloperMode($this->request->getDeveloperMode()); $data = array('batch_id' => $batch['batchId']); $dataResponse = $gateway->queryBatchDetail($data)->send(); $transactions = $dataResponse->getData(); foreach ($transactions as $transaction) { $detailResponse = $gateway->queryDetail(array( 'transactionReference' => $transaction['transId'] ))->send(); $result[] = $detailResponse->transaction; } } } return $result; } } PK ! `��� � QueryBatchResponse.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\Common\Exception\InvalidResponseException; use Omnipay\Common\Message\AbstractRequest; /** * Authorize.Net AIM Response */ class QueryBatchResponse extends AbstractQueryResponse { /** * For Error codes: @see * https://developer.authorize.net/api/reference/responseCodes.html */ const ERROR_RESPONSE_CODE_CANNOT_ISSUE_CREDIT = 54; public function __construct(AbstractRequest $request, $data) { // Strip out the xmlns junk so that PHP can parse the XML. $xml = preg_replace( '/<getSettledBatchListRequest[^>]+>/', '<getSettledBatchListRequest>', (string)$data ); try { $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOWARNING); } catch (\Exception $e) { throw new InvalidResponseException(); } if (!$xml) { throw new InvalidResponseException(); } parent::__construct($request, $xml); } public function isSuccessful() { return 'Ok' === $this->getResultCode(); } public function getResultCode() { $result = $this->xml2array($this->data->messages, true); return $result['messages'][0]['resultCode']; } public function getData() { return $this->xml2array($this->data->batchList, true)['batch']; } } PK ! �P� � AIMAbstractQueryRequest.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; /** * Authorize.Net AIM Abstract Request */ use Omnipay\AuthorizeNet\Message\AIMAbstractRequest; use SimpleXMLElement; abstract class AIMAbstractQueryRequest extends AIMAbstractRequest { protected $limit = 1000; protected $offset = 1; /** * Disable validation check on the parent method. */ protected function addTransactionType(SimpleXMLElement $data) { // NOOP } /** * Get Limit. * * @return int */ public function getLimit() { return $this->limit; } /** * Set Limit. * * @param int $limit */ public function setLimit($limit) { $this->limit = $limit; } /** * Get offset. * * @return int */ public function getOffset() { return $this->offset; } /** * Set offset. * * @param int $offset */ public function setOffset($offset) { $this->offset = $offset; } /** * Get data to send. */ public function getData() { $data = $this->getBaseData(); return $data; } } PK ! ���u u QueryBatchDetailRequest.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; /** * Authorize.Net AIM Authorize Request */ class QueryBatchDetailRequest extends QueryBatchRequest { protected $action = ''; protected $requestType = 'getTransactionListRequest'; protected $limit = 1000; protected $offset = 1; protected $batchID; /** * Get data to send. */ public function getData() { $data = $this->getBaseData(); $data->batchId = $this->getBatchID(); return $data; } public function sendData($data) { $headers = array('Content-Type' => 'text/xml; charset=utf-8'); $data = $data->saveXml(); $httpResponse = $this->httpClient->request( 'POST', $this->getEndpoint(), $headers, $data ); return $this->response = new QueryBatchDetailResponse( $this, $httpResponse->getBody()->getContents() ); } public function setBatchID($batchID) { $this->batchID = $batchID; } public function getBatchID() { return $this->batchID; } } PK ! *,4 4 AIMPaymentPlansQueryRequest.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\AuthorizeNet\Message\AIMAbstractRequest; /** * Authorize.Net AIM Authorize Request */ class AIMPaymentPlansQueryRequest extends AIMAbstractRequest { protected $action = ''; protected $requestType = 'ARBGetSubscriptionListRequest'; protected $limit = 1000; protected $offset = 1; /** * Get Limit. * * @return int */ public function getLimit() { return $this->limit; } /** * Get data to send. */ public function getData() { $data = $this->getBaseData(); $data->searchType = 'subscriptionActive'; $data->sorting->orderBy = 'id'; $data->sorting->orderDescending = true; $data->paging->limit = $this->getLimit(); $data->paging->offset = $this->getOffset(); return $data; } protected function addTransactionType(\SimpleXMLElement $data) { } public function sendData($data) { $headers = array('Content-Type' => 'text/xml; charset=utf-8'); $data = $data->saveXml(); $httpResponse = $this->httpClient->request('POST', $this->getEndpoint(), $headers, $data); return $this->response = new AIMPaymentPlansQueryResponse($this, $httpResponse->getBody()->getContents()); } } PK ! }o� � QueryRequest.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; /** * Authorize.Net AIM Authorize Request */ class QueryRequest extends QueryBatchRequest { const DATE_TIME_FORMAT = 'Y-m-d\Th:i:s\Z'; protected $startTimestamp; protected $endTimestamp; /** * @return int|null */ public function getStartTimestamp() { return $this->startTimestamp; } /** * @param int|null $startTimestamp unix timestamp */ public function setStartTimestamp($startTimestamp) { $this->startTimestamp = $startTimestamp; } /** * @return int|null */ public function getEndTimestamp() { return $this->endTimestamp; } /** * @param int|null $endTimestamp unix timestamp */ public function setEndTimestamp($endTimestamp) { $this->endTimestamp = $endTimestamp; } /** * Get data to send. */ public function getData() { $data = $this->getBaseData(); if ($this->getStartTimestamp()) { $data->firstSettlementDate = date( static::DATE_TIME_FORMAT, $this->getStartTimestamp() ); $data->lastSettlementDate = date(static::DATE_TIME_FORMAT); } if ($this->getEndTimestamp()) { $data->lastSettlementDate = date( static::DATE_TIME_FORMAT, $this->getEndTimestamp() ); } return $data; } public function sendData($data) { $headers = array('Content-Type' => 'text/xml; charset=utf-8'); $data = $data->saveXml(); $httpResponse = $this->httpClient->request( 'POST', $this->getEndpoint(), $headers, $data ); $this->response = new QueryResponse( $this, $httpResponse->getBody()->getContents() ); return $this->response; } } PK ! ����� � QueryBatchRequest.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; /** * Authorize.Net AIM Authorize Request */ class QueryBatchRequest extends AIMAbstractQueryRequest { protected $requestType = 'getSettledBatchListRequest'; public function sendData($data) { $headers = array('Content-Type' => 'text/xml; charset=utf-8'); $data = $data->saveXml(); $httpResponse = $this->httpClient->request( 'POST', $this->getEndpoint(), $headers, $data ); return $this->response = new QueryBatchResponse( $this, $httpResponse->getBody()->getContents() ); } } PK ! 6��� � AIMPaymentPlansQueryResponse.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\Common\Exception\InvalidResponseException; use Omnipay\Common\Message\AbstractRequest; use Omnipay\Common\Message\AbstractResponse; /** * Authorize.Net AIM Response */ class AIMPaymentPlansQueryResponse extends AbstractQueryResponse { public function __construct(AbstractRequest $request, $data) { // Strip out the xmlns junk so that PHP can parse the XML $xml = preg_replace('/<ARBGetSubscriptionListRequest[^>]+>/', '<ARBGetSubscriptionListRequest>', (string)$data); try { $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOWARNING); } catch (\Exception $e) { throw new InvalidResponseException(); } if (!$xml) { throw new InvalidResponseException(); } parent::__construct($request, $xml); } public function isSuccessful() { return 1 === $this->getResultCode(); } public function getPlanData() { $result = $this->xml2array($this->data->subscriptionDetails, true); return $result['subscriptionDetails'][0]['subscriptionDetail']; } } PK ! �\�j AIMPaymentPlanQueryResponse.phpnu �[��� <?php namespace Omnipay\AuthorizeNet\Message\Query; use Omnipay\Common\Exception\InvalidResponseException; use Omnipay\Common\Message\AbstractRequest; use Omnipay\Common\Message\AbstractResponse; use Omnipay\Omnipay; /** * Authorize.Net AIM Response */ class AIMPaymentPlanQueryResponse extends AbstractQueryResponse { protected $subscription; protected $profile; public function __construct(AbstractRequest $request, $data) { // Strip out the xmlns junk so that PHP can parse the XML $xml = preg_replace( '/<ARBGetSubscriptionRequest[^>]+>/', '<ARBGetSubscriptionRequest>', (string)$data ); try { $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOWARNING); } catch (\Exception $e) { throw new InvalidResponseException(); } if (!$xml) { throw new InvalidResponseException(); } parent::__construct($request, $xml); $result = $this->xml2array($this->data->subscription, true); $this->subscription = $result['subscription'][0]; } public function isSuccessful() { return 1 === $this->getResultCode(); } public function getData() { return $this->subscription; } public function getRecurStartDate() { return $this->subscription['paymentSchedule']['interval']['startDate']; } public function getRecurInstallmentLimit() { return $this->subscription['paymentSchedule']['interval']['totalOccurrences']; } public function getRecurrenceInterval() { return $this->subscription['paymentSchedule']['interval'][0]['length']; } public function getRecurAmount() { return $this->subscription['amount']; } public function getRecurReference() { return $this->subscription; } public function getContactReference() { $profileID = $this->subscription['profile'][0]['customerProfileId']; $gateway = $gateway = Omnipay::create('AuthorizeNet_CIM'); $gateway->setApiLoginId($this->request->getApiLoginId()); $gateway->setHashSecret($this->request->getHashSecret()); $gateway->setTransactionKey($this->request->getTransactionKey()); $data = array( 'customerProfileId' => $profileID, 'customerPaymentProfileId' => $this->subscription['profile'][0]['paymentProfile'][0]['customerPaymentProfileId'], ); $dataResponse = $gateway->getProfile($data)->send(); return $dataResponse->getCustomerId(); } /** * @todo formalise options. * * @return mixed */ public function getRecurStatus() { return $this->subscription['paymentSchedule']['interval'][0]['status']; } public function getRecurrenceUnit() { $interval = $this->subscription['paymentSchedule']['interval'][0]['unit']; $options = array( 'months' => 'month', ); return $options[$interval]; } /** * http://bookofzeus.com/articles/convert-simplexml-object-into-php-array/ * * Convert a simpleXMLElement in to an array * * @todo this is duplicated from CIMAbstractResponse. Put somewhere shared. * * @param \SimpleXMLElement $xml * * @return array */ public function xml2array(\SimpleXMLElement $xml) { $arr = array(); foreach ($xml as $element) { $tag = $element->getName(); $e = get_object_vars($element); if (!empty($e)) { $arr[$tag][] = $element instanceof \SimpleXMLElement ? $this->xml2array($element) : $e; } else { $arr[$tag] = trim($element); } } return $arr; } } PK ! �L�K K QueryBatchDetailResponse.phpnu �[��� PK ! `$� � � AIMPaymentPlanQueryRequest.phpnu �[��� PK ! ��#A A � QueryDetailRequest.phpnu �[��� PK ! sA��B B f AbstractQueryResponse.phpnu �[��� PK ! pl� � � QueryDetailResponse.phpnu �[��� PK ! +8+Ԁ � �( QueryResponse.phpnu �[��� PK ! `��� � �. QueryBatchResponse.phpnu �[��� PK ! �P� � �4 AIMAbstractQueryRequest.phpnu �[��� PK ! ���u u z9 QueryBatchDetailRequest.phpnu �[��� PK ! *,4 4 :>