Файловый менеджер - Редактировать - /var/www/html/multisafepay.zip
Ðазад
PK ! �X͓ � src/Message/AbstractResponse.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; use Omnipay\Common\Message\AbstractResponse as BaseAbstractResponse; /** * @method mixed|\SimpleXMLElement getData() */ abstract class AbstractResponse extends BaseAbstractResponse { /** * {@inheritdoc} */ public function getMessage() { if (isset($this->data->error)) { return (string) $this->data->error->description; } return null; } /** * {@inheritdoc} */ public function getCode() { if (isset($this->data->error)) { return (string) $this->data->error->code; } return null; } } PK ! �Oہ � ( src/Message/CompletePurchaseResponse.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; class CompletePurchaseResponse extends AbstractResponse { /** * {@inheritdoc} */ public function isSuccessful() { return isset($this->data->ewallet->status) && 'completed' === (string) $this->data->ewallet->status; } /** * {@inheritdoc} */ public function getTransactionReference() { return isset($this->data->transaction->id) ? (string) $this->data->transaction->id : null; } /** * Is the payment created, but uncompleted? * * @return boolean */ public function isInitialized() { return isset($this->data->ewallet->status) && 'initialized' === (string) $this->data->ewallet->status; } /** * Is the payment created, but not yet exempted (credit cards)? * * @return boolean */ public function isUncleared() { return isset($this->data->ewallet->status) && 'uncleared' === (string) $this->data->ewallet->status; } /** * Is the payment canceled? * * @return boolean */ public function isCanceled() { return isset($this->data->ewallet->status) && 'canceled' === (string) $this->data->ewallet->status; } /** * Is the payment rejected? * * @return boolean */ public function isRejected() { return isset($this->data->ewallet->status) && 'declined' === (string) $this->data->ewallet->status; } /** * Is the payment refunded? * * @return boolean */ public function isRefunded() { return isset($this->data->ewallet->status) && 'refunded' === (string) $this->data->ewallet->status; } /** * Is the payment expired? * * @return boolean */ public function isExpired() { return isset($this->data->ewallet->status) && 'expired' === (string) $this->data->ewallet->status; } /** * Get raw payment status. * * @return null|string */ public function getPaymentStatus() { return isset($this->data->ewallet->status) ? (string) $this->data->ewallet->status : null; } } PK ! �!�7 src/Message/PurchaseResponse.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; use Omnipay\Common\Message\RedirectResponseInterface; class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface { /** * {@inheritdoc} */ public function getTransactionReference() { return isset($this->data->transaction->id) ? (string) $this->data->transaction->id : null; } /** * {@inheritdoc} */ public function isSuccessful() { return false; } /** * {@inheritdoc} */ public function isRedirect() { return isset($this->data->transaction->payment_url) || isset($this->data->gatewayinfo->redirecturl); } /** * {@inheritdoc} */ public function getRedirectUrl() { if (isset($this->data->gatewayinfo->redirecturl)) { return (string) $this->data->gatewayinfo->redirecturl; } elseif (isset($this->data->transaction->payment_url)) { return (string) $this->data->transaction->payment_url; } return null; } /** * {@inheritdoc} */ public function getRedirectMethod() { return 'GET'; } /** * {@inheritdoc} */ public function getRedirectData() { return null; } } PK ! X�{Q� � src/Message/AbstractRequest.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; use Omnipay\Common\Message\AbstractRequest as BaseAbstractRequest; abstract class AbstractRequest extends BaseAbstractRequest { protected $userAgent = 'Omnipay'; protected $liveEndpoint = 'https://api.multisafepay.com/ewx/'; protected $testEndpoint = 'https://testapi.multisafepay.com/ewx/'; public function getAccountId() { return $this->getParameter('accountId'); } public function setAccountId($value) { return $this->setParameter('accountId', $value); } public function getSiteId() { return $this->getParameter('siteId'); } public function setSiteId($value) { return $this->setParameter('siteId', $value); } public function getSiteCode() { return $this->getParameter('siteCode'); } public function setSiteCode($value) { return $this->setParameter('siteCode', $value); } public function getEndpoint() { return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; } /** * @return array */ protected function getHeaders() { return array( 'User-Agent' => $this->userAgent, ); } } PK ! ��A src/Message/PurchaseRequest.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; use Omnipay\Common\CreditCard; use SimpleXMLElement; /** * @method \Omnipay\MultiSafepay\Message\PurchaseResponse send() */ class PurchaseRequest extends AbstractRequest { public function getLanguage() { return $this->getParameter('language'); } public function setLanguage($value) { return $this->setParameter('language', $value); } public function getGateway() { return $this->getParameter('gateway'); } public function setGateway($value) { return $this->setParameter('gateway', $value); } public function getIssuer() { return $this->getParameter('issuer'); } public function setIssuer($value) { return $this->setParameter('issuer', $value); } public function getGoogleAnalyticsCode() { return $this->getParameter('googleAnalyticsCode'); } public function setGoogleAnalyticsCode($value) { return $this->setParameter('googleAnalyticsCode', $value); } public function getExtraData1() { return $this->getParameter('extraData1'); } public function setExtraData1($value) { return $this->setParameter('extraData1', $value); } public function getExtraData2() { return $this->getParameter('extraData2'); } public function setExtraData2($value) { return $this->setParameter('extraData2', $value); } public function getExtraData3() { return $this->getParameter('extraData3'); } public function setExtraData3($value) { return $this->setParameter('extraData3', $value); } public function getItems() { return $this->getParameter('items'); } public function setItems($value) { return $this->setParameter('items', $value); } /** * {@inheritdoc} */ public function getData() { $this->validate('transactionId', 'amount', 'currency', 'description', 'clientIp', 'card'); if ('IDEAL' === $this->getGateway() && $this->getIssuer()) { $data = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><directtransaction/>'); } else { $data = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><redirecttransaction/>'); } $data->addAttribute('ua', $this->userAgent); $merchant = $data->addChild('merchant'); $merchant->addChild('account', $this->getAccountId()); $merchant->addChild('site_id', $this->getSiteId()); $merchant->addChild('site_secure_code', $this->getSiteCode()); $merchant->addChild('notification_url', htmlspecialchars($this->getNotifyUrl())); $merchant->addChild('cancel_url', htmlspecialchars($this->getCancelUrl())); $merchant->addChild('redirect_url', htmlspecialchars($this->getReturnUrl())); /** @var CreditCard $card */ $card = $this->getCard(); $customer = $data->addChild('customer'); $customer->addChild('ipaddress', $this->getClientIp()); $customer->addChild('locale', $this->getLanguage()); $customer->addChild('email', $card->getEmail()); $customer->addChild('firstname', $card->getFirstName()); $customer->addChild('lastname', $card->getLastName()); $customer->addChild('address1', $card->getAddress1()); $customer->addChild('address2', $card->getAddress2()); $customer->addChild('zipcode', $card->getPostcode()); $customer->addChild('city', $card->getCity()); $customer->addChild('country', $card->getCountry()); $customer->addChild('phone', $card->getPhone()); $data->addChild('google_analytics', $this->getGoogleAnalyticsCode()); $transaction = $data->addChild('transaction'); $transaction->addChild('id', $this->getTransactionId()); $transaction->addChild('currency', $this->getCurrency()); $transaction->addChild('amount', $this->getAmountInteger()); $transaction->addChild('description', $this->getDescription()); $transaction->addChild('var1', $this->getExtraData1()); $transaction->addChild('var2', $this->getExtraData2()); $transaction->addChild('var3', $this->getExtraData3()); $transaction->addChild('gateway', $this->getGateway()); if ($items = $this->getItems()) { $itemsHtml = '<ul>'; foreach ($items as $item) { $itemsHtml .= "<li>{$item['quantity']} x {$item['name']}</li>"; } $itemsHtml .= '</ul>'; $transaction->addChild('items', $itemsHtml); } if ('IDEAL' === $this->getGateway() && $this->getIssuer()) { $gatewayInfo = $data->addChild('gatewayinfo'); $gatewayInfo->addChild('issuerid', $this->getIssuer()); } $data->addChild('signature', $this->generateSignature()); return $data; } /** * {@inheritdoc} */ public function sendData($data) { $httpResponse = $this->httpClient->post( $this->getEndpoint(), $this->getHeaders(), $data->asXML() )->send(); return $this->response = new PurchaseResponse($this, $httpResponse->xml()); } /** * @return string */ protected function generateSignature() { return md5( $this->getAmountInteger(). $this->getCurrency(). $this->getAccountId(). $this->getSiteId(). $this->getTransactionId() ); } } PK ! �]�{Q Q * src/Message/FetchPaymentMethodsRequest.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; use SimpleXMLElement; /** * @method \Omnipay\MultiSafepay\Message\FetchPaymentMethodsResponse send() */ class FetchPaymentMethodsRequest extends AbstractRequest { public function getCountry() { return $this->getParameter('country'); } public function setCountry($value) { return $this->setParameter('country', $value); } /** * {@inheritdoc} */ public function getData() { $data = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><gateways/>'); $data->addAttribute('ua', $this->userAgent); $merchant = $data->addChild('merchant'); $merchant->addChild('account', $this->getAccountId()); $merchant->addChild('site_id', $this->getSiteId()); $merchant->addChild('site_secure_code', $this->getSiteCode()); $customer = $data->addChild('customer'); $customer->addChild('country', $this->getCountry()); return $data; } /** * {@inheritdoc} */ public function sendData($data) { $httpResponse = $this->httpClient->post( $this->getEndpoint(), $this->getHeaders(), $data->asXML() )->send(); return $this->response = new FetchPaymentMethodsResponse($this, $httpResponse->xml()); } } PK ! +<�� # src/Message/FetchIssuersRequest.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; use SimpleXMLElement; /** * @method \Omnipay\MultiSafepay\Message\FetchIssuersResponse send() */ class FetchIssuersRequest extends AbstractRequest { /** * {@inheritdoc} */ public function getData() { $data = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><idealissuers/>'); $data->addAttribute('ua', $this->userAgent); $merchant = $data->addChild('merchant'); $merchant->addChild('account', $this->getAccountId()); $merchant->addChild('site_id', $this->getSiteId()); $merchant->addChild('site_secure_code', $this->getSiteCode()); return $data; } /** * {@inheritdoc} */ public function sendData($data) { $httpResponse = $this->httpClient->post( $this->getEndpoint(), $this->getHeaders(), $data->asXML() )->send(); return $this->response = new FetchIssuersResponse($this, $httpResponse->xml()); } } PK ! ?8K�] ] + src/Message/FetchPaymentMethodsResponse.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; class FetchPaymentMethodsResponse extends AbstractResponse { /** * {@inheritdoc} */ public function isSuccessful() { return isset($this->data->gateways); } /** * Return available payment methods as an associative array. * * @return array */ public function getPaymentMethods() { $result = array(); foreach ($this->data->gateways->gateway as $gateway) { $result[(string) $gateway->id] = (string) $gateway->description; } return $result; } } PK ! {r5C C $ src/Message/FetchIssuersResponse.phpnu �[��� <?php namespace Omnipay\MultiSafepay\Message; class FetchIssuersResponse extends AbstractResponse { /** * {@inheritdoc} */ public function isSuccessful() { return isset($this->data->issuers); } /** * Return available issuers as an associative array. * * @return array */ public function getIssuers() { $result = array(); foreach ($this->data->issuers->issuer as $issuer) { $result[(string) $issuer->code] = (string) $issuer->description; } return $result; } } PK ! 3��� � '