Файловый менеджер - Редактировать - /var/www/html/bitpay.zip
Ðазад
PK ! �-�� src/Message/PurchaseResponse.phpnu �[��� <?php namespace Omnipay\BitPay\Message; use Omnipay\Common\Message\AbstractResponse; use Omnipay\Common\Message\RedirectResponseInterface; /** * BitPay Purchase Response */ class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface { public function isSuccessful() { return false; } public function isRedirect() { return !isset($this->data['error']); } public function getMessage() { if (isset($this->data['error'])) { return $this->data['error']['type'] . ': ' . $this->data['error']['message']; } } public function getTransactionReference() { if (isset($this->data['id'])) { return $this->data['id']; } } public function getRedirectUrl() { if (isset($this->data['url'])) { return $this->data['url']; } } public function getRedirectMethod() { return 'GET'; } public function getRedirectData() { } } PK ! �"j� � src/Message/AbstractRequest.phpnu �[��� <?php namespace Omnipay\BitPay\Message; abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest { protected $liveEndpoint = 'https://bitpay.com/api'; protected $testEndpoint = 'https://test.bitpay.com/api'; public function getApiKey() { return $this->getParameter('apiKey'); } public function setApiKey($value) { return $this->setParameter('apiKey', $value); } protected function getHttpMethod() { return 'POST'; } public function getEndpoint() { return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; } public function sendData($data) { $httpRequest = $this->httpClient->createRequest( $this->getHttpMethod(), $this->getEndpoint(), array('Authorization' => 'Basic '.base64_encode($this->getApiKey().':')), $data ); $httpResponse = $httpRequest->send(); return $this->response = $this->createResponse($httpResponse->json(), $httpResponse->getStatusCode()); } protected function createResponse($data, $statusCode) { return $this->response = new PurchaseResponse($this, $data, $statusCode); } } PK ! aQ�L� � src/Message/PurchaseRequest.phpnu �[��� <?php namespace Omnipay\BitPay\Message; /** * BitPay Purchase Request */ class PurchaseRequest extends AbstractRequest { public function getData() { $this->validate('amount', 'currency'); $data = array(); $data['price'] = $this->getAmount(); $data['currency'] = $this->getCurrency(); $data['posData'] = $this->getTransactionId(); $data['itemDesc'] = $this->getDescription(); $data['notificationURL'] = $this->getNotifyUrl(); $data['redirectURL'] = $this->getReturnUrl(); return $data; } public function getEndpoint() { return parent::getEndpoint() . '/invoice'; } } PK ! ����N N % src/Message/PurchaseStatusRequest.phpnu �[��� <?php namespace Omnipay\BitPay\Message; /** * BitPay Purchase Status Request */ class PurchaseStatusRequest extends PurchaseRequest { public function getData() { $this->validate('transactionReference'); } public function getEndpoint() { return parent::getEndpoint() . '/' . $this->getTransactionReference(); } protected function getHttpMethod() { return 'GET'; } protected function createResponse($data, $statusCode) { return $this->response = new PurchaseStatusResponse($this, $data, $statusCode); } } PK ! ���' ' &