File manager - Edit - /home/opticamezl/www/newok/buckaroo.zip
Back
PK !��\�臀� � composer.jsonnu &1i� { "name": "omnipay/buckaroo", "type": "library", "description": "Buckaroo driver for the Omnipay payment processing library", "keywords": [ "buckaroo", "gateway", "merchant", "omnipay", "pay", "payment" ], "homepage": "https://github.com/thephpleague/omnipay-buckaroo", "license": "MIT", "authors": [ { "name": "Adrian Macneil", "email": "adrian@adrianmacneil.com" }, { "name": "Omnipay Contributors", "homepage": "https://github.com/thephpleague/omnipay-buckaroo/contributors" } ], "autoload": { "psr-4": { "Omnipay\\Buckaroo\\" : "src/" } }, "require": { "omnipay/common": "~2.0" }, "require-dev": { "omnipay/tests": "~2.0" }, "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } } } PK "��\�Q� � / tests/Message/CreditCardPurchaseRequestTest.phpnu &1i� <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Tests\TestCase; class CreditCardPurchaseRequestTest extends TestCase { public function setUp() { $this->request = new CreditCardPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize( array( 'websiteKey' => 'web', 'secretKey' => 'secret', 'amount' => '12.00', 'returnUrl' => 'https://www.example.com/return', ) ); } public function testGetData() { $data = $this->request->getData(); $this->assertSame('visa', $data['Brq_payment_method']); } } PK "��\7J�;� � . tests/Message/CompletePurchaseResponseTest.phpnu &1i� <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Tests\TestCase; class CompletePurchaseResponseTest extends TestCase { public function testSuccess() { $data = array( 'BRQ_STATUSCODE' => '190', 'BRQ_STATUSMESSAGE' => 'hi!', 'BRQ_PAYMENT' => '5', ); $response = new CompletePurchaseResponse($this->getMockRequest(), $data); $this->assertTrue($response->isSuccessful()); $this->assertSame('190', $response->getCode()); $this->assertSame('hi!', $response->getMessage()); $this->assertSame('5', $response->getTransactionReference()); } public function testEmpty() { $response = new CompletePurchaseResponse($this->getMockRequest(), array()); $this->assertFalse($response->isSuccessful()); $this->assertNull($response->getCode()); $this->assertNull($response->getMessage()); $this->assertNull($response->getTransactionReference()); } } PK "��\���F % tests/Message/AbstractRequestTest.phpnu &1i� <?php namespace Omnipay\Buckaroo\Message; use Mockery as m; use Omnipay\Tests\TestCase; class PurchaseRequestTest extends TestCase { public function setUp() { $this->request = m::mock('\Omnipay\Buckaroo\Message\AbstractRequest')->makePartial(); $this->request->initialize( array( 'websiteKey' => 'web', 'secretKey' => 'secret', 'amount' => '12.00', 'returnUrl' => 'https://www.example.com/return', ) ); } public function testGetData() { $this->request->initialize(array( 'websiteKey' => 'web', 'secretKey' => 'secret', 'amount' => '12.00', 'currency' => 'EUR', 'testMode' => true, 'transactionId' => 13, 'returnUrl' => 'https://www.example.com/return', 'cancelUrl' => 'https://www.example.com/cancel', )); $data = $this->request->getData(); $this->assertSame('web', $data['Brq_websitekey']); $this->assertSame('12.00', $data['Brq_amount']); $this->assertSame('EUR', $data['Brq_currency']); $this->assertSame(13, $data['Brq_invoicenumber']); $this->assertSame('https://www.example.com/return', $data['Brq_return']); $this->assertSame('https://www.example.com/cancel', $data['Brq_returncancel']); } public function testGenerateSignature() { $this->request->setSecretKey('secret'); $data = array( 'Brq_websitekey' => 'a', 'Brq_amount' => 'b', 'Brq_signature' => 'ignore', ); $expected = sha1('Brq_amount=bBrq_websitekey=asecret'); $this->assertSame($expected, $this->request->generateSignature($data)); } public function testGenerateSignatureCaseInsensitivity() { $this->request->setSecretKey('secret'); $data = array( 'Brq_websitekey' => 'a', 'Brq_amount' => 'b', 'BrQ_SIgnatURE' => 'ignore', ); $expected = sha1('Brq_amount=bBrq_websitekey=asecret'); $this->assertSame($expected, $this->request->generateSignature($data)); } public function testSend() { $response = $this->request->send(); $this->assertFalse($response->isSuccessful()); $this->assertTrue($response->isRedirect()); $this->assertSame('POST', $response->getRedirectMethod()); $this->assertSame('https://checkout.buckaroo.nl/html/', $response->getRedirectUrl()); $data = $response->getRedirectData(); $this->assertSame('web', $data['Brq_websitekey']); $this->assertArrayHasKey('Brq_signature', $data); } public function testGetEndpoint() { $this->request->setTestMode(false); $this->assertStringStartsWith('https://checkout.buckaroo.nl', $this->request->getEndpoint()); $this->request->setTestMode(true); $this->assertStringStartsWith('https://testcheckout.buckaroo.nl', $this->request->getEndpoint()); } } PK "��\�`�Ǫ � - tests/Message/CompletePurchaseRequestTest.phpnu &1i� <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Tests\TestCase; class CompletePurchaseRequestTest extends TestCase { public function setUp() { $this->request = new CompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array( 'websiteKey' => 'web', 'transactionId' => 13, 'secretKey' => 'shhhh', 'amount' => '12.00', 'currency' => 'ZAR', 'testMode' => true, )); $this->getHttpRequest()->request->replace(array()); } public function testGetData() { $this->getHttpRequest()->request->set('Brq_signature', $this->request->generateSignature($this->getHttpRequest()->request->all())); $data = $this->request->getData(); $this->assertSame(array_change_key_case($this->getHttpRequest()->request->all(), CASE_UPPER), $data); } public function testGetDataSignatureKeyCaseInsensitivity() { $this->getHttpRequest()->request->set('Brq_SignATure', $this->request->generateSignature($this->getHttpRequest()->request->all())); $data = $this->request->getData(); $this->assertArrayHasKey('BRQ_SIGNATURE', $data); } /** * @expectedException Omnipay\Common\Exception\InvalidRequestException * @expectedExceptionMessage Incorrect signature */ public function testGetDataInvalidSignature() { $this->getHttpRequest()->request->set('Brq_signature', 'zzz'); $this->request->getData(); } /** * @expectedException Omnipay\Common\Exception\InvalidRequestException * @expectedExceptionMessage Incorrect signature */ public function testGetDataMissingSignature() { $this->getHttpRequest()->request->replace(array()); $this->request->getData(); } public function testSendSuccess() { $this->getHttpRequest()->request->set('Brq_payment', '5'); $this->getHttpRequest()->request->set('Brq_statuscode', '190'); $this->getHttpRequest()->request->set('Brq_statusmessage', 'msg'); $this->getHttpRequest()->request->set('Brq_signature', $this->request->generateSignature($this->getHttpRequest()->request->all())); $response = $this->request->send(); $this->assertTrue($response->isSuccessful()); $this->assertSame('5', $response->getTransactionReference()); $this->assertSame('190', $response->getCode()); $this->assertSame('msg', $response->getMessage()); } public function testSendError() { $this->getHttpRequest()->request->set('Brq_payment', '5'); $this->getHttpRequest()->request->set('Brq_statuscode', '999'); $this->getHttpRequest()->request->set('Brq_statusmessage', 'msg'); $this->getHttpRequest()->request->set('Brq_signature', $this->request->generateSignature($this->getHttpRequest()->request->all())); $response = $this->request->send(); $this->assertFalse($response->isSuccessful()); $this->assertSame('5', $response->getTransactionReference()); $this->assertSame('999', $response->getCode()); $this->assertSame('msg', $response->getMessage()); } } PK "��\)�p�� � + tests/Message/PayPalPurchaseRequestTest.phpnu &1i� <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Tests\TestCase; class PayPalPurchaseRequestTest extends TestCase { public function setUp() { $this->request = new PayPalPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize( array( 'websiteKey' => 'web', 'secretKey' => 'secret', 'amount' => '12.00', 'returnUrl' => 'https://www.example.com/return', ) ); } public function testGetData() { $data = $this->request->getData(); $this->assertSame('paypal', $data['Brq_payment_method']); } } PK "��\?�mɫ � * tests/Message/IdealPurchaseRequestTest.phpnu &1i� <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Tests\TestCase; class IdealPurchaseRequestTest extends TestCase { public function setUp() { $this->request = new IdealPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize( array( 'websiteKey' => 'web', 'secretKey' => 'secret', 'amount' => '12.00', 'returnUrl' => 'https://www.example.com/return', ) ); } public function testGetData() { $data = $this->request->getData(); $this->assertSame('ideal', $data['Brq_payment_method']); } } PK "��\�QF* * tests/IdealGatewayTest.phpnu &1i� <?php namespace Omnipay\Buckaroo; use Omnipay\Tests\GatewayTestCase; class IdealGatewayTest extends GatewayTestCase { public function setUp() { parent::setUp(); $this->gateway = new IdealGateway($this->getHttpClient(), $this->getHttpRequest()); } public function testPurchase() { $request = $this->gateway->purchase(array('amount' => '10.00')); $this->assertInstanceOf('Omnipay\Buckaroo\Message\IdealPurchaseRequest', $request); $this->assertSame('10.00', $request->getAmount()); } } PK "��\mF:- - tests/PayPalGatewayTest.phpnu &1i� <?php namespace Omnipay\Buckaroo; use Omnipay\Tests\GatewayTestCase; class PayPalGatewayTest extends GatewayTestCase { public function setUp() { parent::setUp(); $this->gateway = new PayPalGateway($this->getHttpClient(), $this->getHttpRequest()); } public function testPurchase() { $request = $this->gateway->purchase(array('amount' => '10.00')); $this->assertInstanceOf('Omnipay\Buckaroo\Message\PayPalPurchaseRequest', $request); $this->assertSame('10.00', $request->getAmount()); } } PK "��\��[ [ tests/CreditCardGatewayTest.phpnu &1i� <?php namespace Omnipay\Buckaroo; use Omnipay\Tests\GatewayTestCase; class CreditCardGatewayTest extends GatewayTestCase { public function setUp() { parent::setUp(); $this->gateway = new CreditCardGateway($this->getHttpClient(), $this->getHttpRequest()); } public function testPurchase() { $request = $this->gateway->purchase(array('amount' => '10.00')); $this->assertInstanceOf('Omnipay\Buckaroo\Message\CreditCardPurchaseRequest', $request); $this->assertSame('10.00', $request->getAmount()); } public function testPurchaseReturn() { $request = $this->gateway->completePurchase(array('amount' => '10.00')); $this->assertInstanceOf('Omnipay\Buckaroo\Message\CompletePurchaseRequest', $request); $this->assertSame('10.00', $request->getAmount()); } } PK "��\�� CONTRIBUTING.mdnu &1i� # Contributing Guidelines * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit just the modifications, do not mess with the composer.json or CHANGELOG.md files. * Ensure your code is nicely formatted in the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) style and that all tests pass. * Send the pull request. * Check that the Travis CI build passed. If not, rinse and repeat. PK "��\�W� � .travis.ymlnu &1i� language: php php: - 5.3 - 5.4 - 5.5 - 5.6 - hhvm before_script: - composer install -n --dev --prefer-source script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text PK "��\mV�{J J phpunit.xml.distnu &1i� <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" syntaxCheck="false"> <testsuites> <testsuite name="Omnipay Test Suite"> <directory>./tests/</directory> </testsuite> </testsuites> <listeners> <listener class="Mockery\Adapter\Phpunit\TestListener" file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" /> </listeners> <filter> <whitelist> <directory>./src</directory> </whitelist> </filter> </phpunit> PK "��\���~ ~ README.mdnu &1i� # Omnipay: Buckaroo **Buckaroo driver for the Omnipay PHP payment processing library** [](https://travis-ci.org/thephpleague/omnipay-buckaroo) [](https://packagist.org/packages/omnipay/buckaroo) [](https://packagist.org/packages/omnipay/buckaroo) [Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Buckaroo support for Omnipay. ## Installation Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file: ```json { "require": { "omnipay/buckaroo": "~2.0" } } ``` And run composer to update your dependencies: $ curl -s http://getcomposer.org/installer | php $ php composer.phar update ## Basic Usage The following gateways are provided by this package: * Buckaroo * Buckaroo_Ideal * Buckaroo_PayPal For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay) repository. ## Support If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found. If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to. If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/thephpleague/omnipay-buckaroo/issues), or better yet, fork the library and submit a pull request. PK "��\'��0 0 .gitignorenu &1i� /vendor composer.lock composer.phar phpunit.xml PK "��\$��' ' LICENSEnu &1i� Copyright (c) 2012-2013 Adrian Macneil Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK "��\`��� � src/Message/PurchaseResponse.phpnu &1i� <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Common\Message\AbstractResponse; use Omnipay\Common\Message\RedirectResponseInterface; /** * Buckaroo Purchase Response */ class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface { public function isSuccessful() { return false; } public function isRedirect() { return true; } public function getRedirectUrl() { return $this->getRequest()->getEndpoint(); } public function getRedirectMethod() { return 'POST'; } public function getRedirectData() { return $this->data; } } PK "��\u_�? ? '