File manager - Edit - /home/opticamezl/www/newok/dummy.tar
Back
CONTRIBUTING.md 0000604 00000001040 15173220427 0006767 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 15173220427 0006655 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 composer.json 0000604 00000001630 15173220427 0007265 0 ustar 00 { "name": "omnipay/dummy", "type": "library", "description": "Dummy driver for the Omnipay payment processing library", "keywords": [ "dummy", "gateway", "merchant", "omnipay", "pay", "payment" ], "homepage": "https://github.com/thephpleague/omnipay-dummy", "license": "MIT", "authors": [ { "name": "Adrian Macneil", "email": "adrian@adrianmacneil.com" }, { "name": "Omnipay Contributors", "homepage": "https://github.com/thephpleague/omnipay-dummy/contributors" } ], "autoload": { "psr-4": { "Omnipay\\Dummy\\" : "src/" } }, "require": { "omnipay/common": "~2.0" }, "require-dev": { "omnipay/tests": "~2.0" }, "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } } } phpunit.xml.dist 0000604 00000001512 15173220427 0007715 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> src/Message/Response.php 0000604 00000001035 15173220427 0011224 0 ustar 00 <?php namespace Omnipay\Dummy\Message; use Omnipay\Common\Message\AbstractResponse; /** * Dummy Response */ class Response extends AbstractResponse { public function isSuccessful() { return isset($this->data['success']) && $this->data['success']; } public function getTransactionReference() { return isset($this->data['reference']) ? $this->data['reference'] : null; } public function getMessage() { return isset($this->data['message']) ? $this->data['message'] : null; } } src/Message/AuthorizeRequest.php 0000604 00000001215 15173220427 0012751 0 ustar 00 <?php namespace Omnipay\Dummy\Message; use Omnipay\Common\Message\AbstractRequest; /** * Dummy Authorize Request */ class AuthorizeRequest extends AbstractRequest { public function getData() { $this->validate('amount', 'card'); $this->getCard()->validate(); return array('amount' => $this->getAmount()); } public function sendData($data) { $data['reference'] = uniqid(); $data['success'] = 0 === substr($this->getCard()->getNumber(), -1, 1) % 2; $data['message'] = $data['success'] ? 'Success' : 'Failure'; return $this->response = new Response($this, $data); } } src/Gateway.php 0000604 00000001740 15173220427 0007446 0 ustar 00 <?php namespace Omnipay\Dummy; use Omnipay\Common\AbstractGateway; use Omnipay\Dummy\Message\AuthorizeRequest; /** * Dummy Gateway * * This gateway is useful for testing. It simply authorizes any payment made using a valid * credit card number and expiry. * * Any card number which passes the Luhn algorithm and ends in an even number is authorized, * for example: 4242424242424242 * * Any card number which passes the Luhn algorithm and ends in an odd number is declined, * for example: 4111111111111111 */ class Gateway extends AbstractGateway { public function getName() { return 'Dummy'; } public function getDefaultParameters() { return array(); } public function authorize(array $parameters = array()) { return $this->createRequest('\Omnipay\Dummy\Message\AuthorizeRequest', $parameters); } public function purchase(array $parameters = array()) { return $this->authorize($parameters); } } README.md 0000604 00000003467 15173220427 0006034 0 ustar 00 # Omnipay: Dummy **Dummy driver for the Omnipay PHP payment processing library** [](https://travis-ci.org/thephpleague/omnipay-dummy) [](https://packagist.org/packages/omnipay/dummy) [](https://packagist.org/packages/omnipay/dummy) [Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Dummy 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/dummy": "~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: * Dummy 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-dummy/issues), or better yet, fork the library and submit a pull request. LICENSE 0000604 00000002047 15173220427 0005553 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. tests/Message/ResponseTest.php 0000604 00000002002 15173220427 0012432 0 ustar 00 <?php namespace Omnipay\Dummy\Message; use Omnipay\Tests\TestCase; class ResponseTest extends TestCase { public function testSuccess() { $response = new Response( $this->getMockRequest(), array('reference' => 'abc123', 'success' => 1, 'message' => 'Success') ); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('abc123', $response->getTransactionReference()); $this->assertSame('Success', $response->getMessage()); } public function testFailure() { $response = new Response( $this->getMockRequest(), array('reference' => 'abc123', 'success' => 0, 'message' => 'Failure') ); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('abc123', $response->getTransactionReference()); $this->assertSame('Failure', $response->getMessage()); } } tests/Message/AuthorizeRequestTest.php 0000604 00000001021 15173220427 0014157 0 ustar 00 <?php namespace Omnipay\Dummy\Message; use Omnipay\Tests\TestCase; class AuthorizeRequestTest extends TestCase { public function setUp() { $this->request = new AuthorizeRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array( 'amount' => '10.00', 'card' => $this->getValidCard(), )); } public function testGetData() { $data = $this->request->getData(); $this->assertSame('10.00', $data['amount']); } } tests/GatewayTest.php 0000604 00000005176 15173220427 0010670 0 ustar 00 <?php namespace Omnipay\Dummy; use Omnipay\Tests\GatewayTestCase; class GatewayTest extends GatewayTestCase { public function setUp() { parent::setUp(); $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); $this->options = array( 'amount' => '10.00', 'card' => $this->getValidCard(), ); } public function testAuthorizeSuccess() { // card numbers ending in even number should be successful $this->options['card']['number'] = '4242424242424242'; $response = $this->gateway->authorize($this->options)->send(); $this->assertInstanceOf('\Omnipay\Dummy\Message\Response', $response); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNotEmpty($response->getTransactionReference()); $this->assertSame('Success', $response->getMessage()); } public function testAuthorizeFailure() { // card numbers ending in odd number should be declined $this->options['card']['number'] = '4111111111111111'; $response = $this->gateway->authorize($this->options)->send(); $this->assertInstanceOf('\Omnipay\Dummy\Message\Response', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNotEmpty($response->getTransactionReference()); $this->assertSame('Failure', $response->getMessage()); } public function testPurchaseSuccess() { // card numbers ending in even number should be successful $this->options['card']['number'] = '4242424242424242'; $response = $this->gateway->purchase($this->options)->send(); $this->assertInstanceOf('\Omnipay\Dummy\Message\Response', $response); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNotEmpty($response->getTransactionReference()); $this->assertSame('Success', $response->getMessage()); } public function testPurcahseFailure() { // card numbers ending in odd number should be declined $this->options['card']['number'] = '4111111111111111'; $response = $this->gateway->purchase($this->options)->send(); $this->assertInstanceOf('\Omnipay\Dummy\Message\Response', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNotEmpty($response->getTransactionReference()); $this->assertSame('Failure', $response->getMessage()); } } .gitignore 0000604 00000000060 15173220427 0006527 0 ustar 00 /vendor composer.lock composer.phar phpunit.xml
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings