File manager - Edit - /home/opticamezl/www/newok/buckaroo.tar
Back
composer.json 0000604 00000001652 15173272061 0007272 0 ustar 00 { "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" } } } tests/Message/CreditCardPurchaseRequestTest.php 0000604 00000001264 15173272061 0015716 0 ustar 00 <?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']); } } tests/Message/CompletePurchaseResponseTest.php 0000604 00000001746 15173272061 0015635 0 ustar 00 <?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()); } } tests/Message/AbstractRequestTest.php 0000604 00000006014 15173272061 0013760 0 ustar 00 <?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()); } } tests/Message/CompletePurchaseRequestTest.php 0000604 00000006252 15173272061 0015464 0 ustar 00 <?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()); } } tests/Message/PayPalPurchaseRequestTest.php 0000604 00000001256 15173272061 0015101 0 ustar 00 <?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']); } } tests/Message/IdealPurchaseRequestTest.php 0000604 00000001253 15173272061 0014726 0 ustar 00 <?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']); } } tests/IdealGatewayTest.php 0000604 00000001052 15173272061 0011615 0 ustar 00 <?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()); } } tests/PayPalGatewayTest.php 0000604 00000001055 15173272061 0011770 0 ustar 00 <?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()); } } tests/CreditCardGatewayTest.php 0000604 00000001533 15173272061 0012607 0 ustar 00 <?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()); } } CONTRIBUTING.md 0000604 00000001040 15173272061 0006770 0 ustar 00 # 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. .travis.yml 0000604 00000000317 15173272061 0006656 0 ustar 00 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 phpunit.xml.dist 0000604 00000001512 15173272061 0007716 0 ustar 00 <?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> README.md 0000604 00000003576 15173272061 0006036 0 ustar 00 # 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. .gitignore 0000604 00000000060 15173272061 0006530 0 ustar 00 /vendor composer.lock composer.phar phpunit.xml LICENSE 0000604 00000002047 15173272061 0005554 0 ustar 00 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. src/Message/PurchaseResponse.php 0000604 00000001227 15173272061 0012723 0 ustar 00 <?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; } } src/Message/CompletePurchaseRequest.php 0000604 00000001477 15173272061 0014255 0 ustar 00 <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Common\Exception\InvalidRequestException; /** * Buckaroo Complete Purchase Request */ class CompletePurchaseRequest extends AbstractRequest { public function getData() { $this->validate('websiteKey', 'secretKey', 'amount'); $originalData = $this->httpRequest->request->all(); $data = array_change_key_case($originalData, CASE_UPPER); $signature = isset($data['BRQ_SIGNATURE']) ? strtolower($data['BRQ_SIGNATURE']) : null; if ($signature !== $this->generateSignature($originalData)) { throw new InvalidRequestException('Incorrect signature'); } return $data; } public function sendData($data) { return $this->response = new CompletePurchaseResponse($this, $data); } } src/Message/AbstractRequest.php 0000604 00000003637 15173272061 0012555 0 ustar 00 <?php namespace Omnipay\Buckaroo\Message; /** * Buckaroo Abstract Request */ abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest { public $testEndpoint = 'https://testcheckout.buckaroo.nl/html/'; public $liveEndpoint = 'https://checkout.buckaroo.nl/html/'; public function getWebsiteKey() { return $this->getParameter('websiteKey'); } public function setWebsiteKey($value) { return $this->setParameter('websiteKey', $value); } public function getSecretKey() { return $this->getParameter('secretKey'); } public function setSecretKey($value) { return $this->setParameter('secretKey', $value); } public function getData() { $this->validate('websiteKey', 'secretKey', 'amount', 'returnUrl'); $data = array(); $data['Brq_websitekey'] = $this->getWebsiteKey(); $data['Brq_amount'] = $this->getAmount(); $data['Brq_currency'] = $this->getCurrency(); $data['Brq_invoicenumber'] = $this->getTransactionId(); $data['Brq_description'] = $this->getDescription(); $data['Brq_return'] = $this->getReturnUrl(); $data['Brq_returncancel'] = $this->getCancelUrl(); return $data; } public function generateSignature($data) { uksort($data, 'strcasecmp'); $str = ''; foreach ($data as $key => $value) { if (strcasecmp($key, 'Brq_signature') === 0) { continue; } $str .= $key.'='.$value; } return sha1($str.$this->getSecretKey()); } public function sendData($data) { $data['Brq_signature'] = $this->generateSignature($data); return $this->response = new PurchaseResponse($this, $data); } public function getEndpoint() { return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; } } src/Message/IdealPurchaseRequest.php 0000604 00000000441 15173272061 0013511 0 ustar 00 <?php namespace Omnipay\Buckaroo\Message; /** * Buckaroo iDeal Purchase Request */ class IdealPurchaseRequest extends AbstractRequest { public function getData() { $data = parent::getData(); $data['Brq_payment_method'] = 'ideal'; return $data; } } src/Message/CompletePurchaseResponse.php 0000604 00000001526 15173272061 0014416 0 ustar 00 <?php namespace Omnipay\Buckaroo\Message; use Omnipay\Common\Message\AbstractResponse; use Omnipay\Common\Message\RequestInterface; /** * Buckaroo Complete Purchase Response */ class CompletePurchaseResponse extends AbstractResponse { const SUCCESS = '190'; public function isSuccessful() { return static::SUCCESS === $this->getCode(); } public function getCode() { if (isset($this->data['BRQ_STATUSCODE'])) { return $this->data['BRQ_STATUSCODE']; } } public function getMessage() { if (isset($this->data['BRQ_STATUSMESSAGE'])) { return $this->data['BRQ_STATUSMESSAGE']; } } public function getTransactionReference() { if (isset($this->data['BRQ_PAYMENT'])) { return $this->data['BRQ_PAYMENT']; } } } src/Message/PayPalPurchaseRequest.php 0000604 00000000444 15173272061 0013664 0 ustar 00 <?php namespace Omnipay\Buckaroo\Message; /** * Buckaroo PayPal Purchase Request */ class PayPalPurchaseRequest extends AbstractRequest { public function getData() { $data = parent::getData(); $data['Brq_payment_method'] = 'paypal'; return $data; } } src/Message/CreditCardPurchaseRequest.php 0000604 00000000453 15173272061 0014502 0 ustar 00 <?php namespace Omnipay\Buckaroo\Message; /** * Buckaroo Credit Card Purchase Request */ class CreditCardPurchaseRequest extends AbstractRequest { public function getData() { $data = parent::getData(); $data['Brq_payment_method'] = 'visa'; return $data; } } src/IdealGateway.php 0000604 00000000555 15173272061 0010411 0 ustar 00 <?php namespace Omnipay\Buckaroo; /** * Buckaroo iDeal Gateway */ class IdealGateway extends CreditCardGateway { public function getName() { return 'Buckaroo iDeal'; } public function purchase(array $parameters = array()) { return $this->createRequest('\Omnipay\Buckaroo\Message\IdealPurchaseRequest', $parameters); } } src/CreditCardGateway.php 0000604 00000002271 15173272061 0011374 0 ustar 00 <?php namespace Omnipay\Buckaroo; use Omnipay\Common\AbstractGateway; /** * Buckaroo Credit Card Gateway */ class CreditCardGateway extends AbstractGateway { public function getName() { return 'Buckaroo Credit Card'; } public function getDefaultParameters() { return array( 'websiteKey' => '', 'secretKey' => '', 'testMode' => false, ); } public function getWebsiteKey() { return $this->getParameter('websiteKey'); } public function setWebsiteKey($value) { return $this->setParameter('websiteKey', $value); } public function getSecretKey() { return $this->getParameter('secretKey'); } public function setSecretKey($value) { return $this->setParameter('secretKey', $value); } public function purchase(array $parameters = array()) { return $this->createRequest('\Omnipay\Buckaroo\Message\CreditCardPurchaseRequest', $parameters); } public function completePurchase(array $parameters = array()) { return $this->createRequest('\Omnipay\Buckaroo\Message\CompletePurchaseRequest', $parameters); } } src/PayPalGateway.php 0000604 00000000561 15173272061 0010556 0 ustar 00 <?php namespace Omnipay\Buckaroo; /** * Buckaroo PayPal Gateway */ class PayPalGateway extends CreditCardGateway { public function getName() { return 'Buckaroo PayPal'; } public function purchase(array $parameters = array()) { return $this->createRequest('\Omnipay\Buckaroo\Message\PayPalPurchaseRequest', $parameters); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings