diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..0d77ee1a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [barryvdh] diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..33e89767 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,43 @@ +name: Unit Tests + +on: + push: + branches: + - master + pull_request: + branches: + - "*" + schedule: + - cron: '0 0 * * *' + +jobs: + php-tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + COMPOSER_NO_INTERACTION: 1 + + strategy: + matrix: + php: [8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.4, 7.3] + dependency-version: [prefer-lowest, prefer-stable] + + name: P${{ matrix.php }} - ${{ matrix.dependency-version }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer:v2 + + - name: Install dependencies + run: | + composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress + + - name: Execute Unit Tests + run: composer test diff --git a/.gitignore b/.gitignore index 24c7d969..daea6b43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ -*.log -.DS_Store -/.idea/ /vendor composer.lock composer.phar phpunit.xml +.idea/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ddc250e3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - -env: - - SYMFONY_VERSION="2.1" GUZZLE_VERSION="3.1" - - SYMFONY_VERSION="2.*" GUZZLE_VERSION="3.1" - - SYMFONY_VERSION="2.1" GUZZLE_VERSION="3.*" - - SYMFONY_VERSION="2.*" GUZZLE_VERSION="3.*" - -before_script: - - composer self-update - - composer require symfony/http-foundation:${SYMFONY_VERSION} --no-update - - composer require guzzle/http:${GUZZLE_VERSION} --no-update - - composer install -n --dev --prefer-source - -script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d35774b..951c346f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,31 +1,170 @@ -# Changelog :zap: +Changelog +========= -# v1.0.2 (2013-07-23) +## v3.2 - 2021-06-01 -* Added MultiSafepay gateway -* Added PayPal Subject parameter -* PHPDoc fixes +Omnipay 3.2 is compatible with PHP8. This is done by upgrading the test suite to PHPUnit 8/9, with the release of omnipay/tests v4 and omnipay/common v3.1. This change is primarily for gateway developers, to make it possible to actually test PHP8, but they will need to upgrade their tests to use PHPUnit 9 (the currently supported PHPUnit version). +## v3.1 - 2020-10-29 -# v1.0.1 (2013-06-29) +Omnipay 3.1 uses Guzzle 7 by default (using the Guzzle 7 adapter). This doesn't change omnipay-common because they will work with any compatible Http Client. +The minimum PHP versions is bumped to 7.2 because of this. -* Added Buckaroo gateway -* Added eWAY Rapid 3.0 gateway -* Added `getRedirectResponse()` method to `AbstractResponse` -* A few minor bug fixes & typos +## v3.0 - 2018-05-14 -# v1.0.0 (2013-06-24) +Omnipay 3.0 focuses on separation of the HTTP Client, to be independent of Guzzle. +This release brings compatibility with the latest Symfony 3+4 and Laravel 5. +The breaking changes for applications using Omnipay are kept to a minimum. -`amount` is now specified as a decimal (i.e. `'10.00'` instead of `1000` -to represent $10.00. Passing integers will throw an exception, reminding you -to update your application code. To be clear, that means instead of this: +The `omnipay/omnipay` package name has been changed to `league/omnipay` - $gateway->purchase(array('amount' => 1000, 'currency' => 'USD')); +### Upgrading applications from Omnipay 2.x to 3.x -You must now create the request like so: +#### Breaking changes + - The `redirect()` method no calls `exit()` after sending the content. This is up to the developer now. + - An HTTP Client is required. Guzzle will be installed when using `league/omnipay`, + but otherwise you need to required your own implementation (see [PHP HTTP Clients](http://docs.php-http.org/en/latest/clients.html)) +- The `omnipay/omnipay` package name has been changed to `league/omnipay` and no longers installs all the gateways directly. - $gateway->purchase(array('amount' => '10.00', 'currency' => 'USD')); +#### Added + - It is now possible to use `setAmountInteger(integer $value)` to set the amount in the base units of the currency. + - Support for [Money for PHP](http://moneyphp.org/) objects are added, by using `setMoney(Money $money)` the Amount and Currency are set. -This should avoid any further confusion over how to specify the amount. +### Upgrading Gateways from 2.x to 3.x -* Added Mollie payment gateway -* Added `notifyUrl` and `issuer` fields to example app +The primary difference is the HTTP Client. We are now using HTTPlug (http://httplug.io/) but rely on our own interface. + +### Breaking changes +- Change typehint from Guzzle ClientInterface to `Omnipay\Common\Http\ClientInterface` +- `$client->get('..')`/`$client->post('..')` etc are removed, you can call `$client->request('GET', '')`. +- No need to call `$request->send()`, requests are sent directly. +- Instead of `$client->createRequest(..)` you can create+send the request directly with `$client->request(..)`. +- When sending a JSON body, convert the body to a string with `json_encode()` and set the correct Content-Type. +- The response is a PSR-7 Response object. You can call `$response->getBody()->getContents()` to get the body as string. +- `$response->json()` and `$response->xml()` are gone, but you can implement the logic directly. +- An HTTP Client is no longer added by default by `omnipay/common`, but `league/omnipay` will add Guzzle. +Gateways should not rely on Guzzle or other clients directly. +- `$body` should be a string (eg. `http_build_query($data)` or `json_encode($data)` instead of just `$data`). +- The `$headers` parameters should be an `array` (not `null`, but can be empty) + +Examples: +```php +// V2 XML: + $response = $this->httpClient->post($this->endpoint, null, $data)->send(); + $result = $httpResponse->xml(); + +// V3 XML: + $response = $this->httpClient->request('POST', $this->endpoint, [], http_build_query($data)); + $result = simplexml_load_string($httpResponse->getBody()->getContents()); +``` + +```php +// Example JSON request: + + $response = $this->httpClient->request('POST', $this->endpoint, [ + 'Accept' => 'application/json', + 'Content-Type' => 'application/json', + ], json_encode($data)); + + $result = json_decode($response->getBody()->getContents(), true); +``` + +#### Testing changes + +PHPUnit is upgraded to PHPUnit 6. Common issues: + +- `setExpectedException()` is removed + +```php +// PHPUnit 5: +$this->setExpectedException($class, $message); + +// PHPUnit 6: +$this->expectException($class); +$this->expectExceptionMessage($message); +``` + +- Tests that do not perform any assertions, will be marked as risky. This can be avoided by annotating them with ` @doesNotPerformAssertions` + +- You should remove the `Mockery\Adapter\Phpunit\TestListener` in phpunit.xml.dist + + +## v2.0.0 - 2013-11-17 + +### Package Separation + +As of 2.0, Omnipay has been split into separate packages. Core functionality is contained within the [omnipay/common](https://github.com/omnipay/common) repository, and all gateways have their own repositories. This means that if your project only requires on a single gateway, you can load it without installing all of the other gateways. All officially supported gateways can be found under the [Omnipay GitHub organization](//github.com/omnipay). + +If you want to install all gateways, you can still use the `omnipay/omnipay` metapackage in `composer.json`: + +~~~ javascript +{ + "require": { + "omnipay/omnipay": "~2.0" + } +} +~~~ + +Alternatively, if you want to migrate to an individual gateway, simply change your `composer.json` file to reference the specific gateway (`omnipay/common` will be included for you automatically): + +~~~ javascript +{ + "require": { + "omnipay/paypal": "~2.0" + } +} +~~~ + +### Breaking Changes + +The `GatewayFactory` class can no longer be called in a static fashion. To help those who want to use dependency injection, you can now create an instance of GatewayFactory: + +~~~ php +$factory = new GatewayFactory(); +$gateway = $factory->create('PayPal_Express'); +~~~ + +The following code is invalid and will no longer work: + +~~~ php +$gateway = GatewayFactory::create('PayPal_Express'); // will cause PHP error! +~~~ + +If you want to continue to use static methods for simplicity, you can use the new Omnipay class: + +~~~ php +// at the top of your PHP file +use Omnipay\Omnipay; + +// further down when you need to create the gateway +$gateway = Omnipay::create('PayPal_Express'); +~~~ + +Behind the scenes, this will create a GatewayFactory instance for you and call the appropriate method on it. + +### Additions + +**Omnipay now supports sending line-item data to gateways.** Currently this is only supported by the PayPal gateway. Line item details can be added to a request like so: + +~~~ php +$request->setItems(array( + array('name' => 'Food', 'quantity' => 1, 'price' => '40.00'), + array('name' => 'Drinks', 'quantity' => 2, 'price' => '6.00'), +)); +~~~ + +For more details, see the [pull request](https://github.com/omnipay/omnipay/pull/154). + +**Omnipay now also supports modifying request data before it is sent to the gateway.**. This allows you to send arbitrary custom data with a request, even if Omnipay doesn't support a parameter directly. To modify the request data, instead of calling `send()` directly on the request, you may use the new `sendData()` method: + +~~~ php +// standard method - send default data +$response = $request->send(); + +// new method - get and send custom data +$data = $request->getData(); +$data['customParameter'] = true; + +$response = $request->sendData($data); +~~~ + +For more details, see the [pull request](https://github.com/omnipay/omnipay/pull/162). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..6ad2b7f9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,11 @@ +# 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. +* Don't forget to check all versionnumbers and tag it correctly in GIT ;) +* Send the pull request. +* Check that the Travis CI build passed. If not, rinse and repeat. diff --git a/LICENSE b/LICENSE index d49d0a9d..55cf185f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012-2013 Adrian Macneil +Copyright (c) 2012-2018 Adrian Macneil Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index 1fdca33b..3b1f96a5 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # Omnipay -**An easy to use, consistent payment processing library for PHP 5.3+** +**An easy to use, consistent payment processing library for PHP** -[![Build Status](https://travis-ci.org/adrianmacneil/omnipay.png?branch=master)](https://travis-ci.org/adrianmacneil/omnipay) -[![Latest Stable Version](https://poser.pugx.org/omnipay/omnipay/version.png)](https://packagist.org/packages/omnipay/omnipay) -[![Total Downloads](https://poser.pugx.org/omnipay/omnipay/d/total.png)](https://packagist.org/packages/omnipay/omnipay) +[![Unit Tests](https://github.com/thephpleague/omnipay/actions/workflows/run-tests.yml/badge.svg)](https://github.com/thephpleague/omnipay/actions/workflows/run-tests.yml) +[![Latest Stable Version](https://poser.pugx.org/omnipay/common/version)](https://packagist.org/packages/omnipay/common) +[![Total Downloads](https://poser.pugx.org/omnipay/common/d/total)](https://packagist.org/packages/omnipay/common) Omnipay is a payment processing library for PHP. It has been designed based on ideas from [Active Merchant](http://activemerchant.org/), plus experience implementing -dozens of gateways for [CI Merchant](http://ci-merchant.org/). It has a clear and consistent API, +dozens of gateways for [CI Merchant]. It has a clear and consistent API, is fully unit tested, and even comes with an example application to get you started. **Why use Omnipay instead of a gateway's official PHP package/example code?** @@ -19,30 +19,25 @@ is fully unit tested, and even comes with an example application to get you star * Because most payment gateways have exceptionally poor documentation * Because you are writing a shopping cart and need to support multiple gateways -**Important Note: Upgrading from <1.0** - -If you are upgrading from a pre-1.0 version of Omnipay, please note that the currency format has changed. -See the [changelog](https://github.com/adrianmacneil/omnipay/blob/master/CHANGELOG.md) for more details. - ## TL;DR Just want to see some code? ```php -use Omnipay\Common\GatewayFactory; +use Omnipay\Omnipay; -$gateway = GatewayFactory::create('Stripe'); +$gateway = Omnipay::create('Stripe'); $gateway->setApiKey('abc123'); -$formData = ['number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123']; -$response = $gateway->purchase(['amount' => '10.00', 'currency' => 'USD', 'card' => $formData])->send(); +$formData = array('number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2030', 'cvv' => '123'); +$response = $gateway->purchase(array('amount' => '10.00', 'currency' => 'USD', 'card' => $formData))->send(); -if ($response->isSuccessful()) { - // payment was successful: update database - print_r($response); -} elseif ($response->isRedirect()) { +if ($response->isRedirect()) { // redirect to offsite payment gateway $response->redirect(); +} elseif ($response->isSuccessful()) { + // payment was successful: update database + print_r($response); } else { // payment failed: display message to customer echo $response->getMessage(); @@ -54,74 +49,256 @@ as possible the differences between the various payments gateways. ## Package Layout -Omnipay is a single package which provides abstract base classes and implementations for all -officially supported gateways. There are no dependencies on official payment gateway PHP packages - +Omnipay is a collection of packages which all depend on the +[omnipay/common](https://github.com/thephpleague/omnipay-common) package to provide +a consistent interface. There are no dependencies on official payment gateway PHP packages - we prefer to work with the HTTP API directly. Under the hood, we use the popular and powerful -[Guzzle](http://guzzlephp.org/) library to make HTTP requests. +[PHP-HTTP](http://docs.php-http.org/en/latest/index.html) library to make HTTP requests. +A [Guzzle](http://guzzlephp.org/) adapter is required by default, when using `league/omnipay`. -New gateways can either be added by forking this package and submitting a pull request -(unit tests and tidy code required), or by distributing a separate library which depends on this -package and makes use of our base classes and consistent developer API. +New gateways can be created by cloning the layout of an existing package. When choosing a +name for your package, please don't use the `omnipay` vendor prefix, as this implies that +it is officially supported. You should use your own username as the vendor prefix, and prepend +`omnipay-` to the package name to make it clear that your package works with Omnipay. +For example, if your GitHub username was `santa`, and you were implementing the `giftpay` +payment library, a good name for your composer package would be `santa/omnipay-giftpay`. ## Installation -Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it -to your `composer.json` file: +Omnipay is installed via [Composer](https://getcomposer.org/). +For most uses, you will need to require `league/omnipay` and an individual gateway: -```json -{ - "require": { - "omnipay/omnipay": "1.*" - } -} +``` +composer require league/omnipay:^3 omnipay/paypal +``` + +If you want to use your own HTTP Client instead of Guzzle (which is the default for `league/omnipay`), +you can require `omnipay/common` and any `php-http/client-implementation` (see [PHP Http](http://docs.php-http.org/en/latest/clients.html)) + +``` +composer require league/common:^3 omnipay/paypal php-http/buzz-adapter ``` -And run composer to update your dependencies: +## Upgrade from v2 to v3 - $ curl -s http://getcomposer.org/installer | php - $ php composer.phar update +If your gateway is supported for v3, you can require that version. Make sure you require `league/omnipay` or a separate Http Adapter. + +If there is no version for v3 yet, please raise an issue or upgrade the gateways yourself and create a PR. +See the [Upgrade guide for omnipay/common](https://github.com/thephpleague/omnipay-common/blob/master/UPGRADE.md) + +> Note: The package name has been changed from `omnipay/omnipay` to `league/omnipay` for v3 ## Payment Gateways -All payment gateways must implement [GatewayInterface](https://github.com/adrianmacneil/omnipay/blob/master/src/Omnipay/Common/GatewayInterface.php), and will usually -extend [AbstractGateway](https://github.com/adrianmacneil/omnipay/blob/master/src/Omnipay/Common/AbstractGateway.php) for basic functionality. - -The following gateways are already implemented: - -* 2Checkout -* Authorize.Net AIM -* Authorize.Net SIM -* Buckaroo -* CardSave -* Dummy -* eWAY Rapid 3.0 -* GoCardless -* Manual -* Migs 2-Party -* Migs 3-Party -* Mollie -* MultiSafepay -* Netaxept (BBS) -* Netbanx -* PayFast -* Payflow Pro -* PaymentExpress (DPS) PxPay -* PaymentExpress (DPS) PxPost -* PayPal Express Checkout -* PayPal Payments Pro -* Pin Payments -* Sage Pay Direct -* Sage Pay Server -* SecurePay Direct Post -* Stripe -* WorldPay +All payment gateways must implement [GatewayInterface](https://github.com/thephpleague/omnipay-common/blob/master/src/Common/GatewayInterface.php), and will usually +extend [AbstractGateway](https://github.com/thephpleague/omnipay-common/blob/master/src/Common/AbstractGateway.php) for basic functionality. + +The following gateways are available: + +Gateway | 2.x | 3.x | Composer Package | Maintainer +--- | --- | --- | --- | --- +[2c2p](https://github.com/dilab/omnipay-2c2p) | ✓ | ✓ | dilab/omnipay-2c2p | [Xu Ding](https://github.com/dilab) +[2Checkout](https://github.com/thephpleague/omnipay-2checkout) | ✓ | - | omnipay/2checkout | [Omnipay](https://github.com/thephpleague/omnipay) +[2Checkout Improved](https://github.com/collizo4sky/omnipay-2checkout) | ✓ | - | collizo4sky/omnipay-2checkout | [Agbonghama Collins](https://github.com/collizo4sky) +[99Bill](https://github.com/laraveler/omnipay-99bill) | - | ✓ | x-class/omnipay-99bill | [Laraveler](https://github.com/laraveler) +[Acapture (PayVision)](https://github.com/queueup-dev/omnipay-acapture) | ✓ | - | qup/omnipay-acapture | [Niels de Vries](https://github.com/niels-qup) +[Adyen](https://github.com/academe/omnipay-adyen) | - | ✓ | academe/omnipay-adyen | [Jason Judge](https://github.com/judgej) +[Affirm](https://github.com/eduardlleshi/omnipay-affirm) | ✓ | ✓ | eduardlleshi/omnipay-affirm | [Eduard Lleshi](https://github.com/eduardlleshi) +[Agms](https://github.com/agmscode/omnipay-agms) | ✓ | - | agmscode/omnipay-agms | [Maanas Royy](https://github.com/maanas) +[Alipay(Global)](https://github.com/lokielse/omnipay-global-alipay) | ✓ | ✓ | lokielse/omnipay-global-alipay | [Loki Else](https://github.com/lokielse) +[Alipay](https://github.com/lokielse/omnipay-alipay) | ✓ | ✓ | lokielse/omnipay-alipay | [Loki Else](https://github.com/lokielse) +[Allied Wallet](https://github.com/delatbabel/omnipay-alliedwallet) | ✓ | - | delatbabel/omnipay-alliedwallet | [Del](https://github.com/delatbabel) +[Arca](https://github.com/k3rnel/omnipay-arca) | - | ✓ | k3rnel/omnipay-arca | [Poghos Boyajyan](https://github.com/k3rnel) +[Authorize.Net](https://github.com/thephpleague/omnipay-authorizenet) | ✓ | ✓ | omnipay/authorizenet | [Jason Judge](https://github.com/judgej) +[Authorize.Net API](https://github.com/academe/omnipay-authorizenetapi) | - | ✓ | academe/omnipay-authorizenetapi | [Jason Judge](https://github.com/judgej) +[Authorize.Net Recurring Billing](https://github.com/cimpleo/omnipay-authorizenetrecurring) | - | ✓ | cimpleo/omnipay-authorizenetrecurring | [CimpleO](https://github.com/cimpleo) +[Bankart](https://github.com/ampeco/omnipay-bankart) | ✓ | ✓ | ampeco/omnipay-bankart | [Ampeco](https://github.com/ampeco) +[Barclays ePDQ](https://github.com/digitickets/omnipay-barclays-epdq) | ✓ | - | digitickets/omnipay-barclays-epdq | [DigiTickets](https://github.com/digitickets) +[BlueOrange bank](https://github.com/DeH4eG/omnipay-blueorange) | - | ✓ | deh4eg/omnipay-blueorange | [Denis Smolakov](https://github.com/DeH4eG) +[Beanstream](https://github.com/lemonstand/omnipay-beanstream) | ✓ | - | lemonstand/omnipay-beanstream | [LemonStand](https://github.com/lemonstand) +[BitPay](https://github.com/hiqdev/omnipay-bitpay) | ✓ | ✓ | hiqdev/omnipay-bitpay | [HiQDev](https://github.com/hiqdev) +[BKM Express](https://github.com/yasinkuyu/omnipay-bkm) | ✓ | - | yasinkuyu/omnipay-bkm | [Yasin Kuyu](https://github.com/yasinkuyu) +[BlueSnap](https://github.com/vimeo/omnipay-bluesnap) | ✓ | - | vimeo/omnipay-bluesnap | [Vimeo](https://github.com/vimeo) +[Braintree](https://github.com/thephpleague/omnipay-braintree) | ✓ | ✓ | omnipay/braintree | [Omnipay](https://github.com/thephpleague/omnipay) +[Buckaroo](https://github.com/thephpleague/omnipay-buckaroo) | ✓ | - | omnipay/buckaroo | [Omnipay](https://github.com/thephpleague/omnipay) +[CardGate](https://github.com/cardgate/omnipay-cardgate) | ✓ | - | cardgate/omnipay-cardgate | [CardGate](https://github.com/cardgate) +[CardSave](https://github.com/thephpleague/omnipay-cardsave) | ✓ | - | omnipay/cardsave | [Omnipay](https://github.com/thephpleague/omnipay) +[CashBaBa](https://github.com/tapos007/omnipay-cashbaba) | ✓ | ✓ | omnipay/cashbaba | [Recursion Technologies Ltd](https://github.com/tapos007) +[Checkout.com](https://github.com/fotografde/omnipay-checkoutcom) | ✓ | - | fotografde/checkoutcom | [fotograf.de](https://github.com/fotografde) +[CloudBanking](https://github.com/spsingh/omnipay-cloudbanking) | ✓ | - | cloudbanking/omnipay-cloudbanking | [Cloudbanking](http://cloudbanking.com.au/) +[Coinbase](https://github.com/thephpleague/omnipay-coinbase) | ✓ | - | omnipay/coinbase | [Omnipay](https://github.com/thephpleague/omnipay) +[CoinGate](https://github.com/coingate/omnipay-coingate) | ✓ | - | coingate/omnipay-coingate | [CoinGate](https://github.com/coingate) +[CoinPayments](https://github.com/InkedCurtis/omnipay-coinpayments) | ✓ | ✓ | InkedCurtis/omnipay-coinpayments | [InkedCurtis](https://github.com/InkedCurtis) +[Creditcall](https://github.com/meebio/omnipay-creditcall) | ✓ | - | meebio/omnipay-creditcall | [John Jablonski](https://github.com/jan-j) +[CSOB](https://github.com/bileto/omnipay-csob) (GP WebPay) | ✓ | - | bileto/omnipay-csob | +[Cybersource](https://github.com/dioscouri/omnipay-cybersource) | ✓ | ✓ | dioscouri/omnipay-cybersource | [Dioscouri Design](https://github.com/dioscouri) +[Cybersource SOAP](https://github.com/Klinche/omnipay-cybersource-soap) | ✓ | - | dabsquared/omnipay-cybersource-soap | [DABSquared](https://github.com/DABSquared) +[DataCash](https://github.com/digitickets/omnipay-datacash) | ✓ | - | digitickets/omnipay-datacash | [DigiTickets](https://github.com/digitickets) +[Datatrans](https://github.com/w-vision/omnipay-datatrans) | ✓ | - | w-vision/datatrans | [Dominik Pfaffenbauer](https://github.com/dpfaffenbauer) +[Datatrans](https://github.com/academe/omnipay-datatrans) | ✓ | ✓ | academe/omnipay-datatrans | [Jason Judge](https://github.com/judgej) +[Docdata Payments](https://github.com/Uskur/omnipay-docdata-payments) | ✓ | ✓ | uskur/omnipay-docdata-payments | [Uskur](https://github.com/Uskur) +[Dummy](https://github.com/thephpleague/omnipay-dummy) | ✓ | ✓ | omnipay/dummy | [Del](https://github.com/delatbabel) +[Ebanx](https://github.com/descubraomundo/omnipay-ebanx) | - | ✓ | descubraomundo/omnipay-ebanx | [Descubra o Mundo](https://github.com/descubraomundo/) +[eGHL](https://bitbucket.org/eghl/eghl-omnipay/src/master/) | - | ✓ | e-ghl/omnipay | [Jawad Humayun](https://bitbucket.org/jawad242/) +[eGHL](https://github.com/dilab/omnipay-eghl) | ✓ | ✓ | dilab/omnipay-eghl | [Xu Ding](https://github.com/dilab) +[eCoin](https://github.com/hiqdev/omnipay-ecoin) | ✓ | ✓ | hiqdev/omnipay-ecoin | [HiQDev](https://github.com/hiqdev) +[ecoPayz](https://github.com/dercoder/omnipay-ecopayz) | ✓ | - | dercoder/omnipay-ecopayz | [Alexander Fedra](https://github.com/dercoder) +[eSewa](https://github.com/sudiptpa/esewa) | - | ✓ | sudiptpa/omnipay-esewa | [Sujip Thapa](https://github.com/sudiptpa) +[EgopayRu](https://github.com/pinguinjkeke/omnipay-egopaymentru) | ✓ | - | pinguinjkeke/omnipay-egopaymentru | [Alexander Avakov](https://github.com/pinguinjkeke) +[Elavon](https://github.com/lxrco/omnipay-elavon) | ✓ | ✓ | lxrco/omnipay-elavon | [Korri](https://github.com/Korri) +[ePayments](https://github.com/hiqdev/omnipay-epayments) | ✓ | ✓ | hiqdev/omnipay-epayments | [HiQDev](https://github.com/hiqdev) +[ePayService](https://github.com/hiqdev/omnipay-epayservice) | ✓ | ✓ | hiqdev/omnipay-epayservice | [HiQDev](https://github.com/hiqdev) +[eWAY](https://github.com/thephpleague/omnipay-eway) | ✓ | ✓ | omnipay/eway | [Del](https://github.com/delatbabel) +[Fasapay](https://github.com/andreas22/omnipay-fasapay) | ✓ | - | andreas22/omnipay-fasapay | [Andreas Christodoulou](https://github.com/andreas22) +[Faspay](https://github.com/David-Kurniawan/omnipay-faspay) | ✓ | ✓ | David-Kurniawan/omnipay-faspay | [David](https://github.com/David-Kurniawan) +[Fat Zebra](https://github.com/delatbabel/omnipay-fatzebra) | ✓ | - | delatbabel/omnipay-fatzebra | [Del](https://github.com/delatbabel) +[FreeKassa](https://github.com/hiqdev/omnipay-freekassa) | ✓ | ✓ | hiqdev/omnipay-freekassa | [HiQDev](https://github.com/hiqdev) +[Fibank](https://github.com/ampeco/omnipay-fibank) | - | ✓ | ampeco/omnipay-fibank | [Ampeco](https://github.com/ampeco) +[First Data](https://github.com/thephpleague/omnipay-firstdata) | ✓ | - | omnipay/firstdata | [OmniPay](https://github.com/thephpleague/omnipay) +[Flo2cash](https://github.com/guisea/omnipay-flo2cash) | ✓ | - | guisea/omnipay-flo2cash | [Aaron Guise](https://github.com/guisea) +[Free / Zero Amount](https://github.com/colinodell/omnipay-zero) | ✓ | - | colinodell/omnipay-zero | [Colin O'Dell](https://github.com/colinodell) +[GiroCheckout](https://github.com/academe/Omnipay-GiroCheckout) | ✓ | ✓ | academe/omnipay-girocheckout | [Jason Judge](https://github.com/judgej) +[Globalcloudpay](https://github.com/dercoder/omnipay-globalcloudpay) | ✓ | - | dercoder/omnipay-globalcloudpay | [Alexander Fedra](https://github.com/dercoder) +[GoCardless](https://github.com/thephpleague/omnipay-gocardless) | ✓ | - | omnipay/gocardless | [Del](https://github.com/delatbabel) +[GoPay](https://github.com/bileto/omnipay-gopay) | ✓ | - | bileto/omnipay-gopay | +[GovPayNet](https://github.com/flexcoders/omnipay-govpaynet) | ✓ | - | omnipay/omnipay-govpaynet | [FlexCoders](https://github.com/flexcoders) +[GVP (Garanti)](https://github.com/yasinkuyu/omnipay-gvp) | ✓ | - | yasinkuyu/omnipay-gvp | [Yasin Kuyu](https://github.com/yasinkuyu) +[GVP (Garanti)](https://github.com/emr/omnipay-gvp) | - | ✓ | emr/omnipay-gvp | [Emre Akinci](https://github.com/emr) +[Helcim](https://github.com/academe/omnipay-helcim) | ✓ | - | academe/omnipay-helcim | [Jason Judge](https://github.com/judgej) +[Icepay Payments](https://github.com/superbrave/omnipay-icepay-payments) | - | ✓ | superbrave/omnipay-icepay-payments | [SuperBrave](https://github.com/superbrave) +[iDram](https://github.com/ptuchik/omnipay-idram) | - | ✓ | ptuchik/omnipay-idram | [Avik Aghajanyan](https://github.com/ptuchik) +[iDeal](https://github.com/deniztezcan/omnipay-ideal) | - | ✓ | deniztezcan/omnipay-ideal | [Deniz Tezcan](https://github.com/deniztezcan) +[Ingenico ePayments](https://github.com/deniztezcan/omnipay-ingenico-epayments) | - | ✓ | deniztezcan/omnipay-ingenico-epayments | [Deniz Tezcan](https://github.com/deniztezcan) +[iPay88](https://github.com/dilab/omnipay-ipay88) | ✓ | ✓ | dilab/omnipay-ipay88 | [Xu Ding](https://github.com/dilab) +[IfthenPay](https://github.com/ifthenpay/omnipay-ifthenpay) | ✓ | - | ifthenpay/omnipay-ifthenpay | [Rafael Almeida](https://github.com/rafaelcpalmeida) +[Ikajo](https://github.com/hiqdev/omnipay-ikajo) | ✓ | ✓ | hiqdev/omnipay-ikajo | [HiQDev](https://github.com/hiqdev) +[InterKassa](https://github.com/hiqdev/omnipay-interkassa) | ✓ | ✓ | hiqdev/omnipay-interkassa | [HiQDev](https://github.com/hiqdev) +[InovioPay](https://github.com/mvestil/omnipay-inoviopay) | ✓ | ✓ | mvestil/omnipay-inoviopay | [Mark Vestil](https://github.com/mvestil) +[Iyzico](https://github.com/yasinkuyu/omnipay-iyzico) | ✓ | - | yasinkuyu/omnipay-iyzico | [Yasin Kuyu](https://github.com/yasinkuyu) +[Judo Pay](https://github.com/Transportersio/omnipay-judopay) | ✓ | - | transportersio/omnipay-judopay | [Transporters.io](https://github.com/Transportersio) +[Klarna Checkout](https://github.com/MyOnlineStore/omnipay-klarna-checkout) | ✓ | ✓ | myonlinestore/omnipay-klarna-checkout | [MyOnlineStore](https://github.com/MyOnlineStore) +[Laybuy](https://github.com/mediabeastnz/omnipay-laybuy) | ✓ | - | mediabeastnz/omnipay-laybuy | [Myles Derham](https://github.com/mediabeastnz) +[Luminor Gateway](https://github.com/DeH4eG/omnipay-luminor) | - | ✓ | deh4eg/omnipay-luminor | [Denis Smolakov](https://github.com/DeH4eG) +[Komerci (Rede, former RedeCard)](https://github.com/byjg/omnipay-komerci) | ✓ | - | byjg/omnipay-komerci | [João Gilberto Magalhães](https://github.com/byjg) +[Komoju](https://github.com/dannyvink/omnipay-komoju) | ✓ | - | vink/omnipay-komoju | [Danny Vink](https://github.com/dannyvink) +[Midtrans](https://github.com/dilab/omnipay-midtrans) | ✓ | ✓ | dilab/omnipay-midtrans | [Xu Ding](https://github.com/dilab) +[MercadoPago](https://github.com/lucassmacedo/omnipay-mercadopago) | - | ✓ | lucassmacedo/omnipay-mercadopago | [Lucas Macedo](https://github.com/lucassmacedo) +[Magnius](https://github.com/fruitcake/omnipay-magnius) | - | ✓ | fruitcake/omnipay-magnius | [Fruitcake](https://github.com/fruitcake) +[Manual](https://github.com/thephpleague/omnipay-manual) | ✓ | - | omnipay/manual | [Del](https://github.com/delatbabel) +[Migs](https://github.com/thephpleague/omnipay-migs) | ✓ | - | omnipay/migs | [Omnipay](https://github.com/thephpleague/omnipay) +[Mpesa](https://github.com/wasksofts/omnipay-mpesa) | ✓ | - | wasksofts/omnipay-mpesa | [wasksofts](https://github.com/wasksofts/omnipay-mpesa) +[MTNCAM Mobile Money](https://github.com/larrytech7/omnipay-momocm) | ✓ | ✓ | larrytech7/omnipay-momocm | [Akah Harvey](https://github.com/larrytech7) +[Mollie](https://github.com/thephpleague/omnipay-mollie) | ✓ | ✓ | omnipay/mollie | [Barry vd. Heuvel](https://github.com/barryvdh) +[MOLPay](https://github.com/leesiongchan/omnipay-molpay) | ✓ | - | leesiongchan/molpay | [Lee Siong Chan](https://github.com/leesiongchan) +[MoMo](https://github.com/phpviet/omnipay-momo) | - | ✓ | phpviet/omnipay-momo | [PHPViet](https://github.com/phpviet) +[Moneris](https://github.com/unoapp-dev/omnipay-moneris) | - | ✓ | unoapp-dev/omnipay-moneris | [UNOapp Dev](https://github.com/unoapp-dev) +[MultiCards](https://github.com/incube8/omnipay-multicards) | ✓ | - | incube8/omnipay-multicards | [Del](https://github.com/delatbabel) +[MultiSafepay](https://github.com/thephpleague/omnipay-multisafepay) | ✓ | - | omnipay/multisafepay | [Alexander Deruwe](https://github.com/aderuwe) +[MyCard](https://github.com/xxtime/omnipay-mycard) | ✓ | - | xxtime/omnipay-mycard | [Joe Chu](https://github.com/xxtime) +[MyFatoorah](https://github.com/my-fatoorah/omnipay-myfatoorah) | - | ✓ | myfatoorah/omnipay | [MyFatoorah Plugins Team](https://github.com/my-fatoorah) +[National Australia Bank (NAB) Transact](https://github.com/sudiptpa/omnipay-nabtransact) | ✓ | ✓ | sudiptpa/omnipay-nabtransact | [Sujip Thapa](https://github.com/sudiptpa) +[NestPay (EST)](https://github.com/yasinkuyu/omnipay-nestpay) | ✓ | - | yasinkuyu/omnipay-nestpay | [Yasin Kuyu](https://github.com/yasinkuyu) +[NestPay (EST)](https://github.com/uskur/omnipay-nestpay) | - | ✓ | uskur/omnipay-nestpay | [Uskur](https://github.com/uskur) +[Netaxept (BBS)](https://github.com/thephpleague/omnipay-netaxept) | ✓ | - | omnipay/netaxept | [Omnipay](https://github.com/thephpleague/omnipay) +[Netbanx](https://github.com/thephpleague/omnipay-netbanx) | ✓ | - | omnipay/netbanx | [Maks Rafalko](https://github.com/borNfreee) +[Neteller](https://github.com/dercoder/omnipay-neteller) | ✓ | - | dercoder/omnipay-neteller | [Alexander Fedra](https://github.com/dercoder) +[NetPay](https://github.com/netpay/omnipay-netpay) | ✓ | - | netpay/omnipay-netpay | [NetPay](https://github.com/netpay) +[Network Merchants Inc. (NMI)](https://github.com/mfauveau/omnipay-nmi) | ✓ | - | mfauveau/omnipay-nmi | [Matthieu Fauveau](https://github.com/mfauveau) +[Nocks](https://github.com/nocksapp/checkout-omnipay) | ✓ | ✓ | nocksapp/omnipay-nocks | [Nocks](https://github.com/nocksapp) +[Nuvei](https://github.com/diversifiedtech/omnipay-nuvei) | - | ✓ | nmc9/omnipay-nuvei | [DiversifiedTech](https://github.com/diversifiedtech) +[OkPay](https://github.com/hiqdev/omnipay-okpay) | ✓ | ✓ | hiqdev/omnipay-okpay | [HiQDev](https://github.com/hiqdev) +[OnePay](https://github.com/dilab/omnipay-onepay) | ✓ | ✓ | dilab/omnipay-onepay | [Xu Ding](https://github.com/dilab) +[Openpay Australia](https://github.com/sudiptpa/openpay) | ✓ | ✓ | sudiptpa/omnipay-openpay | [Sujip Thapa](https://github.com/sudiptpa) +[Oppwa](https://github.com/vdbelt/omnipay-oppwa) | ✓ | ✓ | vdbelt/omnipay-oppwa | [Martin van de Belt](https://github.com/vdbelt) +[PAY. (Pay.nl & Pay.be)](https://github.com/paynl/omnipay-paynl) | ✓ | ✓ | paynl/omnipay-paynl | [Andy Pieters](https://github.com/andypieters) +[PayMongo](https://github.com/oozman/omnipay-paymongo) | - | ✓ | oozman/omnipay-paymongo | [Oozman](https://github.com/oozman) +[Payoo](https://github.com/dilab/omnipay-payoo) | ✓ | ✓ | dilab/omnipay-payoo | [Xu Ding](https://github.com/dilab) +[Pacnet](https://github.com/mfauveau/omnipay-pacnet) | ✓ | - | mfauveau/omnipay-pacnet | [Matthieu Fauveau](https://github.com/mfauveau) +[Pagar.me](https://github.com/descubraomundo/omnipay-pagarme) | ✓ | - | descubraomundo/omnipay-pagarme | [Descubra o Mundo](https://github.com/descubraomundo) +[Paratika (Asseco)](https://github.com/yasinkuyu/omnipay-paratika) | ✓ | - | yasinkuyu/omnipay-paratika | [Yasin Kuyu](https://github.com/yasinkuyu) +[PayFast](https://github.com/thephpleague/omnipay-payfast) | ✓ | - | omnipay/payfast | [Omnipay](https://github.com/thephpleague/omnipay) +[PayGate](https://github.com/mvnrsa/omnipay-paygate) | - | ✓ | mvnrsa/paygate | [Marnus van Niekerk](https://github.com/mvnrsa) +[Payflow](https://github.com/thephpleague/omnipay-payflow) | ✓ | - | omnipay/payflow | [Del](https://github.com/delatbabel) +[PaymentExpress (DPS)](https://github.com/thephpleague/omnipay-paymentexpress) | ✓ | ✓ | omnipay/paymentexpress | [Del](https://github.com/delatbabel) +[PaymentExpress / DPS (A2A)](https://github.com/onlinesid/omnipay-paymentexpress-a2a) | ✓ | - | onlinesid/omnipay-paymentexpress-a2a | [Sid](https://github.com/onlinesid) +[PaymentgateRu](https://github.com/pinguinjkeke/omnipay-paymentgateru) | ✓ | ✓ | pinguinjkeke/omnipay-paymentgateru | [Alexander Avakov](https://github.com/pinguinjkeke) +[PaymentSense](https://github.com/digitickets/omnipay-paymentsense) | ✓ | - | digitickets/omnipay-paymentsense | [DigiTickets](https://github.com/digitickets) +[PaymentWall](https://github.com/incube8/omnipay-paymentwall) | ✓ | - | incube8/omnipay-paymentwall | [Del](https://github.com/delatbabel) +[Paynow](https://github.com/pay-now/omnipay-paynow) | - | ✓ | pay-now/omnipay-paynow | [Paynow](https://github.com/pay-now) +[PayPal](https://github.com/thephpleague/omnipay-paypal) | ✓ | ✓ | omnipay/paypal | [Del](https://github.com/delatbabel) +[PayPro](https://github.com/payproNL/omnipay-paypro) | ✓ | - | paypronl/omnipay-paypro | [Fruitcake](https://github.com/fruitcake) +[PAYONE](https://github.com/academe/omnipay-payone) | ✓ | ✓ | academe/omnipay-payone | [Jason Judge](https://github.com/judgej) +[Paysafecard](https://github.com/dercoder/omnipay-paysafecard) | ✓ | - | dercoder/omnipay-paysafecard | [Alexander Fedra](https://github.com/dercoder) +[Paysafecard](https://github.com/worldstream-labs/omnipay-paysafecard) | - | ✓ | worldstream-labs/omnipay-paysafecard | [Worldstream](https://github.com/worldstream-labs) +[Paysafe Payment Hub (Neteller)](https://github.com/worldstream-labs/omnipay-paysafe-payment-hub) | - | ✓ | worldstream-labs/omnipay-paysafe-payment-hub | [Worldstream](https://github.com/worldstream-labs) +[Paysera](https://github.com/povils/omnipay-paysera) | ✓ | - | povils/omnipay-paysera | [Povils](https://github.com/povils) +[Paysera](https://github.com/semyonchetvertnyh/omnipay-paysera) | - | ✓ | semyonchetvertnyh/omnipay-paysera | [Semyon Chetvertnyh](https://github.com/semyonchetvertnyh) +[PaySimple](https://github.com/dranes/omnipay-paysimple) | ✓ | - | dranes/omnipay-paysimple | [Dranes](https://github.com/dranes) +[PaySsion](https://github.com/InkedCurtis/omnipay-payssion) | ✓ | - | inkedcurtis/omnipay-payssion | [Curtis](https://github.com/inkedcurtis) +[PayTrace](https://github.com/iddqdidkfa/omnipay-paytrace) | ✓ | - | softcommerce/omnipay-paytrace | [Oleg Ilyushyn](https://github.com/iddqdidkfa) +[PayU](https://github.com/bileto/omnipay-payu) | ✓ | - | bileto/omnipay-payu | +[PayZen](https://github.com/ubitransports/omnipay-payzen) | ✓ | - | ubitransports/omnipay-payzen | [Ubitransport](https://github.com/ubitransports) +[Paxum](https://github.com/hiqdev/omnipay-paxum) | ✓ | ✓ | hiqdev/omnipay-paxum | [HiQDev](https://github.com/hiqdev) +[Pelecard](https://github.com/Uskur/omnipay-pelecard) | ✓ | ✓ | uskur/omnipay-pelecard | [Uskur](https://github.com/Uskur) +[Pin Payments](https://github.com/thephpleague/omnipay-pin) | ✓ | - | omnipay/pin | [Del](https://github.com/delatbabel) +[Ping++](https://github.com/phoenixg/omnipay-pingpp) | ✓ | - | phoenixg/omnipay-pingpp | [Huang Feng](https://github.com/phoenixg) +[POLi](https://github.com/burnbright/omnipay-poli) | ✓ | - | burnbright/omnipay-poli | [Sid](https://github.com/onlinesid) +[Portmanat](https://github.com/dercoder/omnipay-portmanat) | ✓ | - | dercoder/omnipay-portmanat | [Alexander Fedra](https://github.com/dercoder) +[Posnet](https://github.com/yasinkuyu/omnipay-posnet) | ✓ | - | yasinkuyu/omnipay-posnet | [Yasin Kuyu](https://github.com/yasinkuyu) +[Postfinance](https://github.com/bummzack/omnipay-postfinance) | ✓ | - | bummzack/omnipay-postfinance | [Roman Schmid](https://github.com/bummzack) +[Qiwi](https://github.com/hiqdev/omnipay-qiwi) | ✓ | ✓ | hiqdev/omnipay-qiwi | [HiQDev](https://github.com/hiqdev) +[QQ Wallet(QPay)](https://github.com/kuangjy2/omnipay-qpay) | - | ✓ | kuangjy/omnipay-qpay | [Kuang Jiaye](https://github.com/kuangjy2) +[Quickpay](https://github.com/NobrainerWeb/omnipay-quickpay) | ✓ | - | nobrainerweb/omnipay-quickpay | [Nobrainer Web](https://github.com/NobrainerWeb) +[Rabobank](https://github.com/thephpleague/omnipay-rabobank) | ✓ | - | omnipay/rabobank | [Barry vd. Heuvel](https://github.com/barryvdh) +[Razorpay](https://github.com/razorpay/omnipay-razorpay) | ✓ | - | razorpay/omnipay-razorpay | [razorpay](https://github.com/razorpay) +[Realex](https://github.com/digitickets/omnipay-realex) | ✓ | - | digitickets/omnipay-realex | [DigiTickets](https://github.com/digitickets) +[RedSys](https://github.com/jsampedro77/sermepa-omnipay) | ✓ | - | nazka/sermepa-omnipay | [Javier Sampedro](https://github.com/jsampedro77) +[RentMoola](https://github.com/rentmoola/omnipay-rentmoola) | ✓ | - | rentmoola/omnipay-rentmoola | [Geoff Shaw](https://github.com/Shawg) +[RoboKassa](https://github.com/hiqdev/omnipay-robokassa) | ✓ | ✓ | hiqdev/omnipay-robokassa | [HiQDev](https://github.com/hiqdev) +[RocketGate](https://github.com/mvestil/omnipay-rocketgate) | ✓ | ✓ | mvestil/omnipay-rocketgate | [Mark Vestil](https://github.com/mvestil) +[Sage Pay](https://github.com/thephpleague/omnipay-sagepay) | ✓ | ✓ | omnipay/sagepay | [Jason Judge](https://github.com/judgej) +[Sberbank](https://github.com/AndrewNovikof/omnipay-sberbank) | - | ✓ | andrewnovikof/omnipay-sberbank | [Andrew Novikov](https://github.com/AndrewNovikof) +[SecPay](https://github.com/justinbusschau/omnipay-secpay) | ✓ | - | justinbusschau/omnipay-secpay | [Justin Busschau](https://github.com/justinbusschau) +[SecurePay](https://github.com/thephpleague/omnipay-securepay) | ✓ | ✓ | omnipay/securepay | [Omnipay](https://github.com/thephpleague/omnipay) +[Secure Trading](https://github.com/meebio/omnipay-secure-trading) | ✓ | - | meebio/omnipay-secure-trading | [John Jablonski](https://github.com/jan-j) +[Sisow](https://github.com/fruitcake/omnipay-sisow) | ✓ | ✓ | fruitcakestudio/omnipay-sisow | [Fruitcake](https://github.com/fruitcake) +[Skrill](https://github.com/alfaproject/omnipay-skrill) | ✓ | - | alfaproject/omnipay-skrill | [João Dias](https://github.com/alfaproject) +[Sofort](https://github.com/aimeoscom/omnipay-sofort) | ✓ | - | aimeoscom/omnipay-sofort | [Aimeos GmbH](https://github.com/aimeoscom) +[Spreedly](https://github.com/gregoriohc/omnipay-spreedly) | ✓ | - | gregoriohc/omnipay-spreedly | [Gregorio Hernández Caso](https://github.com/gregoriohc) +[Square](https://github.com/Transportersio/omnipay-square) | ✓ | ✓ | transportersio/omnipay-square | [Transporters.io](https://github.com/Transportersio) +[Starkpay](https://github.com/starkpay/omnipay) | ✓ | ✓ | starkpay/omnipay | [Starkpay](https://github.com/starkpay) +[Stripe](https://github.com/thephpleague/omnipay-stripe) | ✓ | ✓ | omnipay/stripe | [Del](https://github.com/delatbabel) +[TargetPay](https://github.com/thephpleague/omnipay-targetpay) | ✓ | - | omnipay/targetpay | [Alexander Deruwe](https://github.com/aderuwe) +[TatraBank](https://github.com/bileto/omnipay-tatrabank) | ✓ | - | omnipay-tatrabank | +[ToyyibPay](https://github.com/sitehandy/omnipay-toyyibpay) | - | ✓ | sitehandy/omnipay-toyyibpay | [Amirol Zolkifli](https://github.com/sitehandy) +[Tpay](https://github.com/tpay-com/omnipay-tpay) | ✓ | - | omnipay/tpay | [Tpay.com](https://github.com/tpay-com) +[UnionPay](https://github.com/lokielse/omnipay-unionpay) | ✓ | ✓ | lokielse/omnipay-unionpay | [Loki Else](https://github.com/lokielse) +[Vantiv](https://github.com/lemonstand/omnipay-vantiv) | ✓ | - | lemonstand/omnipay-vantiv | [LemonStand](https://github.com/lemonstand) +[Veritrans](https://github.com/andylibrian/omnipay-veritrans) | ✓ | - | andylibrian/omnipay-veritrans | [Andy Librian](https://github.com/andylibrian) +[Vindicia](https://github.com/vimeo/omnipay-vindicia) | ✓ | - | vimeo/omnipay-vindicia | [Vimeo](https://github.com/vimeo) +[VivaPayments](https://github.com/delatbabel/omnipay-vivapayments) | ✓ | - | delatbabel/omnipay-vivapayments | [Del](https://github.com/delatbabel) +[VR Payment](https://github.com/antibodies-online/omnipay-vr-payment) | - | ✓ | antibodies-online/omnipay-vr-payment | [antibodies-online](https://github.com/antibodies-online) +[WebMoney](https://github.com/dercoder/omnipay-webmoney) | ✓ | ✓ | dercoder/omnipay-webmoney | [Alexander Fedra](https://github.com/dercoder) +[WeChat](https://github.com/labs7in0/omnipay-wechat) | ✓ | - | labs7in0/omnipay-wechat | [7IN0's Labs](https://github.com/labs7in0) +[WechatPay](https://github.com/lokielse/omnipay-wechatpay) | ✓ | ✓ | lokielse/omnipay-wechatpay | [Loki Else](https://github.com/lokielse) +[WePay](https://github.com/collizo4sky/omnipay-wepay) | ✓ | - | collizo4sky/omnipay-wepay | [Agbonghama Collins](https://github.com/collizo4sky) +[Wirecard](https://github.com/igaponov/omnipay-wirecard) | ✓ | ✓ | igaponov/omnipay-wirecard | [Igor Gaponov](https://github.com/igaponov) +[Wirecard](https://github.com/academe/omnipay-wirecard) | ✓ | - | academe/omnipay-wirecard | [Jason Judge](https://github.com/judgej) +[Worldpay XML Direct Corporate Gateway](https://github.com/teaandcode/omnipay-worldpay-xml) | ✓ | - | teaandcode/omnipay-worldpay-xml | [Dave Nash](https://github.com/teaandcode) +[Worldpay XML Hosted Corporate Gateway](https://github.com/catharsisjelly/omnipay-worldpay-cg-hosted) | ✓ | ✓ | catharsisjelly/omnipay-worldpay-cg-hosted | [Chris Lock](https://github.com/catharsisjelly) +[Worldpay Business Gateway](https://github.com/thephpleague/omnipay-worldpay) | ✓ | ✓ | omnipay/worldpay | [Omnipay](https://github.com/thephpleague/omnipay) +[Yandex.Kassa](https://github.com/hiqdev/omnipay-yandex-kassa) | ✓ | ✓ | hiqdev/omnipay-yandex-kassa | [HiQDev](https://github.com/hiqdev) +[Yandex.Money](https://github.com/yandex-money/yandex-money-cms-omnipay) | ✓ | - | yandexmoney/omnipay | [Roman Ananyev](https://github.com/aTastyCookie/) +[Yandex.Money for P2P payments](https://github.com/hiqdev/omnipay-yandexmoney) | ✓ | ✓ | hiqdev/omnipay-yandexmoney | [HiQDev](https://github.com/hiqdev) +[Yekpay](https://github.com/nekofar/omnipay-yekpay) | - | ✓ | nekofar/omnipay-yekpay | [Milad Nekofar](https://github.com/nekofar) +[ZarinPal](https://github.com/nekofar/omnipay-zarinpal) | - | ✓ | nekofar/omnipay-zarinpal | [Milad Nekofar](https://github.com/nekofar) Gateways are created and initialized like so: ```php -use Omnipay\Common\GatewayFactory; +use Omnipay\Omnipay; -$gateway = GatewayFactory::create('PayPal_Express'); +$gateway = Omnipay::create('PayPal_Express'); $gateway->setUsername('adrian'); $gateway->setPassword('12345'); ``` @@ -150,7 +327,7 @@ gateway (other than by the methods they support). ## Credit Card / Payment Form Input -User form input is directed to an [CreditCard](https://github.com/adrianmacneil/omnipay/blob/master/src/Omnipay/Common/CreditCard.php) +User form input is directed to an [CreditCard](https://github.com/thephpleague/omnipay-common/blob/master/src/Common/CreditCard.php) object. This provides a safe way to accept user input. The `CreditCard` object has the following fields: @@ -208,11 +385,11 @@ $card->setFirstName('Adrian'); ``` If you submit credit card details which are obviously invalid (missing required fields, or a number -which fails the Luhn check), [InvalidCreditCardException](https://github.com/adrianmacneil/omnipay/blob/master/src/Omnipay/Common/Exception/InvalidCreditCardException.php) +which fails the Luhn check), [InvalidCreditCardException](https://github.com/thephpleague/omnipay-common/blob/master/src/Omnipay/Common/Exception/InvalidCreditCardException.php) will be thrown. You should validate the card details using your framework's validation library before submitting the details to your gateway, to avoid unnecessary API calls. -For on-site payment gateways, the following card fields are always required: +For on-site payment gateways, the following card fields are generally required: * firstName * lastName @@ -234,13 +411,18 @@ The main methods implemented by gateways are: * `completePurchase($options)` - handle return from off-site gateways after purchase * `refund($options)` - refund an already processed transaction * `void($options)` - generally can only be called up to 24 hours after submitting a transaction +* `acceptNotification()` - convert an incoming request from an off-site gateway to a generic notification object + for further processing +* `createCard` - get a cardReference that can be used for future payments. This might be used in a monthly billing scenario, for example. -On-site gateways do not need to implement the `completeAuthorize` and `completePurchase` methods. If any gateway does not support -certain features (such as refunds), it will throw `BadMethodCallException`. +On-site gateways do not need to implement the `completeAuthorize` and `completePurchase` methods. Gateways that don't +receive payment notifications don't need to implement `acceptNotification`. If any gateway does not support certain +features (such as refunds), it will throw `BadMethodCallException`. -All gateway methods take an `$options` array as an argument. Each gateway differs in which -parameters are required, and the gateway will throw `InvalidRequestException` if you -omit any required parameters. All gateways will accept a subset of these options: +All gateway methods except `acceptNotification` take an `$options` array as an argument. The `acceptNotification` method +does not take any parameters and will access the HTTP URL variables or POST data implicitly. Each gateway differs in +which parameters are required, and the gateway will throw `InvalidRequestException` if you omit any required parameters. +All gateways will accept a subset of these options: * card * token @@ -256,11 +438,11 @@ Pass the options through to the method like so: ```php $card = new CreditCard($formData); -$request = $gateway->authorize([ +$request = $gateway->authorize(array( 'amount' => '10.00', // this represents $10.00 'card' => $card, 'returnUrl' => 'https://www.example.com/return', -]); +)); ``` When calling the `completeAuthorize` or `completePurchase` methods, the exact same arguments should be provided as @@ -275,7 +457,7 @@ To summarize the various parameters you have available to you: ## The Payment Response -The payment response must implement [ResponseInterface](https://github.com/adrianmacneil/omnipay/blob/master/src/Omnipay/Common/ResponseInterface.php). There are two main types of response: +The payment response must implement [ResponseInterface](https://github.com/thephpleague/omnipay-common/blob/master/src/Omnipay/Common/Message/ResponseInterface.php). There are two main types of response: * Payment was successful (standard response) * Website requires redirect to off-site payment form (redirect response) @@ -286,15 +468,18 @@ For a successful responses, a reference will normally be generated, which can be at a later date. The following methods are always available: ```php -$response = $gateway->purchase(['amount' => '10.00', 'card' => $card])->send(); +$response = $gateway->purchase(array('amount' => '10.00', 'card' => $card))->send(); $response->isSuccessful(); // is the response successful? $response->isRedirect(); // is the response a redirect? $response->getTransactionReference(); // a reference generated by the payment gateway +$response->getTransactionId(); // the reference set by the originating website if available. $response->getMessage(); // a message generated by the payment gateway ``` In addition, most gateways will override the response object, and provide access to any extra fields returned by the gateway. +If the payment authorization is re-usable the gateway will implement ```$response->getCardReference();```. This +method is always available (but may return NULL) from 3.1.1 ### Redirect Response @@ -304,7 +489,7 @@ POST (FormRedirectResponse). These could potentially be combined into a single r After processing a payment, the cart should check whether the response requires a redirect, and if so, redirect accordingly: ```php -$response = $gateway->purchase(['amount' => '10.00', 'card' => $card])->send(); +$response = $gateway->purchase(array('amount' => '10.00', 'card' => $card))->send(); if ($response->isSuccessful()) { // payment is complete } elseif ($response->isRedirect()) { @@ -337,7 +522,7 @@ You can handle both scenarios by wrapping the entire request in a try-catch bloc ```php try { - $response = $gateway->purchase(['amount' => '10.00', 'card' => $card])->send(); + $response = $gateway->purchase(array('amount' => '10.00', 'card' => $card))->send(); if ($response->isSuccessful()) { // mark order as complete } elseif ($response->isRedirect()) { @@ -352,6 +537,25 @@ try { } ``` +## Test mode and developer mode + Most gateways allow you to set up a sandbox or developer account which uses a different url + and credentials. Some also allow you to do test transactions against the live site, which does + not result in a live transaction. + + Gateways that implement only the developer account (most of them) call it testMode. Authorize.net, + however, implements both and refers to this mode as developerMode. + + When implementing with multiple gateways you should use a construct along the lines of the following: +```php +if ($is_developer_mode) { + if (method_exists($gateway, 'setDeveloperMode')) { + $gateway->setDeveloperMode(TRUE); + } else { + $gateway->setTestMode(TRUE); + } +} +``` + ## Token Billing Token billing allows you to store a credit card with your gateway, and charge it at a later date. @@ -362,9 +566,14 @@ are available: * `updateCard($options)` - update a stored card, not all gateways support this method * `deleteCard($options)` - remove a stored card, not all gateways support this method -Once you have a `cardReference`, you can use it instead of the `card` parameter when creating a charge: +Once you have a `cardReference`, (which should be available from the response object +using getCardReference) you can use it instead of the `card` parameter when creating a charge: - $gateway->purchase(['amount' => '10.00', 'cardReference' => 'abc']); + $gateway->purchase(array('amount' => '10.00', 'cardReference' => 'abc')); + +In many cases the createCard action will also process the initial payment at the same time. +In these cases you should pass in the 'action' ('authorize' or 'purchase') in the createCard +options. ## Recurring Billing @@ -374,20 +583,57 @@ recurring billing profiles. Also in most cases token billing will cover your nee store a credit card then charge it on whatever schedule you like. Feel free to get in touch if you really think this should be a core feature and worth the effort. +## Incoming Notifications + +Some gateways (e.g. Cybersource, GoPay) offer HTTP notifications to inform the merchant about the completion (or, in +general, status) of the payment. To assist with handling such notifications, the `acceptNotification()` method will +extract the transaction reference and payment status from the HTTP request and return a generic `NotificationInterface`. + +```php +$notification = $gateway->acceptNotification(); + +$notification->getTransactionReference(); // A reference provided by the gateway to represent this transaction +$notification->getTransactionStatus(); // Current status of the transaction, one of NotificationInterface::STATUS_* +$notification->getMessage(); // Additional message, if any, provided by the gateway + +// update the status of the corresponding transaction in your database +``` + +**Note:** some earlier gateways used the `completeAuthorize` and `completePurchase` messages to handle the incoming +notifications. These are being converted and the `complete*` messages deprecated. +They won't be removed in OmniPay 2.x, but it is advisable to switch to the `acceptNotification` message when convenient. +An example is Sage Pay Server [completeAuthorize](https://github.com/thephpleague/omnipay-sagepay/blob/master/src/ServerGateway.php#L81) +which is now handled by [acceptNotification](https://github.com/thephpleague/omnipay-sagepay/blob/master/src/ServerGateway.php#L40). + ## Example Application -An example application is provided in the `example` directory. You can run it using PHP's built in -web server (PHP 5.4+): +An example application is provided in the [omnipay/example](https://github.com/thephpleague/omnipay-example) repo. +You can run it using PHP's built in web server (PHP 5.4+): $ php composer.phar update --dev - $ php -S localhost:8000 -t example/ + $ php -S localhost:8000 + +For more information, see the [Omnipay example application](https://github.com/thephpleague/omnipay-example). + +## 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 +for the appropriate package, or better yet, fork the library and submit a pull request. + +## Security +If you discover any security related issues, please email barryvdh@gmail.com instead of using the issue tracker. -For more information, see the [example application directory](https://github.com/adrianmacneil/omnipay/tree/master/example). ## Feedback **Please provide feedback!** We want to make this library useful in as many projects as possible. -Please raise a Github issue, and point out what you do and don't like, or fork the project and make -suggestions. **No issue is too small.** - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/adrianmacneil/omnipay/trend.png)](https://bitdeli.com/free "Bitdeli Badge") +Please head on over to the [mailing list](https://groups.google.com/forum/#!forum/omnipay) +and point out what you do and don't like, or fork the project and make suggestions. **No issue is too small.** diff --git a/composer.json b/composer.json index 7abb7d28..9bbc6db9 100644 --- a/composer.json +++ b/composer.json @@ -1,67 +1,45 @@ { - "name": "omnipay/omnipay", - "type": "library", - "description": "A framework agnostic, multi-gateway payment processing library", + "name": "league/omnipay", + "type": "metapackage", + "description": "Omnipay payment processing library", "keywords": [ - "2checkout", - "2co", - "auth.net", - "authorize", - "authorize.net", - "buckaroo", - "cardsave", - "commweb", - "dps", - "egate", - "eway", - "express", - "gateway", - "gocardless", - "ideal", - "merchant", - "migs", - "mollie", - "netaxept", - "netbanx", - "pay", - "payfast", - "payflow", - "payment", - "paymentexpress", - "paypal", - "pin", - "purchase", - "rapid", - "sagepay", - "securepay", - "stripe", - "tala", - "tala-payments", - "twocheckout", - "worldpay" + "omnipay", + "checkout", + "creditcard", + "payment" ], - "homepage": "https://github.com/adrianmacneil/omnipay", + "homepage": "https://omnipay.thephpleague.com/", "license": "MIT", "authors": [ { "name": "Adrian Macneil", "email": "adrian@adrianmacneil.com" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" } ], - "autoload": { - "psr-0": { "Omnipay" : "src/" } - }, "require": { - "php": ">=5.3.2", - "guzzle/http": "~3.1", - "symfony/http-foundation": "~2.1" + "php": "^7.2|^8.0", + "omnipay/common": "^3.1", + "php-http/discovery": "^1.14", + "php-http/guzzle7-adapter": "^1" }, "require-dev": { - "guzzle/plugin-mock": "~3.1", - "mockery/mockery": "~0.7", - "phpunit/phpunit": "~3.7.16", - "silex/silex": "1.0.*@dev", - "squizlabs/php_codesniffer": "~1.4.4", - "twig/twig": "~1.12" - } + "omnipay/tests": "^3|^4" + }, + "autoload-dev": { + "psr-4": { "Omnipay\\Tests\\" : "tests" } + }, + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "scripts": { + "test": "phpunit" + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/example/.htaccess b/example/.htaccess deleted file mode 100644 index b104c122..00000000 --- a/example/.htaccess +++ /dev/null @@ -1,4 +0,0 @@ -RewriteEngine On -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule . /index.php [L] diff --git a/example/README.md b/example/README.md deleted file mode 100644 index c7892eeb..00000000 --- a/example/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Omnipay: Example Application - -This is an example web application built using the [Silex micro-framework](http://silex.sensiolabs.org/). -It demonstrates using Omnipay to process payments using all supported payment gateways. - -## Getting Started - -To run the example application, you must first install the development dependencies via composer. -From the root `omnipay` directory, run: - - $ php composer.phar update --dev - -You can the use the built in web server (PHP 5.4+) to start the application: - - $ php -S localhost:8000 -t example/ - -The application will now be available at [http://localhost:8000/](http://localhost:8000/) - -## Configuration - -To test a gateway, you will need to have access to valid credentials. To obtain valid credentials, -contact the payment gateway's support. - -You can configure a gateways settings in the application. All data is stored using regular PHP -sessions, so will not be persisted between sessions. diff --git a/example/assets/bootstrap.css b/example/assets/bootstrap.css deleted file mode 100644 index b2550569..00000000 --- a/example/assets/bootstrap.css +++ /dev/null @@ -1,6158 +0,0 @@ -/*! - * Bootstrap v2.3.0 - * - * Copyright 2012 Twitter, Inc - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Designed and built with all the love in the world @twitter by @mdo and @fat. - */ - -.clearfix { - *zoom: 1; -} - -.clearfix:before, -.clearfix:after { - display: table; - line-height: 0; - content: ""; -} - -.clearfix:after { - clear: both; -} - -.hide-text { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} - -.input-block-level { - display: block; - width: 100%; - min-height: 30px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -nav, -section { - display: block; -} - -audio, -canvas, -video { - display: inline-block; - *display: inline; - *zoom: 1; -} - -audio:not([controls]) { - display: none; -} - -html { - font-size: 100%; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} - -a:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -a:hover, -a:active { - outline: 0; -} - -sub, -sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -img { - width: auto\9; - height: auto; - max-width: 100%; - vertical-align: middle; - border: 0; - -ms-interpolation-mode: bicubic; -} - -#map_canvas img, -.google-maps img { - max-width: none; -} - -button, -input, -select, -textarea { - margin: 0; - font-size: 100%; - vertical-align: middle; -} - -button, -input { - *overflow: visible; - line-height: normal; -} - -button::-moz-focus-inner, -input::-moz-focus-inner { - padding: 0; - border: 0; -} - -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - cursor: pointer; - -webkit-appearance: button; -} - -label, -select, -button, -input[type="button"], -input[type="reset"], -input[type="submit"], -input[type="radio"], -input[type="checkbox"] { - cursor: pointer; -} - -input[type="search"] { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; - -webkit-appearance: textfield; -} - -input[type="search"]::-webkit-search-decoration, -input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; -} - -textarea { - overflow: auto; - vertical-align: top; -} - -@media print { - * { - color: #000 !important; - text-shadow: none !important; - background: transparent !important; - box-shadow: none !important; - } - a, - a:visited { - text-decoration: underline; - } - a[href]:after { - content: " (" attr(href) ")"; - } - abbr[title]:after { - content: " (" attr(title) ")"; - } - .ir a:after, - a[href^="javascript:"]:after, - a[href^="#"]:after { - content: ""; - } - pre, - blockquote { - border: 1px solid #999; - page-break-inside: avoid; - } - thead { - display: table-header-group; - } - tr, - img { - page-break-inside: avoid; - } - img { - max-width: 100% !important; - } - @page { - margin: 0.5cm; - } - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - h2, - h3 { - page-break-after: avoid; - } -} - -body { - margin: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 20px; - color: #333333; - background-color: #ffffff; -} - -a { - color: #0088cc; - text-decoration: none; -} - -a:hover, -a:focus { - color: #005580; - text-decoration: underline; -} - -.img-rounded { - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -.img-polaroid { - padding: 4px; - background-color: #fff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); -} - -.img-circle { - -webkit-border-radius: 500px; - -moz-border-radius: 500px; - border-radius: 500px; -} - -.row { - margin-left: -20px; - *zoom: 1; -} - -.row:before, -.row:after { - display: table; - line-height: 0; - content: ""; -} - -.row:after { - clear: both; -} - -[class*="span"] { - float: left; - min-height: 1px; - margin-left: 20px; -} - -.container, -.navbar-static-top .container, -.navbar-fixed-top .container, -.navbar-fixed-bottom .container { - width: 940px; -} - -.span12 { - width: 940px; -} - -.span11 { - width: 860px; -} - -.span10 { - width: 780px; -} - -.span9 { - width: 700px; -} - -.span8 { - width: 620px; -} - -.span7 { - width: 540px; -} - -.span6 { - width: 460px; -} - -.span5 { - width: 380px; -} - -.span4 { - width: 300px; -} - -.span3 { - width: 220px; -} - -.span2 { - width: 140px; -} - -.span1 { - width: 60px; -} - -.offset12 { - margin-left: 980px; -} - -.offset11 { - margin-left: 900px; -} - -.offset10 { - margin-left: 820px; -} - -.offset9 { - margin-left: 740px; -} - -.offset8 { - margin-left: 660px; -} - -.offset7 { - margin-left: 580px; -} - -.offset6 { - margin-left: 500px; -} - -.offset5 { - margin-left: 420px; -} - -.offset4 { - margin-left: 340px; -} - -.offset3 { - margin-left: 260px; -} - -.offset2 { - margin-left: 180px; -} - -.offset1 { - margin-left: 100px; -} - -.row-fluid { - width: 100%; - *zoom: 1; -} - -.row-fluid:before, -.row-fluid:after { - display: table; - line-height: 0; - content: ""; -} - -.row-fluid:after { - clear: both; -} - -.row-fluid [class*="span"] { - display: block; - float: left; - width: 100%; - min-height: 30px; - margin-left: 2.127659574468085%; - *margin-left: 2.074468085106383%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.row-fluid [class*="span"]:first-child { - margin-left: 0; -} - -.row-fluid .controls-row [class*="span"] + [class*="span"] { - margin-left: 2.127659574468085%; -} - -.row-fluid .span12 { - width: 100%; - *width: 99.94680851063829%; -} - -.row-fluid .span11 { - width: 91.48936170212765%; - *width: 91.43617021276594%; -} - -.row-fluid .span10 { - width: 82.97872340425532%; - *width: 82.92553191489361%; -} - -.row-fluid .span9 { - width: 74.46808510638297%; - *width: 74.41489361702126%; -} - -.row-fluid .span8 { - width: 65.95744680851064%; - *width: 65.90425531914893%; -} - -.row-fluid .span7 { - width: 57.44680851063829%; - *width: 57.39361702127659%; -} - -.row-fluid .span6 { - width: 48.93617021276595%; - *width: 48.88297872340425%; -} - -.row-fluid .span5 { - width: 40.42553191489362%; - *width: 40.37234042553192%; -} - -.row-fluid .span4 { - width: 31.914893617021278%; - *width: 31.861702127659576%; -} - -.row-fluid .span3 { - width: 23.404255319148934%; - *width: 23.351063829787233%; -} - -.row-fluid .span2 { - width: 14.893617021276595%; - *width: 14.840425531914894%; -} - -.row-fluid .span1 { - width: 6.382978723404255%; - *width: 6.329787234042553%; -} - -.row-fluid .offset12 { - margin-left: 104.25531914893617%; - *margin-left: 104.14893617021275%; -} - -.row-fluid .offset12:first-child { - margin-left: 102.12765957446808%; - *margin-left: 102.02127659574467%; -} - -.row-fluid .offset11 { - margin-left: 95.74468085106382%; - *margin-left: 95.6382978723404%; -} - -.row-fluid .offset11:first-child { - margin-left: 93.61702127659574%; - *margin-left: 93.51063829787232%; -} - -.row-fluid .offset10 { - margin-left: 87.23404255319149%; - *margin-left: 87.12765957446807%; -} - -.row-fluid .offset10:first-child { - margin-left: 85.1063829787234%; - *margin-left: 84.99999999999999%; -} - -.row-fluid .offset9 { - margin-left: 78.72340425531914%; - *margin-left: 78.61702127659572%; -} - -.row-fluid .offset9:first-child { - margin-left: 76.59574468085106%; - *margin-left: 76.48936170212764%; -} - -.row-fluid .offset8 { - margin-left: 70.2127659574468%; - *margin-left: 70.10638297872339%; -} - -.row-fluid .offset8:first-child { - margin-left: 68.08510638297872%; - *margin-left: 67.9787234042553%; -} - -.row-fluid .offset7 { - margin-left: 61.70212765957446%; - *margin-left: 61.59574468085106%; -} - -.row-fluid .offset7:first-child { - margin-left: 59.574468085106375%; - *margin-left: 59.46808510638297%; -} - -.row-fluid .offset6 { - margin-left: 53.191489361702125%; - *margin-left: 53.085106382978715%; -} - -.row-fluid .offset6:first-child { - margin-left: 51.063829787234035%; - *margin-left: 50.95744680851063%; -} - -.row-fluid .offset5 { - margin-left: 44.68085106382979%; - *margin-left: 44.57446808510638%; -} - -.row-fluid .offset5:first-child { - margin-left: 42.5531914893617%; - *margin-left: 42.4468085106383%; -} - -.row-fluid .offset4 { - margin-left: 36.170212765957444%; - *margin-left: 36.06382978723405%; -} - -.row-fluid .offset4:first-child { - margin-left: 34.04255319148936%; - *margin-left: 33.93617021276596%; -} - -.row-fluid .offset3 { - margin-left: 27.659574468085104%; - *margin-left: 27.5531914893617%; -} - -.row-fluid .offset3:first-child { - margin-left: 25.53191489361702%; - *margin-left: 25.425531914893618%; -} - -.row-fluid .offset2 { - margin-left: 19.148936170212764%; - *margin-left: 19.04255319148936%; -} - -.row-fluid .offset2:first-child { - margin-left: 17.02127659574468%; - *margin-left: 16.914893617021278%; -} - -.row-fluid .offset1 { - margin-left: 10.638297872340425%; - *margin-left: 10.53191489361702%; -} - -.row-fluid .offset1:first-child { - margin-left: 8.51063829787234%; - *margin-left: 8.404255319148938%; -} - -[class*="span"].hide, -.row-fluid [class*="span"].hide { - display: none; -} - -[class*="span"].pull-right, -.row-fluid [class*="span"].pull-right { - float: right; -} - -.container { - margin-right: auto; - margin-left: auto; - *zoom: 1; -} - -.container:before, -.container:after { - display: table; - line-height: 0; - content: ""; -} - -.container:after { - clear: both; -} - -.container-fluid { - padding-right: 20px; - padding-left: 20px; - *zoom: 1; -} - -.container-fluid:before, -.container-fluid:after { - display: table; - line-height: 0; - content: ""; -} - -.container-fluid:after { - clear: both; -} - -p { - margin: 0 0 10px; -} - -.lead { - margin-bottom: 20px; - font-size: 21px; - font-weight: 200; - line-height: 30px; -} - -small { - font-size: 85%; -} - -strong { - font-weight: bold; -} - -em { - font-style: italic; -} - -cite { - font-style: normal; -} - -.muted { - color: #999999; -} - -a.muted:hover, -a.muted:focus { - color: #808080; -} - -.text-warning { - color: #c09853; -} - -a.text-warning:hover, -a.text-warning:focus { - color: #a47e3c; -} - -.text-error { - color: #b94a48; -} - -a.text-error:hover, -a.text-error:focus { - color: #953b39; -} - -.text-info { - color: #3a87ad; -} - -a.text-info:hover, -a.text-info:focus { - color: #2d6987; -} - -.text-success { - color: #468847; -} - -a.text-success:hover, -a.text-success:focus { - color: #356635; -} - -.text-left { - text-align: left; -} - -.text-right { - text-align: right; -} - -.text-center { - text-align: center; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - margin: 10px 0; - font-family: inherit; - font-weight: bold; - line-height: 20px; - color: inherit; - text-rendering: optimizelegibility; -} - -h1 small, -h2 small, -h3 small, -h4 small, -h5 small, -h6 small { - font-weight: normal; - line-height: 1; - color: #999999; -} - -h1, -h2, -h3 { - line-height: 40px; -} - -h1 { - font-size: 38.5px; -} - -h2 { - font-size: 31.5px; -} - -h3 { - font-size: 24.5px; -} - -h4 { - font-size: 17.5px; -} - -h5 { - font-size: 14px; -} - -h6 { - font-size: 11.9px; -} - -h1 small { - font-size: 24.5px; -} - -h2 small { - font-size: 17.5px; -} - -h3 small { - font-size: 14px; -} - -h4 small { - font-size: 14px; -} - -.page-header { - padding-bottom: 9px; - margin: 20px 0 30px; - border-bottom: 1px solid #eeeeee; -} - -ul, -ol { - padding: 0; - margin: 0 0 10px 25px; -} - -ul ul, -ul ol, -ol ol, -ol ul { - margin-bottom: 0; -} - -li { - line-height: 20px; -} - -ul.unstyled, -ol.unstyled { - margin-left: 0; - list-style: none; -} - -ul.inline, -ol.inline { - margin-left: 0; - list-style: none; -} - -ul.inline > li, -ol.inline > li { - display: inline-block; - *display: inline; - padding-right: 5px; - padding-left: 5px; - *zoom: 1; -} - -dl { - margin-bottom: 20px; -} - -dt, -dd { - line-height: 20px; -} - -dt { - font-weight: bold; -} - -dd { - margin-left: 10px; -} - -.dl-horizontal { - *zoom: 1; -} - -.dl-horizontal:before, -.dl-horizontal:after { - display: table; - line-height: 0; - content: ""; -} - -.dl-horizontal:after { - clear: both; -} - -.dl-horizontal dt { - float: left; - width: 160px; - overflow: hidden; - clear: left; - text-align: right; - text-overflow: ellipsis; - white-space: nowrap; -} - -.dl-horizontal dd { - margin-left: 180px; -} - -hr { - margin: 20px 0; - border: 0; - border-top: 1px solid #eeeeee; - border-bottom: 1px solid #ffffff; -} - -abbr[title], -abbr[data-original-title] { - cursor: help; - border-bottom: 1px dotted #999999; -} - -abbr.initialism { - font-size: 90%; - text-transform: uppercase; -} - -blockquote { - padding: 0 0 0 15px; - margin: 0 0 20px; - border-left: 5px solid #eeeeee; -} - -blockquote p { - margin-bottom: 0; - font-size: 17.5px; - font-weight: 300; - line-height: 1.25; -} - -blockquote small { - display: block; - line-height: 20px; - color: #999999; -} - -blockquote small:before { - content: '\2014 \00A0'; -} - -blockquote.pull-right { - float: right; - padding-right: 15px; - padding-left: 0; - border-right: 5px solid #eeeeee; - border-left: 0; -} - -blockquote.pull-right p, -blockquote.pull-right small { - text-align: right; -} - -blockquote.pull-right small:before { - content: ''; -} - -blockquote.pull-right small:after { - content: '\00A0 \2014'; -} - -q:before, -q:after, -blockquote:before, -blockquote:after { - content: ""; -} - -address { - display: block; - margin-bottom: 20px; - font-style: normal; - line-height: 20px; -} - -code, -pre { - padding: 0 3px 2px; - font-family: Monaco, Menlo, Consolas, "Courier New", monospace; - font-size: 12px; - color: #333333; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -code { - padding: 2px 4px; - color: #d14; - white-space: nowrap; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; -} - -pre { - display: block; - padding: 9.5px; - margin: 0 0 10px; - font-size: 13px; - line-height: 20px; - word-break: break-all; - word-wrap: break-word; - white-space: pre; - white-space: pre-wrap; - background-color: #f5f5f5; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.15); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -pre.prettyprint { - margin-bottom: 20px; -} - -pre code { - padding: 0; - color: inherit; - white-space: pre; - white-space: pre-wrap; - background-color: transparent; - border: 0; -} - -.pre-scrollable { - max-height: 340px; - overflow-y: scroll; -} - -form { - margin: 0 0 20px; -} - -fieldset { - padding: 0; - margin: 0; - border: 0; -} - -legend { - display: block; - width: 100%; - padding: 0; - margin-bottom: 20px; - font-size: 21px; - line-height: 40px; - color: #333333; - border: 0; - border-bottom: 1px solid #e5e5e5; -} - -legend small { - font-size: 15px; - color: #999999; -} - -label, -input, -button, -select, -textarea { - font-size: 14px; - font-weight: normal; - line-height: 20px; -} - -input, -button, -select, -textarea { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -} - -label { - display: block; - margin-bottom: 5px; -} - -select, -textarea, -input[type="text"], -input[type="password"], -input[type="datetime"], -input[type="datetime-local"], -input[type="date"], -input[type="month"], -input[type="time"], -input[type="week"], -input[type="number"], -input[type="email"], -input[type="url"], -input[type="search"], -input[type="tel"], -input[type="color"], -.uneditable-input { - display: inline-block; - height: 20px; - padding: 4px 6px; - margin-bottom: 10px; - font-size: 14px; - line-height: 20px; - color: #555555; - vertical-align: middle; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -input, -textarea, -.uneditable-input { - width: 206px; -} - -textarea { - height: auto; -} - -textarea, -input[type="text"], -input[type="password"], -input[type="datetime"], -input[type="datetime-local"], -input[type="date"], -input[type="month"], -input[type="time"], -input[type="week"], -input[type="number"], -input[type="email"], -input[type="url"], -input[type="search"], -input[type="tel"], -input[type="color"], -.uneditable-input { - background-color: #ffffff; - border: 1px solid #cccccc; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; - -moz-transition: border linear 0.2s, box-shadow linear 0.2s; - -o-transition: border linear 0.2s, box-shadow linear 0.2s; - transition: border linear 0.2s, box-shadow linear 0.2s; -} - -textarea:focus, -input[type="text"]:focus, -input[type="password"]:focus, -input[type="datetime"]:focus, -input[type="datetime-local"]:focus, -input[type="date"]:focus, -input[type="month"]:focus, -input[type="time"]:focus, -input[type="week"]:focus, -input[type="number"]:focus, -input[type="email"]:focus, -input[type="url"]:focus, -input[type="search"]:focus, -input[type="tel"]:focus, -input[type="color"]:focus, -.uneditable-input:focus { - border-color: rgba(82, 168, 236, 0.8); - outline: 0; - outline: thin dotted \9; - /* IE6-9 */ - - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); -} - -input[type="radio"], -input[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - *margin-top: 0; - line-height: normal; -} - -input[type="file"], -input[type="image"], -input[type="submit"], -input[type="reset"], -input[type="button"], -input[type="radio"], -input[type="checkbox"] { - width: auto; -} - -select, -input[type="file"] { - height: 30px; - /* In IE7, the height of the select element cannot be changed by height, only font-size */ - - *margin-top: 4px; - /* For IE7, add top margin to align select with labels */ - - line-height: 30px; -} - -select { - width: 220px; - background-color: #ffffff; - border: 1px solid #cccccc; -} - -select[multiple], -select[size] { - height: auto; -} - -select:focus, -input[type="file"]:focus, -input[type="radio"]:focus, -input[type="checkbox"]:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -.uneditable-input, -.uneditable-textarea { - color: #999999; - cursor: not-allowed; - background-color: #fcfcfc; - border-color: #cccccc; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); -} - -.uneditable-input { - overflow: hidden; - white-space: nowrap; -} - -.uneditable-textarea { - width: auto; - height: auto; -} - -input:-moz-placeholder, -textarea:-moz-placeholder { - color: #999999; -} - -input:-ms-input-placeholder, -textarea:-ms-input-placeholder { - color: #999999; -} - -input::-webkit-input-placeholder, -textarea::-webkit-input-placeholder { - color: #999999; -} - -.radio, -.checkbox { - min-height: 20px; - padding-left: 20px; -} - -.radio input[type="radio"], -.checkbox input[type="checkbox"] { - float: left; - margin-left: -20px; -} - -.controls > .radio:first-child, -.controls > .checkbox:first-child { - padding-top: 5px; -} - -.radio.inline, -.checkbox.inline { - display: inline-block; - padding-top: 5px; - margin-bottom: 0; - vertical-align: middle; -} - -.radio.inline + .radio.inline, -.checkbox.inline + .checkbox.inline { - margin-left: 10px; -} - -.input-mini { - width: 60px; -} - -.input-small { - width: 90px; -} - -.input-medium { - width: 150px; -} - -.input-large { - width: 210px; -} - -.input-xlarge { - width: 270px; -} - -.input-xxlarge { - width: 530px; -} - -input[class*="span"], -select[class*="span"], -textarea[class*="span"], -.uneditable-input[class*="span"], -.row-fluid input[class*="span"], -.row-fluid select[class*="span"], -.row-fluid textarea[class*="span"], -.row-fluid .uneditable-input[class*="span"] { - float: none; - margin-left: 0; -} - -.input-append input[class*="span"], -.input-append .uneditable-input[class*="span"], -.input-prepend input[class*="span"], -.input-prepend .uneditable-input[class*="span"], -.row-fluid input[class*="span"], -.row-fluid select[class*="span"], -.row-fluid textarea[class*="span"], -.row-fluid .uneditable-input[class*="span"], -.row-fluid .input-prepend [class*="span"], -.row-fluid .input-append [class*="span"] { - display: inline-block; -} - -input, -textarea, -.uneditable-input { - margin-left: 0; -} - -.controls-row [class*="span"] + [class*="span"] { - margin-left: 20px; -} - -input.span12, -textarea.span12, -.uneditable-input.span12 { - width: 926px; -} - -input.span11, -textarea.span11, -.uneditable-input.span11 { - width: 846px; -} - -input.span10, -textarea.span10, -.uneditable-input.span10 { - width: 766px; -} - -input.span9, -textarea.span9, -.uneditable-input.span9 { - width: 686px; -} - -input.span8, -textarea.span8, -.uneditable-input.span8 { - width: 606px; -} - -input.span7, -textarea.span7, -.uneditable-input.span7 { - width: 526px; -} - -input.span6, -textarea.span6, -.uneditable-input.span6 { - width: 446px; -} - -input.span5, -textarea.span5, -.uneditable-input.span5 { - width: 366px; -} - -input.span4, -textarea.span4, -.uneditable-input.span4 { - width: 286px; -} - -input.span3, -textarea.span3, -.uneditable-input.span3 { - width: 206px; -} - -input.span2, -textarea.span2, -.uneditable-input.span2 { - width: 126px; -} - -input.span1, -textarea.span1, -.uneditable-input.span1 { - width: 46px; -} - -.controls-row { - *zoom: 1; -} - -.controls-row:before, -.controls-row:after { - display: table; - line-height: 0; - content: ""; -} - -.controls-row:after { - clear: both; -} - -.controls-row [class*="span"], -.row-fluid .controls-row [class*="span"] { - float: left; -} - -.controls-row .checkbox[class*="span"], -.controls-row .radio[class*="span"] { - padding-top: 5px; -} - -input[disabled], -select[disabled], -textarea[disabled], -input[readonly], -select[readonly], -textarea[readonly] { - cursor: not-allowed; - background-color: #eeeeee; -} - -input[type="radio"][disabled], -input[type="checkbox"][disabled], -input[type="radio"][readonly], -input[type="checkbox"][readonly] { - background-color: transparent; -} - -.control-group.warning .control-label, -.control-group.warning .help-block, -.control-group.warning .help-inline { - color: #c09853; -} - -.control-group.warning .checkbox, -.control-group.warning .radio, -.control-group.warning input, -.control-group.warning select, -.control-group.warning textarea { - color: #c09853; -} - -.control-group.warning input, -.control-group.warning select, -.control-group.warning textarea { - border-color: #c09853; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} - -.control-group.warning input:focus, -.control-group.warning select:focus, -.control-group.warning textarea:focus { - border-color: #a47e3c; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; -} - -.control-group.warning .input-prepend .add-on, -.control-group.warning .input-append .add-on { - color: #c09853; - background-color: #fcf8e3; - border-color: #c09853; -} - -.control-group.error .control-label, -.control-group.error .help-block, -.control-group.error .help-inline { - color: #b94a48; -} - -.control-group.error .checkbox, -.control-group.error .radio, -.control-group.error input, -.control-group.error select, -.control-group.error textarea { - color: #b94a48; -} - -.control-group.error input, -.control-group.error select, -.control-group.error textarea { - border-color: #b94a48; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} - -.control-group.error input:focus, -.control-group.error select:focus, -.control-group.error textarea:focus { - border-color: #953b39; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; -} - -.control-group.error .input-prepend .add-on, -.control-group.error .input-append .add-on { - color: #b94a48; - background-color: #f2dede; - border-color: #b94a48; -} - -.control-group.success .control-label, -.control-group.success .help-block, -.control-group.success .help-inline { - color: #468847; -} - -.control-group.success .checkbox, -.control-group.success .radio, -.control-group.success input, -.control-group.success select, -.control-group.success textarea { - color: #468847; -} - -.control-group.success input, -.control-group.success select, -.control-group.success textarea { - border-color: #468847; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} - -.control-group.success input:focus, -.control-group.success select:focus, -.control-group.success textarea:focus { - border-color: #356635; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; -} - -.control-group.success .input-prepend .add-on, -.control-group.success .input-append .add-on { - color: #468847; - background-color: #dff0d8; - border-color: #468847; -} - -.control-group.info .control-label, -.control-group.info .help-block, -.control-group.info .help-inline { - color: #3a87ad; -} - -.control-group.info .checkbox, -.control-group.info .radio, -.control-group.info input, -.control-group.info select, -.control-group.info textarea { - color: #3a87ad; -} - -.control-group.info input, -.control-group.info select, -.control-group.info textarea { - border-color: #3a87ad; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} - -.control-group.info input:focus, -.control-group.info select:focus, -.control-group.info textarea:focus { - border-color: #2d6987; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; -} - -.control-group.info .input-prepend .add-on, -.control-group.info .input-append .add-on { - color: #3a87ad; - background-color: #d9edf7; - border-color: #3a87ad; -} - -input:focus:invalid, -textarea:focus:invalid, -select:focus:invalid { - color: #b94a48; - border-color: #ee5f5b; -} - -input:focus:invalid:focus, -textarea:focus:invalid:focus, -select:focus:invalid:focus { - border-color: #e9322d; - -webkit-box-shadow: 0 0 6px #f8b9b7; - -moz-box-shadow: 0 0 6px #f8b9b7; - box-shadow: 0 0 6px #f8b9b7; -} - -.form-actions { - padding: 19px 20px 20px; - margin-top: 20px; - margin-bottom: 20px; - background-color: #f5f5f5; - border-top: 1px solid #e5e5e5; - *zoom: 1; -} - -.form-actions:before, -.form-actions:after { - display: table; - line-height: 0; - content: ""; -} - -.form-actions:after { - clear: both; -} - -.help-block, -.help-inline { - color: #595959; -} - -.help-block { - display: block; - margin-bottom: 10px; -} - -.help-inline { - display: inline-block; - *display: inline; - padding-left: 5px; - vertical-align: middle; - *zoom: 1; -} - -.input-append, -.input-prepend { - display: inline-block; - margin-bottom: 10px; - font-size: 0; - white-space: nowrap; - vertical-align: middle; -} - -.input-append input, -.input-prepend input, -.input-append select, -.input-prepend select, -.input-append .uneditable-input, -.input-prepend .uneditable-input, -.input-append .dropdown-menu, -.input-prepend .dropdown-menu, -.input-append .popover, -.input-prepend .popover { - font-size: 14px; -} - -.input-append input, -.input-prepend input, -.input-append select, -.input-prepend select, -.input-append .uneditable-input, -.input-prepend .uneditable-input { - position: relative; - margin-bottom: 0; - *margin-left: 0; - vertical-align: top; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; -} - -.input-append input:focus, -.input-prepend input:focus, -.input-append select:focus, -.input-prepend select:focus, -.input-append .uneditable-input:focus, -.input-prepend .uneditable-input:focus { - z-index: 2; -} - -.input-append .add-on, -.input-prepend .add-on { - display: inline-block; - width: auto; - height: 20px; - min-width: 16px; - padding: 4px 5px; - font-size: 14px; - font-weight: normal; - line-height: 20px; - text-align: center; - text-shadow: 0 1px 0 #ffffff; - background-color: #eeeeee; - border: 1px solid #ccc; -} - -.input-append .add-on, -.input-prepend .add-on, -.input-append .btn, -.input-prepend .btn, -.input-append .btn-group > .dropdown-toggle, -.input-prepend .btn-group > .dropdown-toggle { - vertical-align: top; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.input-append .active, -.input-prepend .active { - background-color: #a9dba9; - border-color: #46a546; -} - -.input-prepend .add-on, -.input-prepend .btn { - margin-right: -1px; -} - -.input-prepend .add-on:first-child, -.input-prepend .btn:first-child { - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; -} - -.input-append input, -.input-append select, -.input-append .uneditable-input { - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; -} - -.input-append input + .btn-group .btn:last-child, -.input-append select + .btn-group .btn:last-child, -.input-append .uneditable-input + .btn-group .btn:last-child { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; -} - -.input-append .add-on, -.input-append .btn, -.input-append .btn-group { - margin-left: -1px; -} - -.input-append .add-on:last-child, -.input-append .btn:last-child, -.input-append .btn-group:last-child > .dropdown-toggle { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; -} - -.input-prepend.input-append input, -.input-prepend.input-append select, -.input-prepend.input-append .uneditable-input { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.input-prepend.input-append input + .btn-group .btn, -.input-prepend.input-append select + .btn-group .btn, -.input-prepend.input-append .uneditable-input + .btn-group .btn { - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; -} - -.input-prepend.input-append .add-on:first-child, -.input-prepend.input-append .btn:first-child { - margin-right: -1px; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; -} - -.input-prepend.input-append .add-on:last-child, -.input-prepend.input-append .btn:last-child { - margin-left: -1px; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; -} - -.input-prepend.input-append .btn-group:first-child { - margin-left: 0; -} - -input.search-query { - padding-right: 14px; - padding-right: 4px \9; - padding-left: 14px; - padding-left: 4px \9; - /* IE7-8 doesn't have border-radius, so don't indent the padding */ - - margin-bottom: 0; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; -} - -/* Allow for input prepend/append in search forms */ - -.form-search .input-append .search-query, -.form-search .input-prepend .search-query { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.form-search .input-append .search-query { - -webkit-border-radius: 14px 0 0 14px; - -moz-border-radius: 14px 0 0 14px; - border-radius: 14px 0 0 14px; -} - -.form-search .input-append .btn { - -webkit-border-radius: 0 14px 14px 0; - -moz-border-radius: 0 14px 14px 0; - border-radius: 0 14px 14px 0; -} - -.form-search .input-prepend .search-query { - -webkit-border-radius: 0 14px 14px 0; - -moz-border-radius: 0 14px 14px 0; - border-radius: 0 14px 14px 0; -} - -.form-search .input-prepend .btn { - -webkit-border-radius: 14px 0 0 14px; - -moz-border-radius: 14px 0 0 14px; - border-radius: 14px 0 0 14px; -} - -.form-search input, -.form-inline input, -.form-horizontal input, -.form-search textarea, -.form-inline textarea, -.form-horizontal textarea, -.form-search select, -.form-inline select, -.form-horizontal select, -.form-search .help-inline, -.form-inline .help-inline, -.form-horizontal .help-inline, -.form-search .uneditable-input, -.form-inline .uneditable-input, -.form-horizontal .uneditable-input, -.form-search .input-prepend, -.form-inline .input-prepend, -.form-horizontal .input-prepend, -.form-search .input-append, -.form-inline .input-append, -.form-horizontal .input-append { - display: inline-block; - *display: inline; - margin-bottom: 0; - vertical-align: middle; - *zoom: 1; -} - -.form-search .hide, -.form-inline .hide, -.form-horizontal .hide { - display: none; -} - -.form-search label, -.form-inline label, -.form-search .btn-group, -.form-inline .btn-group { - display: inline-block; -} - -.form-search .input-append, -.form-inline .input-append, -.form-search .input-prepend, -.form-inline .input-prepend { - margin-bottom: 0; -} - -.form-search .radio, -.form-search .checkbox, -.form-inline .radio, -.form-inline .checkbox { - padding-left: 0; - margin-bottom: 0; - vertical-align: middle; -} - -.form-search .radio input[type="radio"], -.form-search .checkbox input[type="checkbox"], -.form-inline .radio input[type="radio"], -.form-inline .checkbox input[type="checkbox"] { - float: left; - margin-right: 3px; - margin-left: 0; -} - -.control-group { - margin-bottom: 10px; -} - -legend + .control-group { - margin-top: 20px; - -webkit-margin-top-collapse: separate; -} - -.form-horizontal .control-group { - margin-bottom: 20px; - *zoom: 1; -} - -.form-horizontal .control-group:before, -.form-horizontal .control-group:after { - display: table; - line-height: 0; - content: ""; -} - -.form-horizontal .control-group:after { - clear: both; -} - -.form-horizontal .control-label { - float: left; - width: 160px; - padding-top: 5px; - text-align: right; -} - -.form-horizontal .controls { - *display: inline-block; - *padding-left: 20px; - margin-left: 180px; - *margin-left: 0; -} - -.form-horizontal .controls:first-child { - *padding-left: 180px; -} - -.form-horizontal .help-block { - margin-bottom: 0; -} - -.form-horizontal input + .help-block, -.form-horizontal select + .help-block, -.form-horizontal textarea + .help-block, -.form-horizontal .uneditable-input + .help-block, -.form-horizontal .input-prepend + .help-block, -.form-horizontal .input-append + .help-block { - margin-top: 10px; -} - -.form-horizontal .form-actions { - padding-left: 180px; -} - -table { - max-width: 100%; - background-color: transparent; - border-collapse: collapse; - border-spacing: 0; -} - -.table { - width: 100%; - margin-bottom: 20px; -} - -.table th, -.table td { - padding: 8px; - line-height: 20px; - text-align: left; - vertical-align: top; - border-top: 1px solid #dddddd; -} - -.table th { - font-weight: bold; -} - -.table thead th { - vertical-align: bottom; -} - -.table caption + thead tr:first-child th, -.table caption + thead tr:first-child td, -.table colgroup + thead tr:first-child th, -.table colgroup + thead tr:first-child td, -.table thead:first-child tr:first-child th, -.table thead:first-child tr:first-child td { - border-top: 0; -} - -.table tbody + tbody { - border-top: 2px solid #dddddd; -} - -.table .table { - background-color: #ffffff; -} - -.table-condensed th, -.table-condensed td { - padding: 4px 5px; -} - -.table-bordered { - border: 1px solid #dddddd; - border-collapse: separate; - *border-collapse: collapse; - border-left: 0; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.table-bordered th, -.table-bordered td { - border-left: 1px solid #dddddd; -} - -.table-bordered caption + thead tr:first-child th, -.table-bordered caption + tbody tr:first-child th, -.table-bordered caption + tbody tr:first-child td, -.table-bordered colgroup + thead tr:first-child th, -.table-bordered colgroup + tbody tr:first-child th, -.table-bordered colgroup + tbody tr:first-child td, -.table-bordered thead:first-child tr:first-child th, -.table-bordered tbody:first-child tr:first-child th, -.table-bordered tbody:first-child tr:first-child td { - border-top: 0; -} - -.table-bordered thead:first-child tr:first-child > th:first-child, -.table-bordered tbody:first-child tr:first-child > td:first-child, -.table-bordered tbody:first-child tr:first-child > th:first-child { - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; -} - -.table-bordered thead:first-child tr:first-child > th:last-child, -.table-bordered tbody:first-child tr:first-child > td:last-child, -.table-bordered tbody:first-child tr:first-child > th:last-child { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; -} - -.table-bordered thead:last-child tr:last-child > th:first-child, -.table-bordered tbody:last-child tr:last-child > td:first-child, -.table-bordered tbody:last-child tr:last-child > th:first-child, -.table-bordered tfoot:last-child tr:last-child > td:first-child, -.table-bordered tfoot:last-child tr:last-child > th:first-child { - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; -} - -.table-bordered thead:last-child tr:last-child > th:last-child, -.table-bordered tbody:last-child tr:last-child > td:last-child, -.table-bordered tbody:last-child tr:last-child > th:last-child, -.table-bordered tfoot:last-child tr:last-child > td:last-child, -.table-bordered tfoot:last-child tr:last-child > th:last-child { - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-bottomright: 4px; -} - -.table-bordered tfoot + tbody:last-child tr:last-child td:first-child { - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomleft: 0; -} - -.table-bordered tfoot + tbody:last-child tr:last-child td:last-child { - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomright: 0; -} - -.table-bordered caption + thead tr:first-child th:first-child, -.table-bordered caption + tbody tr:first-child td:first-child, -.table-bordered colgroup + thead tr:first-child th:first-child, -.table-bordered colgroup + tbody tr:first-child td:first-child { - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; -} - -.table-bordered caption + thead tr:first-child th:last-child, -.table-bordered caption + tbody tr:first-child td:last-child, -.table-bordered colgroup + thead tr:first-child th:last-child, -.table-bordered colgroup + tbody tr:first-child td:last-child { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; -} - -.table-striped tbody > tr:nth-child(odd) > td, -.table-striped tbody > tr:nth-child(odd) > th { - background-color: #f9f9f9; -} - -.table-hover tbody tr:hover > td, -.table-hover tbody tr:hover > th { - background-color: #f5f5f5; -} - -table td[class*="span"], -table th[class*="span"], -.row-fluid table td[class*="span"], -.row-fluid table th[class*="span"] { - display: table-cell; - float: none; - margin-left: 0; -} - -.table td.span1, -.table th.span1 { - float: none; - width: 44px; - margin-left: 0; -} - -.table td.span2, -.table th.span2 { - float: none; - width: 124px; - margin-left: 0; -} - -.table td.span3, -.table th.span3 { - float: none; - width: 204px; - margin-left: 0; -} - -.table td.span4, -.table th.span4 { - float: none; - width: 284px; - margin-left: 0; -} - -.table td.span5, -.table th.span5 { - float: none; - width: 364px; - margin-left: 0; -} - -.table td.span6, -.table th.span6 { - float: none; - width: 444px; - margin-left: 0; -} - -.table td.span7, -.table th.span7 { - float: none; - width: 524px; - margin-left: 0; -} - -.table td.span8, -.table th.span8 { - float: none; - width: 604px; - margin-left: 0; -} - -.table td.span9, -.table th.span9 { - float: none; - width: 684px; - margin-left: 0; -} - -.table td.span10, -.table th.span10 { - float: none; - width: 764px; - margin-left: 0; -} - -.table td.span11, -.table th.span11 { - float: none; - width: 844px; - margin-left: 0; -} - -.table td.span12, -.table th.span12 { - float: none; - width: 924px; - margin-left: 0; -} - -.table tbody tr.success > td { - background-color: #dff0d8; -} - -.table tbody tr.error > td { - background-color: #f2dede; -} - -.table tbody tr.warning > td { - background-color: #fcf8e3; -} - -.table tbody tr.info > td { - background-color: #d9edf7; -} - -.table-hover tbody tr.success:hover > td { - background-color: #d0e9c6; -} - -.table-hover tbody tr.error:hover > td { - background-color: #ebcccc; -} - -.table-hover tbody tr.warning:hover > td { - background-color: #faf2cc; -} - -.table-hover tbody tr.info:hover > td { - background-color: #c4e3f3; -} - -[class^="icon-"], -[class*=" icon-"] { - display: inline-block; - width: 14px; - height: 14px; - margin-top: 1px; - *margin-right: .3em; - line-height: 14px; - vertical-align: text-top; - background-image: url("https://github.com/img/glyphicons-halflings.png"); - background-position: 14px 14px; - background-repeat: no-repeat; -} - -/* White icons with optional class, or on hover/focus/active states of certain elements */ - -.icon-white, -.nav-pills > .active > a > [class^="icon-"], -.nav-pills > .active > a > [class*=" icon-"], -.nav-list > .active > a > [class^="icon-"], -.nav-list > .active > a > [class*=" icon-"], -.navbar-inverse .nav > .active > a > [class^="icon-"], -.navbar-inverse .nav > .active > a > [class*=" icon-"], -.dropdown-menu > li > a:hover > [class^="icon-"], -.dropdown-menu > li > a:focus > [class^="icon-"], -.dropdown-menu > li > a:hover > [class*=" icon-"], -.dropdown-menu > li > a:focus > [class*=" icon-"], -.dropdown-menu > .active > a > [class^="icon-"], -.dropdown-menu > .active > a > [class*=" icon-"], -.dropdown-submenu:hover > a > [class^="icon-"], -.dropdown-submenu:focus > a > [class^="icon-"], -.dropdown-submenu:hover > a > [class*=" icon-"], -.dropdown-submenu:focus > a > [class*=" icon-"] { - background-image: url("https://github.com/img/glyphicons-halflings-white.png"); -} - -.icon-glass { - background-position: 0 0; -} - -.icon-music { - background-position: -24px 0; -} - -.icon-search { - background-position: -48px 0; -} - -.icon-envelope { - background-position: -72px 0; -} - -.icon-heart { - background-position: -96px 0; -} - -.icon-star { - background-position: -120px 0; -} - -.icon-star-empty { - background-position: -144px 0; -} - -.icon-user { - background-position: -168px 0; -} - -.icon-film { - background-position: -192px 0; -} - -.icon-th-large { - background-position: -216px 0; -} - -.icon-th { - background-position: -240px 0; -} - -.icon-th-list { - background-position: -264px 0; -} - -.icon-ok { - background-position: -288px 0; -} - -.icon-remove { - background-position: -312px 0; -} - -.icon-zoom-in { - background-position: -336px 0; -} - -.icon-zoom-out { - background-position: -360px 0; -} - -.icon-off { - background-position: -384px 0; -} - -.icon-signal { - background-position: -408px 0; -} - -.icon-cog { - background-position: -432px 0; -} - -.icon-trash { - background-position: -456px 0; -} - -.icon-home { - background-position: 0 -24px; -} - -.icon-file { - background-position: -24px -24px; -} - -.icon-time { - background-position: -48px -24px; -} - -.icon-road { - background-position: -72px -24px; -} - -.icon-download-alt { - background-position: -96px -24px; -} - -.icon-download { - background-position: -120px -24px; -} - -.icon-upload { - background-position: -144px -24px; -} - -.icon-inbox { - background-position: -168px -24px; -} - -.icon-play-circle { - background-position: -192px -24px; -} - -.icon-repeat { - background-position: -216px -24px; -} - -.icon-refresh { - background-position: -240px -24px; -} - -.icon-list-alt { - background-position: -264px -24px; -} - -.icon-lock { - background-position: -287px -24px; -} - -.icon-flag { - background-position: -312px -24px; -} - -.icon-headphones { - background-position: -336px -24px; -} - -.icon-volume-off { - background-position: -360px -24px; -} - -.icon-volume-down { - background-position: -384px -24px; -} - -.icon-volume-up { - background-position: -408px -24px; -} - -.icon-qrcode { - background-position: -432px -24px; -} - -.icon-barcode { - background-position: -456px -24px; -} - -.icon-tag { - background-position: 0 -48px; -} - -.icon-tags { - background-position: -25px -48px; -} - -.icon-book { - background-position: -48px -48px; -} - -.icon-bookmark { - background-position: -72px -48px; -} - -.icon-print { - background-position: -96px -48px; -} - -.icon-camera { - background-position: -120px -48px; -} - -.icon-font { - background-position: -144px -48px; -} - -.icon-bold { - background-position: -167px -48px; -} - -.icon-italic { - background-position: -192px -48px; -} - -.icon-text-height { - background-position: -216px -48px; -} - -.icon-text-width { - background-position: -240px -48px; -} - -.icon-align-left { - background-position: -264px -48px; -} - -.icon-align-center { - background-position: -288px -48px; -} - -.icon-align-right { - background-position: -312px -48px; -} - -.icon-align-justify { - background-position: -336px -48px; -} - -.icon-list { - background-position: -360px -48px; -} - -.icon-indent-left { - background-position: -384px -48px; -} - -.icon-indent-right { - background-position: -408px -48px; -} - -.icon-facetime-video { - background-position: -432px -48px; -} - -.icon-picture { - background-position: -456px -48px; -} - -.icon-pencil { - background-position: 0 -72px; -} - -.icon-map-marker { - background-position: -24px -72px; -} - -.icon-adjust { - background-position: -48px -72px; -} - -.icon-tint { - background-position: -72px -72px; -} - -.icon-edit { - background-position: -96px -72px; -} - -.icon-share { - background-position: -120px -72px; -} - -.icon-check { - background-position: -144px -72px; -} - -.icon-move { - background-position: -168px -72px; -} - -.icon-step-backward { - background-position: -192px -72px; -} - -.icon-fast-backward { - background-position: -216px -72px; -} - -.icon-backward { - background-position: -240px -72px; -} - -.icon-play { - background-position: -264px -72px; -} - -.icon-pause { - background-position: -288px -72px; -} - -.icon-stop { - background-position: -312px -72px; -} - -.icon-forward { - background-position: -336px -72px; -} - -.icon-fast-forward { - background-position: -360px -72px; -} - -.icon-step-forward { - background-position: -384px -72px; -} - -.icon-eject { - background-position: -408px -72px; -} - -.icon-chevron-left { - background-position: -432px -72px; -} - -.icon-chevron-right { - background-position: -456px -72px; -} - -.icon-plus-sign { - background-position: 0 -96px; -} - -.icon-minus-sign { - background-position: -24px -96px; -} - -.icon-remove-sign { - background-position: -48px -96px; -} - -.icon-ok-sign { - background-position: -72px -96px; -} - -.icon-question-sign { - background-position: -96px -96px; -} - -.icon-info-sign { - background-position: -120px -96px; -} - -.icon-screenshot { - background-position: -144px -96px; -} - -.icon-remove-circle { - background-position: -168px -96px; -} - -.icon-ok-circle { - background-position: -192px -96px; -} - -.icon-ban-circle { - background-position: -216px -96px; -} - -.icon-arrow-left { - background-position: -240px -96px; -} - -.icon-arrow-right { - background-position: -264px -96px; -} - -.icon-arrow-up { - background-position: -289px -96px; -} - -.icon-arrow-down { - background-position: -312px -96px; -} - -.icon-share-alt { - background-position: -336px -96px; -} - -.icon-resize-full { - background-position: -360px -96px; -} - -.icon-resize-small { - background-position: -384px -96px; -} - -.icon-plus { - background-position: -408px -96px; -} - -.icon-minus { - background-position: -433px -96px; -} - -.icon-asterisk { - background-position: -456px -96px; -} - -.icon-exclamation-sign { - background-position: 0 -120px; -} - -.icon-gift { - background-position: -24px -120px; -} - -.icon-leaf { - background-position: -48px -120px; -} - -.icon-fire { - background-position: -72px -120px; -} - -.icon-eye-open { - background-position: -96px -120px; -} - -.icon-eye-close { - background-position: -120px -120px; -} - -.icon-warning-sign { - background-position: -144px -120px; -} - -.icon-plane { - background-position: -168px -120px; -} - -.icon-calendar { - background-position: -192px -120px; -} - -.icon-random { - width: 16px; - background-position: -216px -120px; -} - -.icon-comment { - background-position: -240px -120px; -} - -.icon-magnet { - background-position: -264px -120px; -} - -.icon-chevron-up { - background-position: -288px -120px; -} - -.icon-chevron-down { - background-position: -313px -119px; -} - -.icon-retweet { - background-position: -336px -120px; -} - -.icon-shopping-cart { - background-position: -360px -120px; -} - -.icon-folder-close { - width: 16px; - background-position: -384px -120px; -} - -.icon-folder-open { - width: 16px; - background-position: -408px -120px; -} - -.icon-resize-vertical { - background-position: -432px -119px; -} - -.icon-resize-horizontal { - background-position: -456px -118px; -} - -.icon-hdd { - background-position: 0 -144px; -} - -.icon-bullhorn { - background-position: -24px -144px; -} - -.icon-bell { - background-position: -48px -144px; -} - -.icon-certificate { - background-position: -72px -144px; -} - -.icon-thumbs-up { - background-position: -96px -144px; -} - -.icon-thumbs-down { - background-position: -120px -144px; -} - -.icon-hand-right { - background-position: -144px -144px; -} - -.icon-hand-left { - background-position: -168px -144px; -} - -.icon-hand-up { - background-position: -192px -144px; -} - -.icon-hand-down { - background-position: -216px -144px; -} - -.icon-circle-arrow-right { - background-position: -240px -144px; -} - -.icon-circle-arrow-left { - background-position: -264px -144px; -} - -.icon-circle-arrow-up { - background-position: -288px -144px; -} - -.icon-circle-arrow-down { - background-position: -312px -144px; -} - -.icon-globe { - background-position: -336px -144px; -} - -.icon-wrench { - background-position: -360px -144px; -} - -.icon-tasks { - background-position: -384px -144px; -} - -.icon-filter { - background-position: -408px -144px; -} - -.icon-briefcase { - background-position: -432px -144px; -} - -.icon-fullscreen { - background-position: -456px -144px; -} - -.dropup, -.dropdown { - position: relative; -} - -.dropdown-toggle { - *margin-bottom: -3px; -} - -.dropdown-toggle:active, -.open .dropdown-toggle { - outline: 0; -} - -.caret { - display: inline-block; - width: 0; - height: 0; - vertical-align: top; - border-top: 4px solid #000000; - border-right: 4px solid transparent; - border-left: 4px solid transparent; - content: ""; -} - -.dropdown .caret { - margin-top: 8px; - margin-left: 2px; -} - -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - list-style: none; - background-color: #ffffff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - *border-right-width: 2px; - *border-bottom-width: 2px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; -} - -.dropdown-menu.pull-right { - right: 0; - left: auto; -} - -.dropdown-menu .divider { - *width: 100%; - height: 1px; - margin: 9px 1px; - *margin: -5px 0 5px; - overflow: hidden; - background-color: #e5e5e5; - border-bottom: 1px solid #ffffff; -} - -.dropdown-menu > li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 20px; - color: #333333; - white-space: nowrap; -} - -.dropdown-menu > li > a:hover, -.dropdown-menu > li > a:focus, -.dropdown-submenu:hover > a, -.dropdown-submenu:focus > a { - color: #ffffff; - text-decoration: none; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #0088cc, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); - background-image: -o-linear-gradient(top, #0088cc, #0077b3); - background-image: linear-gradient(to bottom, #0088cc, #0077b3); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); -} - -.dropdown-menu > .active > a, -.dropdown-menu > .active > a:hover, -.dropdown-menu > .active > a:focus { - color: #ffffff; - text-decoration: none; - background-color: #0081c2; - background-image: -moz-linear-gradient(top, #0088cc, #0077b3); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); - background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); - background-image: -o-linear-gradient(top, #0088cc, #0077b3); - background-image: linear-gradient(to bottom, #0088cc, #0077b3); - background-repeat: repeat-x; - outline: 0; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); -} - -.dropdown-menu > .disabled > a, -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - color: #999999; -} - -.dropdown-menu > .disabled > a:hover, -.dropdown-menu > .disabled > a:focus { - text-decoration: none; - cursor: default; - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.open { - *z-index: 1000; -} - -.open > .dropdown-menu { - display: block; -} - -.pull-right > .dropdown-menu { - right: 0; - left: auto; -} - -.dropup .caret, -.navbar-fixed-bottom .dropdown .caret { - border-top: 0; - border-bottom: 4px solid #000000; - content: ""; -} - -.dropup .dropdown-menu, -.navbar-fixed-bottom .dropdown .dropdown-menu { - top: auto; - bottom: 100%; - margin-bottom: 1px; -} - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu > .dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - -webkit-border-radius: 0 6px 6px 6px; - -moz-border-radius: 0 6px 6px 6px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover > .dropdown-menu { - display: block; -} - -.dropup .dropdown-submenu > .dropdown-menu { - top: auto; - bottom: 0; - margin-top: 0; - margin-bottom: -2px; - -webkit-border-radius: 5px 5px 5px 0; - -moz-border-radius: 5px 5px 5px 0; - border-radius: 5px 5px 5px 0; -} - -.dropdown-submenu > a:after { - display: block; - float: right; - width: 0; - height: 0; - margin-top: 5px; - margin-right: -10px; - border-color: transparent; - border-left-color: #cccccc; - border-style: solid; - border-width: 5px 0 5px 5px; - content: " "; -} - -.dropdown-submenu:hover > a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left > .dropdown-menu { - left: -100%; - margin-left: 10px; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; -} - -.dropdown .dropdown-menu .nav-header { - padding-right: 20px; - padding-left: 20px; -} - -.typeahead { - z-index: 1051; - margin-top: 2px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.well { - min-height: 20px; - padding: 19px; - margin-bottom: 20px; - background-color: #f5f5f5; - border: 1px solid #e3e3e3; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -} - -.well blockquote { - border-color: #ddd; - border-color: rgba(0, 0, 0, 0.15); -} - -.well-large { - padding: 24px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -.well-small { - padding: 9px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -.fade { - opacity: 0; - -webkit-transition: opacity 0.15s linear; - -moz-transition: opacity 0.15s linear; - -o-transition: opacity 0.15s linear; - transition: opacity 0.15s linear; -} - -.fade.in { - opacity: 1; -} - -.collapse { - position: relative; - height: 0; - overflow: hidden; - -webkit-transition: height 0.35s ease; - -moz-transition: height 0.35s ease; - -o-transition: height 0.35s ease; - transition: height 0.35s ease; -} - -.collapse.in { - height: auto; -} - -.close { - float: right; - font-size: 20px; - font-weight: bold; - line-height: 20px; - color: #000000; - text-shadow: 0 1px 0 #ffffff; - opacity: 0.2; - filter: alpha(opacity=20); -} - -.close:hover, -.close:focus { - color: #000000; - text-decoration: none; - cursor: pointer; - opacity: 0.4; - filter: alpha(opacity=40); -} - -button.close { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; -} - -.btn { - display: inline-block; - *display: inline; - padding: 4px 12px; - margin-bottom: 0; - *margin-left: .3em; - font-size: 14px; - line-height: 20px; - color: #333333; - text-align: center; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); - vertical-align: middle; - cursor: pointer; - background-color: #f5f5f5; - *background-color: #e6e6e6; - background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); - background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); - background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); - background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); - background-repeat: repeat-x; - border: 1px solid #cccccc; - *border: 0; - border-color: #e6e6e6 #e6e6e6 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - border-bottom-color: #b3b3b3; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - *zoom: 1; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.btn:hover, -.btn:focus, -.btn:active, -.btn.active, -.btn.disabled, -.btn[disabled] { - color: #333333; - background-color: #e6e6e6; - *background-color: #d9d9d9; -} - -.btn:active, -.btn.active { - background-color: #cccccc \9; -} - -.btn:first-child { - *margin-left: 0; -} - -.btn:hover, -.btn:focus { - color: #333333; - text-decoration: none; - background-position: 0 -15px; - -webkit-transition: background-position 0.1s linear; - -moz-transition: background-position 0.1s linear; - -o-transition: background-position 0.1s linear; - transition: background-position 0.1s linear; -} - -.btn:focus { - outline: thin dotted #333; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -.btn.active, -.btn:active { - background-image: none; - outline: 0; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.btn.disabled, -.btn[disabled] { - cursor: default; - background-image: none; - opacity: 0.65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} - -.btn-large { - padding: 11px 19px; - font-size: 17.5px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -.btn-large [class^="icon-"], -.btn-large [class*=" icon-"] { - margin-top: 4px; -} - -.btn-small { - padding: 2px 10px; - font-size: 11.9px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -.btn-small [class^="icon-"], -.btn-small [class*=" icon-"] { - margin-top: 0; -} - -.btn-mini [class^="icon-"], -.btn-mini [class*=" icon-"] { - margin-top: -1px; -} - -.btn-mini { - padding: 0 6px; - font-size: 10.5px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -.btn-block { - display: block; - width: 100%; - padding-right: 0; - padding-left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.btn-block + .btn-block { - margin-top: 5px; -} - -input[type="submit"].btn-block, -input[type="reset"].btn-block, -input[type="button"].btn-block { - width: 100%; -} - -.btn-primary.active, -.btn-warning.active, -.btn-danger.active, -.btn-success.active, -.btn-info.active, -.btn-inverse.active { - color: rgba(255, 255, 255, 0.75); -} - -.btn-primary { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #006dcc; - *background-color: #0044cc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(to bottom, #0088cc, #0044cc); - background-repeat: repeat-x; - border-color: #0044cc #0044cc #002a80; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.btn-primary:hover, -.btn-primary:focus, -.btn-primary:active, -.btn-primary.active, -.btn-primary.disabled, -.btn-primary[disabled] { - color: #ffffff; - background-color: #0044cc; - *background-color: #003bb3; -} - -.btn-primary:active, -.btn-primary.active { - background-color: #003399 \9; -} - -.btn-warning { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #faa732; - *background-color: #f89406; - background-image: -moz-linear-gradient(top, #fbb450, #f89406); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); - background-image: -webkit-linear-gradient(top, #fbb450, #f89406); - background-image: -o-linear-gradient(top, #fbb450, #f89406); - background-image: linear-gradient(to bottom, #fbb450, #f89406); - background-repeat: repeat-x; - border-color: #f89406 #f89406 #ad6704; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.btn-warning:hover, -.btn-warning:focus, -.btn-warning:active, -.btn-warning.active, -.btn-warning.disabled, -.btn-warning[disabled] { - color: #ffffff; - background-color: #f89406; - *background-color: #df8505; -} - -.btn-warning:active, -.btn-warning.active { - background-color: #c67605 \9; -} - -.btn-danger { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #da4f49; - *background-color: #bd362f; - background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); - background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); - background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); - background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); - background-repeat: repeat-x; - border-color: #bd362f #bd362f #802420; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.btn-danger:hover, -.btn-danger:focus, -.btn-danger:active, -.btn-danger.active, -.btn-danger.disabled, -.btn-danger[disabled] { - color: #ffffff; - background-color: #bd362f; - *background-color: #a9302a; -} - -.btn-danger:active, -.btn-danger.active { - background-color: #942a25 \9; -} - -.btn-success { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #5bb75b; - *background-color: #51a351; - background-image: -moz-linear-gradient(top, #62c462, #51a351); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); - background-image: -webkit-linear-gradient(top, #62c462, #51a351); - background-image: -o-linear-gradient(top, #62c462, #51a351); - background-image: linear-gradient(to bottom, #62c462, #51a351); - background-repeat: repeat-x; - border-color: #51a351 #51a351 #387038; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.btn-success:hover, -.btn-success:focus, -.btn-success:active, -.btn-success.active, -.btn-success.disabled, -.btn-success[disabled] { - color: #ffffff; - background-color: #51a351; - *background-color: #499249; -} - -.btn-success:active, -.btn-success.active { - background-color: #408140 \9; -} - -.btn-info { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #49afcd; - *background-color: #2f96b4; - background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); - background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); - background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); - background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); - background-repeat: repeat-x; - border-color: #2f96b4 #2f96b4 #1f6377; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.btn-info:hover, -.btn-info:focus, -.btn-info:active, -.btn-info.active, -.btn-info.disabled, -.btn-info[disabled] { - color: #ffffff; - background-color: #2f96b4; - *background-color: #2a85a0; -} - -.btn-info:active, -.btn-info.active { - background-color: #24748c \9; -} - -.btn-inverse { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #363636; - *background-color: #222222; - background-image: -moz-linear-gradient(top, #444444, #222222); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); - background-image: -webkit-linear-gradient(top, #444444, #222222); - background-image: -o-linear-gradient(top, #444444, #222222); - background-image: linear-gradient(to bottom, #444444, #222222); - background-repeat: repeat-x; - border-color: #222222 #222222 #000000; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.btn-inverse:hover, -.btn-inverse:focus, -.btn-inverse:active, -.btn-inverse.active, -.btn-inverse.disabled, -.btn-inverse[disabled] { - color: #ffffff; - background-color: #222222; - *background-color: #151515; -} - -.btn-inverse:active, -.btn-inverse.active { - background-color: #080808 \9; -} - -button.btn, -input[type="submit"].btn { - *padding-top: 3px; - *padding-bottom: 3px; -} - -button.btn::-moz-focus-inner, -input[type="submit"].btn::-moz-focus-inner { - padding: 0; - border: 0; -} - -button.btn.btn-large, -input[type="submit"].btn.btn-large { - *padding-top: 7px; - *padding-bottom: 7px; -} - -button.btn.btn-small, -input[type="submit"].btn.btn-small { - *padding-top: 3px; - *padding-bottom: 3px; -} - -button.btn.btn-mini, -input[type="submit"].btn.btn-mini { - *padding-top: 1px; - *padding-bottom: 1px; -} - -.btn-link, -.btn-link:active, -.btn-link[disabled] { - background-color: transparent; - background-image: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} - -.btn-link { - color: #0088cc; - cursor: pointer; - border-color: transparent; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.btn-link:hover, -.btn-link:focus { - color: #005580; - text-decoration: underline; - background-color: transparent; -} - -.btn-link[disabled]:hover, -.btn-link[disabled]:focus { - color: #333333; - text-decoration: none; -} - -.btn-group { - position: relative; - display: inline-block; - *display: inline; - *margin-left: .3em; - font-size: 0; - white-space: nowrap; - vertical-align: middle; - *zoom: 1; -} - -.btn-group:first-child { - *margin-left: 0; -} - -.btn-group + .btn-group { - margin-left: 5px; -} - -.btn-toolbar { - margin-top: 10px; - margin-bottom: 10px; - font-size: 0; -} - -.btn-toolbar > .btn + .btn, -.btn-toolbar > .btn-group + .btn, -.btn-toolbar > .btn + .btn-group { - margin-left: 5px; -} - -.btn-group > .btn { - position: relative; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.btn-group > .btn + .btn { - margin-left: -1px; -} - -.btn-group > .btn, -.btn-group > .dropdown-menu, -.btn-group > .popover { - font-size: 14px; -} - -.btn-group > .btn-mini { - font-size: 10.5px; -} - -.btn-group > .btn-small { - font-size: 11.9px; -} - -.btn-group > .btn-large { - font-size: 17.5px; -} - -.btn-group > .btn:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-topleft: 4px; -} - -.btn-group > .btn:last-child, -.btn-group > .dropdown-toggle { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; -} - -.btn-group > .btn.large:first-child { - margin-left: 0; - -webkit-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -webkit-border-top-left-radius: 6px; - border-top-left-radius: 6px; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-topleft: 6px; -} - -.btn-group > .btn.large:last-child, -.btn-group > .large.dropdown-toggle { - -webkit-border-top-right-radius: 6px; - border-top-right-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-topright: 6px; - -moz-border-radius-bottomright: 6px; -} - -.btn-group > .btn:hover, -.btn-group > .btn:focus, -.btn-group > .btn:active, -.btn-group > .btn.active { - z-index: 2; -} - -.btn-group .dropdown-toggle:active, -.btn-group.open .dropdown-toggle { - outline: 0; -} - -.btn-group > .btn + .dropdown-toggle { - *padding-top: 5px; - padding-right: 8px; - *padding-bottom: 5px; - padding-left: 8px; - -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.btn-group > .btn-mini + .dropdown-toggle { - *padding-top: 2px; - padding-right: 5px; - *padding-bottom: 2px; - padding-left: 5px; -} - -.btn-group > .btn-small + .dropdown-toggle { - *padding-top: 5px; - *padding-bottom: 4px; -} - -.btn-group > .btn-large + .dropdown-toggle { - *padding-top: 7px; - padding-right: 12px; - *padding-bottom: 7px; - padding-left: 12px; -} - -.btn-group.open .dropdown-toggle { - background-image: none; - -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.btn-group.open .btn.dropdown-toggle { - background-color: #e6e6e6; -} - -.btn-group.open .btn-primary.dropdown-toggle { - background-color: #0044cc; -} - -.btn-group.open .btn-warning.dropdown-toggle { - background-color: #f89406; -} - -.btn-group.open .btn-danger.dropdown-toggle { - background-color: #bd362f; -} - -.btn-group.open .btn-success.dropdown-toggle { - background-color: #51a351; -} - -.btn-group.open .btn-info.dropdown-toggle { - background-color: #2f96b4; -} - -.btn-group.open .btn-inverse.dropdown-toggle { - background-color: #222222; -} - -.btn .caret { - margin-top: 8px; - margin-left: 0; -} - -.btn-large .caret { - margin-top: 6px; -} - -.btn-large .caret { - border-top-width: 5px; - border-right-width: 5px; - border-left-width: 5px; -} - -.btn-mini .caret, -.btn-small .caret { - margin-top: 8px; -} - -.dropup .btn-large .caret { - border-bottom-width: 5px; -} - -.btn-primary .caret, -.btn-warning .caret, -.btn-danger .caret, -.btn-info .caret, -.btn-success .caret, -.btn-inverse .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; -} - -.btn-group-vertical { - display: inline-block; - *display: inline; - /* IE7 inline-block hack */ - - *zoom: 1; -} - -.btn-group-vertical > .btn { - display: block; - float: none; - max-width: 100%; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.btn-group-vertical > .btn + .btn { - margin-top: -1px; - margin-left: 0; -} - -.btn-group-vertical > .btn:first-child { - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; -} - -.btn-group-vertical > .btn:last-child { - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; -} - -.btn-group-vertical > .btn-large:first-child { - -webkit-border-radius: 6px 6px 0 0; - -moz-border-radius: 6px 6px 0 0; - border-radius: 6px 6px 0 0; -} - -.btn-group-vertical > .btn-large:last-child { - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; -} - -.alert { - padding: 8px 35px 8px 14px; - margin-bottom: 20px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #fcf8e3; - border: 1px solid #fbeed5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.alert, -.alert h4 { - color: #c09853; -} - -.alert h4 { - margin: 0; -} - -.alert .close { - position: relative; - top: -2px; - right: -21px; - line-height: 20px; -} - -.alert-success { - color: #468847; - background-color: #dff0d8; - border-color: #d6e9c6; -} - -.alert-success h4 { - color: #468847; -} - -.alert-danger, -.alert-error { - color: #b94a48; - background-color: #f2dede; - border-color: #eed3d7; -} - -.alert-danger h4, -.alert-error h4 { - color: #b94a48; -} - -.alert-info { - color: #3a87ad; - background-color: #d9edf7; - border-color: #bce8f1; -} - -.alert-info h4 { - color: #3a87ad; -} - -.alert-block { - padding-top: 14px; - padding-bottom: 14px; -} - -.alert-block > p, -.alert-block > ul { - margin-bottom: 0; -} - -.alert-block p + p { - margin-top: 5px; -} - -.nav { - margin-bottom: 20px; - margin-left: 0; - list-style: none; -} - -.nav > li > a { - display: block; -} - -.nav > li > a:hover, -.nav > li > a:focus { - text-decoration: none; - background-color: #eeeeee; -} - -.nav > li > a > img { - max-width: none; -} - -.nav > .pull-right { - float: right; -} - -.nav-header { - display: block; - padding: 3px 15px; - font-size: 11px; - font-weight: bold; - line-height: 20px; - color: #999999; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - text-transform: uppercase; -} - -.nav li + .nav-header { - margin-top: 9px; -} - -.nav-list { - padding-right: 15px; - padding-left: 15px; - margin-bottom: 0; -} - -.nav-list > li > a, -.nav-list .nav-header { - margin-right: -15px; - margin-left: -15px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); -} - -.nav-list > li > a { - padding: 3px 15px; -} - -.nav-list > .active > a, -.nav-list > .active > a:hover, -.nav-list > .active > a:focus { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); - background-color: #0088cc; -} - -.nav-list [class^="icon-"], -.nav-list [class*=" icon-"] { - margin-right: 2px; -} - -.nav-list .divider { - *width: 100%; - height: 1px; - margin: 9px 1px; - *margin: -5px 0 5px; - overflow: hidden; - background-color: #e5e5e5; - border-bottom: 1px solid #ffffff; -} - -.nav-tabs, -.nav-pills { - *zoom: 1; -} - -.nav-tabs:before, -.nav-pills:before, -.nav-tabs:after, -.nav-pills:after { - display: table; - line-height: 0; - content: ""; -} - -.nav-tabs:after, -.nav-pills:after { - clear: both; -} - -.nav-tabs > li, -.nav-pills > li { - float: left; -} - -.nav-tabs > li > a, -.nav-pills > li > a { - padding-right: 12px; - padding-left: 12px; - margin-right: 2px; - line-height: 14px; -} - -.nav-tabs { - border-bottom: 1px solid #ddd; -} - -.nav-tabs > li { - margin-bottom: -1px; -} - -.nav-tabs > li > a { - padding-top: 8px; - padding-bottom: 8px; - line-height: 20px; - border: 1px solid transparent; - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; -} - -.nav-tabs > li > a:hover, -.nav-tabs > li > a:focus { - border-color: #eeeeee #eeeeee #dddddd; -} - -.nav-tabs > .active > a, -.nav-tabs > .active > a:hover, -.nav-tabs > .active > a:focus { - color: #555555; - cursor: default; - background-color: #ffffff; - border: 1px solid #ddd; - border-bottom-color: transparent; -} - -.nav-pills > li > a { - padding-top: 8px; - padding-bottom: 8px; - margin-top: 2px; - margin-bottom: 2px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} - -.nav-pills > .active > a, -.nav-pills > .active > a:hover, -.nav-pills > .active > a:focus { - color: #ffffff; - background-color: #0088cc; -} - -.nav-stacked > li { - float: none; -} - -.nav-stacked > li > a { - margin-right: 0; -} - -.nav-tabs.nav-stacked { - border-bottom: 0; -} - -.nav-tabs.nav-stacked > li > a { - border: 1px solid #ddd; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.nav-tabs.nav-stacked > li:first-child > a { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-topleft: 4px; -} - -.nav-tabs.nav-stacked > li:last-child > a { - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomright: 4px; - -moz-border-radius-bottomleft: 4px; -} - -.nav-tabs.nav-stacked > li > a:hover, -.nav-tabs.nav-stacked > li > a:focus { - z-index: 2; - border-color: #ddd; -} - -.nav-pills.nav-stacked > li > a { - margin-bottom: 3px; -} - -.nav-pills.nav-stacked > li:last-child > a { - margin-bottom: 1px; -} - -.nav-tabs .dropdown-menu { - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; -} - -.nav-pills .dropdown-menu { - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -.nav .dropdown-toggle .caret { - margin-top: 6px; - border-top-color: #0088cc; - border-bottom-color: #0088cc; -} - -.nav .dropdown-toggle:hover .caret, -.nav .dropdown-toggle:focus .caret { - border-top-color: #005580; - border-bottom-color: #005580; -} - -/* move down carets for tabs */ - -.nav-tabs .dropdown-toggle .caret { - margin-top: 8px; -} - -.nav .active .dropdown-toggle .caret { - border-top-color: #fff; - border-bottom-color: #fff; -} - -.nav-tabs .active .dropdown-toggle .caret { - border-top-color: #555555; - border-bottom-color: #555555; -} - -.nav > .dropdown.active > a:hover, -.nav > .dropdown.active > a:focus { - cursor: pointer; -} - -.nav-tabs .open .dropdown-toggle, -.nav-pills .open .dropdown-toggle, -.nav > li.dropdown.open.active > a:hover, -.nav > li.dropdown.open.active > a:focus { - color: #ffffff; - background-color: #999999; - border-color: #999999; -} - -.nav li.dropdown.open .caret, -.nav li.dropdown.open.active .caret, -.nav li.dropdown.open a:hover .caret, -.nav li.dropdown.open a:focus .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; - opacity: 1; - filter: alpha(opacity=100); -} - -.tabs-stacked .open > a:hover, -.tabs-stacked .open > a:focus { - border-color: #999999; -} - -.tabbable { - *zoom: 1; -} - -.tabbable:before, -.tabbable:after { - display: table; - line-height: 0; - content: ""; -} - -.tabbable:after { - clear: both; -} - -.tab-content { - overflow: auto; -} - -.tabs-below > .nav-tabs, -.tabs-right > .nav-tabs, -.tabs-left > .nav-tabs { - border-bottom: 0; -} - -.tab-content > .tab-pane, -.pill-content > .pill-pane { - display: none; -} - -.tab-content > .active, -.pill-content > .active { - display: block; -} - -.tabs-below > .nav-tabs { - border-top: 1px solid #ddd; -} - -.tabs-below > .nav-tabs > li { - margin-top: -1px; - margin-bottom: 0; -} - -.tabs-below > .nav-tabs > li > a { - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; -} - -.tabs-below > .nav-tabs > li > a:hover, -.tabs-below > .nav-tabs > li > a:focus { - border-top-color: #ddd; - border-bottom-color: transparent; -} - -.tabs-below > .nav-tabs > .active > a, -.tabs-below > .nav-tabs > .active > a:hover, -.tabs-below > .nav-tabs > .active > a:focus { - border-color: transparent #ddd #ddd #ddd; -} - -.tabs-left > .nav-tabs > li, -.tabs-right > .nav-tabs > li { - float: none; -} - -.tabs-left > .nav-tabs > li > a, -.tabs-right > .nav-tabs > li > a { - min-width: 74px; - margin-right: 0; - margin-bottom: 3px; -} - -.tabs-left > .nav-tabs { - float: left; - margin-right: 19px; - border-right: 1px solid #ddd; -} - -.tabs-left > .nav-tabs > li > a { - margin-right: -1px; - -webkit-border-radius: 4px 0 0 4px; - -moz-border-radius: 4px 0 0 4px; - border-radius: 4px 0 0 4px; -} - -.tabs-left > .nav-tabs > li > a:hover, -.tabs-left > .nav-tabs > li > a:focus { - border-color: #eeeeee #dddddd #eeeeee #eeeeee; -} - -.tabs-left > .nav-tabs .active > a, -.tabs-left > .nav-tabs .active > a:hover, -.tabs-left > .nav-tabs .active > a:focus { - border-color: #ddd transparent #ddd #ddd; - *border-right-color: #ffffff; -} - -.tabs-right > .nav-tabs { - float: right; - margin-left: 19px; - border-left: 1px solid #ddd; -} - -.tabs-right > .nav-tabs > li > a { - margin-left: -1px; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; -} - -.tabs-right > .nav-tabs > li > a:hover, -.tabs-right > .nav-tabs > li > a:focus { - border-color: #eeeeee #eeeeee #eeeeee #dddddd; -} - -.tabs-right > .nav-tabs .active > a, -.tabs-right > .nav-tabs .active > a:hover, -.tabs-right > .nav-tabs .active > a:focus { - border-color: #ddd #ddd #ddd transparent; - *border-left-color: #ffffff; -} - -.nav > .disabled > a { - color: #999999; -} - -.nav > .disabled > a:hover, -.nav > .disabled > a:focus { - text-decoration: none; - cursor: default; - background-color: transparent; -} - -.navbar { - *position: relative; - *z-index: 2; - margin-bottom: 20px; - overflow: visible; -} - -.navbar-inner { - min-height: 40px; - padding-right: 20px; - padding-left: 20px; - background-color: #fafafa; - background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); - background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); - background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); - background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); - background-repeat: repeat-x; - border: 1px solid #d4d4d4; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); - *zoom: 1; - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); -} - -.navbar-inner:before, -.navbar-inner:after { - display: table; - line-height: 0; - content: ""; -} - -.navbar-inner:after { - clear: both; -} - -.navbar .container { - width: auto; -} - -.nav-collapse.collapse { - height: auto; - overflow: visible; -} - -.navbar .brand { - display: block; - float: left; - padding: 10px 20px 10px; - margin-left: -20px; - font-size: 20px; - font-weight: 200; - color: #777777; - text-shadow: 0 1px 0 #ffffff; -} - -.navbar .brand:hover, -.navbar .brand:focus { - text-decoration: none; -} - -.navbar-text { - margin-bottom: 0; - line-height: 40px; - color: #777777; -} - -.navbar-link { - color: #777777; -} - -.navbar-link:hover, -.navbar-link:focus { - color: #333333; -} - -.navbar .divider-vertical { - height: 40px; - margin: 0 9px; - border-right: 1px solid #ffffff; - border-left: 1px solid #f2f2f2; -} - -.navbar .btn, -.navbar .btn-group { - margin-top: 5px; -} - -.navbar .btn-group .btn, -.navbar .input-prepend .btn, -.navbar .input-append .btn, -.navbar .input-prepend .btn-group, -.navbar .input-append .btn-group { - margin-top: 0; -} - -.navbar-form { - margin-bottom: 0; - *zoom: 1; -} - -.navbar-form:before, -.navbar-form:after { - display: table; - line-height: 0; - content: ""; -} - -.navbar-form:after { - clear: both; -} - -.navbar-form input, -.navbar-form select, -.navbar-form .radio, -.navbar-form .checkbox { - margin-top: 5px; -} - -.navbar-form input, -.navbar-form select, -.navbar-form .btn { - display: inline-block; - margin-bottom: 0; -} - -.navbar-form input[type="image"], -.navbar-form input[type="checkbox"], -.navbar-form input[type="radio"] { - margin-top: 3px; -} - -.navbar-form .input-append, -.navbar-form .input-prepend { - margin-top: 5px; - white-space: nowrap; -} - -.navbar-form .input-append input, -.navbar-form .input-prepend input { - margin-top: 0; -} - -.navbar-search { - position: relative; - float: left; - margin-top: 5px; - margin-bottom: 0; -} - -.navbar-search .search-query { - padding: 4px 14px; - margin-bottom: 0; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - font-weight: normal; - line-height: 1; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; -} - -.navbar-static-top { - position: static; - margin-bottom: 0; -} - -.navbar-static-top .navbar-inner { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.navbar-fixed-top, -.navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: 1030; - margin-bottom: 0; -} - -.navbar-fixed-top .navbar-inner, -.navbar-static-top .navbar-inner { - border-width: 0 0 1px; -} - -.navbar-fixed-bottom .navbar-inner { - border-width: 1px 0 0; -} - -.navbar-fixed-top .navbar-inner, -.navbar-fixed-bottom .navbar-inner { - padding-right: 0; - padding-left: 0; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} - -.navbar-static-top .container, -.navbar-fixed-top .container, -.navbar-fixed-bottom .container { - width: 940px; -} - -.navbar-fixed-top { - top: 0; -} - -.navbar-fixed-top .navbar-inner, -.navbar-static-top .navbar-inner { - -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); -} - -.navbar-fixed-bottom { - bottom: 0; -} - -.navbar-fixed-bottom .navbar-inner { - -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); - box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); -} - -.navbar .nav { - position: relative; - left: 0; - display: block; - float: left; - margin: 0 10px 0 0; -} - -.navbar .nav.pull-right { - float: right; - margin-right: 0; -} - -.navbar .nav > li { - float: left; -} - -.navbar .nav > li > a { - float: none; - padding: 10px 15px 10px; - color: #777777; - text-decoration: none; - text-shadow: 0 1px 0 #ffffff; -} - -.navbar .nav .dropdown-toggle .caret { - margin-top: 8px; -} - -.navbar .nav > li > a:focus, -.navbar .nav > li > a:hover { - color: #333333; - text-decoration: none; - background-color: transparent; -} - -.navbar .nav > .active > a, -.navbar .nav > .active > a:hover, -.navbar .nav > .active > a:focus { - color: #555555; - text-decoration: none; - background-color: #e5e5e5; - -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); - -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); - box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); -} - -.navbar .btn-navbar { - display: none; - float: right; - padding: 7px 10px; - margin-right: 5px; - margin-left: 5px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #ededed; - *background-color: #e5e5e5; - background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); - background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); - background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); - background-repeat: repeat-x; - border-color: #e5e5e5 #e5e5e5 #bfbfbf; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); - -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); -} - -.navbar .btn-navbar:hover, -.navbar .btn-navbar:focus, -.navbar .btn-navbar:active, -.navbar .btn-navbar.active, -.navbar .btn-navbar.disabled, -.navbar .btn-navbar[disabled] { - color: #ffffff; - background-color: #e5e5e5; - *background-color: #d9d9d9; -} - -.navbar .btn-navbar:active, -.navbar .btn-navbar.active { - background-color: #cccccc \9; -} - -.navbar .btn-navbar .icon-bar { - display: block; - width: 18px; - height: 2px; - background-color: #f5f5f5; - -webkit-border-radius: 1px; - -moz-border-radius: 1px; - border-radius: 1px; - -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); - -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); -} - -.btn-navbar .icon-bar + .icon-bar { - margin-top: 3px; -} - -.navbar .nav > li > .dropdown-menu:before { - position: absolute; - top: -7px; - left: 9px; - display: inline-block; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-left: 7px solid transparent; - border-bottom-color: rgba(0, 0, 0, 0.2); - content: ''; -} - -.navbar .nav > li > .dropdown-menu:after { - position: absolute; - top: -6px; - left: 10px; - display: inline-block; - border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; - border-left: 6px solid transparent; - content: ''; -} - -.navbar-fixed-bottom .nav > li > .dropdown-menu:before { - top: auto; - bottom: -7px; - border-top: 7px solid #ccc; - border-bottom: 0; - border-top-color: rgba(0, 0, 0, 0.2); -} - -.navbar-fixed-bottom .nav > li > .dropdown-menu:after { - top: auto; - bottom: -6px; - border-top: 6px solid #ffffff; - border-bottom: 0; -} - -.navbar .nav li.dropdown > a:hover .caret, -.navbar .nav li.dropdown > a:focus .caret { - border-top-color: #333333; - border-bottom-color: #333333; -} - -.navbar .nav li.dropdown.open > .dropdown-toggle, -.navbar .nav li.dropdown.active > .dropdown-toggle, -.navbar .nav li.dropdown.open.active > .dropdown-toggle { - color: #555555; - background-color: #e5e5e5; -} - -.navbar .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: #777777; - border-bottom-color: #777777; -} - -.navbar .nav li.dropdown.open > .dropdown-toggle .caret, -.navbar .nav li.dropdown.active > .dropdown-toggle .caret, -.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: #555555; - border-bottom-color: #555555; -} - -.navbar .pull-right > li > .dropdown-menu, -.navbar .nav > li > .dropdown-menu.pull-right { - right: 0; - left: auto; -} - -.navbar .pull-right > li > .dropdown-menu:before, -.navbar .nav > li > .dropdown-menu.pull-right:before { - right: 12px; - left: auto; -} - -.navbar .pull-right > li > .dropdown-menu:after, -.navbar .nav > li > .dropdown-menu.pull-right:after { - right: 13px; - left: auto; -} - -.navbar .pull-right > li > .dropdown-menu .dropdown-menu, -.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { - right: 100%; - left: auto; - margin-right: -1px; - margin-left: 0; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; -} - -.navbar-inverse .navbar-inner { - background-color: #1b1b1b; - background-image: -moz-linear-gradient(top, #222222, #111111); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); - background-image: -webkit-linear-gradient(top, #222222, #111111); - background-image: -o-linear-gradient(top, #222222, #111111); - background-image: linear-gradient(to bottom, #222222, #111111); - background-repeat: repeat-x; - border-color: #252525; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); -} - -.navbar-inverse .brand, -.navbar-inverse .nav > li > a { - color: #999999; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); -} - -.navbar-inverse .brand:hover, -.navbar-inverse .nav > li > a:hover, -.navbar-inverse .brand:focus, -.navbar-inverse .nav > li > a:focus { - color: #ffffff; -} - -.navbar-inverse .brand { - color: #999999; -} - -.navbar-inverse .navbar-text { - color: #999999; -} - -.navbar-inverse .nav > li > a:focus, -.navbar-inverse .nav > li > a:hover { - color: #ffffff; - background-color: transparent; -} - -.navbar-inverse .nav .active > a, -.navbar-inverse .nav .active > a:hover, -.navbar-inverse .nav .active > a:focus { - color: #ffffff; - background-color: #111111; -} - -.navbar-inverse .navbar-link { - color: #999999; -} - -.navbar-inverse .navbar-link:hover, -.navbar-inverse .navbar-link:focus { - color: #ffffff; -} - -.navbar-inverse .divider-vertical { - border-right-color: #222222; - border-left-color: #111111; -} - -.navbar-inverse .nav li.dropdown.open > .dropdown-toggle, -.navbar-inverse .nav li.dropdown.active > .dropdown-toggle, -.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { - color: #ffffff; - background-color: #111111; -} - -.navbar-inverse .nav li.dropdown > a:hover .caret, -.navbar-inverse .nav li.dropdown > a:focus .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; -} - -.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { - border-top-color: #999999; - border-bottom-color: #999999; -} - -.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, -.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, -.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { - border-top-color: #ffffff; - border-bottom-color: #ffffff; -} - -.navbar-inverse .navbar-search .search-query { - color: #ffffff; - background-color: #515151; - border-color: #111111; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; -} - -.navbar-inverse .navbar-search .search-query:-moz-placeholder { - color: #cccccc; -} - -.navbar-inverse .navbar-search .search-query:-ms-input-placeholder { - color: #cccccc; -} - -.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { - color: #cccccc; -} - -.navbar-inverse .navbar-search .search-query:focus, -.navbar-inverse .navbar-search .search-query.focused { - padding: 5px 15px; - color: #333333; - text-shadow: 0 1px 0 #ffffff; - background-color: #ffffff; - border: 0; - outline: 0; - -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); - -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); - box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); -} - -.navbar-inverse .btn-navbar { - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #0e0e0e; - *background-color: #040404; - background-image: -moz-linear-gradient(top, #151515, #040404); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); - background-image: -webkit-linear-gradient(top, #151515, #040404); - background-image: -o-linear-gradient(top, #151515, #040404); - background-image: linear-gradient(to bottom, #151515, #040404); - background-repeat: repeat-x; - border-color: #040404 #040404 #000000; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -} - -.navbar-inverse .btn-navbar:hover, -.navbar-inverse .btn-navbar:focus, -.navbar-inverse .btn-navbar:active, -.navbar-inverse .btn-navbar.active, -.navbar-inverse .btn-navbar.disabled, -.navbar-inverse .btn-navbar[disabled] { - color: #ffffff; - background-color: #040404; - *background-color: #000000; -} - -.navbar-inverse .btn-navbar:active, -.navbar-inverse .btn-navbar.active { - background-color: #000000 \9; -} - -.breadcrumb { - padding: 8px 15px; - margin: 0 0 20px; - list-style: none; - background-color: #f5f5f5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.breadcrumb > li { - display: inline-block; - *display: inline; - text-shadow: 0 1px 0 #ffffff; - *zoom: 1; -} - -.breadcrumb > li > .divider { - padding: 0 5px; - color: #ccc; -} - -.breadcrumb > .active { - color: #999999; -} - -.pagination { - margin: 20px 0; -} - -.pagination ul { - display: inline-block; - *display: inline; - margin-bottom: 0; - margin-left: 0; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - *zoom: 1; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.pagination ul > li { - display: inline; -} - -.pagination ul > li > a, -.pagination ul > li > span { - float: left; - padding: 4px 12px; - line-height: 20px; - text-decoration: none; - background-color: #ffffff; - border: 1px solid #dddddd; - border-left-width: 0; -} - -.pagination ul > li > a:hover, -.pagination ul > li > a:focus, -.pagination ul > .active > a, -.pagination ul > .active > span { - background-color: #f5f5f5; -} - -.pagination ul > .active > a, -.pagination ul > .active > span { - color: #999999; - cursor: default; -} - -.pagination ul > .disabled > span, -.pagination ul > .disabled > a, -.pagination ul > .disabled > a:hover, -.pagination ul > .disabled > a:focus { - color: #999999; - cursor: default; - background-color: transparent; -} - -.pagination ul > li:first-child > a, -.pagination ul > li:first-child > span { - border-left-width: 1px; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -webkit-border-top-left-radius: 4px; - border-top-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-topleft: 4px; -} - -.pagination ul > li:last-child > a, -.pagination ul > li:last-child > span { - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -moz-border-radius-topright: 4px; - -moz-border-radius-bottomright: 4px; -} - -.pagination-centered { - text-align: center; -} - -.pagination-right { - text-align: right; -} - -.pagination-large ul > li > a, -.pagination-large ul > li > span { - padding: 11px 19px; - font-size: 17.5px; -} - -.pagination-large ul > li:first-child > a, -.pagination-large ul > li:first-child > span { - -webkit-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -webkit-border-top-left-radius: 6px; - border-top-left-radius: 6px; - -moz-border-radius-bottomleft: 6px; - -moz-border-radius-topleft: 6px; -} - -.pagination-large ul > li:last-child > a, -.pagination-large ul > li:last-child > span { - -webkit-border-top-right-radius: 6px; - border-top-right-radius: 6px; - -webkit-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - -moz-border-radius-topright: 6px; - -moz-border-radius-bottomright: 6px; -} - -.pagination-mini ul > li:first-child > a, -.pagination-small ul > li:first-child > a, -.pagination-mini ul > li:first-child > span, -.pagination-small ul > li:first-child > span { - -webkit-border-bottom-left-radius: 3px; - border-bottom-left-radius: 3px; - -webkit-border-top-left-radius: 3px; - border-top-left-radius: 3px; - -moz-border-radius-bottomleft: 3px; - -moz-border-radius-topleft: 3px; -} - -.pagination-mini ul > li:last-child > a, -.pagination-small ul > li:last-child > a, -.pagination-mini ul > li:last-child > span, -.pagination-small ul > li:last-child > span { - -webkit-border-top-right-radius: 3px; - border-top-right-radius: 3px; - -webkit-border-bottom-right-radius: 3px; - border-bottom-right-radius: 3px; - -moz-border-radius-topright: 3px; - -moz-border-radius-bottomright: 3px; -} - -.pagination-small ul > li > a, -.pagination-small ul > li > span { - padding: 2px 10px; - font-size: 11.9px; -} - -.pagination-mini ul > li > a, -.pagination-mini ul > li > span { - padding: 0 6px; - font-size: 10.5px; -} - -.pager { - margin: 20px 0; - text-align: center; - list-style: none; - *zoom: 1; -} - -.pager:before, -.pager:after { - display: table; - line-height: 0; - content: ""; -} - -.pager:after { - clear: both; -} - -.pager li { - display: inline; -} - -.pager li > a, -.pager li > span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; -} - -.pager li > a:hover, -.pager li > a:focus { - text-decoration: none; - background-color: #f5f5f5; -} - -.pager .next > a, -.pager .next > span { - float: right; -} - -.pager .previous > a, -.pager .previous > span { - float: left; -} - -.pager .disabled > a, -.pager .disabled > a:hover, -.pager .disabled > a:focus, -.pager .disabled > span { - color: #999999; - cursor: default; - background-color: #fff; -} - -.modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1040; - background-color: #000000; -} - -.modal-backdrop.fade { - opacity: 0; -} - -.modal-backdrop, -.modal-backdrop.fade.in { - opacity: 0.8; - filter: alpha(opacity=80); -} - -.modal { - position: fixed; - top: 10%; - left: 50%; - z-index: 1050; - width: 560px; - margin-left: -280px; - background-color: #ffffff; - border: 1px solid #999; - border: 1px solid rgba(0, 0, 0, 0.3); - *border: 1px solid #999; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - outline: none; - -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - -webkit-background-clip: padding-box; - -moz-background-clip: padding-box; - background-clip: padding-box; -} - -.modal.fade { - top: -25%; - -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; - -moz-transition: opacity 0.3s linear, top 0.3s ease-out; - -o-transition: opacity 0.3s linear, top 0.3s ease-out; - transition: opacity 0.3s linear, top 0.3s ease-out; -} - -.modal.fade.in { - top: 10%; -} - -.modal-header { - padding: 9px 15px; - border-bottom: 1px solid #eee; -} - -.modal-header .close { - margin-top: 2px; -} - -.modal-header h3 { - margin: 0; - line-height: 30px; -} - -.modal-body { - position: relative; - max-height: 400px; - padding: 15px; - overflow-y: auto; -} - -.modal-form { - margin-bottom: 0; -} - -.modal-footer { - padding: 14px 15px 15px; - margin-bottom: 0; - text-align: right; - background-color: #f5f5f5; - border-top: 1px solid #ddd; - -webkit-border-radius: 0 0 6px 6px; - -moz-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; - *zoom: 1; - -webkit-box-shadow: inset 0 1px 0 #ffffff; - -moz-box-shadow: inset 0 1px 0 #ffffff; - box-shadow: inset 0 1px 0 #ffffff; -} - -.modal-footer:before, -.modal-footer:after { - display: table; - line-height: 0; - content: ""; -} - -.modal-footer:after { - clear: both; -} - -.modal-footer .btn + .btn { - margin-bottom: 0; - margin-left: 5px; -} - -.modal-footer .btn-group .btn + .btn { - margin-left: -1px; -} - -.modal-footer .btn-block + .btn-block { - margin-left: 0; -} - -.tooltip { - position: absolute; - z-index: 1030; - display: block; - font-size: 11px; - line-height: 1.4; - opacity: 0; - filter: alpha(opacity=0); - visibility: visible; -} - -.tooltip.in { - opacity: 0.8; - filter: alpha(opacity=80); -} - -.tooltip.top { - padding: 5px 0; - margin-top: -3px; -} - -.tooltip.right { - padding: 0 5px; - margin-left: 3px; -} - -.tooltip.bottom { - padding: 5px 0; - margin-top: 3px; -} - -.tooltip.left { - padding: 0 5px; - margin-left: -3px; -} - -.tooltip-inner { - max-width: 200px; - padding: 8px; - color: #ffffff; - text-align: center; - text-decoration: none; - background-color: #000000; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} - -.tooltip.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-top-color: #000000; - border-width: 5px 5px 0; -} - -.tooltip.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-right-color: #000000; - border-width: 5px 5px 5px 0; -} - -.tooltip.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-left-color: #000000; - border-width: 5px 0 5px 5px; -} - -.tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-bottom-color: #000000; - border-width: 0 5px 5px; -} - -.popover { - position: absolute; - top: 0; - left: 0; - z-index: 1010; - display: none; - max-width: 276px; - padding: 1px; - text-align: left; - white-space: normal; - background-color: #ffffff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.2); - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; -} - -.popover.top { - margin-top: -10px; -} - -.popover.right { - margin-left: 10px; -} - -.popover.bottom { - margin-top: 10px; -} - -.popover.left { - margin-left: -10px; -} - -.popover-title { - padding: 8px 14px; - margin: 0; - font-size: 14px; - font-weight: normal; - line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; -} - -.popover-title:empty { - display: none; -} - -.popover-content { - padding: 9px 14px; -} - -.popover .arrow, -.popover .arrow:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} - -.popover .arrow { - border-width: 11px; -} - -.popover .arrow:after { - border-width: 10px; - content: ""; -} - -.popover.top .arrow { - bottom: -11px; - left: 50%; - margin-left: -11px; - border-top-color: #999; - border-top-color: rgba(0, 0, 0, 0.25); - border-bottom-width: 0; -} - -.popover.top .arrow:after { - bottom: 1px; - margin-left: -10px; - border-top-color: #ffffff; - border-bottom-width: 0; -} - -.popover.right .arrow { - top: 50%; - left: -11px; - margin-top: -11px; - border-right-color: #999; - border-right-color: rgba(0, 0, 0, 0.25); - border-left-width: 0; -} - -.popover.right .arrow:after { - bottom: -10px; - left: 1px; - border-right-color: #ffffff; - border-left-width: 0; -} - -.popover.bottom .arrow { - top: -11px; - left: 50%; - margin-left: -11px; - border-bottom-color: #999; - border-bottom-color: rgba(0, 0, 0, 0.25); - border-top-width: 0; -} - -.popover.bottom .arrow:after { - top: 1px; - margin-left: -10px; - border-bottom-color: #ffffff; - border-top-width: 0; -} - -.popover.left .arrow { - top: 50%; - right: -11px; - margin-top: -11px; - border-left-color: #999; - border-left-color: rgba(0, 0, 0, 0.25); - border-right-width: 0; -} - -.popover.left .arrow:after { - right: 1px; - bottom: -10px; - border-left-color: #ffffff; - border-right-width: 0; -} - -.thumbnails { - margin-left: -20px; - list-style: none; - *zoom: 1; -} - -.thumbnails:before, -.thumbnails:after { - display: table; - line-height: 0; - content: ""; -} - -.thumbnails:after { - clear: both; -} - -.row-fluid .thumbnails { - margin-left: 0; -} - -.thumbnails > li { - float: left; - margin-bottom: 20px; - margin-left: 20px; -} - -.thumbnail { - display: block; - padding: 4px; - line-height: 20px; - border: 1px solid #ddd; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} - -a.thumbnail:hover, -a.thumbnail:focus { - border-color: #0088cc; - -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); - -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); - box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); -} - -.thumbnail > img { - display: block; - max-width: 100%; - margin-right: auto; - margin-left: auto; -} - -.thumbnail .caption { - padding: 9px; - color: #555555; -} - -.media, -.media-body { - overflow: hidden; - *overflow: visible; - zoom: 1; -} - -.media, -.media .media { - margin-top: 15px; -} - -.media:first-child { - margin-top: 0; -} - -.media-object { - display: block; -} - -.media-heading { - margin: 0 0 5px; -} - -.media > .pull-left { - margin-right: 10px; -} - -.media > .pull-right { - margin-left: 10px; -} - -.media-list { - margin-left: 0; - list-style: none; -} - -.label, -.badge { - display: inline-block; - padding: 2px 4px; - font-size: 11.844px; - font-weight: bold; - line-height: 14px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - white-space: nowrap; - vertical-align: baseline; - background-color: #999999; -} - -.label { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -.badge { - padding-right: 9px; - padding-left: 9px; - -webkit-border-radius: 9px; - -moz-border-radius: 9px; - border-radius: 9px; -} - -.label:empty, -.badge:empty { - display: none; -} - -a.label:hover, -a.label:focus, -a.badge:hover, -a.badge:focus { - color: #ffffff; - text-decoration: none; - cursor: pointer; -} - -.label-important, -.badge-important { - background-color: #b94a48; -} - -.label-important[href], -.badge-important[href] { - background-color: #953b39; -} - -.label-warning, -.badge-warning { - background-color: #f89406; -} - -.label-warning[href], -.badge-warning[href] { - background-color: #c67605; -} - -.label-success, -.badge-success { - background-color: #468847; -} - -.label-success[href], -.badge-success[href] { - background-color: #356635; -} - -.label-info, -.badge-info { - background-color: #3a87ad; -} - -.label-info[href], -.badge-info[href] { - background-color: #2d6987; -} - -.label-inverse, -.badge-inverse { - background-color: #333333; -} - -.label-inverse[href], -.badge-inverse[href] { - background-color: #1a1a1a; -} - -.btn .label, -.btn .badge { - position: relative; - top: -1px; -} - -.btn-mini .label, -.btn-mini .badge { - top: 0; -} - -@-webkit-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} - -@-moz-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} - -@-ms-keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} - -@-o-keyframes progress-bar-stripes { - from { - background-position: 0 0; - } - to { - background-position: 40px 0; - } -} - -@keyframes progress-bar-stripes { - from { - background-position: 40px 0; - } - to { - background-position: 0 0; - } -} - -.progress { - height: 20px; - margin-bottom: 20px; - overflow: hidden; - background-color: #f7f7f7; - background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); - background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); - background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); - background-repeat: repeat-x; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -} - -.progress .bar { - float: left; - width: 0; - height: 100%; - font-size: 12px; - color: #ffffff; - text-align: center; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - background-color: #0e90d2; - background-image: -moz-linear-gradient(top, #149bdf, #0480be); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); - background-image: -webkit-linear-gradient(top, #149bdf, #0480be); - background-image: -o-linear-gradient(top, #149bdf, #0480be); - background-image: linear-gradient(to bottom, #149bdf, #0480be); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); - -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - -webkit-transition: width 0.6s ease; - -moz-transition: width 0.6s ease; - -o-transition: width 0.6s ease; - transition: width 0.6s ease; -} - -.progress .bar + .bar { - -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); - -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); - box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); -} - -.progress-striped .bar { - background-color: #149bdf; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - -webkit-background-size: 40px 40px; - -moz-background-size: 40px 40px; - -o-background-size: 40px 40px; - background-size: 40px 40px; -} - -.progress.active .bar { - -webkit-animation: progress-bar-stripes 2s linear infinite; - -moz-animation: progress-bar-stripes 2s linear infinite; - -ms-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; -} - -.progress-danger .bar, -.progress .bar-danger { - background-color: #dd514c; - background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); - background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); - background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); - background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); -} - -.progress-danger.progress-striped .bar, -.progress-striped .bar-danger { - background-color: #ee5f5b; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} - -.progress-success .bar, -.progress .bar-success { - background-color: #5eb95e; - background-image: -moz-linear-gradient(top, #62c462, #57a957); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); - background-image: -webkit-linear-gradient(top, #62c462, #57a957); - background-image: -o-linear-gradient(top, #62c462, #57a957); - background-image: linear-gradient(to bottom, #62c462, #57a957); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); -} - -.progress-success.progress-striped .bar, -.progress-striped .bar-success { - background-color: #62c462; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} - -.progress-info .bar, -.progress .bar-info { - background-color: #4bb1cf; - background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); - background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); - background-image: -o-linear-gradient(top, #5bc0de, #339bb9); - background-image: linear-gradient(to bottom, #5bc0de, #339bb9); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); -} - -.progress-info.progress-striped .bar, -.progress-striped .bar-info { - background-color: #5bc0de; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} - -.progress-warning .bar, -.progress .bar-warning { - background-color: #faa732; - background-image: -moz-linear-gradient(top, #fbb450, #f89406); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); - background-image: -webkit-linear-gradient(top, #fbb450, #f89406); - background-image: -o-linear-gradient(top, #fbb450, #f89406); - background-image: linear-gradient(to bottom, #fbb450, #f89406); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); -} - -.progress-warning.progress-striped .bar, -.progress-striped .bar-warning { - background-color: #fbb450; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} - -.accordion { - margin-bottom: 20px; -} - -.accordion-group { - margin-bottom: 2px; - border: 1px solid #e5e5e5; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.accordion-heading { - border-bottom: 0; -} - -.accordion-heading .accordion-toggle { - display: block; - padding: 8px 15px; -} - -.accordion-toggle { - cursor: pointer; -} - -.accordion-inner { - padding: 9px 15px; - border-top: 1px solid #e5e5e5; -} - -.carousel { - position: relative; - margin-bottom: 20px; - line-height: 1; -} - -.carousel-inner { - position: relative; - width: 100%; - overflow: hidden; -} - -.carousel-inner > .item { - position: relative; - display: none; - -webkit-transition: 0.6s ease-in-out left; - -moz-transition: 0.6s ease-in-out left; - -o-transition: 0.6s ease-in-out left; - transition: 0.6s ease-in-out left; -} - -.carousel-inner > .item > img, -.carousel-inner > .item > a > img { - display: block; - line-height: 1; -} - -.carousel-inner > .active, -.carousel-inner > .next, -.carousel-inner > .prev { - display: block; -} - -.carousel-inner > .active { - left: 0; -} - -.carousel-inner > .next, -.carousel-inner > .prev { - position: absolute; - top: 0; - width: 100%; -} - -.carousel-inner > .next { - left: 100%; -} - -.carousel-inner > .prev { - left: -100%; -} - -.carousel-inner > .next.left, -.carousel-inner > .prev.right { - left: 0; -} - -.carousel-inner > .active.left { - left: -100%; -} - -.carousel-inner > .active.right { - left: 100%; -} - -.carousel-control { - position: absolute; - top: 40%; - left: 15px; - width: 40px; - height: 40px; - margin-top: -20px; - font-size: 60px; - font-weight: 100; - line-height: 30px; - color: #ffffff; - text-align: center; - background: #222222; - border: 3px solid #ffffff; - -webkit-border-radius: 23px; - -moz-border-radius: 23px; - border-radius: 23px; - opacity: 0.5; - filter: alpha(opacity=50); -} - -.carousel-control.right { - right: 15px; - left: auto; -} - -.carousel-control:hover, -.carousel-control:focus { - color: #ffffff; - text-decoration: none; - opacity: 0.9; - filter: alpha(opacity=90); -} - -.carousel-indicators { - position: absolute; - top: 15px; - right: 15px; - z-index: 5; - margin: 0; - list-style: none; -} - -.carousel-indicators li { - display: block; - float: left; - width: 10px; - height: 10px; - margin-left: 5px; - text-indent: -999px; - background-color: #ccc; - background-color: rgba(255, 255, 255, 0.25); - border-radius: 5px; -} - -.carousel-indicators .active { - background-color: #fff; -} - -.carousel-caption { - position: absolute; - right: 0; - bottom: 0; - left: 0; - padding: 15px; - background: #333333; - background: rgba(0, 0, 0, 0.75); -} - -.carousel-caption h4, -.carousel-caption p { - line-height: 20px; - color: #ffffff; -} - -.carousel-caption h4 { - margin: 0 0 5px; -} - -.carousel-caption p { - margin-bottom: 0; -} - -.hero-unit { - padding: 60px; - margin-bottom: 30px; - font-size: 18px; - font-weight: 200; - line-height: 30px; - color: inherit; - background-color: #eeeeee; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -.hero-unit h1 { - margin-bottom: 0; - font-size: 60px; - line-height: 1; - letter-spacing: -1px; - color: inherit; -} - -.hero-unit li { - line-height: 30px; -} - -.pull-right { - float: right; -} - -.pull-left { - float: left; -} - -.hide { - display: none; -} - -.show { - display: block; -} - -.invisible { - visibility: hidden; -} - -.affix { - position: fixed; -} diff --git a/example/index.php b/example/index.php deleted file mode 100644 index 81af49b5..00000000 --- a/example/index.php +++ /dev/null @@ -1,321 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -require __DIR__.'/../vendor/autoload.php'; - -// create basic Silex application -$app = new Silex\Application(); -$app->register(new Silex\Provider\SessionServiceProvider()); -$app->register(new Silex\Provider\TwigServiceProvider(), array( - 'twig.path' => __DIR__.'/views', -)); - -// enable Silex debugging -$app['debug'] = true; - -// root route -$app->get('/', function() use ($app) { - $gateways = array_map(function($name) { - return Omnipay\Common\GatewayFactory::create($name); - }, Omnipay\Common\GatewayFactory::find()); - - return $app['twig']->render('index.twig', array( - 'gateways' => $gateways, - )); -}); - -// gateway settings -$app->get('/gateways/{name}', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - return $app['twig']->render('gateway.twig', array( - 'gateway' => $gateway, - 'settings' => $gateway->getParameters(), - )); -}); - -// save gateway settings -$app->post('/gateways/{name}', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['request']->get('gateway')); - - // save gateway settings in session - $app['session']->set($sessionVar, $gateway->getParameters()); - - // redirect back to gateway settings page - $app['session']->getFlashBag()->add('success', 'Gateway settings updated!'); - - return $app->redirect($app['request']->getPathInfo()); -}); - -// create gateway authorize -$app->get('/gateways/{name}/authorize', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - $params = $app['session']->get($sessionVar.'.authorize', array()); - $params['returnUrl'] = str_replace('/authorize', '/completeAuthorize', $app['request']->getUri()); - $params['cancelUrl'] = $app['request']->getUri(); - $card = new Omnipay\Common\CreditCard($app['session']->get($sessionVar.'.card')); - - return $app['twig']->render('request.twig', array( - 'gateway' => $gateway, - 'method' => 'authorize', - 'params' => $params, - 'card' => $card->getParameters(), - )); -}); - -// submit gateway authorize -$app->post('/gateways/{name}/authorize', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - // load POST data - $params = $app['request']->get('params'); - $card = $app['request']->get('card'); - - // save POST data into session - $app['session']->set($sessionVar.'.authorize', $params); - $app['session']->set($sessionVar.'.card', $card); - - $params['card'] = $card; - $params['clientIp'] = $app['request']->getClientIp(); - $response = $gateway->authorize($params)->send(); - - return $app['twig']->render('response.twig', array( - 'gateway' => $gateway, - 'response' => $response, - )); -}); - -// create gateway capture -$app->get('/gateways/{name}/capture', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - $params = $app['session']->get($sessionVar.'.capture', array()); - - return $app['twig']->render('request.twig', array( - 'gateway' => $gateway, - 'method' => 'capture', - 'params' => $params, - )); -}); - -// submit gateway capture -$app->post('/gateways/{name}/capture', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - // load POST data - $params = $app['request']->get('params'); - - // save POST data into session - $app['session']->set($sessionVar.'.capture', $params); - - $params['clientIp'] = $app['request']->getClientIp(); - $response = $gateway->capture($params)->send(); - - return $app['twig']->render('response.twig', array( - 'gateway' => $gateway, - 'response' => $response, - )); -}); - -// create gateway purchase -$app->get('/gateways/{name}/purchase', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - $params = $app['session']->get($sessionVar.'.purchase', array()); - $params['returnUrl'] = str_replace('/purchase', '/completePurchase', $app['request']->getUri()); - $params['cancelUrl'] = $app['request']->getUri(); - $card = new Omnipay\Common\CreditCard($app['session']->get($sessionVar.'.card')); - - return $app['twig']->render('request.twig', array( - 'gateway' => $gateway, - 'method' => 'purchase', - 'params' => $params, - 'card' => $card->getParameters(), - )); -}); - -// submit gateway purchase -$app->post('/gateways/{name}/purchase', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - // load POST data - $params = $app['request']->get('params'); - $card = $app['request']->get('card'); - - // save POST data into session - $app['session']->set($sessionVar.'.purchase', $params); - $app['session']->set($sessionVar.'.card', $card); - - $params['card'] = $card; - $params['clientIp'] = $app['request']->getClientIp(); - $response = $gateway->purchase($params)->send(); - - return $app['twig']->render('response.twig', array( - 'gateway' => $gateway, - 'response' => $response, - )); -}); - -// gateway purchase return -// this won't work for gateways which require an internet-accessible URL (yet) -$app->match('/gateways/{name}/completePurchase', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - // load request data from session - $params = $app['session']->get($sessionVar.'.purchase', array()); - - $params['clientIp'] = $app['request']->getClientIp(); - $response = $gateway->completePurchase($params)->send(); - - return $app['twig']->render('response.twig', array( - 'gateway' => $gateway, - 'response' => $response, - )); -}); - -// create gateway create Credit Card -$app->get('/gateways/{name}/create-card', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - $params = $app['session']->get($sessionVar.'.create', array()); - $card = new Omnipay\Common\CreditCard($app['session']->get($sessionVar.'.card')); - - return $app['twig']->render('request.twig', array( - 'gateway' => $gateway, - 'method' => 'createCard', - 'params' => $params, - 'card' => $card->getParameters(), - )); -}); - -// submit gateway create Credit Card -$app->post('/gateways/{name}/create-card', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - // load POST data - $params = $app['request']->get('params'); - $card = $app['request']->get('card'); - - // save POST data into session - $app['session']->set($sessionVar.'.create', $params); - $app['session']->set($sessionVar.'.card', $card); - - $params['card'] = $card; - $params['clientIp'] = $app['request']->getClientIp(); - $response = $gateway->createCard($params)->send(); - - return $app['twig']->render('response.twig', array( - 'gateway' => $gateway, - 'response' => $response, - )); -}); - -// create gateway update Credit Card -$app->get('/gateways/{name}/update-card', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - $params = $app['session']->get($sessionVar.'.update', array()); - $card = new Omnipay\Common\CreditCard($app['session']->get($sessionVar.'.card')); - - return $app['twig']->render('request.twig', array( - 'gateway' => $gateway, - 'method' => 'updateCard', - 'params' => $params, - 'card' => $card->getParameters(), - )); -}); - -// submit gateway update Credit Card -$app->post('/gateways/{name}/update-card', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - // load POST data - $params = $app['request']->get('params'); - $card = $app['request']->get('card'); - - // save POST data into session - $app['session']->set($sessionVar.'.update', $params); - $app['session']->set($sessionVar.'.card', $card); - - $params['card'] = $card; - $params['clientIp'] = $app['request']->getClientIp(); - $response = $gateway->updateCard($params)->send(); - - return $app['twig']->render('response.twig', array( - 'gateway' => $gateway, - 'response' => $response, - )); -}); - -// create gateway delete Credit Card -$app->get('/gateways/{name}/delete-card', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - $params = $app['session']->get($sessionVar.'.delete', array()); - - return $app['twig']->render('request.twig', array( - 'gateway' => $gateway, - 'method' => 'deleteCard', - 'params' => $params, - )); -}); - -// submit gateway delete Credit Card -$app->post('/gateways/{name}/delete-card', function($name) use ($app) { - $gateway = Omnipay\Common\GatewayFactory::create($name); - $sessionVar = 'omnipay.'.$gateway->getShortName(); - $gateway->initialize((array) $app['session']->get($sessionVar)); - - // load POST data - $params = $app['request']->get('params'); - - // save POST data into session - $app['session']->set($sessionVar.'.delete', $params); - - $params['clientIp'] = $app['request']->getClientIp(); - $response = $gateway->deleteCard($params)->send(); - - return $app['twig']->render('response.twig', array( - 'gateway' => $gateway, - 'response' => $response, - )); -}); - -$app->run(); diff --git a/example/views/gateway.twig b/example/views/gateway.twig deleted file mode 100644 index 193a5ab5..00000000 --- a/example/views/gateway.twig +++ /dev/null @@ -1,56 +0,0 @@ -{% extends "layout.twig" %} - -{% set title = gateway.name %} -{% block content %} - -

You can create an instance of this gateway using:

-
$gateway = GatewayFactory::create('{{ gateway.shortName }}');
-$response = $gateway->initialize($params);
- -

Gateway Settings

-

Note These settings will be stored in your session and used to create test purchases.

- -
- - {% for key, default in gateway.getDefaultParameters %} - -
- -
- -
-
- - {% endfor %} - -
-
- -

Gateway Methods

-

Click on a method to generate a test request.

- - -{% endblock %} diff --git a/example/views/index.twig b/example/views/index.twig deleted file mode 100644 index 58da5beb..00000000 --- a/example/views/index.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "layout.twig" %} - -{% set title = "Omnipay Example Application" %} -{% block content %} -

The following gateways are available:

- - -{% endblock %} diff --git a/example/views/layout.twig b/example/views/layout.twig deleted file mode 100644 index b67355a4..00000000 --- a/example/views/layout.twig +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {{ title }} - - - -
-

{{ title }}

- - {% for message in app.session.flashbag.get('success') %} -
{{ message }}
- {% endfor %} - - {% block content %}{% endblock %} -
- - diff --git a/example/views/request.twig b/example/views/request.twig deleted file mode 100644 index 4d582def..00000000 --- a/example/views/request.twig +++ /dev/null @@ -1,54 +0,0 @@ -{% extends "layout.twig" %} - -{% set title = gateway.name~": "~method~"()" %} -{% block content %} - -

The charge will be created like so:

-
$gateway = GatewayFactory::create('{{ gateway.shortName }}');
-$response = $gateway->{{ method }}($params);
- -
- -

Request Parameters

- -

The following parameters are available. Not all options are required by all gateways.

-

Note Normally these parameters would be generated by your application and not set via form input.

- - {% for key in ["amount", "currency", "description", "transactionId", "transactionReference", "cardReference", "returnUrl", "cancelUrl", "notifyUrl", "issuer"] %} - -
- -
- -
-
- - {% endfor %} - - {% if card is defined %} - -

Credit Card Parameters

- -

The following credit card parameters are available. Normally you will assign these - directly from POST data.

-

Important Never store raw credit card details in your application! Instead, you should pass them straight to the gateway.

- - {% for key in ["firstName", "lastName", "number", "expiryMonth", "expiryYear", "startMonth", "startYear", "cvv", - "issueNumber", "address1", "address2", "city", "postcode", "state", "country", "phone", "email"] %} - -
- -
- -
-
- - {% endfor %} - - {% endif %} - -
- -
- -{% endblock %} diff --git a/example/views/response.twig b/example/views/response.twig deleted file mode 100644 index 6862355e..00000000 --- a/example/views/response.twig +++ /dev/null @@ -1,66 +0,0 @@ -{% extends "layout.twig" %} - -{% set title = gateway.name~": Response" %} -{% block content %} - - {% if response.isSuccessful() %} -
Congratulations, your request was successful!
- {% elseif response.isRedirect() %} -
Your request requires {{ response.redirectMethod }} - redirect to an off-site payment page.
- - {% if response.redirectMethod == "GET" %} -

Redirect Now

- {% elseif response.redirectMethod == "POST" %} -
-

- {% for key, value in response.redirectData %} - - {% endfor %} - - -

-
- {% endif %} - {% else %} -
Sorry, your request failed.
- {% endif %} - -

The response object had the following to say:

- -

$request->isSuccessful()

-
{{ response.isSuccessful() ? "true" : "false" }}
- -

$request->isRedirect()

-
{{ response.isRedirect() ? "true" : "false" }}
- - {% if response.redirectUrl is defined %} -

$request->getRedirectUrl()

-
{{ response.redirectUrl }}
- {% endif %} - - {% if response.redirectMethod is defined %} -

$request->getRedirectMethod()

-
{{ response.redirectMethod }}
- {% endif %} - - {% if response.redirectData is defined %} -

$request->getRedirectData()

-
{{ dump(response.redirectData) }}
- {% endif %} - -

$request->getMessage()

-
{{ response.message }}
- -

$request->getTransactionReference()

-
{{ response.transactionReference }}
- - {% if response.cardReference is defined %} -

$request->getCardReference()

-
{{ dump(response.cardReference) }}
- {% endif %} - -

$request->getData()

-
{{ dump(response.data) }}
- -{% endblock %} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a61160cd..1347f357 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,25 +1,23 @@ - - - - ./tests/ - - - - - - - - ./src - - + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> + + + ./src + + + + + ./tests/ + + diff --git a/src/Omnipay/AuthorizeNet/AIMGateway.php b/src/Omnipay/AuthorizeNet/AIMGateway.php deleted file mode 100644 index ea85bfec..00000000 --- a/src/Omnipay/AuthorizeNet/AIMGateway.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet; - -use Omnipay\AuthorizeNet\Message\AIMAuthorizeRequest; -use Omnipay\AuthorizeNet\Message\AIMPurchaseRequest; -use Omnipay\AuthorizeNet\Message\CaptureRequest; -use Omnipay\Common\AbstractGateway; - -/** - * Authorize.Net AIM Class - */ -class AIMGateway extends AbstractGateway -{ - public function getName() - { - return 'Authorize.Net AIM'; - } - - public function getDefaultParameters() - { - return array( - 'apiLoginId' => '', - 'transactionKey' => '', - 'testMode' => false, - 'developerMode' => false, - ); - } - - public function getApiLoginId() - { - return $this->getParameter('apiLoginId'); - } - - public function setApiLoginId($value) - { - return $this->setParameter('apiLoginId', $value); - } - - public function getTransactionKey() - { - return $this->getParameter('transactionKey'); - } - - public function setTransactionKey($value) - { - return $this->setParameter('transactionKey', $value); - } - - public function getDeveloperMode() - { - return $this->getParameter('developerMode'); - } - - public function setDeveloperMode($value) - { - return $this->setParameter('developerMode', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\AuthorizeNet\Message\AIMAuthorizeRequest', $parameters); - } - - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\AuthorizeNet\Message\CaptureRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\AuthorizeNet\Message\AIMPurchaseRequest', $parameters); - } - - public function void(array $parameters = array()) - { - return $this->createRequest('\Omnipay\AuthorizeNet\Message\AIMVoidRequest', $parameters); - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/AIMAuthorizeRequest.php b/src/Omnipay/AuthorizeNet/Message/AIMAuthorizeRequest.php deleted file mode 100644 index effa8694..00000000 --- a/src/Omnipay/AuthorizeNet/Message/AIMAuthorizeRequest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -/** - * Authorize.Net AIM Authorize Request - */ -class AIMAuthorizeRequest extends AbstractRequest -{ - protected $action = 'AUTH_ONLY'; - - public function getData() - { - $this->validate('amount', 'card'); - $this->getCard()->validate(); - - $data = $this->getBaseData(); - $data['x_customer_ip'] = $this->getClientIp(); - $data['x_card_num'] = $this->getCard()->getNumber(); - $data['x_exp_date'] = $this->getCard()->getExpiryDate('my'); - $data['x_card_code'] = $this->getCard()->getCvv(); - $data['x_cust_id'] = $this->getCustomerId(); - - if ($this->getTestMode()) { - $data['x_test_request'] = 'TRUE'; - } - - return array_merge($data, $this->getBillingData()); - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/AIMPurchaseRequest.php b/src/Omnipay/AuthorizeNet/Message/AIMPurchaseRequest.php deleted file mode 100644 index ded94de8..00000000 --- a/src/Omnipay/AuthorizeNet/Message/AIMPurchaseRequest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -/** - * Authorize.Net AIM Purchase Request - */ -class AIMPurchaseRequest extends AIMAuthorizeRequest -{ - protected $action = 'AUTH_CAPTURE'; - - public function getData() - { - $this->validate('amount', 'card'); - $this->getCard()->validate(); - - $data = $this->getBaseData(); - $data['x_customer_ip'] = $this->getClientIp(); - $data['x_card_num'] = $this->getCard()->getNumber(); - $data['x_exp_date'] = $this->getCard()->getExpiryDate('my'); - $data['x_card_code'] = $this->getCard()->getCvv(); - - if ($this->getTestMode()) { - $data['x_test_request'] = 'TRUE'; - } - - return array_merge($data, $this->getBillingData()); - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/AIMResponse.php b/src/Omnipay/AuthorizeNet/Message/AIMResponse.php deleted file mode 100644 index a6c0e550..00000000 --- a/src/Omnipay/AuthorizeNet/Message/AIMResponse.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * Authorize.Net AIM Response - */ -class AIMResponse extends AbstractResponse -{ - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - $this->data = explode('|,|', substr($data, 1, -1)); - - if (count($this->data) < 10) { - throw new InvalidResponseException(); - } - } - - public function isSuccessful() - { - return '1' === $this->data[0]; - } - - public function getTransactionReference() - { - return $this->data[6]; - } - - public function getMessage() - { - return $this->data[3]; - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/AIMVoidRequest.php b/src/Omnipay/AuthorizeNet/Message/AIMVoidRequest.php deleted file mode 100644 index 47bcd708..00000000 --- a/src/Omnipay/AuthorizeNet/Message/AIMVoidRequest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -/** - * Authorize.Net AIM Void Request - */ -class AIMVoidRequest extends AbstractRequest -{ - protected $action = 'VOID'; - - public function getData() - { - $this->validate('transactionReference'); - - $data = $this->getBaseData(); - $data['x_trans_id'] = $this->getTransactionReference(); - - return $data; - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/AbstractRequest.php b/src/Omnipay/AuthorizeNet/Message/AbstractRequest.php deleted file mode 100644 index 001c131c..00000000 --- a/src/Omnipay/AuthorizeNet/Message/AbstractRequest.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -/** - * Authorize.Net Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - protected $liveEndpoint = 'https://secure.authorize.net/gateway/transact.dll'; - protected $developerEndpoint = 'https://test.authorize.net/gateway/transact.dll'; - - public function getApiLoginId() - { - return $this->getParameter('apiLoginId'); - } - - public function setApiLoginId($value) - { - return $this->setParameter('apiLoginId', $value); - } - - public function getTransactionKey() - { - return $this->getParameter('transactionKey'); - } - - public function setTransactionKey($value) - { - return $this->setParameter('transactionKey', $value); - } - - public function getDeveloperMode() - { - return $this->getParameter('developerMode'); - } - - public function setDeveloperMode($value) - { - return $this->setParameter('developerMode', $value); - } - - public function getCustomerId() - { - return $this->getParameter('customerId'); - } - - public function setCustomerId($value) - { - return $this->setParameter('customerId', $value); - } - - protected function getBaseData() - { - $data = array(); - $data['x_login'] = $this->getApiLoginId(); - $data['x_tran_key'] = $this->getTransactionKey(); - $data['x_type'] = $this->action; - $data['x_version'] = '3.1'; - $data['x_delim_data'] = 'TRUE'; - $data['x_delim_char'] = ','; - $data['x_encap_char'] = '|'; - $data['x_relay_response'] = 'FALSE'; - - return $data; - } - - protected function getBillingData() - { - $data = array(); - $data['x_amount'] = $this->getAmount(); - $data['x_invoice_num'] = $this->getTransactionId(); - $data['x_description'] = $this->getDescription(); - - if ($card = $this->getCard()) { - // customer billing details - $data['x_first_name'] = $card->getBillingFirstName(); - $data['x_last_name'] = $card->getBillingLastName(); - $data['x_company'] = $card->getBillingCompany(); - $data['x_address'] = trim( - $card->getBillingAddress1()." \n". - $card->getBillingAddress2() - ); - $data['x_city'] = $card->getBillingCity(); - $data['x_state'] = $card->getBillingState(); - $data['x_zip'] = $card->getBillingPostcode(); - $data['x_country'] = $card->getBillingCountry(); - $data['x_phone'] = $card->getBillingPhone(); - $data['x_email'] = $card->getEmail(); - - // customer shipping details - $data['x_ship_to_first_name'] = $card->getShippingFirstName(); - $data['x_ship_to_last_name'] = $card->getShippingLastName(); - $data['x_ship_to_company'] = $card->getShippingCompany(); - $data['x_ship_to_address'] = trim( - $card->getShippingAddress1()." \n". - $card->getShippingAddress2() - ); - $data['x_ship_to_city'] = $card->getShippingCity(); - $data['x_ship_to_state'] = $card->getShippingState(); - $data['x_ship_to_zip'] = $card->getShippingPostcode(); - $data['x_ship_to_country'] = $card->getShippingCountry(); - } - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $this->getData())->send(); - - return $this->response = new AIMResponse($this, $httpResponse->getBody()); - } - - public function getEndpoint() - { - return $this->getDeveloperMode() ? $this->developerEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/CaptureRequest.php b/src/Omnipay/AuthorizeNet/Message/CaptureRequest.php deleted file mode 100644 index 1e380420..00000000 --- a/src/Omnipay/AuthorizeNet/Message/CaptureRequest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -/** - * Authorize.Net Capture Request - */ -class CaptureRequest extends AbstractRequest -{ - protected $action = 'PRIOR_AUTH_CAPTURE'; - - public function getData() - { - $this->validate('amount', 'transactionReference'); - - $data = $this->getBaseData(); - $data['x_amount'] = $this->getAmount(); - $data['x_trans_id'] = $this->getTransactionReference(); - - return $data; - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/SIMAuthorizeRequest.php b/src/Omnipay/AuthorizeNet/Message/SIMAuthorizeRequest.php deleted file mode 100644 index 2d049e66..00000000 --- a/src/Omnipay/AuthorizeNet/Message/SIMAuthorizeRequest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -/** - * Authorize.Net SIM Authorize Request - */ -class SIMAuthorizeRequest extends AbstractRequest -{ - protected $action = 'AUTH_ONLY'; - - public function getData() - { - $this->validate('amount', 'returnUrl'); - - $data = array(); - $data['x_login'] = $this->getApiLoginId(); - $data['x_type'] = $this->action; - $data['x_fp_sequence'] = mt_rand(); - $data['x_fp_timestamp'] = time(); - $data['x_delim_data'] = 'FALSE'; - $data['x_show_form'] = 'PAYMENT_FORM'; - $data['x_relay_response'] = 'TRUE'; - $data['x_relay_url'] = $this->getReturnUrl(); - $data['x_cancel_url'] = $this->getCancelUrl(); - - if ($this->getTestMode()) { - $data['x_test_request'] = 'TRUE'; - } - - $data = array_merge($data, $this->getBillingData()); - $data['x_fp_hash'] = $this->getHash($data); - - return $data; - } - - public function getHash($data) - { - $fingerprint = implode( - '^', - array( - $this->getApiLoginId(), - $data['x_fp_sequence'], - $data['x_fp_timestamp'], - $data['x_amount'] - ) - ).'^'; - - return hash_hmac('md5', $fingerprint, $this->getTransactionKey()); - } - - public function send() - { - return $this->response = new SIMAuthorizeResponse($this, $this->getData(), $this->getEndpoint()); - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/SIMAuthorizeResponse.php b/src/Omnipay/AuthorizeNet/Message/SIMAuthorizeResponse.php deleted file mode 100644 index cfed5df0..00000000 --- a/src/Omnipay/AuthorizeNet/Message/SIMAuthorizeResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; - -/** - * Authorize.Net SIM Authorize Response - */ -class SIMAuthorizeResponse extends AbstractResponse -{ - protected $redirectUrl; - - public function __construct(RequestInterface $request, $data, $redirectUrl) - { - $this->request = $request; - $this->data = $data; - $this->redirectUrl = $redirectUrl; - } - - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return true; - } - - public function getRedirectUrl() - { - return $this->redirectUrl; - } - - public function getRedirectMethod() - { - return 'POST'; - } - - public function getRedirectData() - { - return $this->getData(); - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeRequest.php b/src/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeRequest.php deleted file mode 100644 index bba4e3ad..00000000 --- a/src/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeRequest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -use Omnipay\Common\Exception\InvalidRequestException; - -/** - * Authorize.Net SIM Complete Authorize Request - */ -class SIMCompleteAuthorizeRequest extends AbstractRequest -{ - public function getData() - { - if (strtolower($this->httpRequest->request->get('x_MD5_Hash')) !== $this->getHash()) { - throw new InvalidRequestException('Incorrect hash'); - } - - return $this->httpRequest->request->all(); - } - - public function getHash() - { - return md5($this->getApiLoginId().$this->getTransactionId().$this->getAmount()); - } - - public function send() - { - return $this->response = new SIMCompleteAuthorizeResponse($this, $this->getData()); - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeResponse.php b/src/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeResponse.php deleted file mode 100644 index a5cf26ab..00000000 --- a/src/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeResponse.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * Authorize.Net SIM Complete Authorize Response - */ -class SIMCompleteAuthorizeResponse extends AbstractResponse -{ - public function isSuccessful() - { - return isset($this->data['x_response_code']) && '1' === $this->data['x_response_code']; - } - - public function getTransactionReference() - { - return isset($this->data['x_trans_id']) ? $this->data['x_trans_id'] : null; - } - - public function getMessage() - { - return isset($this->data['x_response_reason_text']) ? $this->data['x_response_reason_text'] : null; - } -} diff --git a/src/Omnipay/AuthorizeNet/Message/SIMPurchaseRequest.php b/src/Omnipay/AuthorizeNet/Message/SIMPurchaseRequest.php deleted file mode 100644 index eb5e1935..00000000 --- a/src/Omnipay/AuthorizeNet/Message/SIMPurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -/** - * Authorize.Net SIM Purchase Request - */ -class SIMPurchaseRequest extends SIMAuthorizeRequest -{ - protected $action = 'AUTH_CAPTURE'; -} diff --git a/src/Omnipay/AuthorizeNet/SIMGateway.php b/src/Omnipay/AuthorizeNet/SIMGateway.php deleted file mode 100644 index 4b4936c9..00000000 --- a/src/Omnipay/AuthorizeNet/SIMGateway.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet; - -use Omnipay\AuthorizeNet\Message\SIMAuthorizeRequest; -use Omnipay\AuthorizeNet\Message\SIMCompleteAuthorizeRequest; - -/** - * Authorize.Net SIM Class - */ -class SIMGateway extends AIMGateway -{ - public function getName() - { - return 'Authorize.Net SIM'; - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\AuthorizeNet\Message\SIMAuthorizeRequest', $parameters); - } - - public function completeAuthorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\AuthorizeNet\Message\SIMCompleteAuthorizeRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\AuthorizeNet\Message\SIMAuthorizeRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->completeAuthorize($parameters); - } -} diff --git a/src/Omnipay/Buckaroo/Gateway.php b/src/Omnipay/Buckaroo/Gateway.php deleted file mode 100644 index 194ef770..00000000 --- a/src/Omnipay/Buckaroo/Gateway.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Buckaroo; - -use Omnipay\Common\AbstractGateway; - -/** - * Buckaroo Gateway - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'Buckaroo'; - } - - public function getDefaultParameters() - { - return array( - 'merchantId' => '', - 'secret' => '', - 'testMode' => false, - ); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getSecret() - { - return $this->getParameter('secret'); - } - - public function setSecret($value) - { - return $this->setParameter('secret', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Buckaroo\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Buckaroo\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/Buckaroo/Message/CompletePurchaseRequest.php b/src/Omnipay/Buckaroo/Message/CompletePurchaseRequest.php deleted file mode 100644 index 46b5a25e..00000000 --- a/src/Omnipay/Buckaroo/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Buckaroo\Message; - -use Omnipay\Common\Exception\InvalidRequestException; - -/** - * Buckaroo Complete Purchase Request - */ -class CompletePurchaseRequest extends PurchaseRequest -{ - public function getData() - { - $this->validate('merchantId', 'secret', 'amount'); - - if (strtolower($this->httpRequest->request->get('bpe_signature2')) !== $this->generateResponseSignature()) { - throw new InvalidRequestException('Incorrect signature'); - } - - return $this->httpRequest->request->all(); - } - - public function generateResponseSignature() - { - return md5( - $this->httpRequest->request->get('bpe_trx'). - $this->httpRequest->request->get('bpe_timestamp'). - $this->getMerchantId(). - $this->getTransactionId(). - $this->getCurrency(). - $this->getAmountInteger(). - $this->httpRequest->request->get('bpe_result'). - (int) $this->getTestMode(). - $this->getSecret() - ); - } - - public function send() - { - return $this->response = new CompletePurchaseResponse($this, $this->getData()); - } -} diff --git a/src/Omnipay/Buckaroo/Message/CompletePurchaseResponse.php b/src/Omnipay/Buckaroo/Message/CompletePurchaseResponse.php deleted file mode 100644 index 4ca539f0..00000000 --- a/src/Omnipay/Buckaroo/Message/CompletePurchaseResponse.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Buckaroo\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * Buckaroo Complete Purchase Response - */ -class CompletePurchaseResponse extends AbstractResponse -{ - const CC_SUCCESS = '100'; - const PAYPAL_SUCCESS = '121'; - const IDEAL_SUCCESS = '801'; - - public function isSuccessful() - { - $success_codes = array( - static::CC_SUCCESS, - static::PAYPAL_SUCCESS, - static::IDEAL_SUCCESS, - ); - - return in_array($this->getCode(), $success_codes); - } - - public function getTransactionReference() - { - if (isset($this->data['bpe_trx'])) { - return $this->data['bpe_trx']; - } - } - - public function getCode() - { - if (isset($this->data['bpe_result'])) { - return $this->data['bpe_result']; - } - } -} diff --git a/src/Omnipay/Buckaroo/Message/PurchaseRequest.php b/src/Omnipay/Buckaroo/Message/PurchaseRequest.php deleted file mode 100644 index d97c9caf..00000000 --- a/src/Omnipay/Buckaroo/Message/PurchaseRequest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Buckaroo\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * Buckaroo Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - protected $endpoint = 'https://payment.buckaroo.nl/sslplus/request_for_authorization.asp'; - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getSecret() - { - return $this->getParameter('secret'); - } - - public function setSecret($value) - { - return $this->setParameter('secret', $value); - } - - public function getData() - { - $this->validate('merchantId', 'secret', 'amount', 'returnUrl'); - - $data = array(); - $data['BPE_Merchant'] = $this->getMerchantId(); - $data['BPE_Amount'] = $this->getAmountInteger(); - $data['BPE_Currency'] = $this->getCurrency(); - $data['BPE_Language'] = 'EN'; - $data['BPE_Mode'] = (int) $this->getTestMode(); - $data['BPE_Invoice'] = $this->getTransactionId(); - $data['BPE_Return_Success'] = $this->getReturnUrl(); - $data['BPE_Return_Reject'] = $this->getReturnUrl(); - $data['BPE_Return_Error'] = $this->getReturnUrl(); - $data['BPE_Return_Method'] = 'POST'; - $data['BPE_Signature2'] = $this->generateSignature($data); - - return $data; - } - - public function generateSignature($data) - { - return md5( - $data['BPE_Merchant']. - $data['BPE_Invoice']. - $data['BPE_Amount']. - $data['BPE_Currency']. - $data['BPE_Mode']. - $this->getSecret() - ); - } - - public function send() - { - return $this->response = new PurchaseResponse($this, $this->getData()); - } - - public function getEndpoint() - { - return $this->endpoint; - } -} diff --git a/src/Omnipay/Buckaroo/Message/PurchaseResponse.php b/src/Omnipay/Buckaroo/Message/PurchaseResponse.php deleted file mode 100644 index e5edb87d..00000000 --- a/src/Omnipay/Buckaroo/Message/PurchaseResponse.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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; - } -} diff --git a/src/Omnipay/CardSave/Gateway.php b/src/Omnipay/CardSave/Gateway.php deleted file mode 100644 index 82772e2c..00000000 --- a/src/Omnipay/CardSave/Gateway.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\CardSave; - -use Omnipay\CardSave\Message\CompletePurchaseRequest; -use Omnipay\CardSave\Message\PurchaseRequest; -use Omnipay\Common\AbstractGateway; - -/** - * CardSave Gateway - * - * @link http://www.cardsave.net/dev-downloads - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'CardSave'; - } - - public function getDefaultParameters() - { - return array( - 'merchantId' => '', - 'password' => '', - ); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\CardSave\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\CardSave\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/CardSave/Message/CompletePurchaseRequest.php b/src/Omnipay/CardSave/Message/CompletePurchaseRequest.php deleted file mode 100644 index 3292cef8..00000000 --- a/src/Omnipay/CardSave/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\CardSave\Message; - -use SimpleXMLElement; -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * CardSave Complete Purchase Request - */ -class CompletePurchaseRequest extends PurchaseRequest -{ - public function getData() - { - $md = $this->httpRequest->request->get('MD'); - $paRes = $this->httpRequest->request->get('PaRes'); - if (empty($md) || empty($paRes)) { - throw new InvalidResponseException; - } - - $data = new SimpleXMLElement(''); - $data->addAttribute('xmlns', $this->namespace); - $data->ThreeDSecureMessage->MerchantAuthentication['MerchantID'] = $this->getMerchantId(); - $data->ThreeDSecureMessage->MerchantAuthentication['Password'] = $this->getPassword(); - $data->ThreeDSecureMessage->ThreeDSecureInputData['CrossReference'] = $md; - $data->ThreeDSecureMessage->ThreeDSecureInputData->PaRES = $paRes; - - return $data; - } -} diff --git a/src/Omnipay/CardSave/Message/PurchaseRequest.php b/src/Omnipay/CardSave/Message/PurchaseRequest.php deleted file mode 100644 index 89affe3e..00000000 --- a/src/Omnipay/CardSave/Message/PurchaseRequest.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\CardSave\Message; - -use DOMDocument; -use SimpleXMLElement; -use Omnipay\Common\Message\AbstractRequest; - -/** - * CardSave Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - protected $endpoint = 'https://gw1.cardsaveonlinepayments.com:4430/'; - protected $namespace = 'https://www.thepaymentgateway.net/'; - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getData() - { - $this->validate('amount', 'card'); - $this->getCard()->validate(); - - $data = new SimpleXMLElement(''); - $data->addAttribute('xmlns', $this->namespace); - - $data->PaymentMessage->MerchantAuthentication['MerchantID'] = $this->getMerchantId(); - $data->PaymentMessage->MerchantAuthentication['Password'] = $this->getPassword(); - $data->PaymentMessage->TransactionDetails['Amount'] = $this->getAmountInteger(); - $data->PaymentMessage->TransactionDetails['CurrencyCode'] = $this->getCurrencyNumeric(); - $data->PaymentMessage->TransactionDetails->OrderID = $this->getTransactionId(); - $data->PaymentMessage->TransactionDetails->OrderDescription = $this->getDescription(); - $data->PaymentMessage->TransactionDetails->MessageDetails['TransactionType'] = 'SALE'; - - $data->PaymentMessage->CardDetails->CardName = $this->getCard()->getName(); - $data->PaymentMessage->CardDetails->CardNumber = $this->getCard()->getNumber(); - $data->PaymentMessage->CardDetails->ExpiryDate['Month'] = $this->getCard()->getExpiryDate('m'); - $data->PaymentMessage->CardDetails->ExpiryDate['Year'] = $this->getCard()->getExpiryDate('y'); - $data->PaymentMessage->CardDetails->CV2 = $this->getCard()->getCvv(); - - if ($this->getCard()->getIssueNumber()) { - $data->PaymentMessage->CardDetails->IssueNumber = $this->getCard()->getIssueNumber(); - } - - if ($this->getCard()->getStartMonth() && $this->getCard()->getStartYear()) { - $data->PaymentMessage->CardDetails->StartDate['Month'] = $this->getCard()->getStartDate('m'); - $data->PaymentMessage->CardDetails->StartDate['Year'] = $this->getCard()->getStartDate('y'); - } - - $data->PaymentMessage->CustomerDetails->BillingAddress->Address1 = $this->getCard()->getAddress1(); - $data->PaymentMessage->CustomerDetails->BillingAddress->Address2 = $this->getCard()->getAddress2(); - $data->PaymentMessage->CustomerDetails->BillingAddress->City = $this->getCard()->getCity(); - $data->PaymentMessage->CustomerDetails->BillingAddress->PostCode = $this->getCard()->getPostcode(); - $data->PaymentMessage->CustomerDetails->BillingAddress->State = $this->getCard()->getState(); - // requires numeric country code - // $data->PaymentMessage->CustomerDetails->BillingAddress->CountryCode = $this->getCard()->getCountryNumeric; - $data->PaymentMessage->CustomerDetails->CustomerIPAddress = $this->getClientIp(); - - return $data; - } - - public function send() - { - $data = $this->getData(); - - // the PHP SOAP library sucks, and SimpleXML can't append element trees - // TODO: find PSR-0 SOAP library - $document = new DOMDocument('1.0', 'utf-8'); - $envelope = $document->appendChild( - $document->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soap:Envelope') - ); - $envelope->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $envelope->setAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema'); - $body = $envelope->appendChild($document->createElement('soap:Body')); - $body->appendChild($document->importNode(dom_import_simplexml($data), true)); - - // post to Cardsave - $headers = array( - 'Content-Type' => 'text/xml; charset=utf-8', - 'SOAPAction' => $this->namespace.$data->getName()); - - $httpResponse = $this->httpClient->post($this->endpoint, $headers, $document->saveXML())->send(); - - return $this->response = new Response($this, $httpResponse->getBody()); - } -} diff --git a/src/Omnipay/CardSave/Message/Response.php b/src/Omnipay/CardSave/Message/Response.php deleted file mode 100644 index 274c060b..00000000 --- a/src/Omnipay/CardSave/Message/Response.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\CardSave\Message; - -use DOMDocument; -use Omnipay\Common\Exception\InvalidResponseException; -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; -use Omnipay\Common\Message\RequestInterface; - -/** - * CardSave Response - */ -class Response extends AbstractResponse implements RedirectResponseInterface -{ - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - - // we only care about the content of the soap:Body element - $responseDom = new DOMDocument; - $responseDom->loadXML($data); - $this->data = simplexml_import_dom($responseDom->documentElement->firstChild->firstChild); - - $resultElement = $this->getResultElement(); - if (!isset($resultElement->StatusCode)) { - throw new InvalidResponseException; - } - } - - public function getResultElement() - { - $resultElement = preg_replace('/Response$/', 'Result', $this->data->getName()); - - return $this->data->$resultElement; - } - - public function isSuccessful() - { - return 0 === (int) $this->getResultElement()->StatusCode; - } - - public function isRedirect() - { - return 3 === (int) $this->getResultElement()->StatusCode; - } - - public function getTransactionReference() - { - return (string) $this->data->TransactionOutputData['CrossReference']; - } - - public function getMessage() - { - return (string) $this->getResultElement()->Message; - } - - public function getRedirectUrl() - { - if ($this->isRedirect()) { - return (string) $this->data->TransactionOutputData->ThreeDSecureOutputData->ACSURL; - } - } - - public function getRedirectMethod() - { - return 'POST'; - } - - public function getRedirectData() - { - return $redirectData = array( - 'PaReq' => (string) $this->data->TransactionOutputData->ThreeDSecureOutputData->PaREQ, - 'TermUrl' => $this->getRequest()->getReturnUrl(), - 'MD' => (string) $this->data->TransactionOutputData['CrossReference'], - ); - } -} diff --git a/src/Omnipay/Common/AbstractGateway.php b/src/Omnipay/Common/AbstractGateway.php deleted file mode 100644 index 161ef4e9..00000000 --- a/src/Omnipay/Common/AbstractGateway.php +++ /dev/null @@ -1,226 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use Guzzle\Http\ClientInterface; -use Guzzle\Http\Client as HttpClient; -use Symfony\Component\HttpFoundation\ParameterBag; -use Symfony\Component\HttpFoundation\Request as HttpRequest; - -/** - * Base payment gateway class - */ -abstract class AbstractGateway implements GatewayInterface -{ - /** - * @var \Symfony\Component\HttpFoundation\ParameterBag - */ - protected $parameters; - - /** - * @var \Guzzle\Http\ClientInterface - */ - protected $httpClient; - - /** - * @var \Symfony\Component\HttpFoundation\Request - */ - protected $httpRequest; - - /** - * Create a new gateway instance - * - * @param ClientInterface $httpClient A Guzzle client to make API calls with - * @param HttpRequest $httpRequest A Symfony HTTP request object - */ - public function __construct(ClientInterface $httpClient = null, HttpRequest $httpRequest = null) - { - $this->httpClient = $httpClient ?: $this->getDefaultHttpClient(); - $this->httpRequest = $httpRequest ?: $this->getDefaultHttpRequest(); - $this->initialize(); - } - - public function getShortName() - { - return Helper::getGatewayShortName(get_class($this)); - } - - public function initialize(array $parameters = array()) - { - $this->parameters = new ParameterBag; - - // set default parameters - foreach ($this->getDefaultParameters() as $key => $value) { - if (is_array($value)) { - $this->parameters->set($key, reset($value)); - } else { - $this->parameters->set($key, $value); - } - } - - Helper::initialize($this, $parameters); - - return $this; - } - - public function getParameters() - { - return $this->parameters->all(); - } - - protected function getParameter($key) - { - return $this->parameters->get($key); - } - - protected function setParameter($key, $value) - { - $this->parameters->set($key, $value); - - return $this; - } - - public function getTestMode() - { - return $this->getParameter('testMode'); - } - - public function setTestMode($value) - { - return $this->setParameter('testMode', $value); - } - - public function getCurrency() - { - return strtoupper($this->getParameter('currency')); - } - - public function setCurrency($value) - { - return $this->setParameter('currency', $value); - } - - /** - * Supports Authorize - * - * @return boolean True if this gateway supports the authorize() method - */ - public function supportsAuthorize() - { - return method_exists($this, 'authorize'); - } - - /** - * Supports Complete Authorize - * - * @return boolean True if this gateway supports the completeAuthorize() method - */ - public function supportsCompleteAuthorize() - { - return method_exists($this, 'completeAuthorize'); - } - - /** - * Supports Capture - * - * @return boolean True if this gateway supports the capture() method - */ - public function supportsCapture() - { - return method_exists($this, 'capture'); - } - - /** - * Supports Complete Purchase - * - * @return boolean True if this gateway supports the completePurchase() method - */ - public function supportsCompletePurchase() - { - return method_exists($this, 'completePurchase'); - } - - /** - * Supports Refund - * - * @return boolean True if this gateway supports the refund() method - */ - public function supportsRefund() - { - return method_exists($this, 'refund'); - } - - /** - * Supports Void - * - * @return boolean True if this gateway supports the void() method - */ - public function supportsVoid() - { - return method_exists($this, 'void'); - } - - /** - * Supports CreateCard - * - * @return boolean True if this gateway supports the create() method - */ - public function supportsCreateCard() - { - return method_exists($this, 'createCard'); - } - - /** - * Supports DeleteCard - * - * @return boolean True if this gateway supports the delete() method - */ - public function supportsDeleteCard() - { - return method_exists($this, 'deleteCard'); - } - - /** - * Supports UpdateCard - * - * @return boolean True if this gateway supports the update() method - */ - public function supportsUpdateCard() - { - return method_exists($this, 'updateCard'); - } - - /** - * Create and initialize a request object using existing parameters from this gateway - */ - protected function createRequest($class, array $parameters) - { - $obj = new $class($this->httpClient, $this->httpRequest); - - return $obj->initialize(array_replace($this->getParameters(), $parameters)); - } - - protected function getDefaultHttpClient() - { - return new HttpClient( - '', - array( - 'curl.options' => array(CURLOPT_CONNECTTIMEOUT => 60), - ) - ); - } - - protected function getDefaultHttpRequest() - { - return HttpRequest::createFromGlobals(); - } -} diff --git a/src/Omnipay/Common/CreditCard.php b/src/Omnipay/Common/CreditCard.php deleted file mode 100644 index 4e26c3e0..00000000 --- a/src/Omnipay/Common/CreditCard.php +++ /dev/null @@ -1,643 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use Omnipay\Common\Exception\InvalidCreditCardException; -use Symfony\Component\HttpFoundation\ParameterBag; - -/** - * Credit Card class - */ -class CreditCard -{ - const BRAND_VISA = 'visa'; - const BRAND_MASTERCARD = 'mastercard'; - const BRAND_DISCOVER = 'discover'; - const BRAND_AMEX = 'amex'; - const BRAND_DINERS_CLUB = 'diners_club'; - const BRAND_JCB = 'jcb'; - const BRAND_SWITCH = 'switch'; - const BRAND_SOLO = 'solo'; - const BRAND_DANKORT = 'dankort'; - const BRAND_MAESTRO = 'maestro'; - const BRAND_FORBRUGSFORENINGEN = 'forbrugsforeningen'; - const BRAND_LASER = 'laser'; - - /** - * @var \Symfony\Component\HttpFoundation\ParameterBag - */ - protected $parameters; - - /** - * Create a new CreditCard object using the specified parameters - * - * @param array $parameters An array of parameters to set on the new object - */ - public function __construct($parameters = null) - { - $this->initialize($parameters); - } - - /** - * All known/supported card brands, and a regular expression to match them. - * - * The order of the card brands is important, as some of the regular expressions overlap. - * - * Note: The fact that this class knows about a particular card brand does not imply - * that your gateway supports it. - * - * @return array - * @link https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/credit_card_methods.rb - */ - public function getSupportedBrands() - { - return array( - static::BRAND_VISA => '/^4\d{12}(\d{3})?$/', - static::BRAND_MASTERCARD => '/^(5[1-5]\d{4}|677189)\d{10}$/', - static::BRAND_DISCOVER => '/^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/', - static::BRAND_AMEX => '/^3[47]\d{13}$/', - static::BRAND_DINERS_CLUB => '/^3(0[0-5]|[68]\d)\d{11}$/', - static::BRAND_JCB => '/^35(28|29|[3-8]\d)\d{12}$/', - static::BRAND_SWITCH => '/^6759\d{12}(\d{2,3})?$/', - static::BRAND_SOLO => '/^6767\d{12}(\d{2,3})?$/', - static::BRAND_DANKORT => '/^5019\d{12}$/', - static::BRAND_MAESTRO => '/^(5[06-8]|6\d)\d{10,17}$/', - static::BRAND_FORBRUGSFORENINGEN => '/^600722\d{10}$/', - static::BRAND_LASER => '/^(6304|6706|6709|6771(?!89))\d{8}(\d{4}|\d{6,7})?$/', - ); - } - - /** - * Initialize the object with parameters. - * - * If any unknown parameters passed, they will be ignored. - * - * @param array $parameters An associative array of parameters - * - * @return $this - */ - public function initialize($parameters = null) - { - $this->parameters = new ParameterBag; - - Helper::initialize($this, $parameters); - - return $this; - } - - public function getParameters() - { - return $this->parameters->all(); - } - - protected function getParameter($key) - { - return $this->parameters->get($key); - } - - protected function setParameter($key, $value) - { - $this->parameters->set($key, $value); - - return $this; - } - - protected function setYearParameter($key, $value) - { - // normalize year to four digits - if (null === $value || '' === $value) { - $value = null; - } else { - $value = (int) gmdate('Y', gmmktime(0, 0, 0, 1, 1, (int) $value)); - } - - return $this->setParameter($key, $value); - } - - /** - * Validate this credit card. If the card is invalid, InvalidCreditCardException is thrown. - * - * This method is called internally by gateways to avoid wasting time with an API call - * when the credit card is clearly invalid. - * - * Generally if you want to validate the credit card yourself with custom error - * messages, you should use your framework's validation library, not this method. - */ - public function validate() - { - foreach (array('number', 'expiryMonth', 'expiryYear') as $key) { - if (!$this->getParameter($key)) { - throw new InvalidCreditCardException("The $key parameter is required"); - } - } - - if ($this->getExpiryDate('Ym') < gmdate('Ym')) { - throw new InvalidCreditCardException('Card has expired'); - } - - if (!Helper::validateLuhn($this->getNumber())) { - throw new InvalidCreditCardException('Card number is invalid'); - } - } - - public function getFirstName() - { - return $this->getBillingFirstName(); - } - - public function setFirstName($value) - { - $this->setBillingFirstName($value); - $this->setShippingFirstName($value); - - return $this; - } - - public function getLastName() - { - return $this->getBillingLastName(); - } - - public function setLastName($value) - { - $this->setBillingLastName($value); - $this->setShippingLastName($value); - - return $this; - } - - public function getName() - { - return $this->getBillingName(); - } - - public function setName($value) - { - $this->setBillingName($value); - $this->setShippingName($value); - - return $this; - } - - public function getNumber() - { - return $this->getParameter('number'); - } - - public function setNumber($value) - { - // strip non-numeric characters - return $this->setParameter('number', preg_replace('/\D/', '', $value)); - } - - /** - * Credit Card Brand - * - * Iterates through known/supported card brands to determine the brand of this card - * - * @return string - */ - public function getBrand() - { - foreach ($this->getSupportedBrands() as $brand => $val) { - if (preg_match($val, $this->getNumber())) { - return $brand; - } - } - } - - public function getExpiryMonth() - { - return $this->getParameter('expiryMonth'); - } - - public function setExpiryMonth($value) - { - return $this->setParameter('expiryMonth', (int) $value); - } - - public function getExpiryYear() - { - return $this->getParameter('expiryYear'); - } - - public function setExpiryYear($value) - { - return $this->setYearParameter('expiryYear', $value); - } - - /** - * Get the card expiry date, using the specified date format string. - * - * @param string $format - * - * @return string - */ - public function getExpiryDate($format) - { - return gmdate($format, gmmktime(0, 0, 0, $this->getExpiryMonth(), 1, $this->getExpiryYear())); - } - - public function getStartMonth() - { - return $this->getParameter('startMonth'); - } - - public function setStartMonth($value) - { - return $this->setParameter('startMonth', (int) $value); - } - - public function getStartYear() - { - return $this->getParameter('startYear'); - } - - public function setStartYear($value) - { - return $this->setYearParameter('startYear', $value); - } - - /** - * Get the card start date, using the specified date format string - * - * @param string $format - * - * @return string - */ - public function getStartDate($format) - { - return gmdate($format, gmmktime(0, 0, 0, $this->getStartMonth(), 1, $this->getStartYear())); - } - - public function getCvv() - { - return $this->getParameter('cvv'); - } - - public function setCvv($value) - { - return $this->setParameter('cvv', $value); - } - - public function getIssueNumber() - { - return $this->getParameter('issueNumber'); - } - - public function setIssueNumber($value) - { - return $this->setParameter('issueNumber', $value); - } - - public function getBillingName() - { - return trim($this->getBillingFirstName() . ' ' . $this->getBillingLastName()); - } - - public function setBillingName($value) - { - $names = explode(' ', $value, 2); - $this->setBillingFirstName($names[0]); - $this->setBillingLastName(isset($names[1]) ? $names[1] : null); - - return $this; - } - - public function getBillingFirstName() - { - return $this->getParameter('billingFirstName'); - } - - public function setBillingFirstName($value) - { - return $this->setParameter('billingFirstName', $value); - } - - public function getBillingLastName() - { - return $this->getParameter('billingLastName'); - } - - public function setBillingLastName($value) - { - return $this->setParameter('billingLastName', $value); - } - - public function getBillingCompany() - { - return $this->getParameter('billingCompany'); - } - - public function setBillingCompany($value) - { - return $this->setParameter('billingCompany', $value); - } - - public function getBillingAddress1() - { - return $this->getParameter('billingAddress1'); - } - - public function setBillingAddress1($value) - { - return $this->setParameter('billingAddress1', $value); - } - - public function getBillingAddress2() - { - return $this->getParameter('billingAddress2'); - } - - public function setBillingAddress2($value) - { - return $this->setParameter('billingAddress2', $value); - } - - public function getBillingCity() - { - return $this->getParameter('billingCity'); - } - - public function setBillingCity($value) - { - return $this->setParameter('billingCity', $value); - } - - public function getBillingPostcode() - { - return $this->getParameter('billingPostcode'); - } - - public function setBillingPostcode($value) - { - return $this->setParameter('billingPostcode', $value); - } - - public function getBillingState() - { - return $this->getParameter('billingState'); - } - - public function setBillingState($value) - { - return $this->setParameter('billingState', $value); - } - - public function getBillingCountry() - { - return $this->getParameter('billingCountry'); - } - - public function setBillingCountry($value) - { - return $this->setParameter('billingCountry', $value); - } - - public function getBillingPhone() - { - return $this->getParameter('billingPhone'); - } - - public function setBillingPhone($value) - { - return $this->setParameter('billingPhone', $value); - } - - public function getShippingName() - { - return trim($this->getShippingFirstName() . ' ' . $this->getShippingLastName()); - } - - public function setShippingName($value) - { - $names = explode(' ', $value, 2); - $this->setShippingFirstName($names[0]); - $this->setShippingLastName(isset($names[1]) ? $names[1] : null); - - return $this; - } - - public function getShippingFirstName() - { - return $this->getParameter('shippingFirstName'); - } - - public function setShippingFirstName($value) - { - return $this->setParameter('shippingFirstName', $value); - } - - public function getShippingLastName() - { - return $this->getParameter('shippingLastName'); - } - - public function setShippingLastName($value) - { - return $this->setParameter('shippingLastName', $value); - } - - public function getShippingCompany() - { - return $this->getParameter('shippingCompany'); - } - - public function setShippingCompany($value) - { - return $this->setParameter('shippingCompany', $value); - } - - public function getShippingAddress1() - { - return $this->getParameter('shippingAddress1'); - } - - public function setShippingAddress1($value) - { - return $this->setParameter('shippingAddress1', $value); - } - - public function getShippingAddress2() - { - return $this->getParameter('shippingAddress2'); - } - - public function setShippingAddress2($value) - { - return $this->setParameter('shippingAddress2', $value); - } - - public function getShippingCity() - { - return $this->getParameter('shippingCity'); - } - - public function setShippingCity($value) - { - return $this->setParameter('shippingCity', $value); - } - - public function getShippingPostcode() - { - return $this->getParameter('shippingPostcode'); - } - - public function setShippingPostcode($value) - { - return $this->setParameter('shippingPostcode', $value); - } - - public function getShippingState() - { - return $this->getParameter('shippingState'); - } - - public function setShippingState($value) - { - return $this->setParameter('shippingState', $value); - } - - public function getShippingCountry() - { - return $this->getParameter('shippingCountry'); - } - - public function setShippingCountry($value) - { - return $this->setParameter('shippingCountry', $value); - } - - public function getShippingPhone() - { - return $this->getParameter('shippingPhone'); - } - - public function setShippingPhone($value) - { - return $this->setParameter('shippingPhone', $value); - } - - public function getAddress1() - { - return $this->getParameter('billingAddress1'); - } - - public function setAddress1($value) - { - $this->setParameter('billingAddress1', $value); - $this->setParameter('shippingAddress1', $value); - - return $this; - } - - public function getAddress2() - { - return $this->getParameter('billingAddress2'); - } - - public function setAddress2($value) - { - $this->setParameter('billingAddress2', $value); - $this->setParameter('shippingAddress2', $value); - - return $this; - } - - public function getCity() - { - return $this->getParameter('billingCity'); - } - - public function setCity($value) - { - $this->setParameter('billingCity', $value); - $this->setParameter('shippingCity', $value); - - return $this; - } - - public function getPostcode() - { - return $this->getParameter('billingPostcode'); - } - - public function setPostcode($value) - { - $this->setParameter('billingPostcode', $value); - $this->setParameter('shippingPostcode', $value); - - return $this; - } - - public function getState() - { - return $this->getParameter('billingState'); - } - - public function setState($value) - { - $this->setParameter('billingState', $value); - $this->setParameter('shippingState', $value); - - return $this; - } - - public function getCountry() - { - return $this->getParameter('billingCountry'); - } - - public function setCountry($value) - { - $this->setParameter('billingCountry', $value); - $this->setParameter('shippingCountry', $value); - - return $this; - } - - public function getPhone() - { - return $this->getParameter('billingPhone'); - } - - public function setPhone($value) - { - $this->setParameter('billingPhone', $value); - $this->setParameter('shippingPhone', $value); - - return $this; - } - - public function getCompany() - { - return $this->getParameter('billingCompany'); - } - - public function setCompany($value) - { - $this->setParameter('billingCompany', $value); - $this->setParameter('shippingCompany', $value); - - return $this; - } - - public function getEmail() - { - return $this->getParameter('email'); - } - - public function setEmail($value) - { - return $this->setParameter('email', $value); - } -} diff --git a/src/Omnipay/Common/Currency.php b/src/Omnipay/Common/Currency.php deleted file mode 100644 index 6e2e4113..00000000 --- a/src/Omnipay/Common/Currency.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -/** - * Currency class - */ -class Currency -{ - private $code; - private $numeric; - private $decimals; - - /** - * Create a new Currency object - */ - private function __construct($code, $numeric, $decimals) - { - $this->code = $code; - $this->numeric = $numeric; - $this->decimals = $decimals; - } - - /** - * Get the three letter code for the currency - * - * @return string - */ - public function getCode() - { - return $this->code; - } - - /** - * Get the numeric code for this currency - * - * @return string - */ - public function getNumeric() - { - return $this->numeric; - } - - /** - * Get the number of decimal places for this currency - * - * @return int - */ - public function getDecimals() - { - return $this->decimals; - } - - /** - * Find a specific currency - * - * @param string $code The three letter currency code - * @return mixed A Currency object, or null if no currency was found - */ - public static function find($code) - { - $code = strtoupper($code); - $currencies = static::all(); - - if (isset($currencies[$code])) { - return new static($code, $currencies[$code]['numeric'], $currencies[$code]['decimals']); - } - } - - /** - * Get an array of all supported currencies - * - * @return array - */ - public static function all() - { - return array( - 'AUD' => array('numeric' => '036', 'decimals' => 2), - 'BRL' => array('numeric' => '986', 'decimals' => 2), - 'CAD' => array('numeric' => '124', 'decimals' => 2), - 'CHF' => array('numeric' => '756', 'decimals' => 2), - 'CLP' => array('numeric' => '152', 'decimals' => 0), - 'CNY' => array('numeric' => '156', 'decimals' => 2), - 'CZK' => array('numeric' => '203', 'decimals' => 2), - 'DKK' => array('numeric' => '208', 'decimals' => 2), - 'EUR' => array('numeric' => '978', 'decimals' => 2), - 'FJD' => array('numeric' => '242', 'decimals' => 2), - 'GBP' => array('numeric' => '826', 'decimals' => 2), - 'HKD' => array('numeric' => '344', 'decimals' => 2), - 'HUF' => array('numeric' => '348', 'decimals' => 2), - 'ILS' => array('numeric' => '376', 'decimals' => 2), - 'INR' => array('numeric' => '356', 'decimals' => 2), - 'JPY' => array('numeric' => '392', 'decimals' => 0), - 'KRW' => array('numeric' => '410', 'decimals' => 0), - 'LAK' => array('numeric' => '418', 'decimals' => 0), - 'MXN' => array('numeric' => '484', 'decimals' => 2), - 'MYR' => array('numeric' => '458', 'decimals' => 2), - 'NOK' => array('numeric' => '578', 'decimals' => 2), - 'NZD' => array('numeric' => '554', 'decimals' => 2), - 'PGK' => array('numeric' => '598', 'decimals' => 2), - 'PHP' => array('numeric' => '608', 'decimals' => 2), - 'PLN' => array('numeric' => '985', 'decimals' => 2), - 'SBD' => array('numeric' => '090', 'decimals' => 2), - 'SEK' => array('numeric' => '752', 'decimals' => 2), - 'SGD' => array('numeric' => '702', 'decimals' => 2), - 'THB' => array('numeric' => '764', 'decimals' => 2), - 'TOP' => array('numeric' => '776', 'decimals' => 2), - 'TRY' => array('numeric' => '949', 'decimals' => 2), - 'TWD' => array('numeric' => '901', 'decimals' => 2), - 'USD' => array('numeric' => '840', 'decimals' => 2), - 'VND' => array('numeric' => '704', 'decimals' => 0), - 'VUV' => array('numeric' => '548', 'decimals' => 0), - 'WST' => array('numeric' => '882', 'decimals' => 2), - 'ZAR' => array('numeric' => '710', 'decimals' => 2), - ); - } -} diff --git a/src/Omnipay/Common/Exception/BadMethodCallException.php b/src/Omnipay/Common/Exception/BadMethodCallException.php deleted file mode 100644 index 1dbca6d7..00000000 --- a/src/Omnipay/Common/Exception/BadMethodCallException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Exception; - -/** - * Bad Method Call Exception - */ -class BadMethodCallException extends \BadMethodCallException implements OmnipayException -{ -} diff --git a/src/Omnipay/Common/Exception/InvalidCreditCardException.php b/src/Omnipay/Common/Exception/InvalidCreditCardException.php deleted file mode 100644 index 836243a5..00000000 --- a/src/Omnipay/Common/Exception/InvalidCreditCardException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Exception; - -/** - * Invalid Credit Card Exception - * - * Thrown when a credit card is invalid or missing required fields. - */ -class InvalidCreditCardException extends \Exception implements OmnipayException -{ -} diff --git a/src/Omnipay/Common/Exception/InvalidRequestException.php b/src/Omnipay/Common/Exception/InvalidRequestException.php deleted file mode 100644 index 9e9aa5e9..00000000 --- a/src/Omnipay/Common/Exception/InvalidRequestException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Exception; - -/** - * Invalid Request Exception - * - * Thrown when a request is invalid or missing required fields. - */ -class InvalidRequestException extends \Exception implements OmnipayException -{ -} diff --git a/src/Omnipay/Common/Exception/InvalidResponseException.php b/src/Omnipay/Common/Exception/InvalidResponseException.php deleted file mode 100644 index 2216e55b..00000000 --- a/src/Omnipay/Common/Exception/InvalidResponseException.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Exception; - -/** - * Invalid Response exception. - * - * Thrown when a gateway responded with invalid or unexpected data (for example, a security hash did not match). - */ -class InvalidResponseException extends \Exception implements OmnipayException -{ - public function __construct($message = "Invalid response from payment gateway", $code = 0, $previous = null) - { - parent::__construct($message, $code, $previous); - } -} diff --git a/src/Omnipay/Common/Exception/OmnipayException.php b/src/Omnipay/Common/Exception/OmnipayException.php deleted file mode 100644 index 4da47864..00000000 --- a/src/Omnipay/Common/Exception/OmnipayException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Exception; - -/** - * Omnipay Exception marker interface - */ -interface OmnipayException -{ -} diff --git a/src/Omnipay/Common/Exception/RuntimeException.php b/src/Omnipay/Common/Exception/RuntimeException.php deleted file mode 100644 index df204035..00000000 --- a/src/Omnipay/Common/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Exception; - -/** - * Runtime Exception - */ -class RuntimeException extends \RuntimeException implements OmnipayException -{ -} diff --git a/src/Omnipay/Common/GatewayFactory.php b/src/Omnipay/Common/GatewayFactory.php deleted file mode 100644 index d7702909..00000000 --- a/src/Omnipay/Common/GatewayFactory.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; -use ReflectionClass; -use Guzzle\Http\ClientInterface; -use Guzzle\Http\Client as HttpClient; -use Omnipay\Common\Exception\RuntimeException; -use Symfony\Component\HttpFoundation\Request as HttpRequest; - -class GatewayFactory -{ - public static function create($class, ClientInterface $httpClient = null, HttpRequest $httpRequest = null) - { - $class = Helper::getGatewayClassName($class); - - if (!class_exists($class)) { - throw new RuntimeException("Class '$class' not found"); - } - - $gateway = new $class($httpClient, $httpRequest); - - return $gateway; - } - - /** - * Get a list of supported gateways, in friendly format (e.g. PayPal_Express) - */ - public static function find($directory = null) - { - $result = array(); - - // find all gateways in the Billing directory - $directory = dirname(__DIR__); - $it = new RecursiveDirectoryIterator($directory); - foreach (new RecursiveIteratorIterator($it) as $file) { - $filepath = $file->getPathName(); - if ('Gateway.php' === substr($filepath, -11)) { - // determine class name - $type = substr($filepath, 0, -11); - $type = str_replace(array($directory, DIRECTORY_SEPARATOR), array('', '_'), $type); - $type = trim($type, '_'); - $class = Helper::getGatewayClassName($type); - - // ensure class exists and is not abstract - if (class_exists($class)) { - $reflection = new ReflectionClass($class); - if (!$reflection->isAbstract() and - $reflection->implementsInterface('\\Omnipay\\Common\\GatewayInterface')) { - $result[] = $type; - } - } - } - } - - return $result; - } -} diff --git a/src/Omnipay/Common/GatewayInterface.php b/src/Omnipay/Common/GatewayInterface.php deleted file mode 100644 index b9405fb1..00000000 --- a/src/Omnipay/Common/GatewayInterface.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -/** - * Payment gateway interface - */ -interface GatewayInterface -{ - - /** - * Get gateway display name - * - * This can be used by carts to get the display name for each gateway. - */ - public function getName(); - - /** - * Get gateway short name - * - * This name can be used with GatewayFactory as an alias of the gateway class, - * to create new instances of this gateway. - */ - public function getShortName(); - - /** - * Define gateway parameters, in the following format: - * - * array( - * 'username' => '', // string variable - * 'testMode' => false, // boolean variable - * 'landingPage' => array('billing', 'login'), // enum variable, first item is default - * ); - */ - public function getDefaultParameters(); - - /** - * Initialize gateway with parameters - */ - public function initialize(array $parameters = array()); - - /** - * Get all gateway parameters - * - * @return array - */ - public function getParameters(); - - /** - * Create a new charge (combined authorize + capture). - * - * @param array $parameters An array of options - * - * @return \Omnipay\Common\Message\RequestInterface - */ - public function purchase(array $parameters = array()); -} diff --git a/src/Omnipay/Common/Helper.php b/src/Omnipay/Common/Helper.php deleted file mode 100644 index 6039411c..00000000 --- a/src/Omnipay/Common/Helper.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -/** - * Helper class - */ -class Helper -{ - /** - * Convert a string to camelCase. Strings already in camelCase will not be harmed. - */ - public static function camelCase($str) - { - return preg_replace_callback( - '/_([a-z])/', - function ($match) { - return strtoupper($match[1]); - }, - $str - ); - } - - /** - * Validate a card number according to the Luhn algorithm. - * - * @param string $number The card number to validate - * @return boolean True if the supplied card number is valid - */ - public static function validateLuhn($number) - { - $str = ''; - foreach (array_reverse(str_split($number)) as $i => $c) { - $str .= $i % 2 ? $c * 2 : $c; - } - - return array_sum(str_split($str)) % 10 === 0; - } - - /** - * Initialize an object with a given array of parameters - * - * Parameters are automatically converted to camelCase. Any parameters which do - * not match a setter on the target object are ignored. - * - * @param mixed $target The object to set parameters on - * @param array $parameters An array of parameters to set - */ - public static function initialize(&$target, $parameters) - { - if (is_array($parameters)) { - foreach ($parameters as $key => $value) { - $method = 'set'.ucfirst(static::camelCase($key)); - if (method_exists($target, $method)) { - $target->$method($value); - } - } - } - } - - /** - * Resolve a gateway class to a short name. - * - * The short name can be used with GatewayFactory as an alias of the gateway class, - * to create new instances of a gateway. - */ - public static function getGatewayShortName($className) - { - if (0 === strpos($className, '\\')) { - $className = substr($className, 1); - } - - if (0 === strpos($className, 'Omnipay\\')) { - return trim(str_replace('\\', '_', substr($className, 8, -7)), '_'); - } - - return '\\'.$className; - } - - /** - * Resolve a short gateway name to a full namespaced gateway class. - * - * Class names beginning with a namespace marker (\) are left intact. - * Non-namespaced classes are expected to be in the \Omnipay namespace, e.g.: - * - * \Custom\Gateway => \Custom\Gateway - * \Custom_Gateway => \Custom_Gateway - * Stripe => \Omnipay\Stripe\Gateway - * PayPal\Express => \Omnipay\PayPal\ExpressGateway - * PayPal_Express => \Omnipay\PayPal\ExpressGateway - */ - public static function getGatewayClassName($shortName) - { - if (0 === strpos($shortName, '\\')) { - return $shortName; - } - - // replace underscores with namespace marker, PSR-0 style - $shortName = str_replace('_', '\\', $shortName); - if (false === strpos($shortName, '\\')) { - $shortName .= '\\'; - } - - return '\\Omnipay\\'.$shortName.'Gateway'; - } -} diff --git a/src/Omnipay/Common/Message/AbstractRequest.php b/src/Omnipay/Common/Message/AbstractRequest.php deleted file mode 100644 index 4b5ea026..00000000 --- a/src/Omnipay/Common/Message/AbstractRequest.php +++ /dev/null @@ -1,311 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -use Guzzle\Http\ClientInterface; -use Omnipay\Common\CreditCard; -use Omnipay\Common\Currency; -use Omnipay\Common\Exception\InvalidRequestException; -use Omnipay\Common\Exception\RuntimeException; -use Omnipay\Common\Helper; -use Symfony\Component\HttpFoundation\ParameterBag; -use Symfony\Component\HttpFoundation\Request as HttpRequest; - -/** - * Abstract Request - */ -abstract class AbstractRequest implements RequestInterface -{ - /** - * @var \Symfony\Component\HttpFoundation\ParameterBag - */ - protected $parameters; - - /** - * @var \Guzzle\Http\ClientInterface - */ - protected $httpClient; - - /** - * @var \Symfony\Component\HttpFoundation\Request - */ - protected $httpRequest; - - /** - * @var ResponseInterface - */ - protected $response; - - /** - * Create a new Request - * - * @param ClientInterface $httpClient A Guzzle client to make API calls with - * @param HttpRequest $httpRequest A Symfony HTTP request object - */ - public function __construct(ClientInterface $httpClient, HttpRequest $httpRequest) - { - $this->httpClient = $httpClient; - $this->httpRequest = $httpRequest; - $this->initialize(); - } - - /** - * Initialize the object with parameters. - * - * If any unknown parameters passed, they will be ignored. - * - * @param array $parameters An associative array of parameters - * - * @return $this - * - * @throws RuntimeException - */ - public function initialize(array $parameters = array()) - { - if (null !== $this->response) { - throw new RuntimeException('Request cannot be modified after it has been sent!'); - } - - $this->parameters = new ParameterBag; - - Helper::initialize($this, $parameters); - - return $this; - } - - public function getParameters() - { - return $this->parameters->all(); - } - - protected function getParameter($key) - { - return $this->parameters->get($key); - } - - protected function setParameter($key, $value) - { - if (null !== $this->response) { - throw new RuntimeException('Request cannot be modified after it has been sent!'); - } - - $this->parameters->set($key, $value); - - return $this; - } - - public function getTestMode() - { - return $this->getParameter('testMode'); - } - - public function setTestMode($value) - { - return $this->setParameter('testMode', $value); - } - - /** - * Validate the request. - * - * This method is called internally by gateways to avoid wasting time with an API call - * when the request is clearly invalid. - * - * @param string ... a variable length list of required parameters - * - * @throws InvalidRequestException - */ - public function validate() - { - foreach (func_get_args() as $key) { - $value = $this->parameters->get($key); - if (empty($value)) { - throw new InvalidRequestException("The $key parameter is required"); - } - } - } - - public function getCard() - { - return $this->getParameter('card'); - } - - public function setCard($value) - { - if ($value && !$value instanceof CreditCard) { - $value = new CreditCard($value); - } - - return $this->setParameter('card', $value); - } - - public function getToken() - { - return $this->getParameter('token'); - } - - public function setToken($value) - { - return $this->setParameter('token', $value); - } - - public function getCardReference() - { - return $this->getParameter('cardReference'); - } - - public function setCardReference($value) - { - return $this->setParameter('cardReference', $value); - } - - public function getAmount() - { - $amount = $this->getParameter('amount'); - if ($amount) { - if (!is_float($amount) && - $this->getCurrencyDecimalPlaces() > 0 && - false === strpos((string) $amount, '.')) { - throw new InvalidRequestException( - 'Please specify amount as a string or float, ' . - 'with decimal places (e.g. \'10.00\' to represent $10.00).' - ); - } - - return number_format( - $amount, - $this->getCurrencyDecimalPlaces(), - '.', - '' - ); - } - } - - public function setAmount($value) - { - return $this->setParameter('amount', $value); - } - - public function getAmountInteger() - { - return (int) round($this->getAmount() * $this->getCurrencyDecimalFactor()); - } - - public function getCurrency() - { - return $this->getParameter('currency'); - } - - public function setCurrency($value) - { - return $this->setParameter('currency', strtoupper($value)); - } - - public function getCurrencyNumeric() - { - if ($currency = Currency::find($this->getCurrency())) { - return $currency->getNumeric(); - } - } - - public function getCurrencyDecimalPlaces() - { - if ($currency = Currency::find($this->getCurrency())) { - return $currency->getDecimals(); - } - - return 2; - } - - private function getCurrencyDecimalFactor() - { - return pow(10, $this->getCurrencyDecimalPlaces()); - } - - public function getDescription() - { - return $this->getParameter('description'); - } - - public function setDescription($value) - { - return $this->setParameter('description', $value); - } - - public function getTransactionId() - { - return $this->getParameter('transactionId'); - } - - public function setTransactionId($value) - { - return $this->setParameter('transactionId', $value); - } - - public function getTransactionReference() - { - return $this->getParameter('transactionReference'); - } - - public function setTransactionReference($value) - { - return $this->setParameter('transactionReference', $value); - } - - public function getClientIp() - { - return $this->getParameter('clientIp'); - } - - public function setClientIp($value) - { - return $this->setParameter('clientIp', $value); - } - - public function getReturnUrl() - { - return $this->getParameter('returnUrl'); - } - - public function setReturnUrl($value) - { - return $this->setParameter('returnUrl', $value); - } - - public function getCancelUrl() - { - return $this->getParameter('cancelUrl'); - } - - public function setCancelUrl($value) - { - return $this->setParameter('cancelUrl', $value); - } - - public function getNotifyUrl() - { - return $this->getParameter('notifyUrl'); - } - - public function setNotifyUrl($value) - { - return $this->setParameter('notifyUrl', $value); - } - - public function getResponse() - { - if (null === $this->response) { - throw new RuntimeException('You must call send() before accessing the Response!'); - } - - return $this->response; - } -} diff --git a/src/Omnipay/Common/Message/AbstractResponse.php b/src/Omnipay/Common/Message/AbstractResponse.php deleted file mode 100644 index 9e45f6c5..00000000 --- a/src/Omnipay/Common/Message/AbstractResponse.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -use Omnipay\Common\Exception\RuntimeException; -use Omnipay\Common\Message\RequestInterface; -use Symfony\Component\HttpFoundation\RedirectResponse as HttpRedirectResponse; -use Symfony\Component\HttpFoundation\Response as HttpResponse; - -/** - * Abstract Response - */ -abstract class AbstractResponse implements ResponseInterface -{ - protected $request; - protected $data; - - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - $this->data = $data; - } - - public function getRequest() - { - return $this->request; - } - - public function isRedirect() - { - return false; - } - - public function getData() - { - return $this->data; - } - - public function getMessage() - { - return null; - } - - public function getCode() - { - return null; - } - - public function getTransactionReference() - { - return null; - } - - /** - * Automatically perform any required redirect - * - * This method is meant to be a helper for simple scenarios. If you want to customize the - * redirection page, just call the getRedirectUrl() and getRedirectData() methods directly. - */ - public function redirect() - { - $this->getRedirectResponse()->send(); - exit; - } - - public function getRedirectResponse() - { - if (!$this instanceof RedirectResponseInterface || !$this->isRedirect()) { - throw new RuntimeException('This response does not support redirection.'); - } - - if ('GET' === $this->getRedirectMethod()) { - return HttpRedirectResponse::create($this->getRedirectUrl()); - } elseif ('POST' === $this->getRedirectMethod()) { - $hiddenFields = ''; - foreach ($this->getRedirectData() as $key => $value) { - $hiddenFields .= sprintf( - '', - htmlspecialchars($key, ENT_QUOTES, 'UTF-8'), - htmlspecialchars($value, ENT_QUOTES, 'UTF-8') - )."\n"; - } - - $output = ' - - - Redirecting... - - -
-

Redirecting to payment page...

-

- %2$s - -

-
- -'; - $output = sprintf($output, htmlspecialchars($this->getRedirectUrl(), ENT_QUOTES, 'UTF-8'), $hiddenFields); - - return HttpResponse::create($output); - } - - throw new RuntimeException('Invalid redirect method "'.$this->getRedirectMethod().'".'); - } -} diff --git a/src/Omnipay/Common/Message/MessageInterface.php b/src/Omnipay/Common/Message/MessageInterface.php deleted file mode 100644 index 557b52ee..00000000 --- a/src/Omnipay/Common/Message/MessageInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -/** - * Message Interface - */ -interface MessageInterface -{ - /** - * Get the raw data array for this message. The format of this varies from gateway to - * gateway, but will usually be either an associative array, or a SimpleXMLElement. - * - * @return mixed - */ - public function getData(); -} diff --git a/src/Omnipay/Common/Message/RedirectResponseInterface.php b/src/Omnipay/Common/Message/RedirectResponseInterface.php deleted file mode 100644 index 1ae3885f..00000000 --- a/src/Omnipay/Common/Message/RedirectResponseInterface.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -/** - * Response interface - */ -interface RedirectResponseInterface extends ResponseInterface -{ - /** - * Gets the redirect target url. - */ - public function getRedirectUrl(); - - /** - * Get the required redirect method (either GET or POST). - */ - public function getRedirectMethod(); - - /** - * Gets the redirect form data array, if the redirect method is POST. - */ - public function getRedirectData(); - - /** - * Perform the required redirect. - */ - public function redirect(); -} diff --git a/src/Omnipay/Common/Message/RequestInterface.php b/src/Omnipay/Common/Message/RequestInterface.php deleted file mode 100644 index 5f092bd5..00000000 --- a/src/Omnipay/Common/Message/RequestInterface.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -/** - * Request Interface - */ -interface RequestInterface extends MessageInterface -{ - /** - * Initialize request with parameters - */ - public function initialize(array $parameters = array()); - - /** - * Get all request parameters - * - * @return array - */ - public function getParameters(); - - /** - * Get the response to this request (if the request has been sent) - * - * @return ResponseInterface - */ - public function getResponse(); - - /** - * Send the request - * - * @return ResponseInterface - */ - public function send(); -} diff --git a/src/Omnipay/Common/Message/ResponseInterface.php b/src/Omnipay/Common/Message/ResponseInterface.php deleted file mode 100644 index 02ebdc9c..00000000 --- a/src/Omnipay/Common/Message/ResponseInterface.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -/** - * Response interface - */ -interface ResponseInterface extends MessageInterface -{ - /** - * Get the original request which generated this response - * - * @return RequestInterface - */ - public function getRequest(); - - /** - * Is the response successful? - * - * @return boolean - */ - public function isSuccessful(); - - /** - * Does the response require a redirect? - * - * @return boolean - */ - public function isRedirect(); - - /** - * Response Message - * - * @return string A response message from the payment gateway - */ - public function getMessage(); - - /** - * Response code - * - * @return string A response code from the payment gateway - */ - public function getCode(); - - /** - * Gateway Reference - * - * @return string A reference provided by the gateway to represent this transaction - */ - public function getTransactionReference(); -} diff --git a/src/Omnipay/Dummy/Gateway.php b/src/Omnipay/Dummy/Gateway.php deleted file mode 100644 index 16e4a7ab..00000000 --- a/src/Omnipay/Dummy/Gateway.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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); - } -} diff --git a/src/Omnipay/Dummy/Message/AuthorizeRequest.php b/src/Omnipay/Dummy/Message/AuthorizeRequest.php deleted file mode 100644 index fd8793aa..00000000 --- a/src/Omnipay/Dummy/Message/AuthorizeRequest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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 send() - { - $data = $this->getData(); - $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); - } -} diff --git a/src/Omnipay/Dummy/Message/Response.php b/src/Omnipay/Dummy/Message/Response.php deleted file mode 100644 index aa8d65ba..00000000 --- a/src/Omnipay/Dummy/Message/Response.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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; - } -} diff --git a/src/Omnipay/Eway/Message/RapidCompletePurchaseRequest.php b/src/Omnipay/Eway/Message/RapidCompletePurchaseRequest.php deleted file mode 100644 index cb47b020..00000000 --- a/src/Omnipay/Eway/Message/RapidCompletePurchaseRequest.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Eway\Message; - -/** - * eWAY Rapid 3.0 Complete Purchase Request - */ -class RapidCompletePurchaseRequest extends RapidPurchaseRequest -{ - public function getData() - { - return array('AccessCode' => $this->httpRequest->query->get('AccessCode')); - } - - public function getEndpoint() - { - return $this->getEndpointBase().'/GetAccessCodeResult.json'; - } -} diff --git a/src/Omnipay/Eway/Message/RapidPurchaseRequest.php b/src/Omnipay/Eway/Message/RapidPurchaseRequest.php deleted file mode 100644 index 5459ca33..00000000 --- a/src/Omnipay/Eway/Message/RapidPurchaseRequest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Eway\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * eWAY Rapid 3.0 Purchase Request - */ -class RapidPurchaseRequest extends AbstractRequest -{ - protected $liveEndpoint = 'https://api.ewaypayments.com/'; - protected $testEndpoint = 'https://api.sandbox.ewaypayments.com/'; - - public function getApiKey() - { - return $this->getParameter('apiKey'); - } - - public function setApiKey($value) - { - return $this->setParameter('apiKey', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getData() - { - $this->validate('amount', 'returnUrl'); - - $data = array(); - $data['Method'] = 'ProcessPayment'; - $data['DeviceID'] = 'https://github.com/adrianmacneil/omnipay'; - $data['CustomerIP'] = $this->getClientIp(); - $data['RedirectUrl'] = $this->getReturnUrl(); - - $data['Payment'] = array(); - $data['Payment']['TotalAmount'] = $this->getAmountInteger(); - $data['Payment']['InvoiceNumber'] = $this->getTransactionId(); - $data['Payment']['InvoiceDescription'] = $this->getDescription(); - $data['Payment']['CurrencyCode'] = $this->getCurrency(); - - $data['Customer'] = array(); - if ($this->getCard()) { - $data['Customer']['FirstName'] = $this->getCard()->getFirstName(); - $data['Customer']['LastName'] = $this->getCard()->getLastName(); - } - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->getEndpoint(), null, json_encode($this->getData())) - ->setAuth($this->getApiKey(), $this->getPassword()) - ->send(); - - return $this->response = new RapidResponse($this, $httpResponse->json()); - } - - public function getEndpoint() - { - return $this->getEndpointBase().'/CreateAccessCode.json'; - } - - public function getEndpointBase() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/Eway/Message/RapidResponse.php b/src/Omnipay/Eway/Message/RapidResponse.php deleted file mode 100644 index 9871aed8..00000000 --- a/src/Omnipay/Eway/Message/RapidResponse.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Eway\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * eWAY Rapid 3.0 Purchase Response - */ -class RapidResponse extends AbstractResponse implements RedirectResponseInterface -{ - public function isSuccessful() - { - return isset($this->data['TransactionStatus']) && $this->data['TransactionStatus']; - } - - public function isRedirect() - { - return isset($this->data['FormActionURL']); - } - - public function getRedirectUrl() - { - return isset($this->data['FormActionURL']) ? $this->data['FormActionURL'] : null; - } - - public function getRedirectMethod() - { - return 'POST'; - } - - public function getRedirectData() - { - if ($this->isRedirect()) { - return array( - 'EWAY_ACCESSCODE' => $this->data['AccessCode'], - ); - } - } - - public function getTransactionReference() - { - return isset($this->data['TransactionID']) ? (string) $this->data['TransactionID'] : null; - } - - public function getMessage() - { - return $this->getCode(); - } - - public function getCode() - { - if (!empty($this->data['ResponseMessage'])) { - return $this->data['ResponseMessage']; - } elseif (!empty($this->data['Errors'])) { - return $this->data['Errors']; - } - } -} diff --git a/src/Omnipay/Eway/RapidGateway.php b/src/Omnipay/Eway/RapidGateway.php deleted file mode 100644 index 5c7b3440..00000000 --- a/src/Omnipay/Eway/RapidGateway.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Eway; - -use Omnipay\Common\AbstractGateway; - -/** - * eWAY Rapid 3.0 Gateway - */ -class RapidGateway extends AbstractGateway -{ - public function getName() - { - return 'eWAY Rapid 3.0'; - } - - public function getDefaultParameters() - { - return array( - 'apiKey' => '', - 'password' => '', - 'testMode' => false, - ); - } - - public function getApiKey() - { - return $this->getParameter('apiKey'); - } - - public function setApiKey($value) - { - return $this->setParameter('apiKey', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Eway\Message\RapidPurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Eway\Message\RapidCompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/GoCardless/Gateway.php b/src/Omnipay/GoCardless/Gateway.php deleted file mode 100644 index 30868033..00000000 --- a/src/Omnipay/GoCardless/Gateway.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless; - -use Omnipay\Common\AbstractGateway; -use Omnipay\GoCardless\Message\PurchaseRequest; -use Omnipay\GoCardless\Message\CompletePurchaseRequest; - -/** - * GoCardless Gateway - * - * @link https://sandbox.gocardless.com/docs - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'GoCardless'; - } - - public function getDefaultParameters() - { - return array( - 'appId' => '', - 'appSecret' => '', - 'merchantId' => '', - 'accessToken' => '', - 'testMode' => false, - ); - } - - public function getAppId() - { - return $this->getParameter('appId'); - } - - public function setAppId($value) - { - return $this->setParameter('appId', $value); - } - - public function getAppSecret() - { - return $this->getParameter('appSecret'); - } - - public function setAppSecret($value) - { - return $this->setParameter('appSecret', $value); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getAccessToken() - { - return $this->getParameter('accessToken'); - } - - public function setAccessToken($value) - { - return $this->setParameter('accessToken', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\GoCardless\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\GoCardless\Message\CompletePurchaseRequest', $parameters); - } - - /** - * Generate a query string for the data array (this is some kind of sick joke) - * - * @link https://github.com/gocardless/gocardless-php/blob/v0.3.3/lib/GoCardless/Utils.php#L39 - */ - public static function generateQueryString($data, &$pairs = array(), $namespace = null) - { - if (is_array($data)) { - foreach ($data as $k => $v) { - if (is_int($k)) { - static::generateQueryString($v, $pairs, $namespace.'[]'); - } else { - static::generateQueryString($v, $pairs, $namespace !== null ? $namespace."[$k]" : $k); - } - } - - if ($namespace !== null) { - return $pairs; - } - - if (empty($pairs)) { - return ''; - } - - sort($pairs); - $strs = array_map('implode', array_fill(0, count($pairs), '='), $pairs); - - return implode('&', $strs); - } else { - $pairs[] = array(rawurlencode($namespace), rawurlencode($data)); - } - } -} diff --git a/src/Omnipay/GoCardless/Message/AbstractRequest.php b/src/Omnipay/GoCardless/Message/AbstractRequest.php deleted file mode 100644 index d0b08998..00000000 --- a/src/Omnipay/GoCardless/Message/AbstractRequest.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless\Message; - -use Omnipay\GoCardless\Gateway; - -/** - * GoCardless Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - protected $liveEndpoint = 'https://gocardless.com/'; - protected $testEndpoint = 'https://sandbox.gocardless.com/'; - - public function getAppId() - { - return $this->getParameter('appId'); - } - - public function setAppId($value) - { - return $this->setParameter('appId', $value); - } - - public function getAppSecret() - { - return $this->getParameter('appSecret'); - } - - public function setAppSecret($value) - { - return $this->setParameter('appSecret', $value); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getAccessToken() - { - return $this->getParameter('accessToken'); - } - - public function setAccessToken($value) - { - return $this->setParameter('accessToken', $value); - } - - /** - * Generate a signature for the data array - */ - public function generateSignature($data) - { - return hash_hmac('sha256', Gateway::generateQueryString($data), $this->getAppSecret()); - } - - public function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/GoCardless/Message/CompletePurchaseRequest.php b/src/Omnipay/GoCardless/Message/CompletePurchaseRequest.php deleted file mode 100644 index bc7619ad..00000000 --- a/src/Omnipay/GoCardless/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless\Message; - -use Omnipay\Common\Exception\InvalidResponseException; -use Omnipay\GoCardless\Gateway; - -/** - * GoCardless Complete Purchase Request - */ -class CompletePurchaseRequest extends AbstractRequest -{ - public function getData() - { - $data = array(); - $data['resource_uri'] = $this->httpRequest->get('resource_uri'); - $data['resource_id'] = $this->httpRequest->get('resource_id'); - $data['resource_type'] = $this->httpRequest->get('resource_type'); - - if ($this->generateSignature($data) !== $this->httpRequest->get('signature')) { - throw new InvalidResponseException; - } - - unset($data['resource_uri']); - - return $data; - } - - public function send() - { - $httpRequest = $this->httpClient->post( - $this->getEndpoint().'/api/v1/confirm', - array('Accept' => 'application/json'), - Gateway::generateQueryString($this->getData()) - ); - $httpResponse = $httpRequest->setAuth($this->getAppId(), $this->getAppSecret())->send(); - - return $this->response = new CompletePurchaseResponse( - $this, - $httpResponse->json(), - $this->httpRequest->get('resource_id') - ); - } -} diff --git a/src/Omnipay/GoCardless/Message/CompletePurchaseResponse.php b/src/Omnipay/GoCardless/Message/CompletePurchaseResponse.php deleted file mode 100644 index c1cb32da..00000000 --- a/src/Omnipay/GoCardless/Message/CompletePurchaseResponse.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; - -/** - * GoCardless Complete Purchase Response - */ -class CompletePurchaseResponse extends AbstractResponse -{ - protected $transactionReference; - - public function __construct(RequestInterface $request, $data, $transactionReference) - { - parent::__construct($request, $data); - $this->transactionReference = $transactionReference; - } - - public function isSuccessful() - { - return !isset($this->data['error']); - } - - public function getTransactionReference() - { - return $this->transactionReference; - } - - public function getMessage() - { - if (!$this->isSuccessful()) { - return reset($this->data['error']); - } - } -} diff --git a/src/Omnipay/GoCardless/Message/PurchaseRequest.php b/src/Omnipay/GoCardless/Message/PurchaseRequest.php deleted file mode 100644 index 21754f14..00000000 --- a/src/Omnipay/GoCardless/Message/PurchaseRequest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless\Message; - -/** - * GoCardless Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('amount', 'returnUrl'); - - $data = array(); - $data['client_id'] = $this->getAppId(); - $data['nonce'] = $this->generateNonce(); - $data['timestamp'] = gmdate('Y-m-d\TH:i:s\Z'); - $data['redirect_uri'] = $this->getReturnUrl(); - $data['cancel_uri'] = $this->getCancelUrl(); - $data['bill'] = array(); - $data['bill']['merchant_id'] = $this->getMerchantId(); - $data['bill']['amount'] = $this->getAmount(); - $data['bill']['name'] = $this->getDescription(); - - if ($this->getCard()) { - $data['bill']['user'] = array(); - $data['bill']['user']['first_name'] = $this->getCard()->getFirstName(); - $data['bill']['user']['last_name'] = $this->getCard()->getLastName(); - $data['bill']['user']['email'] = $this->getCard()->getEmail(); - $data['bill']['user']['billing_address1'] = $this->getCard()->getAddress1(); - $data['bill']['user']['billing_address2'] = $this->getCard()->getAddress2(); - $data['bill']['user']['billing_town'] = $this->getCard()->getCity(); - $data['bill']['user']['billing_county'] = $this->getCard()->getCountry(); - $data['bill']['user']['billing_postcode'] = $this->getCard()->getPostcode(); - } - - $data['signature'] = $this->generateSignature($data); - - return $data; - } - - public function send() - { - return $this->response = new PurchaseResponse($this, $this->getData()); - } - - /** - * Generate a nonce for each request - */ - protected function generateNonce() - { - $nonce = ''; - for ($i = 0; $i < 64; $i++) { - // append random ASCII character - $nonce .= chr(mt_rand(33, 126)); - } - - return base64_encode($nonce); - } -} diff --git a/src/Omnipay/GoCardless/Message/PurchaseResponse.php b/src/Omnipay/GoCardless/Message/PurchaseResponse.php deleted file mode 100644 index c1c8f646..00000000 --- a/src/Omnipay/GoCardless/Message/PurchaseResponse.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; -use Omnipay\GoCardless\Gateway; - -/** - * GoCardless 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().'/connect/bills/new?'.Gateway::generateQueryString($this->data); - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } -} diff --git a/src/Omnipay/Manual/Gateway.php b/src/Omnipay/Manual/Gateway.php deleted file mode 100644 index 9406ae9c..00000000 --- a/src/Omnipay/Manual/Gateway.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Manual; - -use Omnipay\Common\AbstractGateway; - -/** - * Manual Gateway - * - * This gateway is useful for processing check or direct debit payments. It simply - * authorizes every payment. - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'Manual'; - } - - public function getDefaultParameters() - { - return array(); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Manual\Message\Request', $parameters); - } - - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Manual\Message\Request', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Manual\Message\Request', $parameters); - } -} diff --git a/src/Omnipay/Manual/Message/Request.php b/src/Omnipay/Manual/Message/Request.php deleted file mode 100644 index 781d5346..00000000 --- a/src/Omnipay/Manual/Message/Request.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Manual\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * Manual Request - */ -class Request extends AbstractRequest -{ - public function getData() - { - $this->validate('amount'); - - return $this->getParameters(); - } - - public function send() - { - return $this->response = new Response($this, $this->getData()); - } -} diff --git a/src/Omnipay/Manual/Message/Response.php b/src/Omnipay/Manual/Message/Response.php deleted file mode 100644 index f17f311b..00000000 --- a/src/Omnipay/Manual/Message/Response.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Manual\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * Manual Response - */ -class Response extends AbstractResponse -{ - public function isSuccessful() - { - return true; - } -} diff --git a/src/Omnipay/Migs/Message/AbstractRequest.php b/src/Omnipay/Migs/Message/AbstractRequest.php deleted file mode 100644 index bd850473..00000000 --- a/src/Omnipay/Migs/Message/AbstractRequest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -/** - * GoCardless Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - protected $endpoint = 'https://migs.mastercard.com.au/'; - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getMerchantAccessCode() - { - return $this->getParameter('merchantAccessCode'); - } - - public function setMerchantAccessCode($value) - { - return $this->setParameter('merchantAccessCode', $value); - } - - public function getSecureHash() - { - return $this->getParameter('secureHash'); - } - - public function setSecureHash($value) - { - return $this->setParameter('secureHash', $value); - } - - protected function getBaseData() - { - $data = array(); - $data['vpc_Merchant'] = $this->getMerchantId(); - $data['vpc_AccessCode'] = $this->getMerchantAccessCode(); - $data['vpc_Version'] = '1'; - $data['vpc_Locale'] = 'en'; - $data['vpc_Command'] = $this->action; - $data['vpc_Amount'] = $this->getAmountInteger(); - $data['vpc_MerchTxnRef'] = $this->getTransactionId(); - $data['vpc_OrderInfo'] = $this->getDescription(); - $data['vpc_ReturnURL'] = $this->getReturnUrl(); - - return $data; - } - - public function getEndpoint() - { - return $this->endpoint; - } - - public function calculateHash($data) - { - ksort($data); - - $hash = $this->getSecureHash(); - foreach ($data as $k => $v) { - if (substr($k, 0, 4) === 'vpc_' && $k !== 'vpc_SecureHash') { - $hash .= $v; - } - } - - return strtoupper(md5($hash)); - } -} diff --git a/src/Omnipay/Migs/Message/Response.php b/src/Omnipay/Migs/Message/Response.php deleted file mode 100644 index ba16347c..00000000 --- a/src/Omnipay/Migs/Message/Response.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; - -/** - * Migs Purchase Response - */ -class Response extends AbstractResponse -{ - public function __construct(RequestInterface $request, $data) - { - if (!is_array($data)) { - parse_str($data, $data); - } - - parent::__construct($request, $data); - } - - public function isSuccessful() - { - return isset($this->data['vpc_TxnResponseCode']) && "0" === $this->data['vpc_TxnResponseCode']; - } - - public function getTransactionReference() - { - return isset($this->data['vpc_ReceiptNo']) ? $this->data['vpc_ReceiptNo'] : null; - } - - public function getMessage() - { - return isset($this->data['vpc_Message']) ? $this->data['vpc_Message'] : null; - } -} diff --git a/src/Omnipay/Migs/Message/ThreePartyCompletePurchaseRequest.php b/src/Omnipay/Migs/Message/ThreePartyCompletePurchaseRequest.php deleted file mode 100644 index 49cd8316..00000000 --- a/src/Omnipay/Migs/Message/ThreePartyCompletePurchaseRequest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\Common\Exception\InvalidRequestException; - -/** - * Migs Complete Purchase Request - */ -class ThreePartyCompletePurchaseRequest extends AbstractRequest -{ - public function getData() - { - $data = $this->httpRequest->query->all(); - - $hash = isset($data['vpc_SecureHash']) ? $data['vpc_SecureHash'] : null; - if ($this->calculateHash($data) !== $hash) { - throw new InvalidRequestException('Incorrect hash'); - } - - return $data; - } - - public function send() - { - return $this->response = new Response($this, $this->getData()); - } - - public function getEndpoint() - { - return $this->endpoint.'vpcpay'; - } -} diff --git a/src/Omnipay/Migs/Message/ThreePartyPurchaseRequest.php b/src/Omnipay/Migs/Message/ThreePartyPurchaseRequest.php deleted file mode 100644 index e2e66177..00000000 --- a/src/Omnipay/Migs/Message/ThreePartyPurchaseRequest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -/** - * Migs Purchase Request - */ -class ThreePartyPurchaseRequest extends AbstractRequest -{ - protected $action = 'pay'; - - public function getData() - { - $this->validate('amount', 'returnUrl', 'transactionId'); - - $data = $this->getBaseData(); - $data['vpc_SecureHash'] = $this->calculateHash($data); - - return $data; - } - - public function send() - { - $redirectUrl = $this->getEndpoint().'?'.http_build_query($this->getData()); - - return $this->response = new ThreePartyPurchaseResponse($this, $this->getData(), $redirectUrl); - } - - public function getEndpoint() - { - return $this->endpoint.'vpcpay'; - } -} diff --git a/src/Omnipay/Migs/Message/ThreePartyPurchaseResponse.php b/src/Omnipay/Migs/Message/ThreePartyPurchaseResponse.php deleted file mode 100644 index dbfe7f90..00000000 --- a/src/Omnipay/Migs/Message/ThreePartyPurchaseResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * Migs Purchase Response - */ -class ThreePartyPurchaseResponse extends AbstractResponse implements RedirectResponseInterface -{ - protected $redirectUrl; - - public function __construct(RequestInterface $request, $data, $redirectUrl) - { - parent::__construct($request, $data); - $this->redirectUrl = $redirectUrl; - } - - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return true; - } - - public function getRedirectUrl() - { - return $this->redirectUrl; - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return $this->getData(); - } -} diff --git a/src/Omnipay/Migs/Message/TwoPartyPurchaseRequest.php b/src/Omnipay/Migs/Message/TwoPartyPurchaseRequest.php deleted file mode 100644 index ee5898a6..00000000 --- a/src/Omnipay/Migs/Message/TwoPartyPurchaseRequest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -/** - * Migs Purchase Request - */ -class TwoPartyPurchaseRequest extends AbstractRequest -{ - protected $action = 'pay'; - - public function getData() - { - $this->validate('amount', 'transactionId', 'card'); - - $this->getCard()->validate(); - - $data = $this->getBaseData(); - $data['vpc_CardNum'] = $this->getCard()->getNumber(); - $data['vpc_CardExp'] = $this->getCard()->getExpiryDate('ym'); - $data['vpc_CardSecurityCode'] = $this->getCard()->getCvv(); - $data['vpc_SecureHash'] = $this->calculateHash($data); - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $this->getData())->send(); - - return $this->response = new Response($this, $httpResponse->getBody()); - } - - public function getEndpoint() - { - return $this->endpoint.'vpcdps'; - } -} diff --git a/src/Omnipay/Migs/ThreePartyGateway.php b/src/Omnipay/Migs/ThreePartyGateway.php deleted file mode 100644 index 7a8b0a08..00000000 --- a/src/Omnipay/Migs/ThreePartyGateway.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs; - -/** - * MIGS Gateway - * - * @link http://www.anz.com/australia/business/merchant/pdf/VPC-Dev-Kit-Integration-Notes.pdf - */ -class ThreePartyGateway extends TwoPartyGateway -{ - public function getName() - { - return 'MIGS 3-Party'; - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Migs\Message\ThreePartyPurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Migs\Message\ThreePartyCompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/Migs/TwoPartyGateway.php b/src/Omnipay/Migs/TwoPartyGateway.php deleted file mode 100644 index e9261c3f..00000000 --- a/src/Omnipay/Migs/TwoPartyGateway.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs; - -use Omnipay\Common\AbstractGateway; - -/** - * MIGS Gateway - * - * @link http://www.anz.com/australia/business/merchant/pdf/VPC-Dev-Kit-Integration-Notes.pdf - */ -class TwoPartyGateway extends AbstractGateway -{ - public function getName() - { - return 'MIGS 2-Party'; - } - - public function getDefaultParameters() - { - return array( - 'merchantId' => '', - 'merchantAccessCode' => '', - 'secureHash' => '' - ); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getMerchantAccessCode() - { - return $this->getParameter('merchantAccessCode'); - } - - public function setMerchantAccessCode($value) - { - return $this->setParameter('merchantAccessCode', $value); - } - - public function getSecureHash() - { - return $this->getParameter('secureHash'); - } - - public function setSecureHash($value) - { - return $this->setParameter('secureHash', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Migs\Message\TwoPartyPurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/Mollie/Gateway.php b/src/Omnipay/Mollie/Gateway.php deleted file mode 100644 index 22d61fc3..00000000 --- a/src/Omnipay/Mollie/Gateway.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie; - -use Omnipay\Common\AbstractGateway; - -/** - * Mollie (iDeal) Gateway - * - * @link https://www.mollie.nl/support/documentatie/betaaldiensten/ideal/en/ - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'Mollie'; - } - - public function getDefaultParameters() - { - return array( - 'partnerId' => '', - 'testMode' => '', - ); - } - - public function getPartnerId() - { - return $this->getParameter('partnerId'); - } - - public function setPartnerId($value) - { - return $this->setParameter('partnerId', $value); - } - - public function fetchIssuers(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Mollie\Message\FetchIssuersRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Mollie\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Mollie\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/Mollie/Message/AbstractRequest.php b/src/Omnipay/Mollie/Message/AbstractRequest.php deleted file mode 100644 index e70645ea..00000000 --- a/src/Omnipay/Mollie/Message/AbstractRequest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -/** - * Mollie Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - protected $endpoint = 'https://secure.mollie.nl/xml/ideal'; - - public function getPartnerId() - { - return $this->getParameter('partnerId'); - } - - public function setPartnerId($value) - { - return $this->setParameter('partnerId', $value); - } - - public function getIssuer() - { - return $this->getParameter('issuer'); - } - - public function setIssuer($value) - { - return $this->setParameter('issuer', $value); - } - - protected function getBaseData() - { - $data = array(); - - if ($this->getTestMode()) { - $data['testmode'] = 'true'; - } - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->endpoint, null, $this->getData())->send(); - - return $this->response = new Response($this, $httpResponse->xml()); - } -} diff --git a/src/Omnipay/Mollie/Message/CompletePurchaseRequest.php b/src/Omnipay/Mollie/Message/CompletePurchaseRequest.php deleted file mode 100644 index f0be2990..00000000 --- a/src/Omnipay/Mollie/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -/** - * Mollie Complete Purchase Request - */ -class CompletePurchaseRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('partnerId'); - - $data = $this->getBaseData(); - $data['a'] = 'check'; - $data['partnerid'] = $this->getPartnerId(); - $data['transaction_id'] = $this->httpRequest->query->get('transaction_id'); - - return $data; - } -} diff --git a/src/Omnipay/Mollie/Message/FetchIssuersRequest.php b/src/Omnipay/Mollie/Message/FetchIssuersRequest.php deleted file mode 100644 index 60844e6c..00000000 --- a/src/Omnipay/Mollie/Message/FetchIssuersRequest.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -/** - * Mollie Fetch Issuers Request - */ -class FetchIssuersRequest extends AbstractRequest -{ - public function getData() - { - $data = $this->getBaseData(); - $data['a'] = 'banklist'; - - return $data; - } -} diff --git a/src/Omnipay/Mollie/Message/PurchaseRequest.php b/src/Omnipay/Mollie/Message/PurchaseRequest.php deleted file mode 100644 index 47f701cc..00000000 --- a/src/Omnipay/Mollie/Message/PurchaseRequest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -/** - * Mollie Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('partnerId', 'amount', 'issuer', 'returnUrl', 'notifyUrl'); - - $data = $this->getBaseData(); - $data['a'] = 'fetch'; - $data['partnerid'] = $this->getPartnerId(); - $data['returnurl'] = $this->getReturnUrl(); - $data['reporturl'] = $this->getNotifyUrl(); - $data['bank_id'] = $this->getIssuer(); - $data['amount'] = $this->getAmountInteger(); - $data['description'] = $this->getDescription(); - - return $data; - } -} diff --git a/src/Omnipay/Mollie/Message/Response.php b/src/Omnipay/Mollie/Message/Response.php deleted file mode 100644 index 81ebde00..00000000 --- a/src/Omnipay/Mollie/Message/Response.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * Mollie Response - */ -class Response extends AbstractResponse implements RedirectResponseInterface -{ - public function isSuccessful() - { - if ($this->isRedirect()) { - return false; - } - - return 'error' !== (string) $this->data->item['type']; - } - - public function isRedirect() - { - return isset($this->data->order->URL); - } - - public function getRedirectUrl() - { - if ($this->isRedirect()) { - return (string) $this->data->order->URL; - } - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } - - public function getTransactionReference() - { - if (isset($this->data->order)) { - return (string) $this->data->order->transaction_id; - } - } - - public function getMessage() - { - if (isset($this->data->item)) { - return (string) $this->data->item->message; - } elseif (isset($this->data->order)) { - return (string) $this->data->order->message; - } else { - return (string) $this->data->message; - } - } - - public function getCode() - { - if (isset($this->data->item)) { - return (string) $this->data->item->errorcode; - } - } - - /** - * Get an associateive array of banks returned from a fetchIssuers request - */ - public function getIssuers() - { - if (isset($this->data->bank)) { - $issuers = array(); - - foreach ($this->data->bank as $bank) { - $bank_id = (string) $bank->bank_id; - $issuers[$bank_id] = (string) $bank->bank_name; - } - - return $issuers; - } - } -} diff --git a/src/Omnipay/MultiSafepay/Gateway.php b/src/Omnipay/MultiSafepay/Gateway.php deleted file mode 100644 index 24f8dda9..00000000 --- a/src/Omnipay/MultiSafepay/Gateway.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay; - -use Omnipay\Common\AbstractGateway; -use Omnipay\MultiSafepay\Message\FetchIssuersRequest; -use Omnipay\MultiSafepay\Message\FetchPaymentMethodsRequest; - -/** - * MultiSafepay gateway. - * - * @link https://www.multisafepay.com/downloads/handleidingen/Handleiding_connect(ENG).pdf - */ -class Gateway extends AbstractGateway -{ - /** - * {@inheritdoc} - */ - public function getName() - { - return 'MultiSafepay'; - } - - /** - * {@inheritdoc} - */ - public function getDefaultParameters() - { - return array( - 'accountId' => '', - 'siteId' => '', - 'siteCode' => '', - 'testMode' => false, - ); - } - - 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); - } - - /** - * Retrieve payment methods active on the given MultiSafepay - * account. - * - * @param array $parameters - * - * @return FetchPaymentMethodsRequest - */ - public function fetchPaymentMethods(array $parameters = array()) - { - return $this->createRequest('\Omnipay\MultiSafepay\Message\FetchPaymentMethodsRequest', $parameters); - } - - /** - * Retrieve iDEAL issuers. - * - * @param array $parameters - * - * @return FetchIssuersRequest - */ - public function fetchIssuers(array $parameters = array()) - { - return $this->createRequest('\Omnipay\MultiSafepay\Message\FetchIssuersRequest', $parameters); - } - - /** - * {@inheritdoc} - */ - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\MultiSafepay\Message\PurchaseRequest', $parameters); - } - - /** - * {@inheritdoc} - */ - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\MultiSafepay\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/MultiSafepay/Message/AbstractRequest.php b/src/Omnipay/MultiSafepay/Message/AbstractRequest.php deleted file mode 100644 index 5ad4bb4c..00000000 --- a/src/Omnipay/MultiSafepay/Message/AbstractRequest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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, - ); - } -} diff --git a/src/Omnipay/MultiSafepay/Message/AbstractResponse.php b/src/Omnipay/MultiSafepay/Message/AbstractResponse.php deleted file mode 100644 index a66ffe1c..00000000 --- a/src/Omnipay/MultiSafepay/Message/AbstractResponse.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use Omnipay\Common\Message\AbstractResponse as BaseAbstractResponse; - -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; - } -} diff --git a/src/Omnipay/MultiSafepay/Message/CompletePurchaseRequest.php b/src/Omnipay/MultiSafepay/Message/CompletePurchaseRequest.php deleted file mode 100644 index d985bda7..00000000 --- a/src/Omnipay/MultiSafepay/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use SimpleXMLElement; - -class CompletePurchaseRequest extends PurchaseRequest -{ - /** - * {@inheritdoc} - */ - public function getData() - { - $this->validate('transactionId'); - - $data = new SimpleXMLElement(''); - $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()); - - $transaction = $data->addChild('transaction'); - $transaction->addChild('id', $this->getTransactionId()); - - return $data; - } - - /** - * {@inheritdoc} - */ - public function send() - { - $httpResponse = $this->httpClient->post( - $this->getEndpoint(), - $this->getHeaders(), - $this->getData()->asXML() - )->send(); - - return $this->response = new CompletePurchaseResponse($this, $httpResponse->xml()); - } -} diff --git a/src/Omnipay/MultiSafepay/Message/CompletePurchaseResponse.php b/src/Omnipay/MultiSafepay/Message/CompletePurchaseResponse.php deleted file mode 100644 index bee9cb25..00000000 --- a/src/Omnipay/MultiSafepay/Message/CompletePurchaseResponse.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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; - } -} diff --git a/src/Omnipay/MultiSafepay/Message/FetchIssuersRequest.php b/src/Omnipay/MultiSafepay/Message/FetchIssuersRequest.php deleted file mode 100644 index 39a26012..00000000 --- a/src/Omnipay/MultiSafepay/Message/FetchIssuersRequest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use SimpleXMLElement; - -class FetchIssuersRequest extends AbstractRequest -{ - /** - * {@inheritdoc} - */ - public function getData() - { - $data = new SimpleXMLElement(''); - $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 send() - { - $httpResponse = $this->httpClient->post( - $this->getEndpoint(), - $this->getHeaders(), - $this->getData()->asXML() - )->send(); - - return $this->response = new FetchIssuersResponse($this, $httpResponse->xml()); - } -} diff --git a/src/Omnipay/MultiSafepay/Message/FetchIssuersResponse.php b/src/Omnipay/MultiSafepay/Message/FetchIssuersResponse.php deleted file mode 100644 index a5b7ad4a..00000000 --- a/src/Omnipay/MultiSafepay/Message/FetchIssuersResponse.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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; - } -} diff --git a/src/Omnipay/MultiSafepay/Message/FetchPaymentMethodsRequest.php b/src/Omnipay/MultiSafepay/Message/FetchPaymentMethodsRequest.php deleted file mode 100644 index 370af937..00000000 --- a/src/Omnipay/MultiSafepay/Message/FetchPaymentMethodsRequest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use SimpleXMLElement; - -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(''); - $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 send() - { - $httpResponse = $this->httpClient->post( - $this->getEndpoint(), - $this->getHeaders(), - $this->getData()->asXML() - )->send(); - - return $this->response = new FetchPaymentMethodsResponse($this, $httpResponse->xml()); - } -} diff --git a/src/Omnipay/MultiSafepay/Message/FetchPaymentMethodsResponse.php b/src/Omnipay/MultiSafepay/Message/FetchPaymentMethodsResponse.php deleted file mode 100644 index e0ed4561..00000000 --- a/src/Omnipay/MultiSafepay/Message/FetchPaymentMethodsResponse.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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; - } -} diff --git a/src/Omnipay/MultiSafepay/Message/PurchaseRequest.php b/src/Omnipay/MultiSafepay/Message/PurchaseRequest.php deleted file mode 100644 index 042d8327..00000000 --- a/src/Omnipay/MultiSafepay/Message/PurchaseRequest.php +++ /dev/null @@ -1,171 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use Omnipay\Common\CreditCard; -use SimpleXMLElement; - -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); - } - - /** - * {@inheritdoc} - */ - public function getData() - { - $this->validate('transactionId', 'amount', 'currency', 'description', 'clientIp', 'card'); - - $data = new SimpleXMLElement(''); - $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())); - $merchant->addChild('gateway', $this->getGateway()); - - if ('IDEAL' === $this->getGateway() && $this->getIssuer()) { - $gatewayInfo = $data->addChild('gatewayinfo'); - $gatewayInfo->addChild('issuerid', $this->getIssuer()); - } - - /** @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()); - - $data->addChild('signature', $this->generateSignature()); - - return $data; - } - - /** - * {@inheritdoc} - */ - public function send() - { - $httpResponse = $this->httpClient->post( - $this->getEndpoint(), - $this->getHeaders(), - $this->getData()->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() - ); - } -} diff --git a/src/Omnipay/MultiSafepay/Message/PurchaseResponse.php b/src/Omnipay/MultiSafepay/Message/PurchaseResponse.php deleted file mode 100644 index 91d212ff..00000000 --- a/src/Omnipay/MultiSafepay/Message/PurchaseResponse.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -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); - } - - /** - * {@inheritdoc} - */ - public function getRedirectUrl() - { - return $this->isRedirect() ? (string) $this->data->transaction->payment_url : null; - } - - /** - * {@inheritdoc} - */ - public function getRedirectMethod() - { - return 'GET'; - } - - /** - * {@inheritdoc} - */ - public function getRedirectData() - { - return null; - } -} diff --git a/src/Omnipay/NetBanx/Gateway.php b/src/Omnipay/NetBanx/Gateway.php deleted file mode 100644 index 7b360d0e..00000000 --- a/src/Omnipay/NetBanx/Gateway.php +++ /dev/null @@ -1,169 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\NetBanx; - -use Omnipay\Common\AbstractGateway; - -/** - * NetBanx Class - */ -class Gateway extends AbstractGateway -{ - const DECISION_ACCEPTED = 'ACCEPTED'; - const CREATE_CARD_AMOUNT = '1.00'; - const CODE_OK = '0'; - - /** - * Get name of the gateway - * - * @return string - */ - public function getName() - { - return 'NetBanx Gateway'; - } - - /** - * Get default parameters - * - * @return array - */ - public function getDefaultParameters() - { - return array( - 'accountNumber' => '', - 'storeId' => '', - 'storePassword' => '', - 'testMode' => false, - ); - } - - /** - * Authorize a new amount - * - * @param array $parameters - * @return mixed - */ - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\NetBanx\Message\AuthorizeRequest', $parameters); - } - - /** - * Capture authorized amount - * - * @param array $parameters An array of options - * @return \Omnipay\ResponseInterface - */ - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\NetBanx\Message\CaptureRequest', $parameters); - } - - /** - * Create a new charge (combined authorize + capture). - * - * @param array An array of options - * @return \Omnipay\ResponseInterface - */ - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\NetBanx\Message\PurchaseRequest', $parameters); - } - - /** - * Void transaction - * - * @param array $parameters An array of options - * @return \Omnipay\ResponseInterface - */ - public function void(array $parameters = array()) - { - return $this->createRequest('\Omnipay\NetBanx\Message\VoidRequest', $parameters); - } - - /** - * Create card - * - * @param array $parameters - * @return mixed - */ - public function createCard(array $parameters = array()) - { - $parameters['amount'] = self::CREATE_CARD_AMOUNT; - - return $this->createRequest('\Omnipay\NetBanx\Message\AuthorizeRequest', $parameters); - } - - /** - * Setter for Account Number - * - * @param string $value - * @return $this - */ - public function setAccountNumber($value) - { - return $this->setParameter('accountNumber', $value); - } - - /** - * Getter for Account Number - * - * @return string - */ - public function getAccountNumber() - { - return $this->getParameter('accountNumber'); - } - - /** - * Setter for Store ID - * - * @param string $value - * @return $this - */ - public function setStoreId($value) - { - return $this->setParameter('storeId', $value); - } - - /** - * Getter for Store ID - * - * @return string - */ - public function getStoreId() - { - return $this->getParameter('storeId'); - } - - /** - * Setter for Store Password - * - * @param string $value - * @return $this - */ - public function setStorePassword($value) - { - return $this->setParameter('storePassword', $value); - } - - /** - * Getter for Store Password - * - * @return string - */ - public function getStorePassword() - { - return $this->getParameter('storePassword'); - } -} diff --git a/src/Omnipay/NetBanx/Message/AbstractRequest.php b/src/Omnipay/NetBanx/Message/AbstractRequest.php deleted file mode 100644 index 166ff3f8..00000000 --- a/src/Omnipay/NetBanx/Message/AbstractRequest.php +++ /dev/null @@ -1,198 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\NetBanx\Message; - -use Omnipay\Common\CreditCard; - -/** - * NetBanx Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - /** - * Live EndPoint - * - * @var string - */ - protected $liveEndpoint = 'https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1'; - - /** - * Developer EndPoint - * - * @var string - */ - protected $developerEndpoint = 'https://webservices.test.optimalpayments.com/creditcardWS/CreditCardServlet/v1'; - - /** - * Setter for Account Number - * - * @param string $value - * @return $this - */ - public function setAccountNumber($value) - { - return $this->setParameter('accountNumber', $value); - } - - /** - * Getter for Account Number - * - * @return string - */ - public function getAccountNumber() - { - return $this->getParameter('accountNumber'); - } - - /** - * Setter for Store ID - * - * @param string $value - * @return $this - */ - public function setStoreId($value) - { - return $this->setParameter('storeId', $value); - } - - /** - * Getter for Store ID - * - * @return string - */ - public function getStoreId() - { - return $this->getParameter('storeId'); - } - - /** - * Setter for Store Password - * - * @param string $value - * @return $this - */ - public function setStorePassword($value) - { - return $this->setParameter('storePassword', $value); - } - - /** - * Getter for Store Password - * - * @return string - */ - public function getStorePassword() - { - return $this->getParameter('storePassword'); - } - - /** - * Getter for customer ID - * - * @return string - */ - public function getCustomerId() - { - return $this->getParameter('customerId'); - } - - /** - * Setter for customr ID - * - * @param string $value - * @return $this - */ - public function setCustomerId($value) - { - return $this->setParameter('customerId', $value); - } - - /** - * Send request - * - * @return \Omnipay\Common\Message\ResponseInterface|void - */ - public function send() - { - $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $this->getData())->send(); - - return $this->response = new Response($this, $httpResponse->getBody()); - } - - /** - * Get End Point - * - * Depends on Test or Live environment - * - * @return string - */ - public function getEndpoint() - { - return $this->getTestMode() ? $this->developerEndpoint : $this->liveEndpoint; - } - - /** - * Get base data - * - * @return array - */ - protected function getBaseData() - { - $data = array(); - $data['txnMode'] = $this->txnMode; - - return $data; - } - - /** - * Translate card type to internal NetBanx format - * - * @param string $brand - * @return string - */ - protected function translateCardType($brand) - { - switch ($brand) { - case CreditCard::BRAND_VISA: - $cardType = 'VI'; - break; - case CreditCard::BRAND_AMEX: - $cardType = 'AM'; - break; - case CreditCard::BRAND_DISCOVER: - $cardType = 'DI'; - break; - case CreditCard::BRAND_MASTERCARD: - $cardType = 'MC'; - break; - case CreditCard::BRAND_MAESTRO: - $cardType = 'MD'; - break; - case CreditCard::BRAND_LASER: - $cardType = 'LA'; - break; - case CreditCard::BRAND_SOLO: - $cardType = 'SO'; - break; - case CreditCard::BRAND_JCB: - $cardType = 'JC'; - break; - case CreditCard::BRAND_DINERS_CLUB: - $cardType = 'DC'; - break; - default: - $cardType = 'VI'; - } - - return $cardType; - } -} diff --git a/src/Omnipay/NetBanx/Message/AuthorizeRequest.php b/src/Omnipay/NetBanx/Message/AuthorizeRequest.php deleted file mode 100644 index 0c1880bf..00000000 --- a/src/Omnipay/NetBanx/Message/AuthorizeRequest.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\NetBanx\Message; - -use Omnipay\Common\CreditCard; - -/** - * NetBanx Authorize Request - */ -class AuthorizeRequest extends AbstractRequest -{ - const MODE_AUTH = 'ccAuthorize'; - const MODE_STORED_DATA_AUTH = 'ccStoredDataAuthorize'; - - /** - * Method - * - * @var string - */ - protected $txnMode; - - /** - * Get data - * - * @return array - */ - public function getData() - { - if ($this->getTransactionReference() || $this->getCardReference()) { - $this->txnMode = $this->getStoredDataMode(); - $this->validate('amount'); - } else { - $this->txnMode = $this->getBasicMode(); - $this->validate('amount', 'card'); - $this->getCard()->validate(); - } - - $data = $this->getBaseData(); - $data['txnRequest'] = $this->getXmlString(); - - return $data; - } - - /** - * Get XML string - * - * @return string - */ - protected function getXmlString() - { - if ($this->getTransactionReference() || $this->getCardReference()) { - $xmlRoot = 'ccStoredDataRequestV1'; - } else { - $xmlRoot = 'ccAuthRequestV1'; - } - - $xml = " - <{$xmlRoot} - xmlns=\"http://www.optimalpayments.com/creditcard/xmlschema/v1/" - xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance/" - xsi:schemaLocation=\"http://www.optimalpayments.com/creditcard/xmlschema/v1/" />"; - - $sxml = new \SimpleXMLElement($xml); - - $merchantAccount = $sxml->addChild('merchantAccount'); - - $merchantAccount->addChild('accountNum', $this->getAccountNumber()); - $merchantAccount->addChild('storeID', $this->getStoreId()); - $merchantAccount->addChild('storePwd', $this->getStorePassword()); - - $sxml->addChild('merchantRefNum', $this->getCustomerId() ?: 'ref-num - ' . time()); - - if ($this->getTransactionReference() || $this->getCardReference()) { - $sxml->addChild('confirmationNumber', $this->getTransactionReference() ?: $this->getCardReference()); - $sxml->addChild('amount', $this->getAmount()); - } else { - /** @var $card CreditCard */ - $card = $this->getCard(); - - $sxml->addChild('amount', $this->getAmount()); - - $cardChild = $sxml->addChild('card'); - - $cardChild->addChild('cardNum', $card->getNumber()); - - $cardExpiry = $cardChild->addChild('cardExpiry'); - $cardExpiry->addChild('month', $card->getExpiryDate('m')); - $cardExpiry->addChild('year', $card->getExpiryDate('Y')); - - $cardChild->addChild('cardType', $this->translateCardType($card->getBrand())); - $cardChild->addChild('cvdIndicator', '1'); - $cardChild->addChild('cvd', $card->getCvv()); - - $billingDetails = $sxml->addChild('billingDetails'); - - $billingDetails->addChild('cardPayMethod', 'WEB'); - $billingDetails->addChild('firstName', $card->getBillingFirstName()); - $billingDetails->addChild('lastName', $card->getBillingLastName()); - $billingDetails->addChild('street', $card->getBillingAddress1()); - $billingDetails->addChild('street2', $card->getBillingAddress2()); - $billingDetails->addChild('city', $card->getBillingCity()); - $billingDetails->addChild('state', $card->getBillingState()); - $billingDetails->addChild('country', $card->getBillingCountry()); - $billingDetails->addChild('zip', $card->getBillingPostcode()); - $billingDetails->addChild('phone', $card->getBillingPhone()); - $billingDetails->addChild('email', $card->getEmail()); - - $shippingDetails = $sxml->addChild('shippingDetails'); - - $shippingDetails->addChild('firstName', $card->getShippingFirstName()); - $shippingDetails->addChild('lastName', $card->getShippingLastName()); - $shippingDetails->addChild('street', $card->getShippingAddress1()); - $shippingDetails->addChild('street2', $card->getShippingAddress2()); - $shippingDetails->addChild('city', $card->getShippingCity()); - $shippingDetails->addChild('state', $card->getShippingState()); - $shippingDetails->addChild('country', $card->getShippingCountry()); - $shippingDetails->addChild('zip', $card->getShippingPostcode()); - $shippingDetails->addChild('phone', $card->getShippingPhone()); - $shippingDetails->addChild('email', $card->getEmail()); - } - - return $sxml->asXML(); - } - - /** - * Get Stored Data Mode - * - * @return string - */ - protected function getStoredDataMode() - { - return self::MODE_STORED_DATA_AUTH; - } - - /** - * Get Stored Data Mode - * - * @return string - */ - protected function getBasicMode() - { - return self::MODE_AUTH; - } -} diff --git a/src/Omnipay/NetBanx/Message/CaptureRequest.php b/src/Omnipay/NetBanx/Message/CaptureRequest.php deleted file mode 100644 index e7a5d6d6..00000000 --- a/src/Omnipay/NetBanx/Message/CaptureRequest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\NetBanx\Message; - -/** - * NetBanx Capture Request - */ -class CaptureRequest extends AbstractRequest -{ - /** - * Method - * - * @var string - */ - protected $txnMode = 'ccSettlement'; - - /** - * Get data - * - * @return array - */ - public function getData() - { - $this->validate('amount', 'transactionReference'); - - $data = $this->getBaseData(); - $data['txnRequest'] = $this->getXmlString(); - - return $data; - } - - /** - * Get XML string - * - * @return string - */ - protected function getXmlString() - { - $xml = ' - '; - - $sxml = new \SimpleXMLElement($xml); - - $merchantAccount = $sxml->addChild('merchantAccount'); - - $merchantAccount->addChild('accountNum', $this->getAccountNumber()); - $merchantAccount->addChild('storeID', $this->getStoreId()); - $merchantAccount->addChild('storePwd', $this->getStorePassword()); - - $sxml->addChild('confirmationNumber', $this->getTransactionReference()); - $sxml->addChild('merchantRefNum', $this->getCustomerId()); - $sxml->addChild('amount', $this->getAmount()); - - return $sxml->asXML(); - } -} diff --git a/src/Omnipay/NetBanx/Message/PurchaseRequest.php b/src/Omnipay/NetBanx/Message/PurchaseRequest.php deleted file mode 100644 index afb13224..00000000 --- a/src/Omnipay/NetBanx/Message/PurchaseRequest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\NetBanx\Message; - -/** - * NetBanx Purchase Request - */ -class PurchaseRequest extends AuthorizeRequest -{ - const MODE_PURCHASE = 'ccPurchase'; - const MODE_STORED_DATA_PURCHASE = 'ccStoredDataPurchase'; - - /** - * @inheritdoc - */ - protected function getStoredDataMode() - { - return self::MODE_STORED_DATA_PURCHASE; - } - - /** - * @inheritdoc - */ - protected function getBasicMode() - { - return self::MODE_PURCHASE; - } -} diff --git a/src/Omnipay/NetBanx/Message/Response.php b/src/Omnipay/NetBanx/Message/Response.php deleted file mode 100644 index b6cecb67..00000000 --- a/src/Omnipay/NetBanx/Message/Response.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\NetBanx\Message; - -use Omnipay\NetBanx\Gateway; -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * NetBanx Response - */ -class Response extends AbstractResponse -{ - /** - * Constructor - * - * @param RequestInterface $request - * @param string $data - * @throws InvalidResponseException - */ - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - - try { - $this->data = new \SimpleXMLElement($data); - } catch (\Exception $e) { - throw new InvalidResponseException(); - } - } - - /** - * Whether or not response is successful - * - * @return bool - */ - public function isSuccessful() - { - $decisionOk = Gateway::DECISION_ACCEPTED === (string) $this->data->decision; - $codeOk = Gateway::CODE_OK === (string) $this->data->code; - - return $decisionOk && $codeOk; - } - - /** - * Get transaction reference - * - * @return string - */ - public function getTransactionReference() - { - return (string) $this->data->confirmationNumber; - } - - /** - * Get card reference - * - * @return string - */ - public function getCardReference() - { - return (string) $this->data->confirmationNumber; - } - - /** - * Get message from responce - * - * @return string - */ - public function getMessage() - { - return (string) $this->data->description; - } -} diff --git a/src/Omnipay/NetBanx/Message/VoidRequest.php b/src/Omnipay/NetBanx/Message/VoidRequest.php deleted file mode 100644 index c8fe62af..00000000 --- a/src/Omnipay/NetBanx/Message/VoidRequest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\NetBanx\Message; - -/** - * NetBanx Void Request - */ -class VoidRequest extends AbstractRequest -{ - /** - * Method - * - * @var string - */ - protected $txnMode = 'ccAuthorizeReversal'; - - /** - * Get data - * - * @return array - */ - public function getData() - { - $this->validate('transactionReference'); - - $data = $this->getBaseData(); - $data['txnRequest'] = $this->getXmlString(); - - return $data; - } - - /** - * Get XML string - * - * @return string - */ - protected function getXmlString() - { - - $xml = ' - '; - - $sxml = new \SimpleXMLElement($xml); - - $merchantAccount = $sxml->addChild('merchantAccount'); - - $merchantAccount->addChild('accountNum', $this->getAccountNumber()); - $merchantAccount->addChild('storeID', $this->getStoreId()); - $merchantAccount->addChild('storePwd', $this->getStorePassword()); - - $sxml->addChild('confirmationNumber', $this->getTransactionReference()); - $sxml->addChild('merchantRefNum', $this->getCustomerId()); - $sxml->addChild('reversalAmount', $this->getAmount()); - - return $sxml->asXML(); - } -} diff --git a/src/Omnipay/Netaxept/Gateway.php b/src/Omnipay/Netaxept/Gateway.php deleted file mode 100644 index 7be82516..00000000 --- a/src/Omnipay/Netaxept/Gateway.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Netaxept; - -use Omnipay\Common\AbstractGateway; -use Omnipay\Netaxept\Message\PurchaseRequest; -use Omnipay\Netaxept\Message\CompletePurchaseRequest; - -/** - * Netaxept Gateway - * - * @link http://www.betalingsterminal.no/Netthandel-forside/Teknisk-veiledning/Overview/ - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'Netaxept'; - } - - public function getDefaultParameters() - { - return array( - 'merchantId' => '', - 'password' => '', - 'testMode' => false, - ); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Netaxept\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Netaxept\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/Netaxept/Message/CompletePurchaseRequest.php b/src/Omnipay/Netaxept/Message/CompletePurchaseRequest.php deleted file mode 100644 index ef91bfa5..00000000 --- a/src/Omnipay/Netaxept/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Netaxept\Message; - -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * Netaxept Complete Purchase Request - */ -class CompletePurchaseRequest extends PurchaseRequest -{ - public function getData() - { - $data = array(); - $data['responseCode'] = $this->httpRequest->query->get('responseCode'); - $data['transactionId'] = $this->httpRequest->query->get('transactionId'); - $data['merchantId'] = $this->getMerchantId(); - $data['token'] = $this->getPassword(); - $data['operation'] = 'AUTH'; - - if (empty($data['responseCode']) || empty($data['transactionId'])) { - throw new InvalidResponseException; - } - - return $data; - } - - public function send() - { - $data = $this->getData(); - - if ('OK' !== $data['responseCode']) { - return $this->response = new ErrorResponse($this, $data); - } - - $url = $this->getEndpoint().'/Netaxept/Process.aspx?'; - $httpResponse = $this->httpClient->get($url.http_build_query($this->getData()))->send(); - - return $this->response = new Response($this, $httpResponse->xml()); - } -} diff --git a/src/Omnipay/Netaxept/Message/ErrorResponse.php b/src/Omnipay/Netaxept/Message/ErrorResponse.php deleted file mode 100644 index 691e00dd..00000000 --- a/src/Omnipay/Netaxept/Message/ErrorResponse.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Netaxept\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * Netaxept Response - */ -class ErrorResponse extends AbstractResponse -{ - public function isSuccessful() - { - return false; - } - - public function getTransactionReference() - { - return $this->data['transactionId']; - } - - public function getMessage() - { - return $this->data['responseCode']; - } -} diff --git a/src/Omnipay/Netaxept/Message/PurchaseRequest.php b/src/Omnipay/Netaxept/Message/PurchaseRequest.php deleted file mode 100644 index c8a337d5..00000000 --- a/src/Omnipay/Netaxept/Message/PurchaseRequest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Netaxept\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * Netaxept Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - protected $liveEndpoint = 'https://epayment.bbs.no/'; - protected $testEndpoint = 'https://epayment-test.bbs.no/'; - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getData() - { - $this->validate('amount', 'currency', 'transactionId', 'returnUrl'); - - $data = array(); - $data['merchantId'] = $this->getMerchantId(); - $data['token'] = $this->getPassword(); - $data['serviceType'] = 'B'; - $data['orderNumber'] = $this->getTransactionId(); - $data['currencyCode'] = $this->getCurrency(); - $data['amount'] = $this->getAmountInteger(); - $data['redirectUrl'] = $this->getReturnUrl(); - - if ($this->getCard()) { - $data['customerFirstName'] = $this->getCard()->getFirstName(); - $data['customerLastName'] = $this->getCard()->getLastName(); - $data['customerEmail'] = $this->getCard()->getEmail(); - $data['customerPhoneNumber'] = $this->getCard()->getPhone(); - $data['customerAddress1'] = $this->getCard()->getAddress1(); - $data['customerAddress2'] = $this->getCard()->getAddress2(); - $data['customerPostcode'] = $this->getCard()->getPostcode(); - $data['customerTown'] = $this->getCard()->getCity(); - $data['customerCountry'] = $this->getCard()->getCountry(); - } - - return $data; - } - - public function send() - { - $url = $this->getEndpoint().'/Netaxept/Register.aspx?'; - $httpResponse = $this->httpClient->get($url.http_build_query($this->getData()))->send(); - - return $this->response = new Response($this, $httpResponse->xml()); - } - - public function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/Netaxept/Message/Response.php b/src/Omnipay/Netaxept/Message/Response.php deleted file mode 100644 index 25aa96a2..00000000 --- a/src/Omnipay/Netaxept/Message/Response.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Netaxept\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * Netaxept Response - */ -class Response extends AbstractResponse implements RedirectResponseInterface -{ - public function isSuccessful() - { - return isset($this->data->ResponseCode) && 'OK' === (string) $this->data->ResponseCode; - } - - public function isRedirect() - { - return !$this->isSuccessful() && 'RegisterResponse' === (string) $this->data->getName(); - } - - public function getTransactionReference() - { - return isset($this->data->TransactionId) ? (string) $this->data->TransactionId : null; - } - - public function getMessage() - { - if (isset($this->data->Error->Message)) { - return (string) $this->data->Error->Message; - } elseif (isset($this->data->ResponseCode)) { - return (string) $this->data->ResponseCode; - } - } - - public function getRedirectUrl() - { - if ($this->isRedirect()) { - $data = array( - 'merchantId' => $this->getRequest()->getMerchantId(), - 'transactionId' => $this->getTransactionReference(), - ); - - return $this->getRequest()->getEndpoint().'/Terminal/Default.aspx?'.http_build_query($data); - } - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } -} diff --git a/src/Omnipay/PayFast/Gateway.php b/src/Omnipay/PayFast/Gateway.php deleted file mode 100644 index 671e0d68..00000000 --- a/src/Omnipay/PayFast/Gateway.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast; - -use Omnipay\Common\AbstractGateway; - -/** - * PayFast Gateway - * - * Quote: The PayFast engine is basically a "black box" which processes a purchaser's payment. - * - * @link https://www.payfast.co.za/s/std/integration-guide - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'PayFast'; - } - - public function getDefaultParameters() - { - return array( - 'merchantId' => '', - 'merchantKey' => '', - 'pdtKey' => '', - 'testMode' => false, - ); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getMerchantKey() - { - return $this->getParameter('merchantKey'); - } - - public function setMerchantKey($value) - { - return $this->setParameter('merchantKey', $value); - } - - public function getPdtKey() - { - return $this->getParameter('pdtKey'); - } - - public function setPdtKey($value) - { - return $this->setParameter('pdtKey', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayFast\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayFast\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/PayFast/Message/CompletePurchaseItnResponse.php b/src/Omnipay/PayFast/Message/CompletePurchaseItnResponse.php deleted file mode 100644 index f0e3a258..00000000 --- a/src/Omnipay/PayFast/Message/CompletePurchaseItnResponse.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; - -/** - * PayFast Complete Purchase ITN Response - */ -class CompletePurchaseItnResponse extends AbstractResponse -{ - public function __construct(RequestInterface $request, $data, $status) - { - parent::__construct($request, $data); - $this->status = $status; - } - - public function isSuccessful() - { - return 'VALID' === $this->status; - } - - public function getTransactionReference() - { - if ($this->isSuccessful() && isset($this->data['pf_payment_id'])) { - return $this->data['pf_payment_id']; - } - } - - public function getMessage() - { - if ($this->isSuccessful() && isset($this->data['payment_status'])) { - return $this->data['payment_status']; - } else { - return $this->status; - } - } -} diff --git a/src/Omnipay/PayFast/Message/CompletePurchasePdtResponse.php b/src/Omnipay/PayFast/Message/CompletePurchasePdtResponse.php deleted file mode 100644 index 8709a55a..00000000 --- a/src/Omnipay/PayFast/Message/CompletePurchasePdtResponse.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; - -/** - * PayFast Complete Purchase PDT Response - */ -class CompletePurchasePdtResponse extends AbstractResponse -{ - protected $status; - - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - $this->data = array(); - - // parse ridiculous response format - $lines = explode('\n', $data); - $this->status = $lines[0]; - - foreach ($lines as $line) { - $parts = explode('=', $line, 2); - $this->data[$parts[0]] = isset($parts[1]) ? urldecode($parts[1]) : null; - } - } - - public function isSuccessful() - { - return 'SUCCESS' === $this->status; - } - - public function getMessage() - { - return $this->isSuccessful() ? $this->data['payment_status'] : $this->status; - } -} diff --git a/src/Omnipay/PayFast/Message/CompletePurchaseRequest.php b/src/Omnipay/PayFast/Message/CompletePurchaseRequest.php deleted file mode 100644 index b7d61263..00000000 --- a/src/Omnipay/PayFast/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\Common\Exception\InvalidRequestException; - -/** - * PayFast Complete Purchase Request - * - * We use the same return URL & class to handle both PDT (Payment Data Transfer) - * and ITN (Instant Transaction Notification). - */ -class CompletePurchaseRequest extends PurchaseRequest -{ - public function getData() - { - if ($this->httpRequest->query->get('pt')) { - // this is a Payment Data Transfer request - $data = array(); - $data['pt'] = $this->httpRequest->query->get('pt'); - $data['at'] = $this->getPdtKey(); - - return $data; - } elseif ($signature = $this->httpRequest->request->get('signature')) { - // this is an Instant Transaction Notification request - $data = $this->httpRequest->request->all(); - - // signature is completely useless since it has no shared secret - // signature must not be posted back to the validate URL, so we unset it - unset($data['signature']); - - return $data; - } - - throw new InvalidRequestException('Missing PDT or ITN variables'); - } - - public function send() - { - $data = $this->getData(); - if (isset($data['pt'])) { - // validate PDT - $url = $this->getEndpoint().'/query/fetch'; - $httpResponse = $this->httpClient->post($url, null, $data)->send(); - - return $this->response = new CompletePurchasePdtResponse($this, $httpResponse->getBody(true)); - } else { - // validate ITN - $url = $this->getEndpoint().'/query/validate'; - $httpResponse = $this->httpClient->post($url, null, $data)->send(); - $status = $httpResponse->getBody(true); - - return $this->response = new CompletePurchaseItnResponse($this, $data, $status); - } - } -} diff --git a/src/Omnipay/PayFast/Message/PurchaseRequest.php b/src/Omnipay/PayFast/Message/PurchaseRequest.php deleted file mode 100644 index 90554d5f..00000000 --- a/src/Omnipay/PayFast/Message/PurchaseRequest.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * PayFast Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - protected $liveEndpoint = 'https://www.payfast.co.za/eng'; - protected $testEndpoint = 'https://sandbox.payfast.co.za/eng'; - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getMerchantKey() - { - return $this->getParameter('merchantKey'); - } - - public function setMerchantKey($value) - { - return $this->setParameter('merchantKey', $value); - } - - public function getPdtKey() - { - return $this->getParameter('pdtKey'); - } - - public function setPdtKey($value) - { - return $this->setParameter('pdtKey', $value); - } - - public function getData() - { - $this->validate('amount', 'description'); - - $data = array(); - $data['merchant_id'] = $this->getMerchantId(); - $data['merchant_key'] = $this->getMerchantKey(); - $data['return_url'] = $this->getReturnUrl(); - $data['cancel_url'] = $this->getCancelUrl(); - $data['notify_url'] = $this->getReturnUrl(); - - if ($this->getCard()) { - $data['name_first'] = $this->getCard()->getFirstName(); - $data['name_last'] = $this->getCard()->getLastName(); - $data['email_address'] = $this->getCard()->getEmail(); - } - - $data['m_payment_id'] = $this->getTransactionId(); - $data['amount'] = $this->getAmount(); - $data['item_name'] = $this->getDescription(); - - $data['signature'] = $this->generateSignature($data); - - return $data; - } - - protected function generateSignature($data) - { - $fields = array(); - - // specific order required by PayFast - foreach (array('merchant_id', 'merchant_key', 'return_url', 'cancel_url', 'notify_url', - 'name_first', 'name_last', 'email_address', 'm_payment_id', 'amount', 'item_name', - 'item_description', 'email_confirmation', 'confirmation_address') as $key) { - if (!empty($data[$key])) { - $fields[$key] = $data[$key]; - } - } - - return md5(http_build_query($fields)); - } - - public function send() - { - return $this->response = new PurchaseResponse($this, $this->getData(), $this->getEndpoint().'/process'); - } - - public function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/PayFast/Message/PurchaseResponse.php b/src/Omnipay/PayFast/Message/PurchaseResponse.php deleted file mode 100644 index 2d6179c2..00000000 --- a/src/Omnipay/PayFast/Message/PurchaseResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * PayFast Purchase Response - */ -class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface -{ - protected $redirectUrl; - - public function __construct(RequestInterface $request, $data, $redirectUrl) - { - parent::__construct($request, $data); - $this->redirectUrl = $redirectUrl; - } - - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return true; - } - - public function getRedirectUrl() - { - return $this->redirectUrl; - } - - public function getRedirectMethod() - { - return 'POST'; - } - - public function getRedirectData() - { - return $this->getData(); - } -} diff --git a/src/Omnipay/PayPal/ExpressGateway.php b/src/Omnipay/PayPal/ExpressGateway.php deleted file mode 100644 index b17afdc2..00000000 --- a/src/Omnipay/PayPal/ExpressGateway.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal; - -use Omnipay\PayPal\Message\ExpressAuthorizeRequest; -use Omnipay\PayPal\Message\ExpressCompleteAuthorizeRequest; -use Omnipay\PayPal\Message\ExpressCompletePurchaseRequest; - -/** - * PayPal Express Class - */ -class ExpressGateway extends ProGateway -{ - public function getName() - { - return 'PayPal Express'; - } - - public function getDefaultParameters() - { - $settings = parent::getDefaultParameters(); - $settings['solutionType'] = array('Sole', 'Mark'); - $settings['landingPage'] = array('Billing', 'Login'); - $settings['headerImageUrl'] = ''; - - return $settings; - } - - public function getSolutionType() - { - return $this->getParameter('solutionType'); - } - - public function setSolutionType($value) - { - return $this->setParameter('solutionType', $value); - } - - public function getLandingPage() - { - return $this->getParameter('landingPage'); - } - - public function setLandingPage($value) - { - return $this->setParameter('landingPage', $value); - } - - public function getHeaderImageUrl() - { - return $this->getParameter('headerImageUrl'); - } - - /** - * Header Image URL (Optional) - * - * URL for the image you want to appear at the top left of the payment page. - * The image has a maximum size of 750 pixels wide by 90 pixels high. - * PayPal recommends that you provide an image that is stored on a secure (https) server. - * If you do not specify an image, the business name displays. - * Character length and limitations: 127 single-byte alphanumeric characters - */ - public function setHeaderImageUrl($value) - { - return $this->setParameter('headerImageUrl', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayPal\Message\ExpressAuthorizeRequest', $parameters); - } - - public function completeAuthorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayPal\Message\ExpressCompleteAuthorizeRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->authorize($parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayPal\Message\ExpressCompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/PayPal/Message/AbstractRequest.php b/src/Omnipay/PayPal/Message/AbstractRequest.php deleted file mode 100644 index e7190141..00000000 --- a/src/Omnipay/PayPal/Message/AbstractRequest.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - protected $liveEndpoint = 'https://api-3t.paypal.com/nvp'; - protected $testEndpoint = 'https://api-3t.sandbox.paypal.com/nvp'; - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getSignature() - { - return $this->getParameter('signature'); - } - - public function setSignature($value) - { - return $this->setParameter('signature', $value); - } - - public function getSubject() - { - return $this->getParameter('subject'); - } - - public function setSubject($value) - { - return $this->setParameter('subject', $value); - } - - public function getSolutionType() - { - return $this->getParameter('solutionType'); - } - - public function setSolutionType($value) - { - return $this->setParameter('solutionType', $value); - } - - public function getLandingPage() - { - return $this->getParameter('landingPage'); - } - - public function setLandingPage($value) - { - return $this->setParameter('landingPage', $value); - } - - public function getHeaderImageUrl() - { - return $this->getParameter('headerImageUrl'); - } - - public function setHeaderImageUrl($value) - { - return $this->setParameter('headerImageUrl', $value); - } - - protected function getBaseData($method) - { - $data = array(); - $data['METHOD'] = $method; - $data['VERSION'] = '85.0'; - $data['USER'] = $this->getUsername(); - $data['PWD'] = $this->getPassword(); - $data['SIGNATURE'] = $this->getSignature(); - $data['SUBJECT'] = $this->getSubject(); - - return $data; - } - - public function send() - { - $url = $this->getEndpoint().'?'.http_build_query($this->getData()); - $httpResponse = $this->httpClient->get($url)->send(); - - return $this->createResponse($httpResponse->getBody()); - } - - protected function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } - - protected function createResponse($data) - { - return $this->response = new Response($this, $data); - } -} diff --git a/src/Omnipay/PayPal/Message/CaptureRequest.php b/src/Omnipay/PayPal/Message/CaptureRequest.php deleted file mode 100644 index 07e7f6ad..00000000 --- a/src/Omnipay/PayPal/Message/CaptureRequest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Capture Request - */ -class CaptureRequest extends AbstractRequest -{ - public function getData() - { - $data = $this->getBaseData('DoCapture'); - - $this->validate('transactionReference', 'amount'); - - $data['AMT'] = $this->getAmount(); - $data['CURRENCYCODE'] = $this->getCurrency(); - $data['AUTHORIZATIONID'] = $this->getTransactionReference(); - $data['COMPLETETYPE'] = 'Complete'; - - return $data; - } -} diff --git a/src/Omnipay/PayPal/Message/ExpressAuthorizeRequest.php b/src/Omnipay/PayPal/Message/ExpressAuthorizeRequest.php deleted file mode 100644 index 7f836373..00000000 --- a/src/Omnipay/PayPal/Message/ExpressAuthorizeRequest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Express Authorize Request - */ -class ExpressAuthorizeRequest extends AbstractRequest -{ - public function getData() - { - $data = $this->getBaseData('SetExpressCheckout'); - - $this->validate('amount', 'returnUrl', 'cancelUrl'); - - $data['PAYMENTREQUEST_0_PAYMENTACTION'] = 'Authorization'; - $data['PAYMENTREQUEST_0_AMT'] = $this->getAmount(); - $data['PAYMENTREQUEST_0_CURRENCYCODE'] = $this->getCurrency(); - $data['PAYMENTREQUEST_0_INVNUM'] = $this->getTransactionId(); - $data['PAYMENTREQUEST_0_DESC'] = $this->getDescription(); - $data['PAYMENTREQUEST_0_NOTIFYURL'] = $this->getNotifyUrl(); - - // pp express specific fields - $data['SOLUTIONTYPE'] = $this->getSolutionType(); - $data['LANDINGPAGE'] = $this->getLandingPage(); - $data['NOSHIPPING'] = 1; - $data['ALLOWNOTE'] = 0; - $data['RETURNURL'] = $this->getReturnUrl(); - $data['CANCELURL'] = $this->getCancelUrl(); - - if ($headerImageUrl = $this->getHeaderImageUrl()) { - $data['HDRIMG'] = $headerImageUrl; - } - - if ($card = $this->getCard()) { - $data['PAYMENTREQUEST_0_SHIPTONAME'] = $card->getName(); - $data['PAYMENTREQUEST_0_SHIPTOSTREET'] = $card->getAddress1(); - $data['PAYMENTREQUEST_0_SHIPTOSTREET2'] = $card->getAddress2(); - $data['PAYMENTREQUEST_0_SHIPTOCITY'] = $card->getCity(); - $data['PAYMENTREQUEST_0_SHIPTOSTATE'] = $card->getState(); - $data['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE'] = $card->getCountry(); - $data['PAYMENTREQUEST_0_SHIPTOZIP'] = $card->getPostcode(); - $data['PAYMENTREQUEST_0_SHIPTOPHONENUM'] = $card->getPhone(); - $data['EMAIL'] = $card->getEmail(); - } - - return $data; - } - - protected function createResponse($data) - { - return $this->response = new ExpressAuthorizeResponse($this, $data); - } -} diff --git a/src/Omnipay/PayPal/Message/ExpressAuthorizeResponse.php b/src/Omnipay/PayPal/Message/ExpressAuthorizeResponse.php deleted file mode 100644 index c0f8747a..00000000 --- a/src/Omnipay/PayPal/Message/ExpressAuthorizeResponse.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * PayPal Express Authorize Response - */ -class ExpressAuthorizeResponse extends Response implements RedirectResponseInterface -{ - protected $liveCheckoutEndpoint = 'https://www.paypal.com/webscr'; - protected $testCheckoutEndpoint = 'https://www.sandbox.paypal.com/webscr'; - - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return isset($this->data['ACK']) && in_array($this->data['ACK'], array('Success', 'SuccessWithWarning')); - } - - public function getRedirectUrl() - { - return $this->getCheckoutEndpoint().'?'.http_build_query( - array( - 'cmd' => '_express-checkout', - 'useraction' => 'commit', - 'token' => $this->getTransactionReference(), - ) - ); - } - - public function getTransactionReference() - { - return isset($this->data['TOKEN']) ? $this->data['TOKEN'] : null; - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } - - protected function getCheckoutEndpoint() - { - return $this->getRequest()->getTestMode() ? $this->testCheckoutEndpoint : $this->liveCheckoutEndpoint; - } -} diff --git a/src/Omnipay/PayPal/Message/ExpressCompleteAuthorizeRequest.php b/src/Omnipay/PayPal/Message/ExpressCompleteAuthorizeRequest.php deleted file mode 100644 index b57039ef..00000000 --- a/src/Omnipay/PayPal/Message/ExpressCompleteAuthorizeRequest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Express Complete Authorize Request - */ -class ExpressCompleteAuthorizeRequest extends AbstractRequest -{ - protected $action = 'Authorization'; - - public function getData() - { - $data = $this->getBaseData('DoExpressCheckoutPayment'); - - $this->validate('amount'); - - $data['PAYMENTREQUEST_0_PAYMENTACTION'] = $this->action; - $data['PAYMENTREQUEST_0_AMT'] = $this->getAmount(); - $data['PAYMENTREQUEST_0_CURRENCYCODE'] = $this->getCurrency(); - $data['PAYMENTREQUEST_0_INVNUM'] = $this->getTransactionId(); - $data['PAYMENTREQUEST_0_DESC'] = $this->getDescription(); - - $data['TOKEN'] = $this->httpRequest->query->get('token'); - $data['PAYERID'] = $this->httpRequest->query->get('PayerID'); - - return $data; - } -} diff --git a/src/Omnipay/PayPal/Message/ExpressCompletePurchaseRequest.php b/src/Omnipay/PayPal/Message/ExpressCompletePurchaseRequest.php deleted file mode 100644 index c4a17323..00000000 --- a/src/Omnipay/PayPal/Message/ExpressCompletePurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Express Complete Purchase Request - */ -class ExpressCompletePurchaseRequest extends ExpressCompleteAuthorizeRequest -{ - protected $action = 'Sale'; -} diff --git a/src/Omnipay/PayPal/Message/ProAuthorizeRequest.php b/src/Omnipay/PayPal/Message/ProAuthorizeRequest.php deleted file mode 100644 index a4261eda..00000000 --- a/src/Omnipay/PayPal/Message/ProAuthorizeRequest.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Pro Authorize Request - */ -class ProAuthorizeRequest extends AbstractRequest -{ - protected $action = 'Authorization'; - - public function getData() - { - $data = $this->getBaseData('DoDirectPayment'); - - $this->validate('amount', 'card'); - $this->getCard()->validate(); - - $data['PAYMENTACTION'] = $this->action; - $data['AMT'] = $this->getAmount(); - $data['CURRENCYCODE'] = $this->getCurrency(); - $data['INVNUM'] = $this->getTransactionId(); - $data['DESC'] = $this->getDescription(); - - // add credit card details - $data['ACCT'] = $this->getCard()->getNumber(); - $data['CREDITCARDTYPE'] = $this->getCard()->getBrand(); - $data['EXPDATE'] = $this->getCard()->getExpiryMonth().$this->getCard()->getExpiryYear(); - $data['STARTDATE'] = $this->getCard()->getStartMonth().$this->getCard()->getStartYear(); - $data['CVV2'] = $this->getCard()->getCvv(); - $data['ISSUENUMBER'] = $this->getCard()->getIssueNumber(); - $data['IPADDRESS'] = $this->getClientIp(); - $data['FIRSTNAME'] = $this->getCard()->getFirstName(); - $data['LASTNAME'] = $this->getCard()->getLastName(); - $data['EMAIL'] = $this->getCard()->getEmail(); - $data['STREET'] = $this->getCard()->getAddress1(); - $data['STREET2'] = $this->getCard()->getAddress2(); - $data['CITY'] = $this->getCard()->getCity(); - $data['STATE'] = $this->getCard()->getState(); - $data['ZIP'] = $this->getCard()->getPostcode(); - $data['COUNTRYCODE'] = strtoupper($this->getCard()->getCountry()); - - return $data; - } -} diff --git a/src/Omnipay/PayPal/Message/ProPurchaseRequest.php b/src/Omnipay/PayPal/Message/ProPurchaseRequest.php deleted file mode 100644 index 769b25af..00000000 --- a/src/Omnipay/PayPal/Message/ProPurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Pro Purchase Request - */ -class ProPurchaseRequest extends ProAuthorizeRequest -{ - protected $action = 'Sale'; -} diff --git a/src/Omnipay/PayPal/Message/RefundRequest.php b/src/Omnipay/PayPal/Message/RefundRequest.php deleted file mode 100644 index 43c66f79..00000000 --- a/src/Omnipay/PayPal/Message/RefundRequest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -/** - * PayPal Refund Request - */ -class RefundRequest extends AbstractRequest -{ - public function getData() - { - $data = $this->getBaseData('RefundTransaction'); - - $this->validate('transactionReference'); - - $data['TRANSACTIONID'] = $this->getTransactionReference(); - $data['REFUNDTYPE'] = 'Full'; - if ($this->getAmount() > 0) { - $data['REFUNDTYPE'] = 'Partial'; - $data['AMT'] = $this->getAmount(); - $data['CURRENCYCODE'] = $this->getCurrency(); - } - - return $data; - } -} diff --git a/src/Omnipay/PayPal/Message/Response.php b/src/Omnipay/PayPal/Message/Response.php deleted file mode 100644 index 64851b36..00000000 --- a/src/Omnipay/PayPal/Message/Response.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; - -/** - * PayPal Response - */ -class Response extends AbstractResponse -{ - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - parse_str($data, $this->data); - } - - public function isSuccessful() - { - return isset($this->data['ACK']) && in_array($this->data['ACK'], array('Success', 'SuccessWithWarning')); - } - - public function getTransactionReference() - { - foreach (array('REFUNDTRANSACTIONID', 'TRANSACTIONID', 'PAYMENTINFO_0_TRANSACTIONID') as $key) { - if (isset($this->data[$key])) { - return $this->data[$key]; - } - } - } - - public function getMessage() - { - return isset($this->data['L_LONGMESSAGE0']) ? $this->data['L_LONGMESSAGE0'] : null; - } -} diff --git a/src/Omnipay/PayPal/ProGateway.php b/src/Omnipay/PayPal/ProGateway.php deleted file mode 100644 index 19461c71..00000000 --- a/src/Omnipay/PayPal/ProGateway.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal; - -use Omnipay\Common\AbstractGateway; -use Omnipay\PayPal\Message\ProAuthorizeRequest; -use Omnipay\PayPal\Message\CaptureRequest; -use Omnipay\PayPal\Message\RefundRequest; - -/** - * PayPal Pro Class - */ -class ProGateway extends AbstractGateway -{ - public function getName() - { - return 'PayPal Pro'; - } - - public function getDefaultParameters() - { - return array( - 'username' => '', - 'password' => '', - 'signature' => '', - 'testMode' => false, - ); - } - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getSignature() - { - return $this->getParameter('signature'); - } - - public function setSignature($value) - { - return $this->setParameter('signature', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayPal\Message\ProAuthorizeRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayPal\Message\ProPurchaseRequest', $parameters); - } - - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayPal\Message\CaptureRequest', $parameters); - } - - public function refund(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PayPal\Message\RefundRequest', $parameters); - } -} diff --git a/src/Omnipay/Payflow/Message/AuthorizeRequest.php b/src/Omnipay/Payflow/Message/AuthorizeRequest.php deleted file mode 100644 index 217407b1..00000000 --- a/src/Omnipay/Payflow/Message/AuthorizeRequest.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * Payflow Authorize Request - */ -class AuthorizeRequest extends AbstractRequest -{ - protected $liveEndpoint = 'https://payflowpro.paypal.com/'; - protected $testEndpoint = 'https://pilot-payflowpro.paypal.com/'; - protected $action = 'A'; - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getVendor() - { - return $this->getParameter('vendor'); - } - - public function setVendor($value) - { - return $this->setParameter('vendor', $value); - } - - public function getPartner() - { - return $this->getParameter('partner'); - } - - public function setPartner($value) - { - return $this->setParameter('partner', $value); - } - - protected function getBaseData() - { - $data = array(); - $data['TRXTYPE'] = $this->action; - $data['USER'] = $this->getUsername(); - $data['PWD'] = $this->getPassword(); - $data['VENDOR'] = $this->getVendor(); - $data['PARTNER'] = $this->getPartner(); - - return $data; - } - - public function getData() - { - $this->validate('amount', 'card'); - $this->getCard()->validate(); - - $data = $this->getBaseData(); - $data['TENDER'] = 'C'; - $data['AMT'] = $this->getAmount(); - $data['COMMENT1'] = $this->getDescription(); - - $data['ACCT'] = $this->getCard()->getNumber(); - $data['EXPDATE'] = $this->getCard()->getExpiryDate('my'); - $data['CVV2'] = $this->getCard()->getCvv(); - $data['BILLTOFIRSTNAME'] = $this->getCard()->getFirstName(); - $data['BILLTOLASTNAME'] = $this->getCard()->getLastName(); - $data['BILLTOSTREET'] = $this->getCard()->getAddress1(); - $data['BILLTOCITY'] = $this->getCard()->getCity(); - $data['BILLTOSTATE'] = $this->getCard()->getState(); - $data['BILLTOZIP'] = $this->getCard()->getPostcode(); - $data['BILLTOCOUNTRY'] = $this->getCard()->getCountry(); - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $this->getData())->send(); - - return $this->response = new Response($this, $httpResponse->getBody()); - } - - protected function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/Payflow/Message/CaptureRequest.php b/src/Omnipay/Payflow/Message/CaptureRequest.php deleted file mode 100644 index 78904c81..00000000 --- a/src/Omnipay/Payflow/Message/CaptureRequest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow\Message; - -/** - * Payflow Capture Request - */ -class CaptureRequest extends AuthorizeRequest -{ - protected $action = 'D'; - - public function getData() - { - $this->validate('transactionReference', 'amount'); - - $data = $this->getBaseData(); - $data['AMT'] = $this->getAmount(); - $data['ORIGID'] = $this->getTransactionReference(); - - return $data; - } -} diff --git a/src/Omnipay/Payflow/Message/PurchaseRequest.php b/src/Omnipay/Payflow/Message/PurchaseRequest.php deleted file mode 100644 index 14513630..00000000 --- a/src/Omnipay/Payflow/Message/PurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow\Message; - -/** - * Payflow Purchase Request - */ -class PurchaseRequest extends AuthorizeRequest -{ - protected $action = 'S'; -} diff --git a/src/Omnipay/Payflow/Message/RefundRequest.php b/src/Omnipay/Payflow/Message/RefundRequest.php deleted file mode 100644 index 50be991a..00000000 --- a/src/Omnipay/Payflow/Message/RefundRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow\Message; - -/** - * Payflow Refund Request - */ -class RefundRequest extends CaptureRequest -{ - protected $action = 'C'; -} diff --git a/src/Omnipay/Payflow/Message/Response.php b/src/Omnipay/Payflow/Message/Response.php deleted file mode 100644 index 55fb2bc4..00000000 --- a/src/Omnipay/Payflow/Message/Response.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * Payflow Response - */ -class Response extends AbstractResponse -{ - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - - if (empty($data)) { - throw new InvalidResponseException; - } - - parse_str($data, $this->data); - } - - public function isSuccessful() - { - return isset($this->data['RESULT']) && '0' === $this->data['RESULT']; - } - - public function getTransactionReference() - { - return isset($this->data['PNREF']) ? $this->data['PNREF'] : null; - } - - public function getMessage() - { - return isset($this->data['RESPMSG']) ? $this->data['RESPMSG'] : null; - } -} diff --git a/src/Omnipay/Payflow/ProGateway.php b/src/Omnipay/Payflow/ProGateway.php deleted file mode 100644 index 5ea5c2e9..00000000 --- a/src/Omnipay/Payflow/ProGateway.php +++ /dev/null @@ -1,102 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow; - -use Omnipay\Common\AbstractGateway; -use Omnipay\Payflow\Message\AuthorizeRequest; -use Omnipay\Payflow\Message\CaptureRequest; -use Omnipay\Payflow\Message\PurchaseRequest; -use Omnipay\Payflow\Message\RefundRequest; - -/** - * Payflow Pro Class - * - * @link https://www.x.com/sites/default/files/payflowgateway_guide.pdf - */ -class ProGateway extends AbstractGateway -{ - public function getName() - { - return 'Payflow'; - } - - public function getDefaultParameters() - { - return array( - 'username' => '', - 'password' => '', - 'vendor' => '', - 'partner' => '', - 'testMode' => false, - ); - } - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getVendor() - { - return $this->getParameter('vendor'); - } - - public function setVendor($value) - { - return $this->setParameter('vendor', $value); - } - - public function getPartner() - { - return $this->getParameter('partner'); - } - - public function setPartner($value) - { - return $this->setParameter('partner', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Payflow\Message\AuthorizeRequest', $parameters); - } - - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Payflow\Message\CaptureRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Payflow\Message\PurchaseRequest', $parameters); - } - - public function refund(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Payflow\Message\RefundRequest', $parameters); - } -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPayAuthorizeRequest.php b/src/Omnipay/PaymentExpress/Message/PxPayAuthorizeRequest.php deleted file mode 100644 index ef8a9bfc..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPayAuthorizeRequest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -use SimpleXMLElement; -use Omnipay\Common\Message\AbstractRequest; - -/** - * PaymentExpress PxPay Authorize Request - */ -class PxPayAuthorizeRequest extends AbstractRequest -{ - protected $endpoint = 'https://sec.paymentexpress.com/pxpay/pxaccess.aspx'; - protected $action = 'Auth'; - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function getData() - { - $this->validate('amount', 'returnUrl'); - - $data = new SimpleXMLElement(''); - $data->PxPayUserId = $this->getUsername(); - $data->PxPayKey = $this->getPassword(); - $data->TxnType = $this->action; - $data->AmountInput = $this->getAmount(); - $data->CurrencyInput = $this->getCurrency(); - $data->MerchantReference = $this->getDescription(); - $data->UrlSuccess = $this->getReturnUrl(); - $data->UrlFail = $this->getReturnUrl(); - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->endpoint, null, $this->getData()->asXML())->send(); - - return $this->createResponse($httpResponse->xml()); - } - - protected function createResponse($data) - { - return $this->response = new PxPayAuthorizeResponse($this, $data); - } -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPayAuthorizeResponse.php b/src/Omnipay/PaymentExpress/Message/PxPayAuthorizeResponse.php deleted file mode 100644 index c0d9a1eb..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPayAuthorizeResponse.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * PaymentExpress PxPay Authorize Response - */ -class PxPayAuthorizeResponse extends AbstractResponse implements RedirectResponseInterface -{ - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return 1 === (int) $this->data['valid']; - } - - public function getTransactionReference() - { - return null; - } - - public function getMessage() - { - if (!$this->isRedirect()) { - return (string) $this->data->URI; - } - } - - public function getRedirectUrl() - { - if ($this->isRedirect()) { - return (string) $this->data->URI; - } - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPayCompleteAuthorizeRequest.php b/src/Omnipay/PaymentExpress/Message/PxPayCompleteAuthorizeRequest.php deleted file mode 100644 index 3a40b31d..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPayCompleteAuthorizeRequest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -use SimpleXMLElement; -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * PaymentExpress PxPay Complete Authorize Request - */ -class PxPayCompleteAuthorizeRequest extends PxPayAuthorizeRequest -{ - public function getData() - { - $result = $this->httpRequest->query->get('result'); - if (empty($result)) { - throw new InvalidResponseException; - } - - // validate dps response - $data = new SimpleXMLElement(''); - $data->PxPayUserId = $this->getUsername(); - $data->PxPayKey = $this->getPassword(); - $data->Response = $result; - - return $data; - } - - protected function createResponse($data) - { - return $this->response = new Response($this, $data); - } -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPayPurchaseRequest.php b/src/Omnipay/PaymentExpress/Message/PxPayPurchaseRequest.php deleted file mode 100644 index 47cbbf4f..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPayPurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -/** - * PaymentExpress PxPay Purchase Request - */ -class PxPayPurchaseRequest extends PxPayAuthorizeRequest -{ - protected $action = 'Purchase'; -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPostAuthorizeRequest.php b/src/Omnipay/PaymentExpress/Message/PxPostAuthorizeRequest.php deleted file mode 100644 index 48419083..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPostAuthorizeRequest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * PaymentExpress PxPost Authorize Request - */ -class PxPostAuthorizeRequest extends AbstractRequest -{ - protected $endpoint = 'https://sec.paymentexpress.com/pxpost.aspx'; - protected $action = 'Auth'; - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - protected function getBaseData() - { - $data = new \SimpleXMLElement(''); - $data->PostUsername = $this->getUsername(); - $data->PostPassword = $this->getPassword(); - $data->TxnType = $this->action; - - return $data; - } - - public function getData() - { - $this->validate('amount'); - - $data = $this->getBaseData(); - $data->InputCurrency = $this->getCurrency(); - $data->Amount = $this->getAmount(); - $data->MerchantReference = $this->getDescription(); - - if ($this->getCardReference()) { - $data->DpsBillingId = $this->getCardReference(); - } elseif ($this->getCard()) { - $this->getCard()->validate(); - $data->CardNumber = $this->getCard()->getNumber(); - $data->CardHolderName = $this->getCard()->getName(); - $data->DateExpiry = $this->getCard()->getExpiryDate('my'); - $data->Cvc2 = $this->getCard()->getCvv(); - } else { - // either cardReference or card is required - $this->validate('card'); - } - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->endpoint, null, $this->getData()->asXML())->send(); - - return $this->response = new Response($this, $httpResponse->xml()); - } -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPostCaptureRequest.php b/src/Omnipay/PaymentExpress/Message/PxPostCaptureRequest.php deleted file mode 100644 index 12783621..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPostCaptureRequest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -/** - * PaymentExpress PxPost Capture Request - */ -class PxPostCaptureRequest extends PxPostAuthorizeRequest -{ - protected $action = 'Complete'; - - public function getData() - { - $this->validate('transactionReference', 'amount'); - - $data = $this->getBaseData(); - $data->DpsTxnRef = $this->getTransactionReference(); - $data->Amount = $this->getAmount(); - - return $data; - } -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPostCreateCardRequest.php b/src/Omnipay/PaymentExpress/Message/PxPostCreateCardRequest.php deleted file mode 100644 index 82383ef6..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPostCreateCardRequest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -/** - * PaymentExpress PxPost Create Credit Card Request - */ -class PxPostCreateCardRequest extends PxPostAuthorizeRequest -{ - public function getData() - { - $this->validate('card'); - $this->getCard()->validate(); - - $data = $this->getBaseData(); - $data->Amount = '1.00'; - $data->EnableAddBillCard = 1; - $data->CardNumber = $this->getCard()->getNumber(); - $data->CardHolderName = $this->getCard()->getName(); - $data->DateExpiry = $this->getCard()->getExpiryDate('my'); - $data->Cvc2 = $this->getCard()->getCvv(); - - return $data; - } -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPostPurchaseRequest.php b/src/Omnipay/PaymentExpress/Message/PxPostPurchaseRequest.php deleted file mode 100644 index 760f78b6..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPostPurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -/** - * PaymentExpress PxPost Purchase Request - */ -class PxPostPurchaseRequest extends PxPostAuthorizeRequest -{ - protected $action = 'Purchase'; -} diff --git a/src/Omnipay/PaymentExpress/Message/PxPostRefundRequest.php b/src/Omnipay/PaymentExpress/Message/PxPostRefundRequest.php deleted file mode 100644 index 7d31d975..00000000 --- a/src/Omnipay/PaymentExpress/Message/PxPostRefundRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -/** - * PaymentExpress PxPost Refund Request - */ -class PxPostRefundRequest extends PxPostCaptureRequest -{ - protected $action = 'Refund'; -} diff --git a/src/Omnipay/PaymentExpress/Message/Response.php b/src/Omnipay/PaymentExpress/Message/Response.php deleted file mode 100644 index 75ee3a57..00000000 --- a/src/Omnipay/PaymentExpress/Message/Response.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * PaymentExpress Response - */ -class Response extends AbstractResponse -{ - public function isSuccessful() - { - return 1 === (int) $this->data->Success; - } - - public function getTransactionReference() - { - return empty($this->data->DpsTxnRef) ? null : (string) $this->data->DpsTxnRef; - } - - public function getCardReference() - { - return empty($this->data->Transaction->DpsBillingId) - ? null - : (string) $this->data->Transaction->DpsBillingId; - } - - public function getMessage() - { - if (isset($this->data->HelpText)) { - return (string) $this->data->HelpText; - } else { - return (string) $this->data->ResponseText; - } - } -} diff --git a/src/Omnipay/PaymentExpress/PxPayGateway.php b/src/Omnipay/PaymentExpress/PxPayGateway.php deleted file mode 100644 index 52c1ecd1..00000000 --- a/src/Omnipay/PaymentExpress/PxPayGateway.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress; - -use Omnipay\Common\AbstractGateway; -use Omnipay\PaymentExpress\Message\PxPayAuthorizeRequest; -use Omnipay\PaymentExpress\Message\PxPayCompleteAuthorizeRequest; -use Omnipay\PaymentExpress\Message\PxPayPurchaseRequest; - -/** - * DPS PaymentExpress PxPay Gateway - */ -class PxPayGateway extends AbstractGateway -{ - public function getName() - { - return 'PaymentExpress PxPay'; - } - - public function getDefaultParameters() - { - return array( - 'username' => '', - 'password' => '', - ); - } - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPayAuthorizeRequest', $parameters); - } - - public function completeAuthorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPayCompleteAuthorizeRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPayPurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->completeAuthorize($parameters); - } -} diff --git a/src/Omnipay/PaymentExpress/PxPostGateway.php b/src/Omnipay/PaymentExpress/PxPostGateway.php deleted file mode 100644 index 8937faba..00000000 --- a/src/Omnipay/PaymentExpress/PxPostGateway.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress; - -use Omnipay\Common\AbstractGateway; -use Omnipay\PaymentExpress\Message\PxPostAuthorizeRequest; -use Omnipay\PaymentExpress\Message\PxPostCaptureRequest; -use Omnipay\PaymentExpress\Message\PxPostPurchaseRequest; -use Omnipay\PaymentExpress\Message\PxPostRefundRequest; - -/** - * DPS PaymentExpress PxPost Gateway - */ -class PxPostGateway extends AbstractGateway -{ - public function getName() - { - return 'PaymentExpress PxPost'; - } - - public function getDefaultParameters() - { - return array( - 'username' => '', - 'password' => '', - ); - } - - public function getUsername() - { - return $this->getParameter('username'); - } - - public function setUsername($value) - { - return $this->setParameter('username', $value); - } - - public function getPassword() - { - return $this->getParameter('password'); - } - - public function setPassword($value) - { - return $this->setParameter('password', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPostAuthorizeRequest', $parameters); - } - - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPostCaptureRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPostPurchaseRequest', $parameters); - } - - public function refund(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPostRefundRequest', $parameters); - } - - public function createCard(array $parameters = array()) - { - return $this->createRequest('\Omnipay\PaymentExpress\Message\PxPostCreateCardRequest', $parameters); - } -} diff --git a/src/Omnipay/Pin/Gateway.php b/src/Omnipay/Pin/Gateway.php deleted file mode 100644 index 22a79816..00000000 --- a/src/Omnipay/Pin/Gateway.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Pin; - -use Omnipay\Common\AbstractGateway; -use Omnipay\Pin\Message\PurchaseRequest; - -/** - * Pin Gateway - * - * @link https://pin.net.au/docs/api - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'Pin'; - } - - public function getDefaultParameters() - { - return array( - 'secretKey' => '', - 'testMode' => false, - ); - } - - 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\Pin\Message\PurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/Pin/Message/PurchaseRequest.php b/src/Omnipay/Pin/Message/PurchaseRequest.php deleted file mode 100644 index 06d67780..00000000 --- a/src/Omnipay/Pin/Message/PurchaseRequest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Pin\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * Pin Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - protected $liveEndpoint = 'https://api.pin.net.au/1'; - protected $testEndpoint = 'https://test-api.pin.net.au/1'; - - public function getSecretKey() - { - return $this->getParameter('secretKey'); - } - - public function setSecretKey($value) - { - return $this->setParameter('secretKey', $value); - } - - public function getData() - { - $this->validate('amount'); - - $data = array(); - $data['amount'] = $this->getAmountInteger(); - $data['currency'] = strtolower($this->getCurrency()); - $data['description'] = $this->getDescription(); - $data['ip_address'] = $this->getClientIp(); - - if ($this->getCard()) { - $this->getCard()->validate(); - - $data['card']['number'] = $this->getCard()->getNumber(); - $data['card']['expiry_month'] = $this->getCard()->getExpiryMonth(); - $data['card']['expiry_year'] = $this->getCard()->getExpiryYear(); - $data['card']['cvc'] = $this->getCard()->getCvv(); - $data['card']['name'] = $this->getCard()->getName(); - $data['card']['address_line1'] = $this->getCard()->getAddress1(); - $data['card']['address_line2'] = $this->getCard()->getAddress2(); - $data['card']['address_city'] = $this->getCard()->getCity(); - $data['card']['address_postcode'] = $this->getCard()->getPostcode(); - $data['card']['address_state'] = $this->getCard()->getState(); - $data['card']['address_country'] = $this->getCard()->getCountry(); - $data['email'] = $this->getCard()->getEmail(); - } - - return $data; - } - - public function send() - { - // don't throw exceptions for 4xx errors - $this->httpClient->getEventDispatcher()->addListener( - 'request.error', - function ($event) { - if ($event['response']->isClientError()) { - $event->stopPropagation(); - } - } - ); - - $httpResponse = $this->httpClient->post($this->getEndpoint().'/charges', null, $this->getData()) - ->setHeader('Authorization', 'Basic '.base64_encode($this->getSecretKey().':')) - ->send(); - - return $this->response = new Response($this, $httpResponse->json()); - } - - public function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/Pin/Message/Response.php b/src/Omnipay/Pin/Message/Response.php deleted file mode 100644 index 35129e3f..00000000 --- a/src/Omnipay/Pin/Message/Response.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Pin\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * Pin Response - */ -class Response extends AbstractResponse -{ - public function isSuccessful() - { - return !isset($this->data['error']); - } - - public function getTransactionReference() - { - if (isset($this->data['response']['token'])) { - return $this->data['response']['token']; - } - } - - public function getMessage() - { - if ($this->isSuccessful()) { - return $this->data['response']['status_message']; - } else { - return $this->data['error_description']; - } - } -} diff --git a/src/Omnipay/SagePay/DirectGateway.php b/src/Omnipay/SagePay/DirectGateway.php deleted file mode 100644 index 3c2e56a4..00000000 --- a/src/Omnipay/SagePay/DirectGateway.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay; - -use Omnipay\Common\AbstractGateway; -use Omnipay\SagePay\Message\CaptureRequest; -use Omnipay\SagePay\Message\DirectAuthorizeRequest; -use Omnipay\SagePay\Message\DirectPurchaseRequest; -use Omnipay\SagePay\Message\RefundRequest; - -/** - * Sage Pay Direct Gateway - */ -class DirectGateway extends AbstractGateway -{ - public function getName() - { - return 'Sage Pay Direct'; - } - - public function getDefaultParameters() - { - return array( - 'vendor' => '', - 'testMode' => false, - 'simulatorMode' => false, - ); - } - - public function getVendor() - { - return $this->getParameter('vendor'); - } - - public function setVendor($value) - { - return $this->setParameter('vendor', $value); - } - - public function getSimulatorMode() - { - return $this->getParameter('simulatorMode'); - } - - public function setSimulatorMode($value) - { - return $this->setParameter('simulatorMode', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\DirectAuthorizeRequest', $parameters); - } - - public function completeAuthorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\DirectCompleteAuthorizeRequest', $parameters); - } - - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\CaptureRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\DirectPurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->completeAuthorize($parameters); - } - - public function refund(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\RefundRequest', $parameters); - } -} diff --git a/src/Omnipay/SagePay/Message/AbstractRequest.php b/src/Omnipay/SagePay/Message/AbstractRequest.php deleted file mode 100644 index f06f607e..00000000 --- a/src/Omnipay/SagePay/Message/AbstractRequest.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - protected $liveEndpoint = 'https://live.sagepay.com/gateway/service'; - protected $testEndpoint = 'https://test.sagepay.com/gateway/service'; - protected $simulatorEndpoint = 'https://test.sagepay.com/Simulator'; - - public function getVendor() - { - return $this->getParameter('vendor'); - } - - public function setVendor($value) - { - return $this->setParameter('vendor', $value); - } - - public function getSimulatorMode() - { - return $this->getParameter('simulatorMode'); - } - - public function setSimulatorMode($value) - { - return $this->setParameter('simulatorMode', $value); - } - - public function getService() - { - return $this->getParameter('action'); - } - - protected function getBaseData() - { - $data = array(); - $data['VPSProtocol'] = '2.23'; - $data['TxType'] = $this->action; - $data['Vendor'] = $this->getVendor(); - - return $data; - } - - public function send() - { - $httpResponse = $this->httpClient->post($this->getEndpoint(), null, $this->getData())->send(); - - return $this->createResponse($httpResponse->getBody()); - } - - public function getEndpoint() - { - $service = strtolower($this->getService()); - - if ($this->getSimulatorMode()) { - // hooray for consistency - if ($service == 'vspdirect-register') { - return $this->simulatorEndpoint.'/VSPDirectGateway.asp'; - } elseif ($service == 'vspserver-register') { - return $this->simulatorEndpoint.'/VSPServerGateway.asp?Service=VendorRegisterTx'; - } elseif ($service == 'direct3dcallback') { - return $this->simulatorEndpoint.'/VSPDirectCallback.asp'; - } - - return $this->simulatorEndpoint.'/VSPServerGateway.asp?Service=Vendor'.ucfirst($service).'Tx'; - } - - if ($this->getTestMode()) { - return $this->testEndpoint."/$service.vsp"; - } - - return $this->liveEndpoint."/$service.vsp"; - } - - protected function createResponse($data) - { - return $this->response = new Response($this, $data); - } -} diff --git a/src/Omnipay/SagePay/Message/CaptureRequest.php b/src/Omnipay/SagePay/Message/CaptureRequest.php deleted file mode 100644 index 5a1e5061..00000000 --- a/src/Omnipay/SagePay/Message/CaptureRequest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Capture Request - */ -class CaptureRequest extends AbstractRequest -{ - protected $action = 'RELEASE'; - - public function getData() - { - $this->validate('amount', 'transactionReference'); - $reference = json_decode($this->getTransactionReference(), true); - - $data = $this->getBaseData(); - $data['ReleaseAmount'] = $this->getAmount(); - $data['VendorTxCode'] = $reference['VendorTxCode']; - $data['VPSTxId'] = $reference['VPSTxId']; - $data['SecurityKey'] = $reference['SecurityKey']; - $data['TxAuthNo'] = $reference['TxAuthNo']; - - return $data; - } -} diff --git a/src/Omnipay/SagePay/Message/DirectAuthorizeRequest.php b/src/Omnipay/SagePay/Message/DirectAuthorizeRequest.php deleted file mode 100644 index 86f3f5a4..00000000 --- a/src/Omnipay/SagePay/Message/DirectAuthorizeRequest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Direct Authorize Request - */ -class DirectAuthorizeRequest extends AbstractRequest -{ - protected $action = 'DEFERRED'; - - protected function getBaseAuthorizeData() - { - $this->validate('amount', 'card', 'transactionId'); - - $data = $this->getBaseData(); - $data['Description'] = $this->getDescription(); - $data['Amount'] = $this->getAmount(); - $data['Currency'] = $this->getCurrency(); - $data['VendorTxCode'] = $this->getTransactionId(); - $data['ClientIPAddress'] = $this->getClientIp(); - $data['ApplyAVSCV2'] = 0; // use account setting - $data['Apply3DSecure'] = 0; // use account setting - - // billing details - $data['BillingFirstnames'] = $this->getCard()->getFirstName(); - $data['BillingSurname'] = $this->getCard()->getLastName(); - $data['BillingAddress1'] = $this->getCard()->getBillingAddress1(); - $data['BillingAddress2'] = $this->getCard()->getBillingAddress2(); - $data['BillingCity'] = $this->getCard()->getBillingCity(); - $data['BillingPostCode'] = $this->getCard()->getBillingPostcode(); - $data['BillingState'] = $this->getCard()->getBillingState(); - $data['BillingCountry'] = $this->getCard()->getBillingCountry(); - $data['BillingPhone'] = $this->getCard()->getBillingPhone(); - - // shipping details - $data['DeliveryFirstnames'] = $this->getCard()->getFirstName(); - $data['DeliverySurname'] = $this->getCard()->getLastName(); - $data['DeliveryAddress1'] = $this->getCard()->getShippingAddress1(); - $data['DeliveryAddress2'] = $this->getCard()->getShippingAddress2(); - $data['DeliveryCity'] = $this->getCard()->getShippingCity(); - $data['DeliveryPostCode'] = $this->getCard()->getShippingPostcode(); - $data['DeliveryState'] = $this->getCard()->getShippingState(); - $data['DeliveryCountry'] = $this->getCard()->getShippingCountry(); - $data['DeliveryPhone'] = $this->getCard()->getShippingPhone(); - $data['CustomerEMail'] = $this->getCard()->getEmail(); - - return $data; - } - - public function getData() - { - $data = $this->getBaseAuthorizeData(); - $this->getCard()->validate(); - - $data['CardHolder'] = $this->getCard()->getName(); - $data['CardNumber'] = $this->getCard()->getNumber(); - $data['CV2'] = $this->getCard()->getCvv(); - $data['ExpiryDate'] = $this->getCard()->getExpiryDate('my'); - $data['CardType'] = $this->getCard()->getBrand(); - - if ($this->getCard()->getStartMonth() and $this->getCard()->getStartYear()) { - $data['StartDate'] = $this->getCard()->getStartDate('my'); - } - - if ($this->getCard()->getIssueNumber()) { - $data['IssueNumber'] = $this->getCard()->getIssueNumber(); - } - - return $data; - } - - public function getService() - { - return 'vspdirect-register'; - } -} diff --git a/src/Omnipay/SagePay/Message/DirectCompleteAuthorizeRequest.php b/src/Omnipay/SagePay/Message/DirectCompleteAuthorizeRequest.php deleted file mode 100644 index cbc95ba9..00000000 --- a/src/Omnipay/SagePay/Message/DirectCompleteAuthorizeRequest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Direct Complete Authorize Request - */ -class DirectCompleteAuthorizeRequest extends AbstractRequest -{ - public function getData() - { - $data = array( - 'MD' => $this->httpRequest->request->get('MD'), - 'PARes' => $this->httpRequest->request->get('PaRes'), // inconsistent caps are intentional - ); - - if (empty($data['MD']) || empty($data['PARes'])) { - throw new InvalidResponseException; - } - - return $data; - } - - public function getService() - { - return 'direct3dcallback'; - } -} diff --git a/src/Omnipay/SagePay/Message/DirectPurchaseRequest.php b/src/Omnipay/SagePay/Message/DirectPurchaseRequest.php deleted file mode 100644 index 190d0f5b..00000000 --- a/src/Omnipay/SagePay/Message/DirectPurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Direct Purchase Request - */ -class DirectPurchaseRequest extends DirectAuthorizeRequest -{ - protected $action = 'PAYMENT'; -} diff --git a/src/Omnipay/SagePay/Message/RefundRequest.php b/src/Omnipay/SagePay/Message/RefundRequest.php deleted file mode 100644 index 15de07be..00000000 --- a/src/Omnipay/SagePay/Message/RefundRequest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Refund Request - */ -class RefundRequest extends AbstractRequest -{ - protected $action = 'REFUND'; - - public function getData() - { - $this->validate('amount', 'transactionReference'); - $reference = json_decode($this->getTransactionReference(), true); - - $data = $this->getBaseData(); - $data['Amount'] = $this->getAmount(); - $data['Currency'] = $this->getCurrency(); - $data['Description'] = $this->getDescription(); - $data['RelatedVendorTxCode'] = $reference['VendorTxCode']; - $data['RelatedVPSTxId'] = $reference['VPSTxId']; - $data['RelatedSecurityKey'] = $reference['SecurityKey']; - $data['RelatedTxAuthNo'] = $reference['TxAuthNo']; - - // VendorTxCode must be unique for the refund (different from original) - $data['VendorTxCode'] = $this->getTransactionId(); - - return $data; - } -} diff --git a/src/Omnipay/SagePay/Message/Response.php b/src/Omnipay/SagePay/Message/Response.php deleted file mode 100644 index c39e6d5c..00000000 --- a/src/Omnipay/SagePay/Message/Response.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; -use Omnipay\Common\Message\RequestInterface; - -/** - * Sage Pay Response - */ -class Response extends AbstractResponse implements RedirectResponseInterface -{ - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - $this->data = $this->decode($data); - } - - public function isSuccessful() - { - return isset($this->data['Status']) && 'OK' === $this->data['Status']; - } - - public function isRedirect() - { - return isset($this->data['Status']) && '3DAUTH' === $this->data['Status']; - } - - /** - * Gateway Reference - * - * Unfortunately Sage Pay requires the original VendorTxCode as well as 3 separate - * fields from the response object to capture or refund transactions at a later date. - * - * Active Merchant solves this dilemma by returning the gateway reference in the following - * custom format: VendorTxCode;VPSTxId;TxAuthNo;SecurityKey - * - * We have opted to return this reference as JSON, as the keys are much more explicit. - */ - public function getTransactionReference() - { - if (isset($this->data['SecurityKey']) && isset($this->data['TxAuthNo']) && isset($this->data['VPSTxId'])) { - return json_encode( - array( - 'SecurityKey' => $this->data['SecurityKey'], - 'TxAuthNo' => $this->data['TxAuthNo'], - 'VPSTxId' => $this->data['VPSTxId'], - 'VendorTxCode' => $this->getRequest()->getTransactionId(), - ) - ); - } - } - - public function getMessage() - { - return isset($this->data['StatusDetail']) ? $this->data['StatusDetail'] : null; - } - - public function getRedirectUrl() - { - if ($this->isRedirect()) { - return $this->data['ACSURL']; - } - } - - public function getRedirectMethod() - { - return 'POST'; - } - - public function getRedirectData() - { - if ($this->isRedirect()) { - return array( - 'PaReq' => $this->data['PAReq'], - 'TermUrl' => $this->getRequest()->getReturnUrl(), - 'MD' => $this->data['MD'], - ); - } - } - - /** - * Decode raw ini-style response body - * - * @param string The raw response body - * @return array - */ - protected function decode($response) - { - $lines = explode("\n", $response); - $data = array(); - - foreach ($lines as $line) { - $line = explode('=', $line, 2); - if (!empty($line[0])) { - $data[trim($line[0])] = isset($line[1]) ? trim($line[1]) : ''; - } - } - - return $data; - } -} diff --git a/src/Omnipay/SagePay/Message/ServerAuthorizeRequest.php b/src/Omnipay/SagePay/Message/ServerAuthorizeRequest.php deleted file mode 100644 index 0e95b9e0..00000000 --- a/src/Omnipay/SagePay/Message/ServerAuthorizeRequest.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Server Authorize Request - */ -class ServerAuthorizeRequest extends DirectAuthorizeRequest -{ - public function getData() - { - $this->validate('returnUrl'); - - $data = $this->getBaseAuthorizeData(); - $data['NotificationURL'] = $this->getReturnUrl(); - - return $data; - } - - public function getService() - { - return 'vspserver-register'; - } - - protected function createResponse($data) - { - return $this->response = new ServerAuthorizeResponse($this, $data); - } -} diff --git a/src/Omnipay/SagePay/Message/ServerAuthorizeResponse.php b/src/Omnipay/SagePay/Message/ServerAuthorizeResponse.php deleted file mode 100644 index 7cca4ea0..00000000 --- a/src/Omnipay/SagePay/Message/ServerAuthorizeResponse.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Server Authorize Response - */ -class ServerAuthorizeResponse extends Response -{ - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return isset($this->data['Status']) && 'OK' === $this->data['Status']; - } - - public function getRedirectUrl() - { - return isset($this->data['NextURL']) ? $this->data['NextURL'] : null; - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } -} diff --git a/src/Omnipay/SagePay/Message/ServerCompleteAuthorizeRequest.php b/src/Omnipay/SagePay/Message/ServerCompleteAuthorizeRequest.php deleted file mode 100644 index 74b998cc..00000000 --- a/src/Omnipay/SagePay/Message/ServerCompleteAuthorizeRequest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * Sage Pay Server Complete Authorize Request - */ -class ServerCompleteAuthorizeRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('transactionId', 'transactionReference'); - - $reference = json_decode($this->getTransactionReference(), true); - - // validate VPSSignature - $signature = md5( - $reference['VPSTxId']. - $reference['VendorTxCode']. - $this->httpRequest->request->get('Status'). - $this->httpRequest->request->get('TxAuthNo'). - $this->getVendor(). - $this->httpRequest->request->get('AVSCV2'). - $reference['SecurityKey']. - $this->httpRequest->request->get('AddressResult'). - $this->httpRequest->request->get('PostCodeResult'). - $this->httpRequest->request->get('CV2Result'). - $this->httpRequest->request->get('GiftAid'). - $this->httpRequest->request->get('3DSecureStatus'). - $this->httpRequest->request->get('CAVV'). - $this->httpRequest->request->get('AddressStatus'). - $this->httpRequest->request->get('PayerStatus'). - $this->httpRequest->request->get('CardType'). - $this->httpRequest->request->get('Last4Digits') - ); - - if (strtolower($this->httpRequest->request->get('VPSSignature')) !== $signature) { - throw new InvalidResponseException; - } - - return $this->httpRequest->request->all(); - } - - public function send() - { - return $this->response = new ServerCompleteAuthorizeResponse($this, $this->getData()); - } -} diff --git a/src/Omnipay/SagePay/Message/ServerCompleteAuthorizeResponse.php b/src/Omnipay/SagePay/Message/ServerCompleteAuthorizeResponse.php deleted file mode 100644 index 8916bce1..00000000 --- a/src/Omnipay/SagePay/Message/ServerCompleteAuthorizeResponse.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -use Omnipay\Common\Message\RequestInterface; - -/** - * Sage Pay Server Complete Authorize Response - */ -class ServerCompleteAuthorizeResponse extends Response -{ - public function __construct(RequestInterface $request, $data) - { - $this->request = $request; - $this->data = $data; - } - - public function getTransactionReference() - { - if (isset($this->data['TxAuthNo'])) { - $reference = json_decode($this->getRequest()->getTransactionReference(), true); - $reference['VendorTxCode'] = $this->getRequest()->getTransactionId(); - $reference['TxAuthNo'] = $this->data['TxAuthNo']; - - return json_encode($reference); - } - } - - /** - * Confirm (Sage Pay Server only) - * - * Sage Pay Server does things backwards compared to every other gateway (including Sage Pay - * Direct). The return URL is called by their server, and they expect you to confirm receipt - * and then pass a URL for them to forward the customer to. - * - * Because of this, an extra step is required. In your return controller, after calling - * $gateway->completePurchase(), you should update your database with details of the - * successful payment. You must then call $response->confirm() to notify Sage Pay you - * received the payment details, and provide a URL to forward the customer to. - * - * Keep in mind your original confirmPurchase() script is being called by Sage Pay, not - * the customer. - * - * @param string URL to foward the customer to. Note this is different to your standard - * return controller action URL. - */ - public function confirm($nextUrl) - { - exit("Status=OK\r\nRedirectUrl=".$nextUrl); - } -} diff --git a/src/Omnipay/SagePay/Message/ServerPurchaseRequest.php b/src/Omnipay/SagePay/Message/ServerPurchaseRequest.php deleted file mode 100644 index 4900ce0d..00000000 --- a/src/Omnipay/SagePay/Message/ServerPurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -/** - * Sage Pay Server Purchase Request - */ -class ServerPurchaseRequest extends ServerAuthorizeRequest -{ - protected $action = 'PAYMENT'; -} diff --git a/src/Omnipay/SagePay/ServerGateway.php b/src/Omnipay/SagePay/ServerGateway.php deleted file mode 100644 index 3d2b6e7a..00000000 --- a/src/Omnipay/SagePay/ServerGateway.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay; - -use Omnipay\SagePay\Message\ServerAuthorizeRequest; -use Omnipay\SagePay\Message\ServerCompleteAuthorizeRequest; -use Omnipay\SagePay\Message\ServerPurchaseRequest; - -/** - * Sage Pay Server Gateway - */ -class ServerGateway extends DirectGateway -{ - public function getName() - { - return 'Sage Pay Server'; - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\ServerAuthorizeRequest', $parameters); - } - - public function completeAuthorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\ServerCompleteAuthorizeRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SagePay\Message\ServerPurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->completeAuthorize($parameters); - } -} diff --git a/src/Omnipay/SecurePay/DirectPostGateway.php b/src/Omnipay/SecurePay/DirectPostGateway.php deleted file mode 100644 index 33c45a47..00000000 --- a/src/Omnipay/SecurePay/DirectPostGateway.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay; - -use Omnipay\Common\AbstractGateway; - -/** - * SecurePay Direct Post Gateway - * - * @link http://www.securepay.com.au/uploads/Integration%20Guides/Direct_Post_Integration_Guide.pdf - */ -class DirectPostGateway extends AbstractGateway -{ - public function getName() - { - return 'SecurePay Direct Post'; - } - - public function getDefaultParameters() - { - return array( - 'merchantId' => '', - 'transactionPassword' => '', - 'testMode' => false, - ); - } - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getTransactionPassword() - { - return $this->getParameter('transactionPassword'); - } - - public function setTransactionPassword($value) - { - return $this->setParameter('transactionPassword', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SecurePay\Message\DirectPostAuthorizeRequest', $parameters); - } - - public function completeAuthorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SecurePay\Message\DirectPostCompletePurchaseRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SecurePay\Message\DirectPostPurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\SecurePay\Message\DirectPostCompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/SecurePay/Message/DirectPostAbstractRequest.php b/src/Omnipay/SecurePay/Message/DirectPostAbstractRequest.php deleted file mode 100644 index bc8ef1b4..00000000 --- a/src/Omnipay/SecurePay/Message/DirectPostAbstractRequest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * SecurePay Direct Post Abstract Request - */ -abstract class DirectPostAbstractRequest extends AbstractRequest -{ - public $testEndpoint = 'https://api.securepay.com.au/test/directpost/authorise'; - public $liveEndpoint = 'https://api.securepay.com.au/live/directpost/authorise'; - - public function getMerchantId() - { - return $this->getParameter('merchantId'); - } - - public function setMerchantId($value) - { - return $this->setParameter('merchantId', $value); - } - - public function getTransactionPassword() - { - return $this->getParameter('transactionPassword'); - } - - public function setTransactionPassword($value) - { - return $this->setParameter('transactionPassword', $value); - } - - public function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/SecurePay/Message/DirectPostAuthorizeRequest.php b/src/Omnipay/SecurePay/Message/DirectPostAuthorizeRequest.php deleted file mode 100644 index c0a0f510..00000000 --- a/src/Omnipay/SecurePay/Message/DirectPostAuthorizeRequest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -/** - * SecurePay Direct Post Authorize Request - */ -class DirectPostAuthorizeRequest extends DirectPostAbstractRequest -{ - public $txnType = '1'; - - public function getData() - { - $this->validate('amount', 'returnUrl'); - - $data = array(); - $data['EPS_MERCHANT'] = $this->getMerchantId(); - $data['EPS_TXNTYPE'] = $this->txnType; - $data['EPS_IP'] = $this->getClientIp(); - $data['EPS_AMOUNT'] = $this->getAmount(); - $data['EPS_REFERENCEID'] = $this->getTransactionId(); - $data['EPS_TIMESTAMP'] = gmdate('YmdHis'); - $data['EPS_FINGERPRINT'] = $this->generateFingerprint($data); - $data['EPS_RESULTURL'] = $this->getReturnUrl(); - $data['EPS_CALLBACKURL'] = $this->getReturnUrl(); - $data['EPS_REDIRECT'] = 'TRUE'; - $data['EPS_CURRENCY'] = $this->getCurrency(); - - return $data; - } - - public function generateFingerprint(array $data) - { - $hash = implode( - '|', - array( - $data['EPS_MERCHANT'], - $this->getTransactionPassword(), - $data['EPS_TXNTYPE'], - $data['EPS_REFERENCEID'], - $data['EPS_AMOUNT'], - $data['EPS_TIMESTAMP'], - ) - ); - - return sha1($hash); - } - - public function send() - { - return $this->response = new DirectPostAuthorizeResponse($this, $this->getData(), $this->getEndpoint()); - } -} diff --git a/src/Omnipay/SecurePay/Message/DirectPostAuthorizeResponse.php b/src/Omnipay/SecurePay/Message/DirectPostAuthorizeResponse.php deleted file mode 100644 index 56cbcffa..00000000 --- a/src/Omnipay/SecurePay/Message/DirectPostAuthorizeResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RequestInterface; - -/** - * SecurePay Direct Post Authorize Response - */ -class DirectPostAuthorizeResponse extends AbstractResponse -{ - protected $redirectUrl; - - public function __construct(RequestInterface $request, $data, $redirectUrl) - { - $this->request = $request; - $this->data = $data; - $this->redirectUrl = $redirectUrl; - } - - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return true; - } - - public function getRedirectUrl() - { - return $this->redirectUrl; - } - - public function getRedirectMethod() - { - return 'POST'; - } - - public function getRedirectData() - { - return $this->getData(); - } -} diff --git a/src/Omnipay/SecurePay/Message/DirectPostCompletePurchaseRequest.php b/src/Omnipay/SecurePay/Message/DirectPostCompletePurchaseRequest.php deleted file mode 100644 index 9e408c4a..00000000 --- a/src/Omnipay/SecurePay/Message/DirectPostCompletePurchaseRequest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -use Omnipay\Common\Exception\InvalidRequestException; - -/** - * SecurePay Direct Post Complete Purchase Request - */ -class DirectPostCompletePurchaseRequest extends DirectPostAbstractRequest -{ - public function getData() - { - $data = $this->httpRequest->request->all(); - - if ($this->generateResponseFingerprint($data) !== $this->httpRequest->request->get('fingerprint')) { - throw new InvalidRequestException('Invalid fingerprint'); - } - - return $data; - } - - public function generateResponseFingerprint($data) - { - $fields = implode( - '|', - array( - $data['merchant'], - $this->getTransactionPassword(), - $data['refid'], - $this->getAmount(), - $data['timestamp'], - $data['summarycode'], - ) - ); - - return sha1($fields); - } - - public function send() - { - return $this->response = new DirectPostCompletePurchaseResponse($this, $this->getData()); - } -} diff --git a/src/Omnipay/SecurePay/Message/DirectPostCompletePurchaseResponse.php b/src/Omnipay/SecurePay/Message/DirectPostCompletePurchaseResponse.php deleted file mode 100644 index 0ffd4ef4..00000000 --- a/src/Omnipay/SecurePay/Message/DirectPostCompletePurchaseResponse.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * SecurePay Direct Post Complete Purchase Response - */ -class DirectPostCompletePurchaseResponse extends AbstractResponse -{ - public function isSuccessful() - { - return isset($this->data['summarycode']) && $this->data['summarycode'] == 1; - } - - public function getMessage() - { - if (isset($this->data['restext'])) { - return $this->data['restext']; - } - } - - public function getCode() - { - if (isset($this->data['rescode'])) { - return $this->data['rescode']; - } - } - - public function getTransactionReference() - { - if (isset($this->data['txnid'])) { - return $this->data['txnid']; - } - } -} diff --git a/src/Omnipay/SecurePay/Message/DirectPostPurchaseRequest.php b/src/Omnipay/SecurePay/Message/DirectPostPurchaseRequest.php deleted file mode 100644 index 59c38f6b..00000000 --- a/src/Omnipay/SecurePay/Message/DirectPostPurchaseRequest.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -/** - * SecurePay Direct Post Purchase Request - */ -class DirectPostPurchaseRequest extends DirectPostAuthorizeRequest -{ - public $txnType = '0'; -} diff --git a/src/Omnipay/Stripe/Gateway.php b/src/Omnipay/Stripe/Gateway.php deleted file mode 100644 index 9c76873a..00000000 --- a/src/Omnipay/Stripe/Gateway.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe; - -use Omnipay\Common\AbstractGateway; -use Omnipay\Stripe\Message\PurchaseRequest; -use Omnipay\Stripe\Message\RefundRequest; - -/** - * Stripe Gateway - * - * @link https://stripe.com/docs/api - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'Stripe'; - } - - public function getDefaultParameters() - { - return array( - 'apiKey' => '', - ); - } - - public function getApiKey() - { - return $this->getParameter('apiKey'); - } - - public function setApiKey($value) - { - return $this->setParameter('apiKey', $value); - } - - public function authorize(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\AuthorizeRequest', $parameters); - } - - public function capture(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\CaptureRequest', $parameters); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\PurchaseRequest', $parameters); - } - - public function refund(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\RefundRequest', $parameters); - } - - public function fetchTransaction(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\FetchTransactionRequest', $parameters); - } - - public function createCard(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\CreateCardRequest', $parameters); - } - - public function updateCard(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\UpdateCardRequest', $parameters); - } - - public function deleteCard(array $parameters = array()) - { - return $this->createRequest('\Omnipay\Stripe\Message\DeleteCardRequest', $parameters); - } -} diff --git a/src/Omnipay/Stripe/Message/AbstractRequest.php b/src/Omnipay/Stripe/Message/AbstractRequest.php deleted file mode 100644 index e03a4e0a..00000000 --- a/src/Omnipay/Stripe/Message/AbstractRequest.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Abstract Request - */ -abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest -{ - protected $endpoint = 'https://api.stripe.com/v1'; - - public function getApiKey() - { - return $this->getParameter('apiKey'); - } - - public function setApiKey($value) - { - return $this->setParameter('apiKey', $value); - } - - /** - * @deprecated - */ - public function getCardToken() - { - return $this->getParameter('token'); - } - - /** - * @deprecated - */ - public function setCardToken($value) - { - return $this->setParameter('token', $value); - } - - abstract public function getEndpoint(); - - public function getHttpMethod() - { - return 'POST'; - } - - public function send() - { - // don't throw exceptions for 4xx errors - $this->httpClient->getEventDispatcher()->addListener( - 'request.error', - function ($event) { - if ($event['response']->isClientError()) { - $event->stopPropagation(); - } - } - ); - - $httpRequest = $this->httpClient->createRequest( - $this->getHttpMethod(), - $this->getEndpoint(), - null, - $this->getData() - ); - $httpResponse = $httpRequest - ->setHeader('Authorization', 'Basic '.base64_encode($this->getApiKey().':')) - ->send(); - - return $this->response = new Response($this, $httpResponse->json()); - } - - protected function getCardData() - { - $this->getCard()->validate(); - - $data = array(); - $data['number'] = $this->getCard()->getNumber(); - $data['exp_month'] = $this->getCard()->getExpiryMonth(); - $data['exp_year'] = $this->getCard()->getExpiryYear(); - $data['cvc'] = $this->getCard()->getCvv(); - $data['name'] = $this->getCard()->getName(); - $data['address_line1'] = $this->getCard()->getAddress1(); - $data['address_line2'] = $this->getCard()->getAddress2(); - $data['address_city'] = $this->getCard()->getCity(); - $data['address_zip'] = $this->getCard()->getPostcode(); - $data['address_state'] = $this->getCard()->getState(); - $data['address_country'] = $this->getCard()->getCountry(); - - return $data; - } -} diff --git a/src/Omnipay/Stripe/Message/AuthorizeRequest.php b/src/Omnipay/Stripe/Message/AuthorizeRequest.php deleted file mode 100644 index fce9c72d..00000000 --- a/src/Omnipay/Stripe/Message/AuthorizeRequest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Authorize Request - */ -class AuthorizeRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('amount', 'currency'); - - $data = array(); - $data['amount'] = $this->getAmountInteger(); - $data['currency'] = strtolower($this->getCurrency()); - $data['description'] = $this->getDescription(); - $data['capture'] = 'false'; - - if ($this->getCardReference()) { - $data['customer'] = $this->getCardReference(); - } elseif ($this->getToken()) { - $data['card'] = $this->getToken(); - } elseif ($this->getCard()) { - $data['card'] = $this->getCardData(); - } else { - // one of cardReference, token, or card is required - $this->validate('card'); - } - - return $data; - } - - public function getEndpoint() - { - return $this->endpoint.'/charges'; - } -} diff --git a/src/Omnipay/Stripe/Message/CaptureRequest.php b/src/Omnipay/Stripe/Message/CaptureRequest.php deleted file mode 100644 index 4860c36e..00000000 --- a/src/Omnipay/Stripe/Message/CaptureRequest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Capture Request - */ -class CaptureRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('transactionReference'); - - $data = array(); - - if ($amount = $this->getAmountInteger()) { - $data['amount'] = $amount; - } - - return $data; - } - - public function getEndpoint() - { - return $this->endpoint.'/charges/'.$this->getTransactionReference().'/capture'; - } -} diff --git a/src/Omnipay/Stripe/Message/CreateCardRequest.php b/src/Omnipay/Stripe/Message/CreateCardRequest.php deleted file mode 100644 index e9c7a30f..00000000 --- a/src/Omnipay/Stripe/Message/CreateCardRequest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Create Credit Card Request - */ -class CreateCardRequest extends AbstractRequest -{ - public function getData() - { - $data = array(); - $data['description'] = $this->getDescription(); - - if ($this->getToken()) { - $data['card'] = $this->getToken(); - } elseif ($this->getCard()) { - $data['card'] = $this->getCardData(); - $data['email'] = $this->getCard()->getEmail(); - } else { - // one of token or card is required - $this->validate('card'); - } - - return $data; - } - - public function getEndpoint() - { - return $this->endpoint.'/customers'; - } -} diff --git a/src/Omnipay/Stripe/Message/DeleteCardRequest.php b/src/Omnipay/Stripe/Message/DeleteCardRequest.php deleted file mode 100644 index 27cfd397..00000000 --- a/src/Omnipay/Stripe/Message/DeleteCardRequest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Delete Credit Card Request - */ -class DeleteCardRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('cardReference'); - - return null; - } - - public function getHttpMethod() - { - return 'DELETE'; - } - - public function getEndpoint() - { - return $this->endpoint.'/customers/'.$this->getCardReference(); - } -} diff --git a/src/Omnipay/Stripe/Message/FetchTransactionRequest.php b/src/Omnipay/Stripe/Message/FetchTransactionRequest.php deleted file mode 100644 index 957b7b12..00000000 --- a/src/Omnipay/Stripe/Message/FetchTransactionRequest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Fetch Transaction Request - */ -class FetchTransactionRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('transactionReference'); - - $data = array(); - - return $data; - } - - public function getEndpoint() - { - return $this->endpoint.'/charges/'.$this->getTransactionReference(); - } -} diff --git a/src/Omnipay/Stripe/Message/PurchaseRequest.php b/src/Omnipay/Stripe/Message/PurchaseRequest.php deleted file mode 100644 index b9935d17..00000000 --- a/src/Omnipay/Stripe/Message/PurchaseRequest.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Purchase Request - */ -class PurchaseRequest extends AuthorizeRequest -{ - public function getData() - { - $data = parent::getData(); - $data['capture'] = 'true'; - - return $data; - } -} diff --git a/src/Omnipay/Stripe/Message/RefundRequest.php b/src/Omnipay/Stripe/Message/RefundRequest.php deleted file mode 100644 index 84dee3cf..00000000 --- a/src/Omnipay/Stripe/Message/RefundRequest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Refund Request - */ -class RefundRequest extends AbstractRequest -{ - public function getData() - { - $this->validate('transactionReference', 'amount'); - - $data = array(); - $data['amount'] = $this->getAmountInteger(); - - return $data; - } - - public function getEndpoint() - { - return $this->endpoint.'/charges/'.$this->getTransactionReference().'/refund'; - } -} diff --git a/src/Omnipay/Stripe/Message/Response.php b/src/Omnipay/Stripe/Message/Response.php deleted file mode 100644 index dfa926a9..00000000 --- a/src/Omnipay/Stripe/Message/Response.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * Stripe Response - */ -class Response extends AbstractResponse -{ - public function isSuccessful() - { - return !isset($this->data['error']); - } - - public function getTransactionReference() - { - if (isset($this->data['object']) && 'charge' === $this->data['object']) { - return $this->data['id']; - } - } - - public function getCardReference() - { - if (isset($this->data['object']) && 'customer' === $this->data['object']) { - return $this->data['id']; - } - } - - public function getMessage() - { - if (!$this->isSuccessful()) { - return $this->data['error']['message']; - } - } -} diff --git a/src/Omnipay/Stripe/Message/UpdateCardRequest.php b/src/Omnipay/Stripe/Message/UpdateCardRequest.php deleted file mode 100644 index 54ff3476..00000000 --- a/src/Omnipay/Stripe/Message/UpdateCardRequest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -/** - * Stripe Update Credit Card Request - */ -class UpdateCardRequest extends AbstractRequest -{ - public function getData() - { - $data = array(); - $data['description'] = $this->getDescription(); - - if ($this->getToken()) { - $data['card'] = $this->getToken(); - } elseif ($this->getCard()) { - $data['card'] = $this->getCardData(); - $data['email'] = $this->getCard()->getEmail(); - } - - $this->validate('cardReference'); - - return $data; - } - - public function getEndpoint() - { - return $this->endpoint.'/customers/'.$this->getCardReference(); - } -} diff --git a/src/Omnipay/TwoCheckout/Gateway.php b/src/Omnipay/TwoCheckout/Gateway.php deleted file mode 100644 index 78605abe..00000000 --- a/src/Omnipay/TwoCheckout/Gateway.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout; - -use Omnipay\Common\AbstractGateway; -use Omnipay\TwoCheckout\Message\CompletePurchaseRequest; -use Omnipay\TwoCheckout\Message\PurchaseRequest; - -/** - * 2Checkout Gateway - * - * @link http://www.2checkout.com/documentation/Advanced_User_Guide.pdf - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return '2Checkout'; - } - - public function getDefaultParameters() - { - return array( - 'accountNumber' => '', - 'secretWord' => '', - 'testMode' => false, - ); - } - - public function getAccountNumber() - { - return $this->getParameter('accountNumber'); - } - - public function setAccountNumber($value) - { - return $this->setParameter('accountNumber', $value); - } - - public function getSecretWord() - { - return $this->getParameter('secretWord'); - } - - public function setSecretWord($value) - { - return $this->setParameter('secretWord', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\TwoCheckout\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\TwoCheckout\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/TwoCheckout/Message/CompletePurchaseRequest.php b/src/Omnipay/TwoCheckout/Message/CompletePurchaseRequest.php deleted file mode 100644 index 1c7eb688..00000000 --- a/src/Omnipay/TwoCheckout/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout\Message; - -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * 2Checkout Complete Purchase Request - */ -class CompletePurchaseRequest extends PurchaseRequest -{ - public function getData() - { - $orderNo = $this->httpRequest->request->get('order_number'); - - // strange exception specified by 2Checkout - if ($this->getTestMode()) { - $orderNo = '1'; - } - - $key = md5($this->getSecretWord().$this->getAccountNumber().$orderNo.$this->getAmount()); - if (strtolower($this->httpRequest->request->get('key')) !== $key) { - throw new InvalidResponseException('Invalid key'); - } - - return $this->httpRequest->request->all(); - } - - public function send() - { - return $this->response = new CompletePurchaseResponse($this, $this->getData()); - } -} diff --git a/src/Omnipay/TwoCheckout/Message/CompletePurchaseResponse.php b/src/Omnipay/TwoCheckout/Message/CompletePurchaseResponse.php deleted file mode 100644 index a769a132..00000000 --- a/src/Omnipay/TwoCheckout/Message/CompletePurchaseResponse.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * 2Checkout Complete Purchase Response - */ -class CompletePurchaseResponse extends AbstractResponse -{ - public function isSuccessful() - { - return true; - } - - public function getTransactionReference() - { - return isset($this->data['order_number']) ? $this->data['order_number'] : null; - } -} diff --git a/src/Omnipay/TwoCheckout/Message/PurchaseRequest.php b/src/Omnipay/TwoCheckout/Message/PurchaseRequest.php deleted file mode 100644 index e62b7a59..00000000 --- a/src/Omnipay/TwoCheckout/Message/PurchaseRequest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * 2Checkout Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - public function getAccountNumber() - { - return $this->getParameter('accountNumber'); - } - - public function setAccountNumber($value) - { - return $this->setParameter('accountNumber', $value); - } - - public function getSecretWord() - { - return $this->getParameter('secretWord'); - } - - public function setSecretWord($value) - { - return $this->setParameter('secretWord', $value); - } - - public function getData() - { - $this->validate('amount', 'returnUrl'); - - $data = array(); - $data['sid'] = $this->getAccountNumber(); - $data['cart_order_id'] = $this->getTransactionId(); - $data['total'] = $this->getAmount(); - $data['tco_currency'] = $this->getCurrency(); - $data['fixed'] = 'Y'; - $data['skip_landing'] = 1; - $data['x_receipt_link_url'] = $this->getReturnUrl(); - - if ($this->getCard()) { - $data['card_holder_name'] = $this->getCard()->getName(); - $data['street_address'] = $this->getCard()->getAddress1(); - $data['street_address2'] = $this->getCard()->getAddress2(); - $data['city'] = $this->getCard()->getCity(); - $data['state'] = $this->getCard()->getState(); - $data['zip'] = $this->getCard()->getPostcode(); - $data['country'] = $this->getCard()->getCountry(); - $data['phone'] = $this->getCard()->getPhone(); - $data['email'] = $this->getCard()->getEmail(); - } - - if ($this->getTestMode()) { - $data['demo'] = 'Y'; - } - - return $data; - } - - public function send() - { - return $this->response = new PurchaseResponse($this, $this->getData()); - } -} diff --git a/src/Omnipay/TwoCheckout/Message/PurchaseResponse.php b/src/Omnipay/TwoCheckout/Message/PurchaseResponse.php deleted file mode 100644 index 707bb781..00000000 --- a/src/Omnipay/TwoCheckout/Message/PurchaseResponse.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * 2Checkout Purchase Response - */ -class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface -{ - protected $endpoint = 'https://www.2checkout.com/checkout/purchase'; - - public function isSuccessful() - { - return false; - } - - public function isRedirect() - { - return true; - } - - public function getRedirectUrl() - { - return $this->endpoint.'?'.http_build_query($this->data); - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } -} diff --git a/src/Omnipay/WorldPay/Gateway.php b/src/Omnipay/WorldPay/Gateway.php deleted file mode 100644 index 13b7ec12..00000000 --- a/src/Omnipay/WorldPay/Gateway.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay; - -use Omnipay\Common\AbstractGateway; -use Omnipay\WorldPay\Message\CompletePurchaseRequest; -use Omnipay\WorldPay\Message\PurchaseRequest; - -/** - * WorldPay Gateway - * - * @link http://www.worldpay.com/support/kb/bg/htmlredirect/rhtml.html - */ -class Gateway extends AbstractGateway -{ - public function getName() - { - return 'WorldPay'; - } - - public function getDefaultParameters() - { - return array( - 'installationId' => '', - 'secretWord' => '', - 'callbackPassword' => '', - 'testMode' => false, - ); - } - - public function getInstallationId() - { - return $this->getParameter('installationId'); - } - - public function setInstallationId($value) - { - return $this->setParameter('installationId', $value); - } - - public function getSecretWord() - { - return $this->getParameter('secretWord'); - } - - public function setSecretWord($value) - { - return $this->setParameter('secretWord', $value); - } - - public function getCallbackPassword() - { - return $this->getParameter('callbackPassword'); - } - - public function setCallbackPassword($value) - { - return $this->setParameter('callbackPassword', $value); - } - - public function purchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\WorldPay\Message\PurchaseRequest', $parameters); - } - - public function completePurchase(array $parameters = array()) - { - return $this->createRequest('\Omnipay\WorldPay\Message\CompletePurchaseRequest', $parameters); - } -} diff --git a/src/Omnipay/WorldPay/Message/CompletePurchaseRequest.php b/src/Omnipay/WorldPay/Message/CompletePurchaseRequest.php deleted file mode 100644 index 322aab71..00000000 --- a/src/Omnipay/WorldPay/Message/CompletePurchaseRequest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay\Message; - -use Omnipay\Common\Exception\InvalidResponseException; - -/** - * WorldPay Complete Purchase Request - */ -class CompletePurchaseRequest extends PurchaseRequest -{ - public function getData() - { - $callbackPW = (string) $this->httpRequest->request->get('callbackPW'); - if ($callbackPW !== $this->getCallbackPassword()) { - throw new InvalidResponseException("Invalid callback password"); - } - - return $this->httpRequest->request->all(); - } - - public function send() - { - return $this->response = new CompletePurchaseResponse($this, $this->getData()); - } -} diff --git a/src/Omnipay/WorldPay/Message/CompletePurchaseResponse.php b/src/Omnipay/WorldPay/Message/CompletePurchaseResponse.php deleted file mode 100644 index b2e19869..00000000 --- a/src/Omnipay/WorldPay/Message/CompletePurchaseResponse.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay\Message; - -use Omnipay\Common\Message\AbstractResponse; - -/** - * WorldPay Complete Purchase Response - */ -class CompletePurchaseResponse extends AbstractResponse -{ - public function isSuccessful() - { - return isset($this->data['transStatus']) && 'Y' === $this->data['transStatus']; - } - - public function getTransactionReference() - { - return isset($this->data['transId']) ? $this->data['transId'] : null; - } - - public function getMessage() - { - return isset($this->data['rawAuthMessage']) ? $this->data['rawAuthMessage'] : null; - } -} diff --git a/src/Omnipay/WorldPay/Message/PurchaseRequest.php b/src/Omnipay/WorldPay/Message/PurchaseRequest.php deleted file mode 100644 index b64cdca0..00000000 --- a/src/Omnipay/WorldPay/Message/PurchaseRequest.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay\Message; - -use Omnipay\Common\Message\AbstractRequest; - -/** - * WorldPay Purchase Request - */ -class PurchaseRequest extends AbstractRequest -{ - protected $liveEndpoint = 'https://secure.worldpay.com/wcc/purchase'; - protected $testEndpoint = 'https://secure-test.worldpay.com/wcc/purchase'; - - public function getInstallationId() - { - return $this->getParameter('installationId'); - } - - public function setInstallationId($value) - { - return $this->setParameter('installationId', $value); - } - - public function getSecretWord() - { - return $this->getParameter('secretWord'); - } - - public function setSecretWord($value) - { - return $this->setParameter('secretWord', $value); - } - - public function getCallbackPassword() - { - return $this->getParameter('callbackPassword'); - } - - public function setCallbackPassword($value) - { - return $this->setParameter('callbackPassword', $value); - } - - public function getData() - { - $this->validate('amount', 'returnUrl'); - - $data = array(); - $data['instId'] = $this->getInstallationId(); - $data['cartId'] = $this->getTransactionId(); - $data['desc'] = $this->getDescription(); - $data['amount'] = $this->getAmount(); - $data['currency'] = $this->getCurrency(); - $data['testMode'] = $this->getTestMode() ? 100 : 0; - $data['MC_callback'] = $this->getReturnUrl(); - - if ($this->getCard()) { - $data['name'] = $this->getCard()->getName(); - $data['address1'] = $this->getCard()->getAddress1(); - $data['address2'] = $this->getCard()->getAddress2(); - $data['town'] = $this->getCard()->getCity(); - $data['region'] = $this->getCard()->getState(); - $data['postcode'] = $this->getCard()->getPostcode(); - $data['country'] = $this->getCard()->getCountry(); - $data['tel'] = $this->getCard()->getPhone(); - $data['email'] = $this->getCard()->getEmail(); - } - - if ($this->getSecretWord()) { - $data['signatureFields'] = 'instId:amount:currency:cartId'; - $signature_data = array($this->getSecretWord(), - $data['instId'], $data['amount'], $data['currency'], $data['cartId']); - $data['signature'] = md5(implode(':', $signature_data)); - } - - return $data; - } - - public function send() - { - return $this->response = new PurchaseResponse($this, $this->getData()); - } - - public function getEndpoint() - { - return $this->getTestMode() ? $this->testEndpoint : $this->liveEndpoint; - } -} diff --git a/src/Omnipay/WorldPay/Message/PurchaseResponse.php b/src/Omnipay/WorldPay/Message/PurchaseResponse.php deleted file mode 100644 index c584a7cc..00000000 --- a/src/Omnipay/WorldPay/Message/PurchaseResponse.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay\Message; - -use Omnipay\Common\Message\AbstractResponse; -use Omnipay\Common\Message\RedirectResponseInterface; - -/** - * WorldPay 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().'?'.http_build_query($this->data); - } - - public function getRedirectMethod() - { - return 'GET'; - } - - public function getRedirectData() - { - return null; - } -} diff --git a/tests/Omnipay/AuthorizeNet/AIMGatewayTest.php b/tests/Omnipay/AuthorizeNet/AIMGatewayTest.php deleted file mode 100644 index 87f3ab7e..00000000 --- a/tests/Omnipay/AuthorizeNet/AIMGatewayTest.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet; - -use Omnipay\GatewayTestCase; - -class AIMGatewayTest extends GatewayTestCase -{ - protected $voidOptions; - - public function setUp() - { - parent::setUp(); - - $this->gateway = new AIMGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->purchaseOptions = array( - 'amount' => '10.00', - 'card' => $this->getValidCard(), - ); - - $this->captureOptions = array( - 'amount' => '10.00', - 'transactionReference' => '12345', - ); - - $this->voidOptions = array( - 'transactionReference' => '12345', - ); - } - - public function testAuthorizeSuccess() - { - $this->setMockHttpResponse('AIMAuthorizeSuccess.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('2184493132', $response->getTransactionReference()); - $this->assertSame('This transaction has been approved.', $response->getMessage()); - } - - public function testAuthorizeFailure() - { - $this->setMockHttpResponse('AIMAuthorizeFailure.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('A valid amount is required.', $response->getMessage()); - } - - public function testCaptureSuccess() - { - $this->setMockHttpResponse('AIMCaptureSuccess.txt'); - - $response = $this->gateway->capture($this->captureOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('2184494531', $response->getTransactionReference()); - $this->assertSame('This transaction has been approved.', $response->getMessage()); - } - - public function testCaptureFailure() - { - $this->setMockHttpResponse('AIMCaptureFailure.txt'); - - $response = $this->gateway->capture($this->captureOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('The transaction cannot be found.', $response->getMessage()); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('AIMPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->purchaseOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('2184492509', $response->getTransactionReference()); - $this->assertSame('This transaction has been approved.', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('AIMPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('A valid amount is required.', $response->getMessage()); - } - - public function testVoidSuccess() - { - $this->setMockHttpResponse('AIMVoidSuccess.txt'); - - $response = $this->gateway->void($this->voidOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('This transaction has already been voided.', $response->getMessage()); - } - - public function testVoidFailure() - { - $this->setMockHttpResponse('AIMVoidFailure.txt'); - - $response = $this->gateway->void($this->voidOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('A valid referenced transaction ID is required.', $response->getMessage()); - } - -} diff --git a/tests/Omnipay/AuthorizeNet/Message/AIMResponseTest.php b/tests/Omnipay/AuthorizeNet/Message/AIMResponseTest.php deleted file mode 100644 index 79d29db1..00000000 --- a/tests/Omnipay/AuthorizeNet/Message/AIMResponseTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -use Omnipay\TestCase; - -class AIMResponseTest extends TestCase -{ - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testConstructEmpty() - { - $response = new AIMResponse($this->getMockRequest(), ''); - } - - public function testAuthorizeSuccess() - { - $httpResponse = $this->getMockHttpResponse('AIMAuthorizeSuccess.txt'); - $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('2184493132', $response->getTransactionReference()); - $this->assertSame('This transaction has been approved.', $response->getMessage()); - } - - public function testAuthorizeFailure() - { - $httpResponse = $this->getMockHttpResponse('AIMAuthorizeFailure.txt'); - $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('A valid amount is required.', $response->getMessage()); - } - - public function testCaptureSuccess() - { - $httpResponse = $this->getMockHttpResponse('AIMCaptureSuccess.txt'); - $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('2184494531', $response->getTransactionReference()); - $this->assertSame('This transaction has been approved.', $response->getMessage()); - } - - public function testCaptureFailure() - { - $httpResponse = $this->getMockHttpResponse('AIMCaptureFailure.txt'); - $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('The transaction cannot be found.', $response->getMessage()); - } - - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('AIMPurchaseSuccess.txt'); - $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('2184492509', $response->getTransactionReference()); - $this->assertSame('This transaction has been approved.', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('AIMPurchaseFailure.txt'); - $response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('0', $response->getTransactionReference()); - $this->assertSame('A valid amount is required.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeResponseTest.php b/tests/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeResponseTest.php deleted file mode 100644 index b8d5b501..00000000 --- a/tests/Omnipay/AuthorizeNet/Message/SIMCompleteAuthorizeResponseTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet\Message; - -use Omnipay\TestCase; - -class SIMCompleteAuthorizeResponseTest extends TestCase -{ - public function testSuccess() - { - $response = new SIMCompleteAuthorizeResponse($this->getMockRequest(), array('x_response_code' => '1', 'x_trans_id' => '12345')); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('12345', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testFailure() - { - $response = new SIMCompleteAuthorizeResponse($this->getMockRequest(), array('x_response_code' => '0', 'x_response_reason_text' => 'Declined')); - - $this->assertFalse($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Declined', $response->getMessage()); - } -} diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMAuthorizeFailure.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMAuthorizeFailure.txt deleted file mode 100644 index 5cbff0c5..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMAuthorizeFailure.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:23:27 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 326 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|3|,|1|,|5|,|A valid amount is required.|,||,|P|,|0|,|12345|,|first purchase|,|-0.01|,|CC|,|auth_only|,||,|fjkdsl|,|fdjskl|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|3EB992D927587B9FC7A3D83F651CD7EF|,||,||,||,||,||,||,||,||,||,||,||,||,|XXXX1111|,|Visa|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMAuthorizeSuccess.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMAuthorizeSuccess.txt deleted file mode 100644 index b958a41e..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMAuthorizeSuccess.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 350 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|1|,|1|,|1|,|This transaction has been approved.|,|GA4OQP|,|Y|,|2184493132|,|12345|,|first purchase|,|2.00|,|CC|,|auth_only|,||,|fjkdsl|,|fdjskl|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|50D842FB596025E1C7779440D0A62496|,|P|,|2|,||,||,||,||,||,||,||,||,||,||,|XXXX1111|,|Visa|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMCaptureFailure.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMCaptureFailure.txt deleted file mode 100644 index 6b9dd3ca..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMCaptureFailure.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:58:47 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 297 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|3|,|2|,|16|,|The transaction cannot be found.|,||,|P|,|0|,||,||,|2.00|,|CC|,|prior_auth_capture|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|7432D28FA29C86EFEDBFD80C4767CD8C|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMCaptureSuccess.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMCaptureSuccess.txt deleted file mode 100644 index a7d06d04..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMCaptureSuccess.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:56:28 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 326 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|1|,|1|,|1|,|This transaction has been approved.|,|F51OYG|,|P|,|2184494531|,||,||,|2.00|,|CC|,|prior_auth_capture|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|7B7038AB4FA82268A512E6B2F571853A|,||,||,||,||,||,||,||,||,||,||,||,||,|XXXX1111|,|Visa|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMPurchaseFailure.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMPurchaseFailure.txt deleted file mode 100644 index 0fe0b73d..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMPurchaseFailure.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:00:47 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 323 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|3|,|1|,|5|,|A valid amount is required.|,||,|P|,|0|,|12345|,|first purchase|,|-0.01|,|CC|,|auth_capture|,||,|fds|,|fds|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|3EB992D927587B9FC7A3D83F651CD7EF|,||,||,||,||,||,||,||,||,||,||,||,||,|XXXX1111|,|Visa|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMPurchaseSuccess.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMPurchaseSuccess.txt deleted file mode 100644 index 59a44efd..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMPurchaseSuccess.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:00:03 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 347 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|1|,|1|,|1|,|This transaction has been approved.|,|JE6JM1|,|Y|,|2184492509|,|12345|,|first purchase|,|1.00|,|CC|,|auth_capture|,||,|fds|,|fds|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|35951A3F0A91940575132EA09CA1DC31|,|P|,|2|,||,||,||,||,||,||,||,||,||,||,|XXXX1111|,|Visa|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMVoidFailure.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMVoidFailure.txt deleted file mode 100644 index 023dd7a1..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMVoidFailure.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:00:47 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 309 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|3|,|2|,|33|,|A valid referenced transaction ID is required.|,||,|P|,|0|,||,||,|0.00|,|CC|,|void|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|554B8CA3AE27C6104986860760858E83|,||,||,||,||,||,||,||,||,||,||,||,||,|XXXX1111|,|Visa|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/Mock/AIMVoidSuccess.txt b/tests/Omnipay/AuthorizeNet/Mock/AIMVoidSuccess.txt deleted file mode 100644 index a05bf482..00000000 --- a/tests/Omnipay/AuthorizeNet/Mock/AIMVoidSuccess.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:00:03 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 307 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - -|1|,|1|,|310|,|This transaction has already been voided.|,||,|P|,|0|,||,||,|0.00|,|CC|,|void|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|554B8CA3AE27C6104986860760858E83|,|P|,|2|,||,||,||,||,||,||,||,||,||,||,|XXXX1111|,|Visa|,||,||,||,||,||,||,||,||,||,||,||,||,||,||,||,|| \ No newline at end of file diff --git a/tests/Omnipay/AuthorizeNet/SIMGatewayTest.php b/tests/Omnipay/AuthorizeNet/SIMGatewayTest.php deleted file mode 100644 index 48c09310..00000000 --- a/tests/Omnipay/AuthorizeNet/SIMGatewayTest.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\AuthorizeNet; - -use Omnipay\GatewayTestCase; - -class SIMGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new SIMGateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setApiLoginId('example'); - - $this->options = array( - 'amount' => '10.00', - 'transactionId' => '99', - 'returnUrl' => 'https://www.example.com/return', - ); - } - - public function testAuthorize() - { - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNotEmpty($response->getRedirectUrl()); - - $redirectData = $response->getRedirectData(); - $this->assertSame('https://www.example.com/return', $redirectData['x_relay_url']); - } - - public function testCompleteAuthorize() - { - $this->getHttpRequest()->request->replace( - array( - 'x_response_code' => '1', - 'x_trans_id' => '12345', - 'x_MD5_Hash' => md5('example9910.00'), - ) - ); - - $response = $this->gateway->completeAuthorize($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('12345', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testPurchase() - { - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNotEmpty($response->getRedirectUrl()); - - $redirectData = $response->getRedirectData(); - $this->assertSame('https://www.example.com/return', $redirectData['x_relay_url']); - } - - public function testCompletePurchase() - { - $this->getHttpRequest()->request->replace( - array( - 'x_response_code' => '1', - 'x_trans_id' => '12345', - 'x_MD5_Hash' => md5('example9910.00'), - ) - ); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('12345', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/Buckaroo/GatewayTest.php b/tests/Omnipay/Buckaroo/GatewayTest.php deleted file mode 100644 index 0f2b01b8..00000000 --- a/tests/Omnipay/Buckaroo/GatewayTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Buckaroo; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testPurchase() - { - $request = $this->gateway->purchase(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Buckaroo\Message\PurchaseRequest', $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()); - } -} diff --git a/tests/Omnipay/Buckaroo/Message/CompletePurchaseRequestTest.php b/tests/Omnipay/Buckaroo/Message/CompletePurchaseRequestTest.php deleted file mode 100644 index 40796427..00000000 --- a/tests/Omnipay/Buckaroo/Message/CompletePurchaseRequestTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Buckaroo\Message; - -use Omnipay\TestCase; - -class CompletePurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new CompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'merchantId' => 'merchant id', - 'transactionId' => 13, - 'secret' => 'shhhh', - 'amount' => '12.00', - 'currency' => 'ZAR', - 'testMode' => true, - )); - $this->getHttpRequest()->request->replace(array( - 'bpe_signature2' => '351fad9e06e1aa041ec48726e0d98b81', - 'bpe_trx' => 'tricky', - 'bpe_timestamp' => '123456', - 'bpe_result' => 'success', - )); - } - - public function testGetData() - { - $data = $this->request->getData(); - - $this->assertSame($this->getHttpRequest()->request->all(), $data); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidRequestException - */ - public function testGetDataInvalidSignature() - { - $this->getHttpRequest()->request->set('bpe_signature2', 'zzz'); - - $this->request->getData(); - } - - public function testGenerateResponseSignature() - { - $this->request->initialize(array( - 'merchantId' => 'merchant id', - 'transactionId' => 13, - 'secret' => 'shhhh', - 'amount' => '12.00', - 'currency' => 'ZAR', - 'testMode' => true, - )); - $this->getHttpRequest()->request->replace(array( - 'bpe_trx' => 'tricky', - 'bpe_timestamp' => '123456', - 'bpe_result' => 'success', - )); - - $this->assertSame('351fad9e06e1aa041ec48726e0d98b81', $this->request->generateResponseSignature()); - } - - public function testSendSuccess() - { - $this->getHttpRequest()->request->set('bpe_result', '100'); - $this->getHttpRequest()->request->set('bpe_signature2', $this->request->generateResponseSignature()); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('tricky', $response->getTransactionReference()); - $this->assertSame('100', $response->getCode()); - } - - public function testSendError() - { - $this->getHttpRequest()->request->set('bpe_result', '999'); - $this->getHttpRequest()->request->set('bpe_signature2', $this->request->generateResponseSignature()); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('tricky', $response->getTransactionReference()); - $this->assertSame('999', $response->getCode()); - } -} diff --git a/tests/Omnipay/Buckaroo/Message/PurchaseRequestTest.php b/tests/Omnipay/Buckaroo/Message/PurchaseRequestTest.php deleted file mode 100644 index a862bc94..00000000 --- a/tests/Omnipay/Buckaroo/Message/PurchaseRequestTest.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Buckaroo\Message; - -use Omnipay\TestCase; - -class PurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize( - array( - 'merchantId' => 'merchant id', - 'secret' => 'shhhh', - 'amount' => '12.00', - 'returnUrl' => 'https://www.example.com/return', - ) - ); - } - - public function testGetData() - { - $this->request->initialize(array( - 'merchantId' => 'merchant id', - 'secret' => 'shhhh', - 'amount' => '12.00', - 'currency' => 'EUR', - 'testMode' => true, - 'transactionId' => 13, - 'returnUrl' => 'https://www.example.com/return', - )); - - $data = $this->request->getData(); - - $this->assertSame('merchant id', $data['BPE_Merchant']); - $this->assertSame(1200, $data['BPE_Amount']); - $this->assertSame('EUR', $data['BPE_Currency']); - $this->assertSame('EN', $data['BPE_Language']); - $this->assertSame(1, $data['BPE_Mode']); - $this->assertSame(13, $data['BPE_Invoice']); - $this->assertSame('https://www.example.com/return', $data['BPE_Return_Success']); - $this->assertSame('https://www.example.com/return', $data['BPE_Return_Reject']); - $this->assertSame('https://www.example.com/return', $data['BPE_Return_Error']); - $this->assertSame('POST', $data['BPE_Return_Method']); - $this->assertSame('a22b9bd563f52e0a3e8e28998f9f6a12', $data['BPE_Signature2']); - } - - public function testGenerateSignature() - { - $this->request->setSecret('abcdef'); - $data = array( - 'BPE_Merchant' => 'Tony Stark', - 'BPE_Invoice' => '99', - 'BPE_Amount' => '10000', - 'BPE_Currency' => 'ZAR', - 'BPE_Mode' => '1', - ); - - $this->assertSame('e93fea2554382e199df4dcf5fe74c1c6', $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://payment.buckaroo.nl/sslplus/request_for_authorization.asp', $response->getRedirectUrl()); - $this->assertSame($this->request->getData(), $response->getRedirectData()); - } -} diff --git a/tests/Omnipay/CardSave/GatewayTest.php b/tests/Omnipay/CardSave/GatewayTest.php deleted file mode 100644 index 831d6d44..00000000 --- a/tests/Omnipay/CardSave/GatewayTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\CardSave; - -use Omnipay\Common\CreditCard; -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - 'card' => new CreditCard(array( - 'firstName' => 'Example', - 'lastName' => 'User', - 'number' => '4111111111111111', - 'expiryMonth' => '12', - 'expiryYear' => '2016', - 'cvv' => '123', - )), - ); - } - - public function testPurchase() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\CardSave\Message\Response', $response); - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('130215141054377801316798', $response->getTransactionReference()); - } - - public function testPurchaseError() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('Input variable errors', $response->getMessage()); - } -} diff --git a/tests/Omnipay/CardSave/Message/ResponseTest.php b/tests/Omnipay/CardSave/Message/ResponseTest.php deleted file mode 100644 index 518e3b68..00000000 --- a/tests/Omnipay/CardSave/Message/ResponseTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\CardSave\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('130215141054377801316798', $response->getTransactionReference()); - $this->assertSame('AuthCode: 672167', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('', $response->getTransactionReference()); - $this->assertSame('Input variable errors', $response->getMessage()); - } -} diff --git a/tests/Omnipay/CardSave/Mock/PurchaseFailure.txt b/tests/Omnipay/CardSave/Mock/PurchaseFailure.txt deleted file mode 100644 index 9a8238ef..00000000 --- a/tests/Omnipay/CardSave/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: private, max-age=0 -Content-Length: 689 -Content-Type: text/xml; charset=utf-8 -Node: VENUS -X-Powered-By: ASP.NET -X-AspNet-Version: 4.0.30319 -Date: Fri, 15 Feb 2013 14:06:34 GMT - -30Input variable errorsRequired variable (PaymentMessage.TransactionDetails.OrderID) is missing \ No newline at end of file diff --git a/tests/Omnipay/CardSave/Mock/PurchaseSuccess.txt b/tests/Omnipay/CardSave/Mock/PurchaseSuccess.txt deleted file mode 100644 index ed679d03..00000000 --- a/tests/Omnipay/CardSave/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: private, max-age=0 -Content-Length: 944 -Content-Type: text/xml; charset=utf-8 -Node: VENUS -X-Powered-By: ASP.NET -X-AspNet-Version: 4.0.30319 -Date: Fri, 15 Feb 2013 14:10:53 GMT - -0AuthCode: 672167672167NOT_ENROLLED \ No newline at end of file diff --git a/tests/Omnipay/Common/AbstractGatewayTest.php b/tests/Omnipay/Common/AbstractGatewayTest.php deleted file mode 100644 index 9a4233da..00000000 --- a/tests/Omnipay/Common/AbstractGatewayTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use Mockery as m; -use Omnipay\TestCase; - -class AbstractGatewayTest extends TestCase -{ - public function setUp() - { - $this->gateway = m::mock("\Omnipay\Common\AbstractGateway[getName,getDefaultParameters,purchase]"); - } - - public function testGetShortName() - { - // test a couple of known getShortName() examples - $gateway = GatewayFactory::create('PayPal_Express'); - $this->assertSame('PayPal_Express', $gateway->getShortName()); - - $gateway = GatewayFactory::create('Stripe'); - $this->assertSame('Stripe', $gateway->getShortName()); - } -} diff --git a/tests/Omnipay/Common/CreditCardTest.php b/tests/Omnipay/Common/CreditCardTest.php deleted file mode 100644 index 98b5097c..00000000 --- a/tests/Omnipay/Common/CreditCardTest.php +++ /dev/null @@ -1,510 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use Omnipay\TestCase; - -class CreditCardTest extends TestCase -{ - public function setUp() - { - $this->card = new CreditCard; - $this->card->setNumber('4111111111111111'); - $this->card->setFirstName('Example'); - $this->card->setLastName('Customer'); - $this->card->setExpiryMonth('4'); - $this->card->setExpiryYear(gmdate('Y')+2); - $this->card->setCvv('123'); - } - - public function testConstructWithParams() - { - $card = new CreditCard(array('name' => 'Test Customer')); - $this->assertSame('Test Customer', $card->getName()); - } - - public function testInitializeWithParams() - { - $card = new CreditCard; - $card->initialize(array('name' => 'Test Customer')); - $this->assertSame('Test Customer', $card->getName()); - } - - public function testGetParamters() - { - $card = new CreditCard(array( - 'name' => 'Example Customer', - 'number' => '1234', - 'expiryMonth' => 6, - 'expiryYear' => 2016, - )); - - $parameters = $card->getParameters(); - $this->assertSame('Example', $parameters['billingFirstName']); - $this->assertSame('Customer', $parameters['billingLastName']); - $this->assertSame('1234', $parameters['number']); - $this->assertSame(6, $parameters['expiryMonth']); - $this->assertSame(2016, $parameters['expiryYear']); - } - - public function testValidateFixture() - { - $this->card->validate(); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidCreditCardException - * @expectedExceptionMessage The number parameter is required - */ - public function testValidateNumberRequired() - { - $this->card->setNumber(null); - $this->card->validate(); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidCreditCardException - * @expectedExceptionMessage The expiryMonth parameter is required - */ - public function testValidateExpiryMonthRequired() - { - $this->card->setExpiryMonth(null); - $this->card->validate(); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidCreditCardException - * @expectedExceptionMessage The expiryYear parameter is required - */ - public function testValidateExpiryYearRequired() - { - $this->card->setExpiryYear(null); - $this->card->validate(); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidCreditCardException - * @expectedExceptionMessage Card has expired - */ - public function testValidateExpiryDate() - { - $this->card->setExpiryYear(gmdate('Y')-1); - $this->card->validate(); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidCreditCardException - * @expectedExceptionMessage Card number is invalid - */ - public function testValidateNumber() - { - $this->card->setNumber('4111111111111110'); - $this->card->validate(); - } - - public function testGetSupportedBrands() - { - $brands = $this->card->getSupportedBrands(); - $this->assertInternalType('array', $brands); - $this->assertArrayHasKey(CreditCard::BRAND_VISA, $brands); - } - - public function testFirstName() - { - $this->card->setFirstName('Bob'); - $this->assertEquals('Bob', $this->card->getFirstName()); - } - - public function testLastName() - { - $this->card->setLastName('Smith'); - $this->assertEquals('Smith', $this->card->getLastName()); - } - - public function testGetName() - { - $this->card->setFirstName('Bob'); - $this->card->setLastName('Smith'); - $this->assertEquals('Bob Smith', $this->card->getName()); - } - - public function testSetName() - { - $this->card->setName('Bob Smith'); - $this->assertEquals('Bob', $this->card->getFirstName()); - $this->assertEquals('Smith', $this->card->getLastName()); - } - - public function testSetNameWithOneName() - { - $this->card->setName('Bob'); - $this->assertEquals('Bob', $this->card->getFirstName()); - $this->assertEquals('', $this->card->getLastName()); - } - - public function testSetNameWithMultipleNames() - { - $this->card->setName('Bob John Smith'); - $this->assertEquals('Bob', $this->card->getFirstName()); - $this->assertEquals('John Smith', $this->card->getLastName()); - } - - public function testNumber() - { - $this->card->setNumber('4000000000000000'); - $this->assertEquals('4000000000000000', $this->card->getNumber()); - } - - public function testSetNumberStripsNonDigits() - { - $this->card->setNumber('4000 0000 00b00 0000'); - $this->assertEquals('4000000000000000', $this->card->getNumber()); - } - - public function testGetBrandDefault() - { - $card = new CreditCard; - $this->assertNull($card->getBrand()); - } - - public function testGetBrandVisa() - { - $card = new CreditCard(array('number' => '4242424242424242')); - $this->assertSame(CreditCard::BRAND_VISA, $card->getBrand()); - } - - public function testGetBrandMasterCard() - { - $card = new CreditCard(array('number' => '5555555555554444')); - $this->assertSame(CreditCard::BRAND_MASTERCARD, $card->getBrand()); - } - - public function testGetBrandAmex() - { - $card = new CreditCard(array('number' => '378282246310005')); - $this->assertSame(CreditCard::BRAND_AMEX, $card->getBrand()); - } - - public function testGetBrandDiscover() - { - $card = new CreditCard(array('number' => '6011111111111117')); - $this->assertSame(CreditCard::BRAND_DISCOVER, $card->getBrand()); - } - - public function testGetBrandDinersClub() - { - $card = new CreditCard(array('number' => '30569309025904')); - $this->assertSame(CreditCard::BRAND_DINERS_CLUB, $card->getBrand()); - } - - public function testGetBrandJcb() - { - $card = new CreditCard(array('number' => '3530111333300000')); - $this->assertSame(CreditCard::BRAND_JCB, $card->getBrand()); - } - - public function testExpiryMonth() - { - $this->card->setExpiryMonth(9); - $this->assertSame(9, $this->card->getExpiryMonth()); - } - - public function testExpiryMonthLeadingZeros() - { - $this->card->setExpiryMonth('09'); - $this->assertSame(9, $this->card->getExpiryMonth()); - } - - public function testExpiryYear() - { - $this->card->setExpiryYear(2012); - $this->assertSame(2012, $this->card->getExpiryYear()); - } - - public function testExpiryYearTwoDigits() - { - $this->card->setExpiryYear('12'); - $this->assertSame(2012, $this->card->getExpiryYear()); - } - - public function testExpiryDate() - { - $this->assertSame($this->card, $this->card->setExpiryMonth('09')); - $this->assertSame($this->card, $this->card->setExpiryYear('2012')); - $this->assertSame('092012', $this->card->getExpiryDate('mY')); - } - - public function testStartMonth() - { - $this->card->setStartMonth(9); - $this->assertSame(9, $this->card->getStartMonth()); - } - - public function testStartMonthLeadingZeros() - { - $this->card->setStartMonth('09'); - $this->assertSame(9, $this->card->getStartMonth()); - } - - public function testStartYear() - { - $this->card->setStartYear(2012); - $this->assertSame(2012, $this->card->getStartYear()); - } - - public function testStartYearTwoDigits() - { - $this->card->setStartYear('12'); - $this->assertSame(2012, $this->card->getStartYear()); - } - - public function testStartDate() - { - $this->card->setStartMonth('11'); - $this->card->setStartYear('2012'); - $this->assertEquals('112012', $this->card->getStartDate('mY')); - } - - public function testCvv() - { - $this->card->setCvv('456'); - $this->assertEquals('456', $this->card->getCvv()); - } - - public function testIssueNumber() - { - $this->card->setIssueNumber('12'); - $this->assertSame('12', $this->card->getIssueNumber()); - } - - public function testBillingFirstName() - { - $this->card->setBillingFirstName('Bob'); - $this->assertEquals('Bob', $this->card->getBillingFirstName()); - $this->assertEquals('Bob', $this->card->getFirstName()); - } - - public function testBillingLastName() - { - $this->card->setBillingLastName('Smith'); - $this->assertEquals('Smith', $this->card->getBillingLastName()); - $this->assertEquals('Smith', $this->card->getLastName()); - } - - public function testBillingName() - { - $this->card->setBillingFirstName('Bob'); - $this->card->setBillingLastName('Smith'); - $this->assertEquals('Bob Smith', $this->card->getBillingName()); - - $this->card->setBillingName('John Foo'); - $this->assertEquals('John', $this->card->getBillingFirstName()); - $this->assertEquals('Foo', $this->card->getBillingLastName()); - } - - public function testBillingCompany() - { - $this->card->setBillingCompany('SuperSoft'); - $this->assertEquals('SuperSoft', $this->card->getBillingCompany()); - $this->assertEquals('SuperSoft', $this->card->getCompany()); - } - - public function testBillingAddress1() - { - $this->card->setBillingAddress1('31 Spooner St'); - $this->assertEquals('31 Spooner St', $this->card->getBillingAddress1()); - $this->assertEquals('31 Spooner St', $this->card->getAddress1()); - } - - public function testBillingAddress2() - { - $this->card->setBillingAddress2('Suburb'); - $this->assertEquals('Suburb', $this->card->getBillingAddress2()); - $this->assertEquals('Suburb', $this->card->getAddress2()); - } - - public function testBillingCity() - { - $this->card->setBillingCity('Quahog'); - $this->assertEquals('Quahog', $this->card->getBillingCity()); - $this->assertEquals('Quahog', $this->card->getCity()); - } - - public function testBillingPostcode() - { - $this->card->setBillingPostcode('12345'); - $this->assertEquals('12345', $this->card->getBillingPostcode()); - $this->assertEquals('12345', $this->card->getPostcode()); - } - - public function testBillingState() - { - $this->card->setBillingState('RI'); - $this->assertEquals('RI', $this->card->getBillingState()); - $this->assertEquals('RI', $this->card->getState()); - } - - public function testBillingCountry() - { - $this->card->setBillingCountry('US'); - $this->assertEquals('US', $this->card->getBillingCountry()); - $this->assertEquals('US', $this->card->getCountry()); - } - - public function testBillingPhone() - { - $this->card->setBillingPhone('12345'); - $this->assertSame('12345', $this->card->getBillingPhone()); - $this->assertSame('12345', $this->card->getPhone()); - } - - public function testShippingFirstName() - { - $this->card->setShippingFirstName('James'); - $this->assertEquals('James', $this->card->getShippingFirstName()); - } - - public function testShippingLastName() - { - $this->card->setShippingLastName('Doctor'); - $this->assertEquals('Doctor', $this->card->getShippingLastName()); - } - - public function testShippingName() - { - $this->card->setShippingFirstName('Bob'); - $this->card->setShippingLastName('Smith'); - $this->assertEquals('Bob Smith', $this->card->getShippingName()); - - $this->card->setShippingName('John Foo'); - $this->assertEquals('John', $this->card->getShippingFirstName()); - $this->assertEquals('Foo', $this->card->getShippingLastName()); - } - - public function testShippingCompany() - { - $this->card->setShippingCompany('SuperSoft'); - $this->assertEquals('SuperSoft', $this->card->getShippingCompany()); - } - - public function testShippingAddress1() - { - $this->card->setShippingAddress1('31 Spooner St'); - $this->assertEquals('31 Spooner St', $this->card->getShippingAddress1()); - } - - public function testShippingAddress2() - { - $this->card->setShippingAddress2('Suburb'); - $this->assertEquals('Suburb', $this->card->getShippingAddress2()); - } - - public function testShippingCity() - { - $this->card->setShippingCity('Quahog'); - $this->assertEquals('Quahog', $this->card->getShippingCity()); - } - - public function testShippingPostcode() - { - $this->card->setShippingPostcode('12345'); - $this->assertEquals('12345', $this->card->getShippingPostcode()); - } - - public function testShippingState() - { - $this->card->setShippingState('RI'); - $this->assertEquals('RI', $this->card->getShippingState()); - } - - public function testShippingCountry() - { - $this->card->setShippingCountry('US'); - $this->assertEquals('US', $this->card->getShippingCountry()); - } - - public function testShippingPhone() - { - $this->card->setShippingPhone('12345'); - $this->assertEquals('12345', $this->card->getShippingPhone()); - } - - public function testCompany() - { - $this->card->setCompany('FooBar'); - $this->assertEquals('FooBar', $this->card->getCompany()); - $this->assertEquals('FooBar', $this->card->getBillingCompany()); - $this->assertEquals('FooBar', $this->card->getShippingCompany()); - } - - public function testAddress1() - { - $this->card->setAddress1('31 Spooner St'); - $this->assertEquals('31 Spooner St', $this->card->getAddress1()); - $this->assertEquals('31 Spooner St', $this->card->getBillingAddress1()); - $this->assertEquals('31 Spooner St', $this->card->getShippingAddress1()); - } - - public function testAddress2() - { - $this->card->setAddress2('Suburb'); - $this->assertEquals('Suburb', $this->card->getAddress2()); - $this->assertEquals('Suburb', $this->card->getBillingAddress2()); - $this->assertEquals('Suburb', $this->card->getShippingAddress2()); - } - - public function testCity() - { - $this->card->setCity('Quahog'); - $this->assertEquals('Quahog', $this->card->getCity()); - $this->assertEquals('Quahog', $this->card->getBillingCity()); - $this->assertEquals('Quahog', $this->card->getShippingCity()); - } - - public function testPostcode() - { - $this->card->setPostcode('12345'); - $this->assertEquals('12345', $this->card->getPostcode()); - $this->assertEquals('12345', $this->card->getBillingPostcode()); - $this->assertEquals('12345', $this->card->getShippingPostcode()); - } - - public function testState() - { - $this->card->setState('RI'); - $this->assertEquals('RI', $this->card->getState()); - $this->assertEquals('RI', $this->card->getBillingState()); - $this->assertEquals('RI', $this->card->getShippingState()); - } - - public function testCountry() - { - $this->card->setCountry('US'); - $this->assertEquals('US', $this->card->getCountry()); - $this->assertEquals('US', $this->card->getBillingCountry()); - $this->assertEquals('US', $this->card->getShippingCountry()); - } - - public function testPhone() - { - $this->card->setPhone('12345'); - $this->assertEquals('12345', $this->card->getPhone()); - $this->assertEquals('12345', $this->card->getBillingPhone()); - $this->assertEquals('12345', $this->card->getShippingPhone()); - } - - public function testEmail() - { - $this->card->setEmail('adrian@example.com'); - $this->assertEquals('adrian@example.com', $this->card->getEmail()); - } -} diff --git a/tests/Omnipay/Common/CurrencyTest.php b/tests/Omnipay/Common/CurrencyTest.php deleted file mode 100644 index 07431f2e..00000000 --- a/tests/Omnipay/Common/CurrencyTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use Omnipay\Common\Currency; -use Omnipay\TestCase; - -class CurrencyTest extends TestCase -{ - public function testFind() - { - $currency = Currency::find('USD'); - - $this->assertSame('USD', $currency->getCode()); - $this->assertSame('840', $currency->getNumeric()); - $this->assertSame(2, $currency->getDecimals()); - } - - public function testFindLowercase() - { - $currency = Currency::find('usd'); - - $this->assertSame('USD', $currency->getCode()); - $this->assertSame('840', $currency->getNumeric()); - $this->assertSame(2, $currency->getDecimals()); - } - - public function testUnknownCurrencyReturnsNull() - { - $currency = Currency::find('XYZ'); - - $this->assertNull($currency); - } - - public function testAll() - { - $currencies = Currency::all(); - - $this->assertTrue(isset($currencies['USD'])); - $this->assertFalse(isset($currencies['XYZ'])); - } -} diff --git a/tests/Omnipay/Common/GatewayFactoryTest.php b/tests/Omnipay/Common/GatewayFactoryTest.php deleted file mode 100644 index f40a2c83..00000000 --- a/tests/Omnipay/Common/GatewayFactoryTest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use Omnipay\TestCase; - -class GatewayFactoryTest extends TestCase -{ - public function testCreate() - { - $gateway = GatewayFactory::create('Stripe'); - $this->assertInstanceOf('\\Omnipay\\Stripe\\Gateway', $gateway); - } - - /** - * @expectedException \Omnipay\Common\Exception\RuntimeException - * @expectedExceptionMessage Class '\Omnipay\Invalid\Gateway' not found - */ - public function testCreateInvalid() - { - $gateway = GatewayFactory::create('Invalid'); - } - - public function testFind() - { - $gateways = GatewayFactory::find(); - $this->assertContains('PayPal_Express', $gateways); - $this->assertContains('Stripe', $gateways); - } -} diff --git a/tests/Omnipay/Common/HelperTest.php b/tests/Omnipay/Common/HelperTest.php deleted file mode 100644 index 546b693e..00000000 --- a/tests/Omnipay/Common/HelperTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common; - -use Mockery as m; -use Omnipay\TestCase; - -class HelperTest extends TestCase -{ - public function testCamelCase() - { - $result = Helper::camelCase('test_case'); - $this->assertEquals('testCase', $result); - } - - public function testCamelCaseAlreadyCorrect() - { - $result = Helper::camelCase('testCase'); - $this->assertEquals('testCase', $result); - } - - public function testValidateLuhnValid() - { - $result = Helper::validateLuhn('4111111111111111'); - $this->assertTrue($result); - } - - public function testValidateLuhnInvalid() - { - $result = Helper::validateLuhn('4111111111111110'); - $this->assertFalse($result); - } - - public function testValidateLuhnNull() - { - $result = Helper::validateLuhn(null); - $this->assertTrue($result); - } - - public function testInitializeIgnoresNull() - { - $target = m::mock(); - Helper::initialize($target, null); - } - - public function testInitializeIgnoresString() - { - $target = m::mock(); - Helper::initialize($target, 'invalid'); - } - - public function testInitializeCallsSetters() - { - $target = m::mock('\Omnipay\Common\CreditCard'); - $target->shouldReceive('setName')->once()->with('adrian'); - $target->shouldReceive('setNumber')->once()->with('1234'); - - Helper::initialize($target, array('name' => 'adrian', 'number' => '1234')); - } - - public function testInitializeIgnoresInvalidParameters() - { - $target = m::mock('\Omnipay\Common\CreditCard'); - $target->shouldReceive('setName')->once()->with('adrian'); - - Helper::initialize($target, array('name' => 'adrian', 'extra' => 'invalid')); - } - - public function testGetGatewayShortNameSimple() - { - $shortName = Helper::getGatewayShortName('Omnipay\\Stripe\\Gateway'); - $this->assertSame('Stripe', $shortName); - } - - public function testGetGatewayShortNameSimpleLeadingSlash() - { - $shortName = Helper::getGatewayShortName('\\Omnipay\\Stripe\\Gateway'); - $this->assertSame('Stripe', $shortName); - } - - public function testGetGatewayShortNameUnderscore() - { - $shortName = Helper::getGatewayShortName('Omnipay\\PayPal\\ExpressGateway'); - $this->assertSame('PayPal_Express', $shortName); - } - - public function testGetGatewayShortNameUnderscoreLeadingSlash() - { - $shortName = Helper::getGatewayShortName('\\Omnipay\\PayPal\\ExpressGateway'); - $this->assertSame('PayPal_Express', $shortName); - } - - public function testGetGatewayShortNameCustomGateway() - { - $shortName = Helper::getGatewayShortName('\\Custom\\Gateway'); - $this->assertSame('\\Custom\\Gateway', $shortName); - } - - /** - * Type with namespace should simply be returned as is - */ - public function testGetGatewayClassNameExistingNamespace() - { - $class = Helper::getGatewayClassName('\\Custom\\Gateway'); - $this->assertEquals('\\Custom\\Gateway', $class); - } - - /** - * Type with namespace marker should be left intact, even if it contains an underscore - */ - public function testGetGatewayClassNameExistingNamespaceUnderscore() - { - $class = Helper::getGatewayClassName('\\Custom_Gateway'); - $this->assertEquals('\\Custom_Gateway', $class); - } - - public function testGetGatewayClassNameSimple() - { - $class = Helper::getGatewayClassName('Stripe'); - $this->assertEquals('\\Omnipay\\Stripe\\Gateway', $class); - } - - public function testGetGatewayClassNamePartialNamespace() - { - $class = Helper::getGatewayClassName('PayPal\\Express'); - $this->assertEquals('\\Omnipay\\PayPal\\ExpressGateway', $class); - } - - /** - * Underscored types should be resolved in a PSR-0 fashion - */ - public function testGetGatewayClassNameUnderscoreNamespace() - { - $class = Helper::getGatewayClassName('PayPal_Express'); - $this->assertEquals('\\Omnipay\\PayPal\\ExpressGateway', $class); - } -} diff --git a/tests/Omnipay/Common/Message/AbstractRequestTest.php b/tests/Omnipay/Common/Message/AbstractRequestTest.php deleted file mode 100644 index 018d39dc..00000000 --- a/tests/Omnipay/Common/Message/AbstractRequestTest.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -use Mockery as m; -use Omnipay\Common\CreditCard; -use Omnipay\TestCase; - -class AbstractRequestTest extends TestCase -{ - public function setUp() - { - $this->request = m::mock('\Omnipay\Common\Message\AbstractRequest[getData,send]'); - $this->request->initialize(); - } - - public function testInitializeWithParams() - { - $this->assertSame($this->request, $this->request->initialize(array('amount' => '1.23'))); - $this->assertSame('1.23', $this->request->getAmount()); - } - - public function testCard() - { - // no type checking on card parameter - $card = new CreditCard; - $this->assertSame($this->request, $this->request->setCard($card)); - $this->assertSame($card, $this->request->getCard()); - } - - public function testSetCardWithArray() - { - // passing array should create CreditCard object - $this->assertSame($this->request, $this->request->setCard(array('number' => '1234'))); - - $card = $this->request->getCard(); - $this->assertInstanceOf('\Omnipay\Common\CreditCard', $card); - $this->assertSame('1234', $card->getNumber()); - } - - public function testToken() - { - $this->assertSame($this->request, $this->request->setToken('12345')); - $this->assertSame('12345', $this->request->getToken()); - } - - public function testCardReference() - { - $this->assertSame($this->request, $this->request->setCardReference('12345')); - $this->assertSame('12345', $this->request->getCardReference()); - } - - public function testAmount() - { - $this->assertSame($this->request, $this->request->setAmount('2.00')); - $this->assertSame('2.00', $this->request->getAmount()); - } - - public function testAmountWithFloat() - { - $this->assertSame($this->request, $this->request->setAmount(2.0)); - $this->assertSame('2.00', $this->request->getAmount()); - } - - public function testAmountWithEmpty() - { - $this->assertSame($this->request, $this->request->setAmount(null)); - $this->assertSame(null, $this->request->getAmount()); - } - - public function testGetAmountNoDecimals() - { - $this->assertSame($this->request, $this->request->setCurrency('JPY')); - $this->assertSame($this->request, $this->request->setAmount('1366')); - $this->assertSame('1366', $this->request->getAmount()); - } - - public function testGetAmountNoDecimalsRounding() - { - $this->assertSame($this->request, $this->request->setAmount('136.5')); - $this->assertSame($this->request, $this->request->setCurrency('JPY')); - $this->assertSame('137', $this->request->getAmount()); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidRequestException - */ - public function testAmountWithIntThrowsException() - { - // ambiguous value, avoid errors upgrading from v0.9 - $this->assertSame($this->request, $this->request->setAmount(10)); - $this->request->getAmount(); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidRequestException - */ - public function testAmountWithIntStringThrowsException() - { - // ambiguous value, avoid errors upgrading from v0.9 - $this->assertSame($this->request, $this->request->setAmount('10')); - $this->request->getAmount(); - } - - public function testGetAmountInteger() - { - $this->assertSame($this->request, $this->request->setAmount('13.66')); - $this->assertSame(1366, $this->request->getAmountInteger()); - } - - public function testGetAmountIntegerNoDecimals() - { - $this->assertSame($this->request, $this->request->setCurrency('JPY')); - $this->assertSame($this->request, $this->request->setAmount('1366')); - $this->assertSame(1366, $this->request->getAmountInteger()); - } - - public function testCurrency() - { - $this->assertSame($this->request, $this->request->setCurrency('USD')); - $this->assertSame('USD', $this->request->getCurrency()); - } - - public function testCurrencyLowercase() - { - $this->assertSame($this->request, $this->request->setCurrency('usd')); - $this->assertSame('USD', $this->request->getCurrency()); - } - - public function testCurrencyNumeric() - { - $this->assertSame($this->request, $this->request->setCurrency('USD')); - $this->assertSame('840', $this->request->getCurrencyNumeric()); - } - - public function testCurrencyDecimals() - { - $this->assertSame($this->request, $this->request->setCurrency('JPY')); - $this->assertSame(0, $this->request->getCurrencyDecimalPlaces()); - } - - public function testDescription() - { - $this->assertSame($this->request, $this->request->setDescription('Cool product')); - $this->assertSame('Cool product', $this->request->getDescription()); - } - - public function testTransactionId() - { - $this->assertSame($this->request, $this->request->setTransactionId(87)); - $this->assertSame(87, $this->request->getTransactionId()); - } - - public function testTransactionReference() - { - $this->assertSame($this->request, $this->request->setTransactionReference('xyz')); - $this->assertSame('xyz', $this->request->getTransactionReference()); - } - - public function testClientIp() - { - $this->assertSame($this->request, $this->request->setClientIp('127.0.0.1')); - $this->assertSame('127.0.0.1', $this->request->getClientIp()); - } - - public function testReturnUrl() - { - $this->assertSame($this->request, $this->request->setReturnUrl('https://www.example.com/return')); - $this->assertSame('https://www.example.com/return', $this->request->getReturnUrl()); - } - - public function testCancelUrl() - { - $this->assertSame($this->request, $this->request->setCancelUrl('https://www.example.com/cancel')); - $this->assertSame('https://www.example.com/cancel', $this->request->getCancelUrl()); - } - - public function testNotifyUrl() - { - $this->assertSame($this->request, $this->request->setNotifyUrl('https://www.example.com/notify')); - $this->assertSame('https://www.example.com/notify', $this->request->getNotifyUrl()); - } -} diff --git a/tests/Omnipay/Common/Message/AbstractResponseTest.php b/tests/Omnipay/Common/Message/AbstractResponseTest.php deleted file mode 100644 index f8f4e35b..00000000 --- a/tests/Omnipay/Common/Message/AbstractResponseTest.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Common\Message; - -use Mockery as m; -use Omnipay\TestCase; - -class AbstractResponseTest extends TestCase -{ - public function testDefaultMethods() - { - $response = m::mock('\Omnipay\Common\Message\AbstractResponse[isSuccessful]'); - - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getData()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/Dummy/GatewayTest.php b/tests/Omnipay/Dummy/GatewayTest.php deleted file mode 100644 index ab51c797..00000000 --- a/tests/Omnipay/Dummy/GatewayTest.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Dummy; - -use Omnipay\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()); - } -} diff --git a/tests/Omnipay/Dummy/Message/AuthorizeRequestTest.php b/tests/Omnipay/Dummy/Message/AuthorizeRequestTest.php deleted file mode 100644 index b21dd120..00000000 --- a/tests/Omnipay/Dummy/Message/AuthorizeRequestTest.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Dummy\Message; - -use Omnipay\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']); - } -} diff --git a/tests/Omnipay/Dummy/Message/ResponseTest.php b/tests/Omnipay/Dummy/Message/ResponseTest.php deleted file mode 100644 index 93fdaf75..00000000 --- a/tests/Omnipay/Dummy/Message/ResponseTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Dummy\Message; - -use Omnipay\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()); - } -} diff --git a/tests/Omnipay/Eway/Message/RapidCompletePurchaseRequestTest.php b/tests/Omnipay/Eway/Message/RapidCompletePurchaseRequestTest.php deleted file mode 100644 index 468f17e4..00000000 --- a/tests/Omnipay/Eway/Message/RapidCompletePurchaseRequestTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Eway\Message; - -use Omnipay\TestCase; - -class RapidCompletePurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new RapidCompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'apiKey' => 'my api key', - 'password' => 'secret', - )); - $this->getHttpRequest()->query->replace(array( - 'AccessCode' => 'F9802j0-O7sdVLnOcb_3IPryTxHDtKY8u_0pb10GbYq-Xjvbc-5Bc_LhI-oBIrTxTCjhOFn7Mq-CwpkLDja5-iu-Dr3DjVTr9u4yxSB5BckdbJqSA4WWydzDO0jnPWfBdKcWL', - )); - } - - public function testGetData() - { - $data = $this->request->getData(); - - $this->assertSame('F9802j0-O7sdVLnOcb_3IPryTxHDtKY8u_0pb10GbYq-Xjvbc-5Bc_LhI-oBIrTxTCjhOFn7Mq-CwpkLDja5-iu-Dr3DjVTr9u4yxSB5BckdbJqSA4WWydzDO0jnPWfBdKcWL', $data['AccessCode']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('RapidCompletePurchaseRequestSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getRedirectUrl()); - $this->assertNull($response->getRedirectData()); - $this->assertSame('10204029', $response->getTransactionReference()); - $this->assertSame('A2000', $response->getMessage()); - $this->assertSame('A2000', $response->getCode()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('RapidCompletePurchaseRequestFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getRedirectUrl()); - $this->assertNull($response->getRedirectData()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('V6021', $response->getMessage()); - $this->assertSame('V6021', $response->getCode()); - } -} diff --git a/tests/Omnipay/Eway/Message/RapidPurchaseRequestTest.php b/tests/Omnipay/Eway/Message/RapidPurchaseRequestTest.php deleted file mode 100644 index 31a3b8c9..00000000 --- a/tests/Omnipay/Eway/Message/RapidPurchaseRequestTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Eway\Message; - -use Omnipay\TestCase; - -class RapidPurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new RapidPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'apiKey' => 'my api key', - 'password' => 'secret', - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - )); - } - - public function testGetData() - { - $this->request->initialize(array( - 'apiKey' => 'my api key', - 'password' => 'secret', - 'amount' => '10.00', - 'transactionId' => '999', - 'description' => 'new car', - 'currency' => 'AUD', - 'clientIp' => '127.0.0.1', - 'returnUrl' => 'https://www.example.com/return', - 'card' => array( - 'firstName' => 'Patrick', - 'lastName' => 'Collison', - ), - )); - - $data = $this->request->getData(); - - $this->assertSame('127.0.0.1', $data['CustomerIP']); - $this->assertSame('https://www.example.com/return', $data['RedirectUrl']); - $this->assertSame(1000, $data['Payment']['TotalAmount']); - $this->assertSame('999', $data['Payment']['InvoiceNumber']); - $this->assertSame('new car', $data['Payment']['InvoiceDescription']); - $this->assertSame('AUD', $data['Payment']['CurrencyCode']); - $this->assertSame('Patrick', $data['Customer']['FirstName']); - $this->assertSame('Collison', $data['Customer']['LastName']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('RapidPurchaseRequestSuccess.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertSame('POST', $response->getRedirectMethod()); - $this->assertSame('https://secure-au.sandbox.ewaypayments.com/Process', $response->getRedirectUrl()); - $this->assertSame(array('EWAY_ACCESSCODE' => 'F9802j0-O7sdVLnOcb_3IPryTxHDtKY8u_0pb10GbYq-Xjvbc-5Bc_LhI-oBIrTxTCjhOFn7Mq-CwpkLDja5-iu-Dr3DjVTr9u4yxSB5BckdbJqSA4WWydzDO0jnPWfBdKcWL'), $response->getRedirectData()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertNull($response->getCode()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('RapidPurchaseRequestFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getRedirectUrl()); - $this->assertNull($response->getRedirectData()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('V6011', $response->getMessage()); - $this->assertSame('V6011', $response->getCode()); - } -} diff --git a/tests/Omnipay/Eway/Mock/RapidCompletePurchaseRequestFailure.txt b/tests/Omnipay/Eway/Mock/RapidCompletePurchaseRequestFailure.txt deleted file mode 100644 index f98cd486..00000000 --- a/tests/Omnipay/Eway/Mock/RapidCompletePurchaseRequestFailure.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTTP/1.1 200 OK -Cache-control: no-cache="set-cookie" -Content-Type: application/json; charset=utf-8 -Date: Sat, 29 Jun 2013 03:25:35 GMT -Set-Cookie: AWSELB=8361C96B088FEBBC7D3ABDFE8BA0FF6501B9705E7D00F53B19AA8D0E66C1AD34691F2170CB4C6B4D750DDAD028ED5C0787DEB1569F57CC58B5923AA0229EC5B49BD7647A57;PATH=/;MAX-AGE=86400 -X-EWAY-VIA: api-au.sandbox.ewaypayments.com/ -X-EWAY-VIA-FROM: http://api.sandbox.ewaypayments.com/GetAccessCodeResult.json -X-EWAY-VIA-HTTP-METHOD: POST -X-EWAY-VIA-HTTP-STATUS: 200 -X-EWAY-VIA-TO: http://api-au.sandbox.ewaypayments.com/GetAccessCodeResult.json -X-ID: AM-143 -X-Powered-By: eWAY -Content-Length: 469 -Connection: keep-alive - -{"AccessCode":"C3AB91ZFisYBgiWFSAtXjrzc4mVCqWvYCgCOAWp4NvAOwwZjPB4S5xyzdjewRwK09AI_DHwiKMbeAxT2WUIZunZSXt4AybHtI2k-A0SmHoS2JIEYKLGtAZeaFz_0HOWDJQuR4","AuthorisationCode":null,"ResponseCode":"06","ResponseMessage":"V6021","InvoiceNumber":"277","InvoiceReference":"","TotalAmount":46518,"TransactionID":null,"TransactionStatus":false,"TokenCustomerID":null,"BeagleScore":null,"Options":[],"Verification":{"CVN":0,"Address":0,"Email":0,"Mobile":0,"Phone":0},"Errors":null} diff --git a/tests/Omnipay/Eway/Mock/RapidCompletePurchaseRequestSuccess.txt b/tests/Omnipay/Eway/Mock/RapidCompletePurchaseRequestSuccess.txt deleted file mode 100644 index 5993ee50..00000000 --- a/tests/Omnipay/Eway/Mock/RapidCompletePurchaseRequestSuccess.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTTP/1.1 200 OK -Cache-control: no-cache="set-cookie" -Content-Type: application/json; charset=utf-8 -Date: Sat, 29 Jun 2013 04:30:54 GMT -Set-Cookie: AWSELB=8361C96B088FEBBC7D3ABDFE8BA0FF6501B9705E7D00F53B19AA8D0E66C1AD34691F2170CB4C6B4D750DDAD028ED5C0787DEB1569F57CC58B5923AA0229EC5B49BD7647A57;PATH=/;MAX-AGE=86400 -X-EWAY-VIA: api-au.sandbox.ewaypayments.com/ -X-EWAY-VIA-FROM: http://api.sandbox.ewaypayments.com/GetAccessCodeResult.json -X-EWAY-VIA-HTTP-METHOD: POST -X-EWAY-VIA-HTTP-STATUS: 200 -X-EWAY-VIA-TO: http://api-au.sandbox.ewaypayments.com/GetAccessCodeResult.json -X-ID: AM-143 -X-Powered-By: eWAY -Content-Length: 473 -Connection: keep-alive - -{"AccessCode":"44DD7Pm0cBWzDpMAlx2uFhzCQoYSMrcnJSXMlgVPkhTbyz1ovxEUEV_se-U2S0njrthN2Zwg0un6PVhNiAyELDPN_JvozBEh8ceZIQEumHBJqsSFljN8JAo_4N5j3Qqr1Wd60","AuthorisationCode":"397712","ResponseCode":"00","ResponseMessage":"A2000","InvoiceNumber":"295","InvoiceReference":"","TotalAmount":35500,"TransactionID":10204029,"TransactionStatus":true,"TokenCustomerID":null,"BeagleScore":0,"Options":[],"Verification":{"CVN":0,"Address":0,"Email":0,"Mobile":0,"Phone":0},"Errors":null} diff --git a/tests/Omnipay/Eway/Mock/RapidPurchaseRequestFailure.txt b/tests/Omnipay/Eway/Mock/RapidPurchaseRequestFailure.txt deleted file mode 100644 index 76d0f35e..00000000 --- a/tests/Omnipay/Eway/Mock/RapidPurchaseRequestFailure.txt +++ /dev/null @@ -1,17 +0,0 @@ -HTTP/1.1 200 OK -Cache-control: no-cache="set-cookie" -Content-Type: application/json; charset=utf-8 -Date: Thu, 27 Jun 2013 05:22:52 GMT -Set-Cookie: AWSELB=8361C96B088FEBBC7D3ABDFE8BA0FF6501B9705E7D00F53B19AA8D0E66C1AD34691F2170CBA3CC4FEE8666E2FB3C85D3B0E238FA2E93B31AAC1C98DFF4D0639139359FE706;PATH=/;MAX-AGE=86400 -X-EWAY-VIA: api-au.sandbox.ewaypayments.com/ -X-EWAY-VIA-FROM: http://api.sandbox.ewaypayments.com/CreateAccessCode.json -X-EWAY-VIA-HTTP-METHOD: POST -X-EWAY-VIA-HTTP-STATUS: 200 -X-EWAY-VIA-TO: http://api-au.sandbox.ewaypayments.com/CreateAccessCode.json -X-ID: AM-131 -X-Powered-By: eWAY -X-Staging: AU -Content-Length: 649 -Connection: keep-alive - -{"AccessCode":null,"Customer":{"TokenCustomerID":null,"Reference":null,"Title":null,"FirstName":null,"LastName":null,"CompanyName":null,"JobDescription":null,"Street1":null,"Street2":null,"City":null,"State":null,"PostalCode":null,"Country":null,"Email":null,"Phone":null,"Mobile":null,"Comments":null,"Fax":null,"Url":null,"CardNumber":null,"CardStartMonth":null,"CardStartYear":null,"CardIssueNumber":null,"CardName":null,"CardExpiryMonth":null,"CardExpiryYear":null,"IsActive":false},"Payment":{"TotalAmount":-1000,"InvoiceNumber":null,"InvoiceDescription":null,"InvoiceReference":null,"CurrencyCode":"AUD"},"FormActionURL":null,"Errors":"V6011"} diff --git a/tests/Omnipay/Eway/Mock/RapidPurchaseRequestSuccess.txt b/tests/Omnipay/Eway/Mock/RapidPurchaseRequestSuccess.txt deleted file mode 100644 index 8d706006..00000000 --- a/tests/Omnipay/Eway/Mock/RapidPurchaseRequestSuccess.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTTP/1.1 200 OK -Cache-control: no-cache="set-cookie" -Content-Type: application/json; charset=utf-8 -Date: Wed, 26 Jun 2013 13:11:50 GMT -Set-Cookie: AWSELB=8361C96B088FEBBC7D3ABDFE8BA0FF6501B9705E7D00F53B19AA8D0E66C1AD34691F2170CB4C6B4D750DDAD028ED5C0787DEB1569F57CC58B5923AA0229EC5B49BD7647A57;PATH=/;MAX-AGE=86400 -X-EWAY-VIA: api-au.sandbox.ewaypayments.com/ -X-EWAY-VIA-FROM: http://api.sandbox.ewaypayments.com/CreateAccessCode.json -X-EWAY-VIA-HTTP-METHOD: POST -X-EWAY-VIA-HTTP-STATUS: 200 -X-EWAY-VIA-TO: http://api-au.sandbox.ewaypayments.com/CreateAccessCode.json -X-ID: AM-143 -X-Powered-By: eWAY -Content-Length: 774 -Connection: keep-alive - -{"AccessCode":"F9802j0-O7sdVLnOcb_3IPryTxHDtKY8u_0pb10GbYq-Xjvbc-5Bc_LhI-oBIrTxTCjhOFn7Mq-CwpkLDja5-iu-Dr3DjVTr9u4yxSB5BckdbJqSA4WWydzDO0jnPWfBdKcWL","Customer":{"TokenCustomerID":null,"Reference":"","Title":"","FirstName":"","LastName":"","CompanyName":"","JobDescription":"","Street1":"","Street2":"","City":"","State":"","PostalCode":"","Country":"","Email":"","Phone":"","Mobile":"","Comments":"","Fax":"","Url":"","CardNumber":"","CardStartMonth":"","CardStartYear":"","CardIssueNumber":"","CardName":"","CardExpiryMonth":"","CardExpiryYear":"","IsActive":false},"Payment":{"TotalAmount":1000,"InvoiceNumber":null,"InvoiceDescription":null,"InvoiceReference":null,"CurrencyCode":"AUD"},"FormActionURL":"https://secure-au.sandbox.ewaypayments.com/Process","Errors":null} diff --git a/tests/Omnipay/Eway/RapidGatewayTest.php b/tests/Omnipay/Eway/RapidGatewayTest.php deleted file mode 100644 index 5381127e..00000000 --- a/tests/Omnipay/Eway/RapidGatewayTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Eway; - -use Omnipay\GatewayTestCase; - -class RapidGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new RapidGateway($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testPurchase() - { - $request = $this->gateway->purchase(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Eway\Message\RapidPurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testPurchaseReturn() - { - $request = $this->gateway->completePurchase(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Eway\Message\RapidCompletePurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } -} diff --git a/tests/Omnipay/GatewayTestCase.php b/tests/Omnipay/GatewayTestCase.php deleted file mode 100644 index 377b3f78..00000000 --- a/tests/Omnipay/GatewayTestCase.php +++ /dev/null @@ -1,355 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay; - -/** - * Base Gateway Test class - * - * Ensures all gateways conform to consistent standards - */ -abstract class GatewayTestCase extends TestCase -{ - public function testGetNameNotEmpty() - { - $name = $this->gateway->getName(); - $this->assertNotEmpty($name); - $this->assertInternalType('string', $name); - } - - public function testGetShortNameNotEmpty() - { - $shortName = $this->gateway->getShortName(); - $this->assertNotEmpty($shortName); - $this->assertInternalType('string', $shortName); - } - - public function testGetDefaultParametersReturnsArray() - { - $settings = $this->gateway->getDefaultParameters(); - $this->assertInternalType('array', $settings); - } - - public function testDefaultParametersHaveMatchingMethods() - { - $settings = $this->gateway->getDefaultParameters(); - foreach ($settings as $key => $default) { - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - - $this->assertTrue(method_exists($this->gateway, $getter), "Gateway must implement $getter()"); - $this->assertTrue(method_exists($this->gateway, $setter), "Gateway must implement $setter()"); - - // setter must return instance - $this->assertSame($this->gateway, $this->gateway->$setter($value)); - $this->assertSame($value, $this->gateway->$getter()); - } - } - - public function testTestMode() - { - $this->assertSame($this->gateway, $this->gateway->setTestMode(false)); - $this->assertSame(false, $this->gateway->getTestMode()); - - $this->assertSame($this->gateway, $this->gateway->setTestMode(true)); - $this->assertSame(true, $this->gateway->getTestMode()); - } - - public function testCurrency() - { - // currency is normalized to uppercase - $this->assertSame($this->gateway, $this->gateway->setCurrency('eur')); - $this->assertSame('EUR', $this->gateway->getCurrency()); - } - - public function testPurchase() - { - // all gateways must implement purchase - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->purchase()); - } - - public function testSupportsAuthorize() - { - $supportsAuthorize = $this->gateway->supportsAuthorize(); - $this->assertInternalType('boolean', $supportsAuthorize); - - if ($supportsAuthorize) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->authorize()); - } else { - $this->assertFalse(method_exists($this->gateway, 'authorize')); - } - } - - public function testSupportsCompleteAuthorize() - { - $supportsCompleteAuthorize = $this->gateway->supportsCompleteAuthorize(); - $this->assertInternalType('boolean', $supportsCompleteAuthorize); - - if ($supportsCompleteAuthorize) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->completeAuthorize()); - } else { - $this->assertFalse(method_exists($this->gateway, 'completeAuthorize')); - } - } - - public function testSupportsCapture() - { - $supportsCapture = $this->gateway->supportsCapture(); - $this->assertInternalType('boolean', $supportsCapture); - - if ($supportsCapture) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->capture()); - } else { - $this->assertFalse(method_exists($this->gateway, 'capture')); - } - } - - public function testSupportsCompletePurchase() - { - $supportsCompletePurchase = $this->gateway->supportsCompletePurchase(); - $this->assertInternalType('boolean', $supportsCompletePurchase); - - if ($supportsCompletePurchase) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->completePurchase()); - } else { - $this->assertFalse(method_exists($this->gateway, 'completePurchase')); - } - } - - public function testSupportsRefund() - { - $supportsRefund = $this->gateway->supportsRefund(); - $this->assertInternalType('boolean', $supportsRefund); - - if ($supportsRefund) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->refund()); - } else { - $this->assertFalse(method_exists($this->gateway, 'refund')); - } - } - - public function testSupportsVoid() - { - $supportsVoid = $this->gateway->supportsVoid(); - $this->assertInternalType('boolean', $supportsVoid); - - if ($supportsVoid) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->void()); - } else { - $this->assertFalse(method_exists($this->gateway, 'void')); - } - } - - public function testSupportsCreateCard() - { - $supportsCreate = $this->gateway->supportsCreateCard(); - $this->assertInternalType('boolean', $supportsCreate); - - if ($supportsCreate) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->createCard()); - } else { - $this->assertFalse(method_exists($this->gateway, 'createCard')); - } - } - - public function testSupportsDeleteCard() - { - $supportsDelete = $this->gateway->supportsDeleteCard(); - $this->assertInternalType('boolean', $supportsDelete); - - if ($supportsDelete) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->deleteCard()); - } else { - $this->assertFalse(method_exists($this->gateway, 'deleteCard')); - } - } - - public function testSupportsUpdateCard() - { - $supportsUpdate = $this->gateway->supportsUpdateCard(); - $this->assertInternalType('boolean', $supportsUpdate); - - if ($supportsUpdate) { - $this->assertInstanceOf('Omnipay\Common\Message\RequestInterface', $this->gateway->updateCard()); - } else { - $this->assertFalse(method_exists($this->gateway, 'updateCard')); - } - } - - public function testAuthorizeParameters() - { - if ($this->gateway->supportsAuthorize()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->authorize(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testCompleteAuthorizeParameters() - { - if ($this->gateway->supportsCompleteAuthorize()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->completeAuthorize(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testCaptureParameters() - { - if ($this->gateway->supportsCapture()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->capture(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testPurchaseParameters() - { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->purchase(); - $this->assertSame($value, $request->$getter()); - } - } - - public function testCompletePurchaseParameters() - { - if ($this->gateway->supportsCompletePurchase()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->completePurchase(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testRefundParameters() - { - if ($this->gateway->supportsRefund()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->refund(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testVoidParameters() - { - if ($this->gateway->supportsVoid()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->void(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testCreateCardParameters() - { - if ($this->gateway->supportsCreateCard()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->createCard(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testDeleteCardParameters() - { - if ($this->gateway->supportsDeleteCard()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->deleteCard(); - $this->assertSame($value, $request->$getter()); - } - } - } - - public function testUpdateCardParameters() - { - if ($this->gateway->supportsUpdateCard()) { - foreach ($this->gateway->getDefaultParameters() as $key => $default) { - // set property on gateway - $getter = 'get'.ucfirst($key); - $setter = 'set'.ucfirst($key); - $value = uniqid(); - $this->gateway->$setter($value); - - // request should have matching property, with correct value - $request = $this->gateway->updateCard(); - $this->assertSame($value, $request->$getter()); - } - } - } -} diff --git a/tests/Omnipay/GoCardless/GatewayTest.php b/tests/Omnipay/GoCardless/GatewayTest.php deleted file mode 100644 index 486ad114..00000000 --- a/tests/Omnipay/GoCardless/GatewayTest.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setAppId('abc'); - $this->gateway->setAppSecret('123'); - - $this->options = array( - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - ); - } - - public function testPurchase() - { - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\GoCardless\Message\PurchaseResponse', $response); - $this->assertTrue($response->isRedirect()); - $this->assertStringStartsWith('https://gocardless.com/connect/bills/new?', $response->getRedirectUrl()); - } - - public function testCompletePurchaseSuccess() - { - $this->getHttpRequest()->request->replace( - array( - 'resource_uri' => 'a', - 'resource_id' => 'b', - 'resource_type' => 'c', - 'signature' => '416f52e7d287dab49fa8445c1cd0957ca8ddf1c04a6300e00117dc0bedabc7d7', - ) - ); - - $this->setMockHttpResponse('CompletePurchaseSuccess.txt'); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('b', $response->getTransactionReference()); - } - - public function testCompletePurchaseError() - { - $this->getHttpRequest()->request->replace( - array( - 'resource_uri' => 'a', - 'resource_id' => 'b', - 'resource_type' => 'c', - 'signature' => '416f52e7d287dab49fa8445c1cd0957ca8ddf1c04a6300e00117dc0bedabc7d7', - ) - ); - - $this->setMockHttpResponse('CompletePurchaseFailure.txt'); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('The resource cannot be confirmed', $response->getMessage()); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testCompletePurchaseInvalid() - { - $this->getHttpRequest()->request->replace( - array( - 'resource_uri' => 'a', - 'resource_id' => 'b', - 'resource_type' => 'c', - 'signature' => 'd', - ) - ); - - $response = $this->gateway->completePurchase($this->options)->send(); - } -} diff --git a/tests/Omnipay/GoCardless/Message/CompletePurchaseResponseTest.php b/tests/Omnipay/GoCardless/Message/CompletePurchaseResponseTest.php deleted file mode 100644 index 46a53ea3..00000000 --- a/tests/Omnipay/GoCardless/Message/CompletePurchaseResponseTest.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\GoCardless\Message; - -use Omnipay\TestCase; - -class CompletePurchaseResponseTest extends TestCase -{ - public function testCompletePurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('CompletePurchaseSuccess.txt'); - $response = new CompletePurchaseResponse($this->getMockRequest(), $httpResponse->json(), 'abc123'); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('abc123', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testCompletePurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('CompletePurchaseFailure.txt'); - $response = new CompletePurchaseResponse($this->getMockRequest(), $httpResponse->json(), 'abc123'); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('abc123', $response->getTransactionReference()); - $this->assertSame('The resource cannot be confirmed', $response->getMessage()); - } -} diff --git a/tests/Omnipay/GoCardless/Mock/CompletePurchaseFailure.txt b/tests/Omnipay/GoCardless/Mock/CompletePurchaseFailure.txt deleted file mode 100644 index 6213f971..00000000 --- a/tests/Omnipay/GoCardless/Mock/CompletePurchaseFailure.txt +++ /dev/null @@ -1,3 +0,0 @@ -HTTP/1.1 200 OK - -{"error":["The resource cannot be confirmed"]} \ No newline at end of file diff --git a/tests/Omnipay/GoCardless/Mock/CompletePurchaseSuccess.txt b/tests/Omnipay/GoCardless/Mock/CompletePurchaseSuccess.txt deleted file mode 100644 index 4c97d0c7..00000000 --- a/tests/Omnipay/GoCardless/Mock/CompletePurchaseSuccess.txt +++ /dev/null @@ -1,3 +0,0 @@ -HTTP/1.1 200 OK - -{"success":true} \ No newline at end of file diff --git a/tests/Omnipay/Manual/GatewayTest.php b/tests/Omnipay/Manual/GatewayTest.php deleted file mode 100644 index 9cec6989..00000000 --- a/tests/Omnipay/Manual/GatewayTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Manual; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => 1000 - ); - } - - public function testAuthorize() - { - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\Manual\Message\Response', $response); - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testCapture() - { - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\Manual\Message\Response', $response); - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testPurchase() - { - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\Manual\Message\Response', $response); - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/Migs/Message/ThreePartyCompletePurchaseRequestTest.php b/tests/Omnipay/Migs/Message/ThreePartyCompletePurchaseRequestTest.php deleted file mode 100644 index bb962c90..00000000 --- a/tests/Omnipay/Migs/Message/ThreePartyCompletePurchaseRequestTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\TestCase; - -class ThreePartyCompletePurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new ThreePartyCompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testThreePartyCompletePurchaseSuccess() - { - $data = array(); - - $data['vpc_Message'] = "Approved"; - $data['vpc_ReceiptNo'] = "12345"; - $data['vpc_TxnResponseCode'] = "0"; - $data['vpc_SecureHash'] = "8720B88CA00352B2A5F4D51C64E86BCB"; - - $response = new Response($this->getMockRequest(), $data); - - $this->assertInstanceOf('Omnipay\Migs\Message\Response', $response); - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('12345', $response->getTransactionReference()); - $this->assertSame('Approved', $response->getMessage()); - $this->assertNull($response->getCode()); - } - - public function testThreePartyCompletePurchaseFailure() - { - $data = array(); - - $data['vpc_Message'] = "Error"; - $data['vpc_ReceiptNo'] = "12345"; - $data['vpc_TxnResponseCode'] = "1"; - $data['vpc_SecureHash'] = "8720B88CA00352B2A5F4D51C64E86BCB"; - - $response = new Response($this->getMockRequest(), $data); - - $this->assertInstanceOf('Omnipay\Migs\Message\Response', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('12345', $response->getTransactionReference()); - $this->assertNotSame('Approved', $response->getMessage()); - $this->assertNull($response->getCode()); - } -} diff --git a/tests/Omnipay/Migs/Message/ThreePartyPurchaseRequestTest.php b/tests/Omnipay/Migs/Message/ThreePartyPurchaseRequestTest.php deleted file mode 100644 index 7ec8f296..00000000 --- a/tests/Omnipay/Migs/Message/ThreePartyPurchaseRequestTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\TestCase; - -class ThreePartyPurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new ThreePartyPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testSignature() - { - $this->request->initialize( - array( - 'amount' => '12.00', - 'transactionId' => 123, - 'returnUrl' => 'https://www.example.com/return', - - 'merchantId' => '123', - 'merchantAccessCode' => '123', - 'secureHash' => '123', - ) - ); - - $data = $this->request->getData(); - - $this->assertSame('FC86354CC09D414EF308A6FA8CE4F9BB', $data['vpc_SecureHash']); - } - - public function testPurchase() - { - $this->request->initialize( - array( - 'amount' => '12.00', - 'transactionId' => 123, - 'returnUrl' => 'https://www.example.com/return', - - 'merchantId' => '123', - 'merchantAccessCode' => '123', - 'secureHash' => '123', - ) - ); - - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\Migs\Message\ThreePartyPurchaseResponse', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertNull($response->getCode()); - - $this->assertStringStartsWith('https://migs.mastercard.com.au/vpcpay?', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - $this->assertArrayHasKey('vpc_SecureHash', $response->getData()); - } -} diff --git a/tests/Omnipay/Migs/Message/ThreePartyPurchaseResponseTest.php b/tests/Omnipay/Migs/Message/ThreePartyPurchaseResponseTest.php deleted file mode 100644 index 29e95984..00000000 --- a/tests/Omnipay/Migs/Message/ThreePartyPurchaseResponseTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\TestCase; - -class ThreePartyPurchaseResponseTest extends TestCase -{ - public function testConstruct() - { - $data = array('test' => '123'); - - $response = new ThreePartyPurchaseResponse($this->getMockRequest(), $data, 'https://example.com/'); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame($data, $response->getData()); - - $this->assertSame('https://example.com/', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - $this->assertSame($data, $response->getRedirectData()); - } -} diff --git a/tests/Omnipay/Migs/Message/TwoPartyPurchaseRequestTest.php b/tests/Omnipay/Migs/Message/TwoPartyPurchaseRequestTest.php deleted file mode 100644 index 3cee8c97..00000000 --- a/tests/Omnipay/Migs/Message/TwoPartyPurchaseRequestTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\TestCase; - -class TwoPartyPurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new TwoPartyPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testCalculateHash() - { - $data = array( - 'vpc_Merchant' => '123', - 'vpc_AccessCode' => '123', - 'vpc_Version' => '1', - 'vpc_Locale' => 'en', - 'vpc_Command' => 'pay', - 'vpc_Amount' => '1200', - 'vpc_MerchTxnRef' => '123', - 'vpc_OrderInfo' => '', - 'vpc_ReturnURL' => 'https://www.example.com/return', - 'vpc_CardNum' => '4111111111111111', - 'vpc_CardExp' => '1305', - 'vpc_CardSecurityCode' => '123', - ); - - $this->request->setSecureHash('123'); - $hash = $this->request->calculateHash($data); - - $this->assertSame('2624B4BABED7CCA98665238D75560600', $hash); - } - - public function testPurchase() - { - $this->setMockHttpResponse('TwoPartyPurchaseSuccess.txt'); - - $this->request->initialize( - array( - 'amount' => '12.00', - 'transactionId' => 123, - 'card' => $this->getValidCard(), - 'merchantId' => '123', - 'merchantAccessCode' => '123', - 'secureHash' => '123', - 'returnUrl' => 'https://www.example.com/return' - ) - ); - - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\Migs\Message\Response', $response); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertEquals('12345', $response->getTransactionReference()); - $this->assertSame('Approved', $response->getMessage()); - $this->assertNull($response->getCode()); - $this->assertArrayHasKey('vpc_SecureHash', $response->getData()); - } -} diff --git a/tests/Omnipay/Migs/Message/TwoPartyPurchaseResponseTest.php b/tests/Omnipay/Migs/Message/TwoPartyPurchaseResponseTest.php deleted file mode 100644 index ce109d32..00000000 --- a/tests/Omnipay/Migs/Message/TwoPartyPurchaseResponseTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs\Message; - -use Omnipay\TestCase; - -class TwoPartyPurchaseResponseTest extends TestCase -{ - public function testTwoPartyPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('TwoPartyPurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertInstanceOf('Omnipay\Migs\Message\Response', $response); - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('12345', $response->getTransactionReference()); - $this->assertSame('Approved', $response->getMessage()); - $this->assertNull($response->getCode()); - } - - public function testTwoPartyPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('TwoPartyPurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertInstanceOf('Omnipay\Migs\Message\Response', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('12345', $response->getTransactionReference()); - $this->assertSame('Declined', $response->getMessage()); - $this->assertNull($response->getCode()); - } -} diff --git a/tests/Omnipay/Migs/Mock/TwoPartyPurchaseFailure.txt b/tests/Omnipay/Migs/Mock/TwoPartyPurchaseFailure.txt deleted file mode 100644 index bcfe036d..00000000 --- a/tests/Omnipay/Migs/Mock/TwoPartyPurchaseFailure.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Date: Fri, 05 Apr 2013 13:11:19 GMT -Server: Apache -Expires: Sun, 15 Jul 1990 00:00:00 GMT -Pragma: no-cache -Cache-Control: no-cache -Content-Length: 469 -P3P: CP="NOI DSP COR CURa ADMa TA1a OUR BUS IND UNI COM NAV INT" -Content-Type: text/plain;charset=iso-8859-1 - -vpc_AVSRequestCode=Z&vpc_AVSResultCode=Unsupported&vpc_AcqAVSRespCode=Unsupported&vpc_AcqCSCRespCode=Unsupported&vpc_AcqResponseCode=14&vpc_Amount=1000&vpc_BatchNo=12345&vpc_CSCResultCode=Unsupported&vpc_Card=VC&vpc_Command=pay&vpc_Locale=en&vpc_MerchTxnRef=123&vpc_Merchant=EXAMPLE&vpc_Message=Declined&vpc_OrderInfo=&vpc_ReceiptNo=12345&vpc_SecureHash=71B4E0DE9EACB5FC27C902379737D458&vpc_TransactionNo=12345&vpc_TxnResponseCode=2&vpc_Version=1 \ No newline at end of file diff --git a/tests/Omnipay/Migs/Mock/TwoPartyPurchaseSuccess.txt b/tests/Omnipay/Migs/Mock/TwoPartyPurchaseSuccess.txt deleted file mode 100644 index cec21cea..00000000 --- a/tests/Omnipay/Migs/Mock/TwoPartyPurchaseSuccess.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTTP/1.1 200 OK -Date: Fri, 05 Apr 2013 12:29:13 GMT -Server: Apache -Expires: Sun, 15 Jul 1990 00:00:00 GMT -Pragma: no-cache -Cache-Control: no-cache -Content-Length: 492 -P3P: CP="NOI DSP COR CURa ADMa TA1a OUR BUS IND UNI COM NAV INT" -Content-Type: text/plain;charset=iso-8859-1 - -vpc_AVSRequestCode=Z&vpc_AVSResultCode=Unsupported&vpc_AcqAVSRespCode=Unsupported&vpc_AcqCSCRespCode=Unsupported&vpc_AcqResponseCode=00&vpc_Amount=1000&vpc_AuthorizeId=12345&vpc_BatchNo=12345&vpc_CSCResultCode=Unsupported&vpc_Card=VC&vpc_Command=pay&vpc_Locale=en&vpc_MerchTxnRef=123&vpc_Merchant=EXAMPLE&vpc_Message=Approved&vpc_OrderInfo=&vpc_ReceiptNo=12345&vpc_SecureHash=58808781CF7265DEA89EA8B713FAB075&vpc_TransactionNo=12345&vpc_TxnResponseCode=0&vpc_Version=1 \ No newline at end of file diff --git a/tests/Omnipay/Migs/ThreePartyGatewayTest.php b/tests/Omnipay/Migs/ThreePartyGatewayTest.php deleted file mode 100644 index 26c6a18c..00000000 --- a/tests/Omnipay/Migs/ThreePartyGatewayTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs; - -use Omnipay\GatewayTestCase; - -class ThreePartyGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new ThreePartyGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => '10.00', - 'transactionId' => 12345, - 'returnUrl' => 'https://www.example.com/return', - ); - } - - public function testPurchase() - { - $request = $this->gateway->purchase(array('amount' => '10.00')); - - $this->assertInstanceOf('\Omnipay\Migs\Message\ThreePartyPurchaseRequest', $request); - - $this->assertSame('10.00', $request->getAmount()); - } - - public function testCompletePurchase() - { - $request = $this->gateway->completePurchase(array('amount' => '10.00')); - - $this->assertInstanceOf('\Omnipay\Migs\Message\ThreePartyCompletePurchaseRequest', $request); - - $this->assertSame('10.00', $request->getAmount()); - } -} diff --git a/tests/Omnipay/Migs/TwoPartyGatewayTest.php b/tests/Omnipay/Migs/TwoPartyGatewayTest.php deleted file mode 100644 index 9bdb1e67..00000000 --- a/tests/Omnipay/Migs/TwoPartyGatewayTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Migs; - -use Omnipay\GatewayTestCase; - -class TwoPartyGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new TwoPartyGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->gateway->setSecureHash(md5('example')); - - $this->options = array( - 'amount' => '10.00', - 'transactionId' => 12345, - 'card' => $this->getValidCard(), - ); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('TwoPartyPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\Migs\Message\Response', $response); - - $this->assertTrue($response->isSuccessful()); - - $this->assertEquals('12345', $response->getTransactionReference()); - - $this->assertSame('Approved', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('TwoPartyPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\Migs\Message\Response', $response); - - $this->assertFalse($response->isSuccessful()); - - $this->assertEquals('12345', $response->getTransactionReference()); - - $this->assertEquals('Declined', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Mollie/GatewayTest.php b/tests/Omnipay/Mollie/GatewayTest.php deleted file mode 100644 index 34bc1156..00000000 --- a/tests/Omnipay/Mollie/GatewayTest.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testFetchIssuers() - { - $request = $this->gateway->fetchIssuers(array('partnerId' => 'abc123')); - - $this->assertInstanceOf('Omnipay\Mollie\Message\FetchIssuersRequest', $request); - $this->assertSame('abc123', $request->getPartnerId()); - } - - public function testPurchase() - { - $request = $this->gateway->purchase(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Mollie\Message\PurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testPurchaseReturn() - { - $request = $this->gateway->completePurchase(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Mollie\Message\CompletePurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } -} diff --git a/tests/Omnipay/Mollie/Message/CompletePurchaseRequestTest.php b/tests/Omnipay/Mollie/Message/CompletePurchaseRequestTest.php deleted file mode 100644 index cf5090b5..00000000 --- a/tests/Omnipay/Mollie/Message/CompletePurchaseRequestTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -use Omnipay\TestCase; - -class CompletePurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new CompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'partnerId' => 'my partner id', - )); - } - - public function testGetData() - { - $this->getHttpRequest()->query->replace(array( - 'transaction_id' => 'abc123', - )); - - $data = $this->request->getData(); - - $this->assertSame('check', $data['a']); - $this->assertSame('my partner id', $data['partnerid']); - $this->assertSame('abc123', $data['transaction_id']); - } - - /* - * We need a Mollie test account to record some responses to completePurchase() - * and test CompletePurchaseRequest::send() - * Pull requests welcome! - */ -} diff --git a/tests/Omnipay/Mollie/Message/FetchIssuersRequestTest.php b/tests/Omnipay/Mollie/Message/FetchIssuersRequestTest.php deleted file mode 100644 index f9421f8f..00000000 --- a/tests/Omnipay/Mollie/Message/FetchIssuersRequestTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -use Omnipay\TestCase; - -class FetchIssuersRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new FetchIssuersRequest($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testGetData() - { - $data = $this->request->getData(); - - $this->assertSame('banklist', $data['a']); - } - - public function testTestMode() - { - $this->assertArrayNotHasKey('testmode', $this->request->getData()); - - $this->request->setTestMode(true); - $data = $this->request->getData(); - - $this->assertSame('true', $data['testmode']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('FetchIssuersSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('This is the current list of banks and their ID\'s that currently support iDEAL-payments', $response->getMessage()); - $this->assertNull($response->getCode()); - $this->assertSame(array('9999' => 'TBM Bank'), $response->getIssuers()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('FetchIssuersFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Did not receive a proper input value from you', $response->getMessage()); - $this->assertSame('-1', $response->getCode()); - $this->assertNull($response->getIssuers()); - } -} diff --git a/tests/Omnipay/Mollie/Message/PurchaseRequestTest.php b/tests/Omnipay/Mollie/Message/PurchaseRequestTest.php deleted file mode 100644 index 371d3457..00000000 --- a/tests/Omnipay/Mollie/Message/PurchaseRequestTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Mollie\Message; - -use Omnipay\TestCase; - -class PurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize( - array( - 'partnerId' => 'my partner id', - 'amount' => '12.00', - 'issuer' => 'my bank', - 'returnUrl' => 'https://www.example.com/return', - 'notifyUrl' => 'https://www.example.com/return', - ) - ); - } - - public function testGetData() - { - $this->request->initialize(array( - 'partnerId' => 'my partner id', - 'amount' => '12.00', - 'issuer' => 'my bank', - 'returnUrl' => 'https://www.example.com/return', - 'notifyUrl' => 'https://www.example.com/notify', - 'description' => 'a description', - 'testMode' => true, - )); - - $data = $this->request->getData(); - - $this->assertSame('fetch', $data['a']); - $this->assertSame('my partner id', $data['partnerid']); - $this->assertSame(1200, $data['amount']); - $this->assertSame('my bank', $data['bank_id']); - $this->assertSame('a description', $data['description']); - $this->assertSame('https://www.example.com/return', $data['returnurl']); - $this->assertSame('https://www.example.com/notify', $data['reporturl']); - $this->assertSame('true', $data['testmode']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertSame('GET', $response->getRedirectMethod()); - $this->assertSame('https://www.mollie.nl/partners/ideal-test-bank?order_nr=M0361705M1078X9J&transaction_id=2e6455e7c1999436ef7093219f016fc5&trxid=0036170512173671', $response->getRedirectUrl()); - $this->assertNull($response->getRedirectData()); - $this->assertSame('2e6455e7c1999436ef7093219f016fc5', $response->getTransactionReference()); - $this->assertSame('Your iDEAL-payment has successfully been setup. Your customer should visit the given URL to make the payment', $response->getMessage()); - $this->assertNull($response->getCode()); - } - - public function testSendError() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getRedirectUrl()); - $this->assertNull($response->getRedirectData()); - $this->assertSame("A fetch was issued without specification of 'partnerid'.", $response->getMessage()); - $this->assertSame('-2', $response->getCode()); - } -} diff --git a/tests/Omnipay/Mollie/Mock/FetchIssuersFailure.txt b/tests/Omnipay/Mollie/Mock/FetchIssuersFailure.txt deleted file mode 100644 index baa77368..00000000 --- a/tests/Omnipay/Mollie/Mock/FetchIssuersFailure.txt +++ /dev/null @@ -1,14 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx/1.4.1 -Date: Tue, 18 Jun 2013 11:09:43 GMT -Content-Type: text/xml -Content-Length: 207 -Connection: keep-alive -Vary: Accept-Encoding - - - - -1 - Did not receive a proper input value from you - - diff --git a/tests/Omnipay/Mollie/Mock/FetchIssuersSuccess.txt b/tests/Omnipay/Mollie/Mock/FetchIssuersSuccess.txt deleted file mode 100644 index b882b7bf..00000000 --- a/tests/Omnipay/Mollie/Mock/FetchIssuersSuccess.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx/1.4.1 -Date: Tue, 18 Jun 2013 10:55:16 GMT -Content-Type: text/xml -Content-Length: 228 -Connection: keep-alive -Vary: Accept-Encoding - - - - - 9999 - TBM Bank - -This is the current list of banks and their ID's that currently support iDEAL-payments - diff --git a/tests/Omnipay/Mollie/Mock/PurchaseFailure.txt b/tests/Omnipay/Mollie/Mock/PurchaseFailure.txt deleted file mode 100644 index 5b6beeb1..00000000 --- a/tests/Omnipay/Mollie/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,15 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx/1.4.1 -Date: Tue, 18 Jun 2013 10:44:18 GMT -Content-Type: text/xml -Content-Length: 181 -Connection: keep-alive -Vary: Accept-Encoding - - - - - -2 - A fetch was issued without specification of 'partnerid'. - - diff --git a/tests/Omnipay/Mollie/Mock/PurchaseSuccess.txt b/tests/Omnipay/Mollie/Mock/PurchaseSuccess.txt deleted file mode 100644 index 4e57f862..00000000 --- a/tests/Omnipay/Mollie/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,18 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx/1.4.1 -Date: Tue, 18 Jun 2013 11:20:36 GMT -Content-Type: text/xml -Content-Length: 478 -Connection: keep-alive -Vary: Accept-Encoding - - - - - 2e6455e7c1999436ef7093219f016fc5 - 1200 - EUR - https://www.mollie.nl/partners/ideal-test-bank?order_nr=M0361705M1078X9J&transaction_id=2e6455e7c1999436ef7093219f016fc5&trxid=0036170512173671 - Your iDEAL-payment has successfully been setup. Your customer should visit the given URL to make the payment - - diff --git a/tests/Omnipay/MultiSafepay/GatewayTest.php b/tests/Omnipay/MultiSafepay/GatewayTest.php deleted file mode 100644 index 71598999..00000000 --- a/tests/Omnipay/MultiSafepay/GatewayTest.php +++ /dev/null @@ -1,154 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay; - -use Omnipay\Common\CreditCard; -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - /** - * @var Gateway - */ - protected $gateway; - - /** - * @var array - */ - protected $options; - - protected function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setAccountId('111111'); - $this->gateway->setSiteId('222222'); - $this->gateway->setSiteCode('333333'); - - $this->options = array( - 'notifyUrl' => 'http://localhost/notify', - 'cancelUrl' => 'http://localhost/cancel', - 'returnUrl' => 'http://localhost/return', - 'gateway' => 'IDEAL', - 'issuer' => 'issuer', - 'transactionId' => '123456', - 'currency' => 'EUR', - 'amount' => '100.00', - 'description' => 'desc', - 'extraData1' => 'extra 1', - 'extraData2' => 'extra 2', - 'extraData3' => 'extra 3', - 'language' => 'a language', - 'clientIp' => '127.0.0.1', - 'googleAnalyticsCode' => 'analytics code', - 'card' => array( - 'email' => 'something@example.com', - 'firstName' => 'first name', - 'lastName' => 'last name', - 'address1' => 'address 1', - 'address2' => 'address 2', - 'postcode' => '1000', - 'city' => 'a city', - 'country' => 'a country', - 'phone' => 'phone number', - ) - ); - } - - public function testFetchPaymentMethods() - { - /** @var \Omnipay\MultiSafepay\Message\FetchPaymentMethodsRequest $request */ - $request = $this->gateway->fetchPaymentMethods(array('country' => 'NL')); - - $this->assertInstanceOf('Omnipay\MultiSafepay\Message\FetchPaymentMethodsRequest', $request); - $this->assertEquals('NL', $request->getCountry()); - } - - public function testFetchIssuers() - { - /** @var \Omnipay\MultiSafepay\Message\FetchIssuersRequest $request */ - $request = $this->gateway->fetchIssuers(); - - $this->assertInstanceOf('Omnipay\MultiSafepay\Message\FetchIssuersRequest', $request); - } - - public function testPurchase() - { - /** @var \Omnipay\MultiSafepay\Message\PurchaseRequest $request */ - $request = $this->gateway->purchase($this->options); - - /** @var CreditCard $card */ - $card = $request->getCard(); - - $this->assertInstanceOf('Omnipay\MultiSafepay\Message\PurchaseRequest', $request); - $this->assertSame('http://localhost/notify', $request->getNotifyUrl()); - $this->assertSame('http://localhost/cancel', $request->getCancelUrl()); - $this->assertSame('http://localhost/return', $request->getReturnUrl()); - $this->assertSame('IDEAL', $request->getGateway()); - $this->assertSame('issuer', $request->getIssuer()); - $this->assertSame('123456', $request->getTransactionId()); - $this->assertSame('EUR', $request->getCurrency()); - $this->assertSame('100.00', $request->getAmount()); - $this->assertSame('desc', $request->getDescription()); - $this->assertSame('extra 1', $request->getExtraData1()); - $this->assertSame('extra 2', $request->getExtraData2()); - $this->assertSame('extra 3', $request->getExtraData3()); - $this->assertSame('a language', $request->getLanguage()); - $this->assertSame('analytics code', $request->getGoogleAnalyticsCode()); - $this->assertSame('127.0.0.1', $request->getClientIp()); - $this->assertSame('something@example.com', $card->getEmail()); - $this->assertSame('first name', $card->getFirstName()); - $this->assertSame('last name', $card->getLastName()); - $this->assertSame('address 1', $card->getAddress1()); - $this->assertSame('address 2', $card->getAddress2()); - $this->assertSame('1000', $card->getPostcode()); - $this->assertSame('a city', $card->getCity()); - $this->assertSame('a country', $card->getCountry()); - $this->assertSame('phone number', $card->getPhone()); - } - - public function testCompletePurchase() - { - /** @var \Omnipay\MultiSafepay\Message\CompletePurchaseRequest $request */ - $request = $this->gateway->completePurchase($this->options); - - /** @var CreditCard $card */ - $card = $request->getCard(); - - $this->assertInstanceOf('Omnipay\MultiSafepay\Message\CompletePurchaseRequest', $request); - $this->assertSame('http://localhost/notify', $request->getNotifyUrl()); - $this->assertSame('http://localhost/cancel', $request->getCancelUrl()); - $this->assertSame('http://localhost/return', $request->getReturnUrl()); - $this->assertSame('IDEAL', $request->getGateway()); - $this->assertSame('issuer', $request->getIssuer()); - $this->assertSame('123456', $request->getTransactionId()); - $this->assertSame('EUR', $request->getCurrency()); - $this->assertSame('100.00', $request->getAmount()); - $this->assertSame('desc', $request->getDescription()); - $this->assertSame('extra 1', $request->getExtraData1()); - $this->assertSame('extra 2', $request->getExtraData2()); - $this->assertSame('extra 3', $request->getExtraData3()); - $this->assertSame('a language', $request->getLanguage()); - $this->assertSame('analytics code', $request->getGoogleAnalyticsCode()); - $this->assertSame('127.0.0.1', $request->getClientIp()); - $this->assertSame('something@example.com', $card->getEmail()); - $this->assertSame('first name', $card->getFirstName()); - $this->assertSame('last name', $card->getLastName()); - $this->assertSame('address 1', $card->getAddress1()); - $this->assertSame('address 2', $card->getAddress2()); - $this->assertSame('1000', $card->getPostcode()); - $this->assertSame('a city', $card->getCity()); - $this->assertSame('a country', $card->getCountry()); - $this->assertSame('phone number', $card->getPhone()); - } -} diff --git a/tests/Omnipay/MultiSafepay/Message/AbstractRequestTest.php b/tests/Omnipay/MultiSafepay/Message/AbstractRequestTest.php deleted file mode 100644 index 2d3d6b20..00000000 --- a/tests/Omnipay/MultiSafepay/Message/AbstractRequestTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use Mockery as m; -use Omnipay\TestCase; -use ReflectionMethod; - -class AbstractRequestTest extends TestCase -{ - /** - * @var AbstractRequest - */ - private $request; - - protected function setUp() - { - $this->request = m::mock('\Omnipay\MultiSafepay\Message\AbstractRequest[getData,send]'); - } - - /** - * @covers \Omnipay\MultiSafepay\Message\AbstractRequest::getHeaders() - */ - public function testUserAgentHeaderMustNotBeSet() - { - $method = new ReflectionMethod('\Omnipay\MultiSafepay\Message\AbstractRequest', 'getHeaders'); - $method->setAccessible(true); - - $headers = $method->invoke($this->request); - $this->assertArrayHasKey('User-Agent', $headers, 'Omitting User-Agent header not allowed because then Guzzle will set it and cause 403 Forbidden on the gateway'); - $this->assertEquals('Omnipay', $headers['User-Agent'], 'User-Agent header set'); - } -} diff --git a/tests/Omnipay/MultiSafepay/Message/CompletePurchaseRequestTest.php b/tests/Omnipay/MultiSafepay/Message/CompletePurchaseRequestTest.php deleted file mode 100644 index e066e9f6..00000000 --- a/tests/Omnipay/MultiSafepay/Message/CompletePurchaseRequestTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use Omnipay\TestCase; - -class CompletePurchaseRequestTest extends TestCase -{ - /** - * @var CompletePurchaseRequest - */ - private $request; - - protected function setUp() - { - $this->request = new CompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'accountId' => '111111', - 'siteId' => '222222', - 'siteCode' => '333333', - 'notifyUrl' => 'http://localhost/notify', - 'cancelUrl' => 'http://localhost/cancel', - 'returnUrl' => 'http://localhost/return', - 'gateway' => 'IDEAL', - 'issuer' => 'issuer', - 'transactionId' => '123456', - 'currency' => 'EUR', - 'amount' => '100.00', - 'description' => 'desc', - 'extraData1' => 'extra 1', - 'extraData2' => 'extra 2', - 'extraData3' => 'extra 3', - 'language' => 'a language', - 'clientIp' => '127.0.0.1', - 'googleAnalyticsCode' => 'analytics code', - 'card' => array( - 'email' => 'something@example.com', - 'firstName' => 'first name', - 'lastName' => 'last name', - 'address1' => 'address 1', - 'address2' => 'address 2', - 'postcode' => '1000', - 'city' => 'a city', - 'country' => 'a country', - 'phone' => 'phone number', - ) - )); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('CompletePurchaseSuccess.txt'); - - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('123456', $response->getTransactionReference()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('CompletePurchaseFailure.txt'); - - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertEquals('Back-end: missing data', $response->getMessage()); - $this->assertEquals(1016, $response->getCode()); - } - - /** - * @dataProvider dataProvider - */ - public function testGetData($xml) - { - $data = $this->request->getData(); - $this->assertInstanceOf('SimpleXMLElement', $data); - - // Just so the provider remains readable... - $dom = dom_import_simplexml($data)->ownerDocument; - $dom->formatOutput = true; - $this->assertEquals($xml, $dom->saveXML()); - } - - public function dataProvider() - { - $xml = << - - - 111111 - 222222 - 333333 - - - 123456 - - - -EOF; - - return array( - array($xml), - ); - } -} diff --git a/tests/Omnipay/MultiSafepay/Message/FetchIssuersRequestTest.php b/tests/Omnipay/MultiSafepay/Message/FetchIssuersRequestTest.php deleted file mode 100644 index 4e432987..00000000 --- a/tests/Omnipay/MultiSafepay/Message/FetchIssuersRequestTest.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use Omnipay\TestCase; - -class FetchIssuersRequestTest extends TestCase -{ - /** - * @var FetchIssuersRequest - */ - private $request; - - protected function setUp() - { - $this->request = new FetchIssuersRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'accountId' => '111111', - 'siteId' => '222222', - 'siteCode' => '333333', - )); - } - - /** - * @dataProvider issuersProvider - */ - public function testSendSuccess($expected) - { - $this->setMockHttpResponse('FetchIssuersSuccess.txt'); - - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals($expected, $response->getIssuers()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('FetchIssuersFailure.txt'); - - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertEquals('Invalid merchant security code', $response->getMessage()); - $this->assertEquals(1005, $response->getCode()); - } - - /** - * @dataProvider dataProvider - */ - public function testGetData($xml) - { - $data = $this->request->getData(); - $this->assertInstanceOf('SimpleXMLElement', $data); - - // Just so the provider remains readable... - $dom = dom_import_simplexml($data)->ownerDocument; - $dom->formatOutput = true; - $this->assertEquals($xml, $dom->saveXML()); - } - - public function issuersProvider() - { - return array( - array( - array( - '0031' => 'ABN AMRO', - '0751' => 'SNS Bank', - '0721' => 'ING', - '0021' => 'Rabobank', - '0091' => 'Friesland Bank', - '0761' => 'ASN Bank', - '0771' => 'SNS Regio Bank', - '0511' => 'Triodos Bank', - '0161' => 'Van Lanschot Bankiers', - '0801' => 'Knab', - ), - ), - ); - } - - public function dataProvider() - { - $xml = << - - - 111111 - 222222 - 333333 - - - -EOF; - - return array( - array($xml), - ); - } -} diff --git a/tests/Omnipay/MultiSafepay/Message/FetchPaymentMethodsRequestTest.php b/tests/Omnipay/MultiSafepay/Message/FetchPaymentMethodsRequestTest.php deleted file mode 100644 index 72311862..00000000 --- a/tests/Omnipay/MultiSafepay/Message/FetchPaymentMethodsRequestTest.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use Omnipay\TestCase; - -class FetchPaymentMethodsRequestTest extends TestCase -{ - /** - * @var FetchPaymentMethodsRequest - */ - private $request; - - protected function setUp() - { - $this->request = new FetchPaymentMethodsRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'accountId' => '111111', - 'siteId' => '222222', - 'siteCode' => '333333', - 'country' => 'NL', - )); - } - - /** - * @dataProvider paymentMethodsProvider - */ - public function testSendSuccess($expected) - { - $this->setMockHttpResponse('FetchPaymentMethodsSuccess.txt'); - - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals($expected, $response->getPaymentMethods()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('FetchPaymentMethodsFailure.txt'); - - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertEquals('Invalid merchant security code', $response->getMessage()); - $this->assertEquals(1005, $response->getCode()); - } - - /** - * @dataProvider dataProvider - */ - public function testGetData($xml) - { - $data = $this->request->getData(); - $this->assertInstanceOf('SimpleXMLElement', $data); - - // Just so the provider remains readable... - $dom = dom_import_simplexml($data)->ownerDocument; - $dom->formatOutput = true; - $this->assertEquals($xml, $dom->saveXML()); - } - - public function paymentMethodsProvider() - { - return array( - array( - array( - 'VISA' => 'Visa CreditCards', - 'WALLET' => 'MultiSafepay', - 'IDEAL' => 'iDEAL', - 'BANKTRANS' => 'Bank Transfer', - 'MASTERCARD' => 'MasterCard', - ), - ), - ); - } - - public function dataProvider() - { - $xml = << - - - 111111 - 222222 - 333333 - - - NL - - - -EOF; - - return array( - array($xml), - ); - } -} diff --git a/tests/Omnipay/MultiSafepay/Message/PurchaseRequestTest.php b/tests/Omnipay/MultiSafepay/Message/PurchaseRequestTest.php deleted file mode 100644 index d7a33beb..00000000 --- a/tests/Omnipay/MultiSafepay/Message/PurchaseRequestTest.php +++ /dev/null @@ -1,287 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\MultiSafepay\Message; - -use Omnipay\TestCase; -use ReflectionMethod; - -class PurchaseRequestTest extends TestCase -{ - /** - * @var PurchaseRequest - */ - private $request; - - protected function setUp() - { - $this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize(array( - 'accountId' => '111111', - 'siteId' => '222222', - 'siteCode' => '333333', - 'notifyUrl' => 'http://localhost/notify', - 'cancelUrl' => 'http://localhost/cancel', - 'returnUrl' => 'http://localhost/return', - 'gateway' => 'IDEAL', - 'issuer' => 'issuer', - 'transactionId' => '123456', - 'currency' => 'EUR', - 'amount' => '100.00', - 'description' => 'desc', - 'extraData1' => 'extra 1', - 'extraData2' => 'extra 2', - 'extraData3' => 'extra 3', - 'language' => 'a language', - 'clientIp' => '127.0.0.1', - 'googleAnalyticsCode' => 'analytics code', - 'card' => array( - 'email' => 'something@example.com', - 'firstName' => 'first name', - 'lastName' => 'last name', - 'address1' => 'address 1', - 'address2' => 'address 2', - 'postcode' => '1000', - 'city' => 'a city', - 'country' => 'a country', - 'phone' => 'phone number', - ) - )); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertEquals('https://testpay.multisafepay.com/pay/?transaction=1373536347Hz4sFtg7WgMulO5q123456&lang=', $response->getRedirectUrl()); - $this->assertEquals('123456', $response->getTransactionReference()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertEquals('Invalid amount', $response->getMessage()); - $this->assertEquals(1001, $response->getCode()); - } - - /** - * @dataProvider allDataProvider - */ - public function testGetData($xml) - { - $data = $this->request->getData(); - $this->assertInstanceOf('SimpleXMLElement', $data); - - // Just so the provider remains readable... - $dom = dom_import_simplexml($data)->ownerDocument; - $dom->formatOutput = true; - $this->assertEquals($xml, $dom->saveXML()); - } - - /** - * @dataProvider noIssuerDataProvider - */ - public function testGetDataWithNonIDEALGatewayDoesNotSetIssuer($xml) - { - $this->request->setGateway('another'); - $data = $this->request->getData(); - $this->assertInstanceOf('SimpleXMLElement', $data); - - // Just so the provider remains readable... - $dom = dom_import_simplexml($data)->ownerDocument; - $dom->formatOutput = true; - $this->assertEquals($xml, $dom->saveXML()); - } - - /** - * @dataProvider specialCharsDataProvider - */ - public function testGetDataWithUrlsWithSpecialChars($xml) - { - $this->request->setReturnUrl('http://localhost/?one=1&two=2'); - $this->request->setCancelUrl('http://localhost/?one=1&two=2'); - $this->request->setNotifyUrl('http://localhost/?one=1&two=2'); - $data = $this->request->getData(); - $this->assertInstanceOf('SimpleXMLElement', $data); - - // Just so the provider remains readable... - $dom = dom_import_simplexml($data)->ownerDocument; - $dom->formatOutput = true; - $this->assertEquals($xml, $dom->saveXML()); - } - - /** - * @covers \Omnipay\MultiSafepay\Message\PurchaseRequest::generateSignature() - */ - public function testGenerateSignature() - { - $method = new ReflectionMethod('\Omnipay\MultiSafepay\Message\PurchaseRequest', 'generateSignature'); - $method->setAccessible(true); - - $signature = $method->invoke($this->request); - $this->assertEquals('ad447bab87b8597853432c891e341db1', $signature); - } - - public function allDataProvider() - { - $xml = << - - - 111111 - 222222 - 333333 - http://localhost/notify - http://localhost/cancel - http://localhost/return - IDEAL - - - issuer - - - 127.0.0.1 - a language - something@example.com - first name - last name - address 1 - address 2 - 1000 - a city - a country - phone number - - analytics code - - 123456 - EUR - 10000 - desc - extra 1 - extra 2 - extra 3 - - ad447bab87b8597853432c891e341db1 - - -EOF; - - return array( - array($xml), - ); - } - - public function noIssuerDataProvider() - { - $xml = << - - - 111111 - 222222 - 333333 - http://localhost/notify - http://localhost/cancel - http://localhost/return - another - - - 127.0.0.1 - a language - something@example.com - first name - last name - address 1 - address 2 - 1000 - a city - a country - phone number - - analytics code - - 123456 - EUR - 10000 - desc - extra 1 - extra 2 - extra 3 - - ad447bab87b8597853432c891e341db1 - - -EOF; - - return array( - array($xml), - ); - } - - public function specialCharsDataProvider() - { - $xml = << - - - 111111 - 222222 - 333333 - http://localhost/?one=1&two=2 - http://localhost/?one=1&two=2 - http://localhost/?one=1&two=2 - IDEAL - - - issuer - - - 127.0.0.1 - a language - something@example.com - first name - last name - address 1 - address 2 - 1000 - a city - a country - phone number - - analytics code - - 123456 - EUR - 10000 - desc - extra 1 - extra 2 - extra 3 - - ad447bab87b8597853432c891e341db1 - - -EOF; - - return array( - array($xml), - ); - } -} diff --git a/tests/Omnipay/MultiSafepay/Mock/CompletePurchaseFailure.txt b/tests/Omnipay/MultiSafepay/Mock/CompletePurchaseFailure.txt deleted file mode 100644 index 3d4544b8..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/CompletePurchaseFailure.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 10:36:27 GMT -Server: Apache/2.2.22 (FreeBSD) mod_ssl/2.2.22 OpenSSL/0.9.8q DAV/2 -Content-Length: 153 -Content-Type: text/xml - - -1016Back-end: missing data diff --git a/tests/Omnipay/MultiSafepay/Mock/CompletePurchaseSuccess.txt b/tests/Omnipay/MultiSafepay/Mock/CompletePurchaseSuccess.txt deleted file mode 100644 index e7cc8431..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/CompletePurchaseSuccess.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 10:34:48 GMT -Server: Apache/2.2.22 (FreeBSD) mod_ssl/2.2.22 OpenSSL/0.9.8q DAV/2 -Content-Length: 931 -Content-Type: text/xml - - -2087325completedNO201307111233082013071112331710000EURen_UStester@example.com123456EUR10000descIDEAL213698412Hr E G H Küppers en/of Mw M J Küppers an nog een lange consumername0050000075107095 diff --git a/tests/Omnipay/MultiSafepay/Mock/FetchIssuersFailure.txt b/tests/Omnipay/MultiSafepay/Mock/FetchIssuersFailure.txt deleted file mode 100644 index 7507ec6c..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/FetchIssuersFailure.txt +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 13:22:17 GMT -Server: Apache/2.2.16 (Debian) -X-Powered-By: PHP/5.3.3-7+squeeze14 -Vary: Accept-Encoding -Content-Length: 173 -Content-Type: text/xml - - -1005Invalid merchant security code diff --git a/tests/Omnipay/MultiSafepay/Mock/FetchIssuersSuccess.txt b/tests/Omnipay/MultiSafepay/Mock/FetchIssuersSuccess.txt deleted file mode 100644 index 2633e283..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/FetchIssuersSuccess.txt +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 13:21:39 GMT -Server: Apache/2.2.16 (Debian) -X-Powered-By: PHP/5.3.3-7+squeeze14 -Vary: Accept-Encoding -Content-Length: 810 -Content-Type: text/xml - - -0031ABN AMRO0751SNS Bank0721ING0021Rabobank0091Friesland Bank0761ASN Bank0771SNS Regio Bank0511Triodos Bank0161Van Lanschot Bankiers0801Knab diff --git a/tests/Omnipay/MultiSafepay/Mock/FetchPaymentMethodsFailure.txt b/tests/Omnipay/MultiSafepay/Mock/FetchPaymentMethodsFailure.txt deleted file mode 100644 index f43de626..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/FetchPaymentMethodsFailure.txt +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 12:32:27 GMT -Server: Apache/2.2.16 (Debian) -X-Powered-By: PHP/5.3.3-7+squeeze14 -Vary: Accept-Encoding -Content-Length: 165 -Content-Type: text/xml - - -1005Invalid merchant security code diff --git a/tests/Omnipay/MultiSafepay/Mock/FetchPaymentMethodsSuccess.txt b/tests/Omnipay/MultiSafepay/Mock/FetchPaymentMethodsSuccess.txt deleted file mode 100644 index 07612730..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/FetchPaymentMethodsSuccess.txt +++ /dev/null @@ -1,10 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 12:31:26 GMT -Server: Apache/2.2.16 (Debian) -X-Powered-By: PHP/5.3.3-7+squeeze14 -Vary: Accept-Encoding -Content-Length: 459 -Content-Type: text/xml - - -VISAVisa CreditCardsWALLETMultiSafepayIDEALiDEALBANKTRANSBank TransferMASTERCARDMasterCard diff --git a/tests/Omnipay/MultiSafepay/Mock/PurchaseFailure.txt b/tests/Omnipay/MultiSafepay/Mock/PurchaseFailure.txt deleted file mode 100644 index b7900c97..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 10:06:38 GMT -Server: Apache/2.2.22 (FreeBSD) mod_ssl/2.2.22 OpenSSL/0.9.8q DAV/2 -Content-Length: 213 -Content-Type: text/xml - - -1001Invalid amount123456 diff --git a/tests/Omnipay/MultiSafepay/Mock/PurchaseSuccess.txt b/tests/Omnipay/MultiSafepay/Mock/PurchaseSuccess.txt deleted file mode 100644 index 1abdd95d..00000000 --- a/tests/Omnipay/MultiSafepay/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 11 Jul 2013 09:52:27 GMT -Server: Apache/2.2.22 (FreeBSD) mod_ssl/2.2.22 OpenSSL/0.9.8q DAV/2 -Content-Length: 256 -Content-Type: text/xml - - -123456https://testpay.multisafepay.com/pay/?transaction=1373536347Hz4sFtg7WgMulO5q123456&lang= diff --git a/tests/Omnipay/NetBanx/GatewayTest.php b/tests/Omnipay/NetBanx/GatewayTest.php deleted file mode 100644 index cf95ec7f..00000000 --- a/tests/Omnipay/NetBanx/GatewayTest.php +++ /dev/null @@ -1,335 +0,0 @@ -gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - - $card = new CreditCard($this->getValidCard()); - - $card->setBillingAddress1('Wall street'); - $card->setBillingAddress2('Wall street 2'); - $card->setBillingCity('San Luis Obispo'); - $card->setBillingCountry('US'); - $card->setBillingPostcode('93401'); - $card->setBillingPhone('1234567'); - $card->setBillingState('CA'); - - $card->setShippingAddress1('Shipping Wall street'); - $card->setShippingAddress2('Shipping Wall street 2'); - $card->setShippingCity('San Luis Obispo'); - $card->setShippingCountry('US'); - $card->setShippingPostcode('93401'); - $card->setShippingPhone('1234567'); - $card->setShippingState('CA'); - - $card->setCompany('Test Business name'); - $card->setEmail('test@example.com'); - - $this->purchaseOptions = array( - 'amount' => '95.63', - 'card' => $card, - 'customerId' => '9966441', - ); - - $this->captureOptions = array( - 'amount' => '10.00', - 'transactionReference' => '9988775', - ); - - $this->voidOptions = array( - 'accountNumber' => '12345678', - 'storeId' => 'test', - 'storePassword' => 'test', - 'transactionReference' => '115147689', - ); - - $this->storedDataOptions = array( - 'amount' => '95.63', - 'customerId' => '9966441', - 'transactionReference' => '244530120', - ); - } - - public function testAuthorizeSuccess() - { - $this->setMockHttpResponse('AuthorizeSuccess.txt'); - - $request = $this->gateway->authorize($this->purchaseOptions); - $requestData = $request->getData(); - /** @var $card CreditCard */ - $card = $request->getCard(); - - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccAuthorize', $requestData['txnMode']); - - $this->assertSame('93401', (string) $sxml->billingDetails->zip); - $this->assertSame('VI', (string) $sxml->card->cardType); - - $this->assertTrue(isset($sxml->billingDetails)); - $this->assertTrue(isset($sxml->shippingDetails)); - - $this->assertSame('95.63', (string) $sxml->amount); - $this->assertSame('9966441', (string) $sxml->merchantRefNum); - $this->assertSame('93401', $card->getPostcode()); - $this->assertSame('test@example.com', $card->getEmail()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('244350540', $response->getTransactionReference()); - $this->assertSame('No Error', $response->getMessage()); - } - - public function testAuthorizeFailure() - { - $this->setMockHttpResponse('AuthorizeFailure.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('-1', $response->getTransactionReference()); - $this->assertSame('Invalid txnMode: ccccAuthorize', $response->getMessage()); - } - - public function testStoredDataAuthorizeSuccess() - { - $this->setMockHttpResponse('StoredDataAuthorizeSuccess.txt'); - - $request = $this->gateway->authorize($this->storedDataOptions); - $requestData = $request->getData(); - - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccStoredDataAuthorize', $requestData['txnMode']); - - $this->assertSame('244530120', (string) $sxml->confirmationNumber); - - $this->assertSame('95.63', (string) $sxml->amount); - $this->assertSame('9966441', (string) $sxml->merchantRefNum); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('244530120', $response->getTransactionReference()); - $this->assertSame('No Error', $response->getMessage()); - } - - public function testStoredDataAuthorizeFailure() - { - $this->setMockHttpResponse('StoredDataAuthorizeFailure.txt'); - - $response = $this->gateway->authorize($this->storedDataOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame( - 'You submitted an invalid XML request. Please verify your request and retry the transaction.', - $response->getMessage() - ); - } - - public function testCaptureSuccess() - { - $this->setMockHttpResponse('CaptureSuccess.txt'); - - $request = $this->gateway->capture($this->captureOptions); - $requestData = $request->getData(); - - $response = $request->send(); - - $this->assertSame('ccSettlement', $requestData['txnMode']); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('9988775', (string) $sxml->confirmationNumber); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('9988775', $response->getTransactionReference()); - $this->assertSame('No Error', $response->getMessage()); - } - - public function testCaptureFailure() - { - $this->setMockHttpResponse('CaptureFailure.txt'); - - $request = $this->gateway->capture($this->captureOptions); - $requestData = $request->getData(); - - $response = $request->send(); - - $this->assertSame('ccSettlement', $requestData['txnMode']); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('9988775', (string) $sxml->confirmationNumber); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('9988775', $response->getTransactionReference()); - $this->assertSame('The authorization is either fully settled or cancelled.', $response->getMessage()); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $request = $this->gateway->purchase($this->purchaseOptions); - $requestData = $request->getData(); - /** @var $card CreditCard */ - $card = $request->getCard(); - - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccPurchase', $requestData['txnMode']); - - $this->assertSame('93401', (string) $sxml->billingDetails->zip); - - $this->assertSame('93401', $card->getPostcode()); - $this->assertSame('test@example.com', $card->getEmail()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('244356120', $response->getTransactionReference()); - $this->assertSame('No Error', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - - $request = $this->gateway->purchase($this->purchaseOptions); - $requestData = $request->getData(); - /** @var $card CreditCard */ - $card = $request->getCard(); - - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccPurchase', $requestData['txnMode']); - - $this->assertSame('93401', (string) $sxml->billingDetails->zip); - - $this->assertSame('93401', $card->getPostcode()); - $this->assertSame('test@example.com', $card->getEmail()); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('244356120', $response->getTransactionReference()); - $this->assertSame('You submitted an unsupported card type with your request.', $response->getMessage()); - } - - public function testStoredDataPurchaseSuccess() - { - $this->setMockHttpResponse('StoredDataPurchaseSuccess.txt'); - - $request = $this->gateway->purchase($this->storedDataOptions); - $requestData = $request->getData(); - - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccStoredDataPurchase', $requestData['txnMode']); - - $this->assertSame('244530120', (string) $sxml->confirmationNumber); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('244679250', $response->getTransactionReference()); - $this->assertSame('No Error', $response->getMessage()); - } - - public function testStoredDataPurchaseFailure() - { - $this->setMockHttpResponse('StoredDataPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->storedDataOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame( - 'You submitted an invalid XML request. Please verify your request and retry the transaction.', - $response->getMessage() - ); - } - - public function testVoidSuccess() - { - $this->setMockHttpResponse('VoidSuccess.txt'); - - $request = $this->gateway->void($this->voidOptions); - $requestData = $request->getData(); - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccAuthorizeReversal', $requestData['txnMode']); - - $this->assertSame('12345678', (string) $sxml->merchantAccount->accountNum); - $this->assertSame('test', (string) $sxml->merchantAccount->storeID); - $this->assertSame('test', (string) $sxml->merchantAccount->storePwd); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('12345678', $response->getTransactionReference()); - $this->assertSame('No Error', $response->getMessage()); - } - - public function testVoidFailure() - { - $this->setMockHttpResponse('VoidFailure.txt'); - - $request = $this->gateway->void($this->voidOptions); - $requestData = $request->getData(); - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccAuthorizeReversal', $requestData['txnMode']); - - $this->assertSame('12345678', (string) $sxml->merchantAccount->accountNum); - $this->assertSame('test', (string) $sxml->merchantAccount->storeID); - $this->assertSame('test', (string) $sxml->merchantAccount->storePwd); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('12345678', $response->getTransactionReference()); - $this->assertSame('The confirmation number included in this request could not be found.', $response->getMessage()); - } - - public function testCreateCard() - { - $this->setMockHttpResponse('CreateCard.txt'); - - $request = $this->gateway->createCard($this->purchaseOptions); - $requestData = $request->getData(); - /** @var $card CreditCard */ - $card = $request->getCard(); - - $response = $request->send(); - - $sxml = new \SimpleXMLElement($requestData['txnRequest']); - - $this->assertSame('ccAuthorize', $requestData['txnMode']); - - $this->assertSame('93401', (string) $sxml->billingDetails->zip); - $this->assertSame('VI', (string) $sxml->card->cardType); - - $this->assertTrue(isset($sxml->billingDetails)); - $this->assertTrue(isset($sxml->shippingDetails)); - - $this->assertSame('1.00', (string) $sxml->amount); - $this->assertSame('9966441', (string) $sxml->merchantRefNum); - $this->assertSame('93401', $card->getPostcode()); - $this->assertSame('test@example.com', $card->getEmail()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('244350540', $response->getCardReference()); - $this->assertSame('No Error', $response->getMessage()); - } -} diff --git a/tests/Omnipay/NetBanx/Mock/AuthorizeFailure.txt b/tests/Omnipay/NetBanx/Mock/AuthorizeFailure.txt deleted file mode 100644 index a3c63491..00000000 --- a/tests/Omnipay/NetBanx/Mock/AuthorizeFailure.txt +++ /dev/null @@ -1,32 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:23:27 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 683 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - -1 - ERROR - 1000 - Invalid txnMode: ccccAuthorize - R - U - - InternalResponseCode - 14 - - - SubErrorCode - 0 - - - InternalResponseDescription - invalid operation mode - - 2013-02-15T14:17:07.423-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/AuthorizeSuccess.txt b/tests/Omnipay/NetBanx/Mock/AuthorizeSuccess.txt deleted file mode 100644 index 6b489ad3..00000000 --- a/tests/Omnipay/NetBanx/Mock/AuthorizeSuccess.txt +++ /dev/null @@ -1,32 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 638 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 244350540 - ACCEPTED - 0 - No Error - 245904 - X - - InternalResponseCode - 0 - - - SubErrorCode - 0 - - - InternalResponseDescription - no_error - - 2013-04-17T06:27:04.373-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/CaptureFailure.txt b/tests/Omnipay/NetBanx/Mock/CaptureFailure.txt deleted file mode 100644 index 0413fed9..00000000 --- a/tests/Omnipay/NetBanx/Mock/CaptureFailure.txt +++ /dev/null @@ -1,31 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:23:27 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 697 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 9988775 - ERROR - 3203 - M - The authorization is either fully settled or cancelled. - - InternalResponseCode - 204 - - - SubErrorCode - 0 - - - InternalResponseDescription - Authorization is either fully settled or canceled. - - 2013-04-17T08:02:48.092-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/CaptureSuccess.txt b/tests/Omnipay/NetBanx/Mock/CaptureSuccess.txt deleted file mode 100644 index 9946d459..00000000 --- a/tests/Omnipay/NetBanx/Mock/CaptureSuccess.txt +++ /dev/null @@ -1,30 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:56:28 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 577 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 9988775 - ACCEPTED - 0 - No Error - - InternalResponseCode - 0 - - - SubErrorCode - 0 - - - InternalResponseDescription - no_error - - 2013-04-17T08:03:29.538-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/CreateCard.txt b/tests/Omnipay/NetBanx/Mock/CreateCard.txt deleted file mode 100644 index 6b489ad3..00000000 --- a/tests/Omnipay/NetBanx/Mock/CreateCard.txt +++ /dev/null @@ -1,32 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 638 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 244350540 - ACCEPTED - 0 - No Error - 245904 - X - - InternalResponseCode - 0 - - - SubErrorCode - 0 - - - InternalResponseDescription - no_error - - 2013-04-17T06:27:04.373-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/PurchaseFailure.txt b/tests/Omnipay/NetBanx/Mock/PurchaseFailure.txt deleted file mode 100644 index 04878445..00000000 --- a/tests/Omnipay/NetBanx/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,31 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:56:28 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 638 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 244356120 - ERROR - 3001 - C - You submitted an unsupported card type with your request. - - InternalResponseCode - 115 - - - SubErrorCode - 0 - - - InternalResponseDescription - invalid brand - - 2013-04-17T08:23:22.009-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/PurchaseSuccess.txt b/tests/Omnipay/NetBanx/Mock/PurchaseSuccess.txt deleted file mode 100644 index b7bd5591..00000000 --- a/tests/Omnipay/NetBanx/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,32 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:56:28 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 638 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 244356120 - ACCEPTED - 0 - No Error - 246413 - X - - InternalResponseCode - 0 - - - SubErrorCode - 0 - - - InternalResponseDescription - no_error - - 2013-04-17T08:18:43.646-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/StoredDataAuthorizeFailure.txt b/tests/Omnipay/NetBanx/Mock/StoredDataAuthorizeFailure.txt deleted file mode 100644 index 43cf7fa1..00000000 --- a/tests/Omnipay/NetBanx/Mock/StoredDataAuthorizeFailure.txt +++ /dev/null @@ -1,38 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 1618 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 244678250 - ERROR - 5023 - M - You submitted an invalid XML request. Please verify your request and retry the transaction. - - InternalResponseCode - 24 - - - SubErrorCode - 0 - - - InternalResponseDescription - xml error - - - ErrorDetail - Errors: - Node: confirmationNumber, Detail: Expected element \'merchantRefNum@http://www.optimalpayments.com/creditcard/xmlschema/v1\' instead of \'confirmationNumber@http://www.optimalpayments.com/creditcard/xmlschema/v1\' here in element ccStoredDataRequestV1@http://www.optimalpayments.com/creditcard/xmlschema/v1 - Node: amount, Detail: Expected element \'confirmationNumber@http://www.optimalpayments.com/creditcard/xmlschema/v1\' instead of \'amount@http://www.optimalpayments.com/creditcard/xmlschema/v1\' here in element ccStoredDataRequestV1@http://www.optimalpayments.com/creditcard/xmlschema/v1 - Node: ccStoredDataRequestV1, Detail: Expected element \'confirmationNumber@http://www.optimalpayments.com/creditcard/xmlschema/v1\' before the end of the content in element ccStoredDataRequestV1@http://www.optimalpayments.com/creditcard/xmlschema/v1 - - 2013-04-25T06:11:51.284-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/StoredDataAuthorizeSuccess.txt b/tests/Omnipay/NetBanx/Mock/StoredDataAuthorizeSuccess.txt deleted file mode 100644 index f7d005d6..00000000 --- a/tests/Omnipay/NetBanx/Mock/StoredDataAuthorizeSuccess.txt +++ /dev/null @@ -1,32 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 638 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 244530120 - ACCEPTED - 0 - No Error - 107401 - X - - InternalResponseCode - 0 - - - SubErrorCode - 0 - - - InternalResponseDescription - no_error - - 2013-04-22T05:27:48.472-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/StoredDataPurchaseFailure.txt b/tests/Omnipay/NetBanx/Mock/StoredDataPurchaseFailure.txt deleted file mode 100644 index b2ef36d0..00000000 --- a/tests/Omnipay/NetBanx/Mock/StoredDataPurchaseFailure.txt +++ /dev/null @@ -1,31 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 684 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - -1 - ERROR - 5023 - M - You submitted an invalid XML request. Please verify your request and retry the transaction. - - InternalResponseCode - 24 - - - SubErrorCode - 0 - - - InternalResponseDescription - xml error - - 2013-04-25T06:25:35.722-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/StoredDataPurchaseSuccess.txt b/tests/Omnipay/NetBanx/Mock/StoredDataPurchaseSuccess.txt deleted file mode 100644 index 64839440..00000000 --- a/tests/Omnipay/NetBanx/Mock/StoredDataPurchaseSuccess.txt +++ /dev/null @@ -1,32 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 638 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 244679250 - ACCEPTED - 0 - No Error - 117480 - S - - InternalResponseCode - 0 - - - SubErrorCode - 0 - - - InternalResponseDescription - no_error - - 2013-04-25T06:52:55.757-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/VoidFailure.txt b/tests/Omnipay/NetBanx/Mock/VoidFailure.txt deleted file mode 100644 index af3e8311..00000000 --- a/tests/Omnipay/NetBanx/Mock/VoidFailure.txt +++ /dev/null @@ -1,31 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 683 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 12345678 - ERROR - 3500 - M - The confirmation number included in this request could not be found. - - InternalResponseCode - 250 - - - SubErrorCode - 0 - - - InternalResponseDescription - Authorization transaction not found for reversal. - - 2013-04-17T08:35:42.302-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/NetBanx/Mock/VoidSuccess.txt b/tests/Omnipay/NetBanx/Mock/VoidSuccess.txt deleted file mode 100644 index 6934ba4d..00000000 --- a/tests/Omnipay/NetBanx/Mock/VoidSuccess.txt +++ /dev/null @@ -1,30 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Date: Sat, 16 Feb 2013 04:22:58 GMT -Server: Microsoft-IIS/6.0 -X-Powered-By: ASP.NET -Content-Type: text/html -Content-Length: 683 -Cache-Control: private, must-revalidate, max-age=0 -Expires: Tue, 01 Jan 1980 00:00:00 GMT - - - 12345678 - ACCEPTED - 0 - No Error - - InternalResponseCode - 0 - - - SubErrorCode - 0 - - - InternalResponseDescription - no_error - - 2013-04-17T08:39:38.347-04:00 - false - \ No newline at end of file diff --git a/tests/Omnipay/Netaxept/GatewayTest.php b/tests/Omnipay/Netaxept/GatewayTest.php deleted file mode 100644 index ba35017b..00000000 --- a/tests/Omnipay/Netaxept/GatewayTest.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Netaxept; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setMerchantId('foo'); - $this->gateway->setPassword('bar'); - - $this->options = array( - 'amount' => '10.00', - 'currency' => 'NOK', - 'transactionId' => '123', - 'returnUrl' => 'https://www.example.com/return', - ); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertEquals('f3d94dd5c0f743a788fc943402757c58', $response->getTransactionReference()); - $this->assertSame('GET', $response->getRedirectMethod()); - $this->assertSame('https://epayment.bbs.no/Terminal/Default.aspx?merchantId=foo&transactionId=f3d94dd5c0f743a788fc943402757c58', $response->getRedirectUrl()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame("Missing parameter: 'Order Number'", $response->getMessage()); - } - - public function testCompletePurchaseSuccess() - { - $this->getHttpRequest()->query->replace( - array( - 'responseCode' => 'OK', - 'transactionId' => 'abc123', - ) - ); - - $this->setMockHttpResponse('CompletePurchaseSuccess.txt'); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertEquals('8a88d40cab5b47fab25e24d6228180a7', $response->getTransactionReference()); - $this->assertSame('OK', $response->getMessage()); - } - - public function testCompletePurchaseCancel() - { - $this->getHttpRequest()->query->replace( - array( - 'transactionId' => '1de59458487344759832716abf48109b', - 'responseCode' => 'Cancel', - ) - ); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertEquals('1de59458487344759832716abf48109b', $response->getTransactionReference()); - $this->assertEquals('Cancel', $response->getMessage()); - } - - public function testCompletePurchaseFailure() - { - $this->getHttpRequest()->query->replace( - array( - 'responseCode' => 'OK', - 'transactionId' => 'abc123', - ) - ); - - $this->setMockHttpResponse('CompletePurchaseFailure.txt'); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Unable to find transaction', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Netaxept/Message/ResponseTest.php b/tests/Omnipay/Netaxept/Message/ResponseTest.php deleted file mode 100644 index bf1dfffd..00000000 --- a/tests/Omnipay/Netaxept/Message/ResponseTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Netaxept\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertEquals('f3d94dd5c0f743a788fc943402757c58', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame("Missing parameter: 'Order Number'", $response->getMessage()); - } - - public function testCompletePurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('CompletePurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertEquals('8a88d40cab5b47fab25e24d6228180a7', $response->getTransactionReference()); - $this->assertSame('OK', $response->getMessage()); - } - - public function testCompletePurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('CompletePurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Unable to find transaction', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Netaxept/Mock/CompletePurchaseFailure.txt b/tests/Omnipay/Netaxept/Mock/CompletePurchaseFailure.txt deleted file mode 100644 index 6124a408..00000000 --- a/tests/Omnipay/Netaxept/Mock/CompletePurchaseFailure.txt +++ /dev/null @@ -1,15 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: private -Content-Type: text/xml -Server: Microsoft-IIS/7.5 -X-AspNet-Version: 4.0.30319 -X-Powered-By: ASP.NET -Date: Fri, 22 Feb 2013 16:55:41 GMT -Content-Length: 245 - - - - - Unable to find transaction - - \ No newline at end of file diff --git a/tests/Omnipay/Netaxept/Mock/CompletePurchaseSuccess.txt b/tests/Omnipay/Netaxept/Mock/CompletePurchaseSuccess.txt deleted file mode 100644 index bf00d939..00000000 --- a/tests/Omnipay/Netaxept/Mock/CompletePurchaseSuccess.txt +++ /dev/null @@ -1,19 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: private -Content-Type: text/xml -Server: Microsoft-IIS/7.5 -X-AspNet-Version: 4.0.30319 -X-Powered-By: ASP.NET -Date: Fri, 22 Feb 2013 16:53:34 GMT -Content-Length: 474 - - - - AUTH - OK - 090896 - 8a88d40cab5b47fab25e24d6228180a7 - 2013-02-22T17:53:33.9906245+01:00 - 424278 - 246 - \ No newline at end of file diff --git a/tests/Omnipay/Netaxept/Mock/PurchaseFailure.txt b/tests/Omnipay/Netaxept/Mock/PurchaseFailure.txt deleted file mode 100644 index 43836b35..00000000 --- a/tests/Omnipay/Netaxept/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,15 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: private -Content-Type: text/xml -Server: Microsoft-IIS/7.5 -X-AspNet-Version: 4.0.30319 -X-Powered-By: ASP.NET -Date: Fri, 22 Feb 2013 15:53:42 GMT -Content-Length: 259 - - - - - Missing parameter: 'Order Number' - - \ No newline at end of file diff --git a/tests/Omnipay/Netaxept/Mock/PurchaseSuccess.txt b/tests/Omnipay/Netaxept/Mock/PurchaseSuccess.txt deleted file mode 100644 index c50aec61..00000000 --- a/tests/Omnipay/Netaxept/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: private -Content-Type: text/xml -Server: Microsoft-IIS/7.5 -X-AspNet-Version: 4.0.30319 -X-Powered-By: ASP.NET -Date: Fri, 22 Feb 2013 15:55:07 GMT -Content-Length: 228 - - - - f3d94dd5c0f743a788fc943402757c58 - \ No newline at end of file diff --git a/tests/Omnipay/PayFast/GatewayTest.php b/tests/Omnipay/PayFast/GatewayTest.php deleted file mode 100644 index 20a1c541..00000000 --- a/tests/Omnipay/PayFast/GatewayTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testPurchase() - { - $request = $this->gateway->purchase(array('amount' => '12.00')); - - $this->assertInstanceOf('\Omnipay\PayFast\Message\PurchaseRequest', $request); - $this->assertSame('12.00', $request->getAmount()); - } - - public function testCompletePurchase() - { - $request = $this->gateway->completePurchase(array('amount' => '12.00')); - - $this->assertInstanceOf('\Omnipay\PayFast\Message\CompletePurchaseRequest', $request); - $this->assertSame('12.00', $request->getAmount()); - } -} diff --git a/tests/Omnipay/PayFast/Message/CompletePurchaseRequestTest.php b/tests/Omnipay/PayFast/Message/CompletePurchaseRequestTest.php deleted file mode 100644 index 5eba4acd..00000000 --- a/tests/Omnipay/PayFast/Message/CompletePurchaseRequestTest.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\TestCase; - -class CompletePurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new CompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - } - - public function getItnPostData() - { - return array( - 'm_payment_id' => '', - 'pf_payment_id' => '61493', - 'payment_status' => 'COMPLETE', - 'item_name' => 'fjdksl', - 'item_description' => '', - 'amount_gross' => '12.00', - 'amount_fee' => '-0.27', - 'amount_net' => '11.73', - 'custom_str1' => '', - 'custom_str2' => '', - 'custom_str3' => '', - 'custom_str4' => '', - 'custom_str5' => '', - 'custom_int1' => '', - 'custom_int2' => '', - 'custom_int3' => '', - 'custom_int4' => '', - 'custom_int5' => '', - 'name_first' => 'Test', - 'name_last' => 'User 01', - 'email_address' => 'sbtu01@payfast.co.za', - 'merchant_id' => '10000103', - 'signature' => '92ac916145511e9050383b008729e162', - ); - } - - public function testCompletePurchaseItnSuccess() - { - $this->getHttpRequest()->request->replace($this->getItnPostData()); - $this->setMockHttpResponse('CompletePurchaseItnSuccess.txt'); - - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\PayFast\Message\CompletePurchaseItnResponse', $response); - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('61493', $response->getTransactionReference()); - $this->assertSame('COMPLETE', $response->getMessage()); - $this->assertNull($response->getCode()); - } - - public function testCompletePurchaseItnInvalid() - { - $this->getHttpRequest()->request->replace($this->getItnPostData()); - $this->setMockHttpResponse('CompletePurchaseItnFailure.txt'); - - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('INVALID', $response->getMessage()); - $this->assertNull($response->getCode()); - } - - public function testCompletePurchasePdtSuccess() - { - $this->getHttpRequest()->query->replace(array('pt' => 'abc')); - $this->setMockHttpResponse('CompletePurchasePdtFailure.txt'); - - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\PayFast\Message\CompletePurchasePdtResponse', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('FAIL', $response->getMessage()); - $this->assertNull($response->getCode()); - } -} diff --git a/tests/Omnipay/PayFast/Message/PurchaseRequestTest.php b/tests/Omnipay/PayFast/Message/PurchaseRequestTest.php deleted file mode 100644 index a61a9d45..00000000 --- a/tests/Omnipay/PayFast/Message/PurchaseRequestTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\TestCase; - -class PurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testSignature() - { - $this->request->initialize( - array( - 'amount' => '12.00', - 'description' => 'Test Product', - 'transactionId' => 123, - 'merchantId' => 'foo', - 'merchantKey' => 'bar', - 'returnUrl' => 'https://www.example.com/return', - 'cancelUrl' => 'https://www.example.com/cancel', - ) - ); - - $data = $this->request->getData(); - $this->assertSame('ab86df60906e97d3bfb362aff26fd9e6', $data['signature']); - } - - public function testPurchase() - { - $this->request->setAmount('12.00')->setDescription('Test Product'); - - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\PayFast\Message\PurchaseResponse', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertNull($response->getCode()); - - $this->assertSame('https://www.payfast.co.za/eng/process', $response->getRedirectUrl()); - $this->assertSame('POST', $response->getRedirectMethod()); - $this->assertArrayHasKey('signature', $response->getData()); - } -} diff --git a/tests/Omnipay/PayFast/Message/PurchaseResponseTest.php b/tests/Omnipay/PayFast/Message/PurchaseResponseTest.php deleted file mode 100644 index e7e9c4eb..00000000 --- a/tests/Omnipay/PayFast/Message/PurchaseResponseTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayFast\Message; - -use Omnipay\TestCase; - -class PurchaseResponseTest extends TestCase -{ - public function testConstruct() - { - $data = array('test' => '123'); - $response = new PurchaseResponse($this->getMockRequest(), $data, 'https://example.com/'); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame($data, $response->getData()); - - $this->assertSame('https://example.com/', $response->getRedirectUrl()); - $this->assertSame('POST', $response->getRedirectMethod()); - $this->assertSame($data, $response->getRedirectData()); - } -} diff --git a/tests/Omnipay/PayFast/Mock/CompletePurchaseItnFailure.txt b/tests/Omnipay/PayFast/Mock/CompletePurchaseItnFailure.txt deleted file mode 100644 index 11ee6c24..00000000 --- a/tests/Omnipay/PayFast/Mock/CompletePurchaseItnFailure.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 07 Mar 2013 04:57:24 GMT -Server: Apache/2.2.3 (CentOS) -Set-Cookie: refer_session=Direct; path=/; domain=.payfast.co.za, refer_first=Direct; expires=Fri, 07-Mar-2014 04:57:24 GMT; path=/; domain=.payfast.co.za -Expires: Thu, 19 Nov 1981 08:52:00 GMT -Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 -Pragma: no-cache -Vary: Accept-Encoding,User-Agent -Content-Length: 7 -Connection: close -Content-Type: text/html; charset=UTF-8 - -INVALID \ No newline at end of file diff --git a/tests/Omnipay/PayFast/Mock/CompletePurchaseItnSuccess.txt b/tests/Omnipay/PayFast/Mock/CompletePurchaseItnSuccess.txt deleted file mode 100644 index 513ace14..00000000 --- a/tests/Omnipay/PayFast/Mock/CompletePurchaseItnSuccess.txt +++ /dev/null @@ -1,12 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 07 Mar 2013 05:30:11 GMT -Server: Apache/2.2.3 (CentOS) -Expires: Thu, 19 Nov 1981 08:52:00 GMT -Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 -Pragma: no-cache -Vary: Accept-Encoding,User-Agent -Content-Length: 5 -Connection: close -Content-Type: text/html; charset=UTF-8 - -VALID \ No newline at end of file diff --git a/tests/Omnipay/PayFast/Mock/CompletePurchasePdtFailure.txt b/tests/Omnipay/PayFast/Mock/CompletePurchasePdtFailure.txt deleted file mode 100644 index a577ecac..00000000 --- a/tests/Omnipay/PayFast/Mock/CompletePurchasePdtFailure.txt +++ /dev/null @@ -1,12 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 07 Mar 2013 05:07:38 GMT -Server: Apache/2.2.3 (CentOS) -Expires: Thu, 19 Nov 1981 08:52:00 GMT -Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 -Pragma: no-cache -Vary: Accept-Encoding,User-Agent -Content-Length: 4 -Connection: close -Content-Type: text/html; charset=UTF-8 - -FAIL \ No newline at end of file diff --git a/tests/Omnipay/PayFast/Mock/CompletePurchasePdtSuccess.txt b/tests/Omnipay/PayFast/Mock/CompletePurchasePdtSuccess.txt deleted file mode 100644 index 062df7c4..00000000 --- a/tests/Omnipay/PayFast/Mock/CompletePurchasePdtSuccess.txt +++ /dev/null @@ -1,34 +0,0 @@ -HTTP/1.1 200 OK -Date: Thu, 07 Mar 2013 04:50:36 GMT -Server: Apache/2.2.3 (CentOS) -Expires: Thu, 19 Nov 1981 08:52:00 GMT -Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 -Pragma: no-cache -Vary: Accept-Encoding,User-Agent -Content-Length: 397 -Connection: close -Content-Type: text/html; charset=UTF-8 - -SUCCESS -m_payment_id= -pf_payment_id=61484 -payment_status=COMPLETE -item_name=fjdksl -item_description= -amount_gross=12.00 -amount_fee=-0.27 -amount_net=11.73 -custom_str1= -custom_str2= -custom_str3= -custom_str4= -custom_str5= -custom_int1= -custom_int2= -custom_int3= -custom_int4= -custom_int5= -name_first=Test -name_last=User+01 -email_address=sbtu01%40payfast.co.za -merchant_id=10000103 \ No newline at end of file diff --git a/tests/Omnipay/PayPal/ExpressGatewayTest.php b/tests/Omnipay/PayPal/ExpressGatewayTest.php deleted file mode 100644 index 2f66c7c5..00000000 --- a/tests/Omnipay/PayPal/ExpressGatewayTest.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal; - -use Omnipay\GatewayTestCase; - -class ExpressGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new ExpressGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - 'cancelUrl' => 'https://www.example.com/cancel', - ); - } - - public function testAuthorizeSuccess() - { - $this->setMockHttpResponse('ExpressPurchaseSuccess.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\PayPal\Message\ExpressAuthorizeResponse', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertEquals('https://www.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl()); - } - - public function testAuthorizeFailure() - { - $this->setMockHttpResponse('ExpressPurchaseFailure.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('This transaction cannot be processed. The amount to be charged is zero.', $response->getMessage()); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('ExpressPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertInstanceOf('\Omnipay\PayPal\Message\ExpressAuthorizeResponse', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertEquals('https://www.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('ExpressPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('This transaction cannot be processed. The amount to be charged is zero.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/PayPal/Message/ExpressAuthorizeRequestTest.php b/tests/Omnipay/PayPal/Message/ExpressAuthorizeRequestTest.php deleted file mode 100644 index b04b423f..00000000 --- a/tests/Omnipay/PayPal/Message/ExpressAuthorizeRequestTest.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -use Omnipay\TestCase; - -class ExpressAuthorizeRequestTest extends TestCase -{ - public function setUp() - { - parent::setUp(); - - $this->request = new ExpressAuthorizeRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize( - array( - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - 'cancelUrl' => 'https://www.example.com/cancel', - ) - ); - } - - public function testGetData() - { - $this->request->initialize(array( - 'amount' => '10.00', - 'currency' => 'AUD', - 'transactionId' => '111', - 'description' => 'Order Description', - 'returnUrl' => 'https://www.example.com/return', - 'cancelUrl' => 'https://www.example.com/cancel', - 'notifyUrl' => 'https://www.example.com/notify', - 'subject' => 'demo@example.com', - 'headerImageUrl' => 'https://www.example.com/header.jpg', - )); - - $data = $this->request->getData(); - - $this->assertSame('10.00', $data['PAYMENTREQUEST_0_AMT']); - $this->assertSame('AUD', $data['PAYMENTREQUEST_0_CURRENCYCODE']); - $this->assertSame('111', $data['PAYMENTREQUEST_0_INVNUM']); - $this->assertSame('Order Description', $data['PAYMENTREQUEST_0_DESC']); - $this->assertSame('https://www.example.com/return', $data['RETURNURL']); - $this->assertSame('https://www.example.com/cancel', $data['CANCELURL']); - $this->assertSame('https://www.example.com/notify', $data['PAYMENTREQUEST_0_NOTIFYURL']); - $this->assertSame('demo@example.com', $data['SUBJECT']); - $this->assertSame('https://www.example.com/header.jpg', $data['HDRIMG']); - } - - public function testHeaderImageUrl() - { - $this->assertSame($this->request, $this->request->setHeaderImageUrl('https://www.example.com/header.jpg')); - $this->assertSame('https://www.example.com/header.jpg', $this->request->getHeaderImageUrl()); - - $data = $this->request->getData(); - $this->assertEquals('https://www.example.com/header.jpg', $data['HDRIMG']); - } -} diff --git a/tests/Omnipay/PayPal/Message/ExpressAuthorizeResponse.php b/tests/Omnipay/PayPal/Message/ExpressAuthorizeResponse.php deleted file mode 100644 index 98513b34..00000000 --- a/tests/Omnipay/PayPal/Message/ExpressAuthorizeResponse.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -use Omnipay\TestCase; - -class ExpressAuthorizeResponseTest extends TestCase -{ - public function testConstruct() - { - // response should decode URL format data - $response = new ExpressAuthorizeResponse('example=value&foo=bar'); - $this->assertEquals(array('example' => 'value', 'foo' => 'bar'), $response->getData()); - } - - public function testExpressPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('ExpressPurchaseSuccess.txt'); - $response = new ExpressAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('EC-42721413K79637829', $response->getExpressRedirectToken()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testExpressPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('ExpressPurchaseFailure.txt'); - $response = new ExpressAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertNull($response->getExpressRedirectToken()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('This transaction cannot be processed. The amount to be charged is zero.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/PayPal/Message/ResponseTest.php b/tests/Omnipay/PayPal/Message/ResponseTest.php deleted file mode 100644 index 7f2720a5..00000000 --- a/tests/Omnipay/PayPal/Message/ResponseTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - public function testConstruct() - { - // response should decode URL format data - $response = new Response($this->getMockRequest(), 'example=value&foo=bar'); - $this->assertEquals(array('example' => 'value', 'foo' => 'bar'), $response->getData()); - } - - public function testProPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('ProPurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('96U93778BD657313D', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testProPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('ProPurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('This transaction cannot be processed. Please enter a valid credit card expiration year.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/PayPal/Mock/ExpressCompletePurchaseFailure.txt b/tests/Omnipay/PayPal/Mock/ExpressCompletePurchaseFailure.txt deleted file mode 100644 index edab460c..00000000 --- a/tests/Omnipay/PayPal/Mock/ExpressCompletePurchaseFailure.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Wed, 20 Feb 2013 13:55:50 GMT -Server: Apache -Content-Length: 214 -Connection: close -Content-Type: text/plain; charset=utf-8 - -TIMESTAMP=2013%2d02%2d20T13%3a55%3a50Z&CORRELATIONID=73310039452e7&ACK=Failure&VERSION=85%2e0&BUILD=5060305&L_ERRORCODE0=10410&L_SHORTMESSAGE0=Invalid%20token&L_LONGMESSAGE0=Invalid%20token%2e&L_SEVERITYCODE0=Error \ No newline at end of file diff --git a/tests/Omnipay/PayPal/Mock/ExpressCompletePurchaseSuccess.txt b/tests/Omnipay/PayPal/Mock/ExpressCompletePurchaseSuccess.txt deleted file mode 100644 index 10133f63..00000000 --- a/tests/Omnipay/PayPal/Mock/ExpressCompletePurchaseSuccess.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Wed, 20 Feb 2013 13:54:27 GMT -Server: Apache -Content-Length: 869 -Connection: close -Content-Type: text/plain; charset=utf-8 - -TOKEN=EC%2d96V667110D1727015&SUCCESSPAGEREDIRECTREQUESTED=true&TIMESTAMP=2013%2d02%2d20T13%3a54%3a28Z&CORRELATIONID=f78b888897f8a&ACK=Success&VERSION=85%2e0&BUILD=5060305&INSURANCEOPTIONSELECTED=false&SHIPPINGOPTIONISDEFAULT=false&PAYMENTINFO_0_TRANSACTIONID=8RM57414KW761861W&PAYMENTINFO_0_RECEIPTID=0368%2d2088%2d8643%2d7560&PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout&PAYMENTINFO_0_PAYMENTTYPE=instant&PAYMENTINFO_0_ORDERTIME=2013%2d02%2d20T13%3a54%3a03Z&PAYMENTINFO_0_AMT=10%2e00&PAYMENTINFO_0_FEEAMT=0%2e59&PAYMENTINFO_0_TAXAMT=0%2e00&PAYMENTINFO_0_CURRENCYCODE=USD&PAYMENTINFO_0_PAYMENTSTATUS=Completed&PAYMENTINFO_0_PENDINGREASON=None&PAYMENTINFO_0_REASONCODE=None&PAYMENTINFO_0_PROTECTIONELIGIBILITY=Ineligible&PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=None&PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=VZTRGMSKHHAEW&PAYMENTINFO_0_ERRORCODE=0&PAYMENTINFO_0_ACK=Success \ No newline at end of file diff --git a/tests/Omnipay/PayPal/Mock/ExpressPurchaseFailure.txt b/tests/Omnipay/PayPal/Mock/ExpressPurchaseFailure.txt deleted file mode 100644 index 431a16f8..00000000 --- a/tests/Omnipay/PayPal/Mock/ExpressPurchaseFailure.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Fri, 15 Feb 2013 19:21:05 GMT -Server: Apache -Content-Length: 292 -Connection: close -Content-Type: text/plain; charset=utf-8 - -TIMESTAMP=2013%2d02%2d15T19%3a21%3a06Z&CORRELATIONID=2b58be2b8e60e&ACK=Failure&VERSION=85%2e0&BUILD=5060305&L_ERRORCODE0=10525&L_SHORTMESSAGE0=Invalid%20Data&L_LONGMESSAGE0=This%20transaction%20cannot%20be%20processed%2e%20The%20amount%20to%20be%20charged%20is%20zero%2e&L_SEVERITYCODE0=Error \ No newline at end of file diff --git a/tests/Omnipay/PayPal/Mock/ExpressPurchaseSuccess.txt b/tests/Omnipay/PayPal/Mock/ExpressPurchaseSuccess.txt deleted file mode 100644 index 86c40d4f..00000000 --- a/tests/Omnipay/PayPal/Mock/ExpressPurchaseSuccess.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Fri, 15 Feb 2013 19:19:21 GMT -Server: Apache -Content-Length: 136 -Connection: close -Content-Type: text/plain; charset=utf-8 - -TOKEN=EC%2d42721413K79637829&TIMESTAMP=2013%2d02%2d15T19%3a19%3a21Z&CORRELATIONID=37b8b9915987c&ACK=Success&VERSION=85%2e0&BUILD=5060305 \ No newline at end of file diff --git a/tests/Omnipay/PayPal/Mock/ProPurchaseFailure.txt b/tests/Omnipay/PayPal/Mock/ProPurchaseFailure.txt deleted file mode 100644 index 04321987..00000000 --- a/tests/Omnipay/PayPal/Mock/ProPurchaseFailure.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Fri, 15 Feb 2013 18:49:26 GMT -Server: Apache -Content-Length: 340 -Connection: close -Content-Type: text/plain; charset=utf-8 - -TIMESTAMP=2013%2d02%2d15T18%3a49%3a27Z&CORRELATIONID=ec641b50c33b0&ACK=Failure&VERSION=85%2e0&BUILD=5060305&L_ERRORCODE0=10562&L_SHORTMESSAGE0=Invalid%20Data&L_LONGMESSAGE0=This%20transaction%20cannot%20be%20processed%2e%20Please%20enter%20a%20valid%20credit%20card%20expiration%20year%2e&L_SEVERITYCODE0=Error&AMT=150%2e04&CURRENCYCODE=USD \ No newline at end of file diff --git a/tests/Omnipay/PayPal/Mock/ProPurchaseSuccess.txt b/tests/Omnipay/PayPal/Mock/ProPurchaseSuccess.txt deleted file mode 100644 index edaed75f..00000000 --- a/tests/Omnipay/PayPal/Mock/ProPurchaseSuccess.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Date: Fri, 15 Feb 2013 18:38:31 GMT -Server: Apache -Content-Length: 190 -Connection: close -Content-Type: text/plain; charset=utf-8 - -TIMESTAMP=2013%2d02%2d15T18%3a38%3a36Z&CORRELATIONID=541737dc565cb&ACK=Success&VERSION=85%2e0&BUILD=5060305&AMT=10%2e00&CURRENCYCODE=USD&AVSCODE=X&CVV2MATCH=M&TRANSACTIONID=96U93778BD657313D \ No newline at end of file diff --git a/tests/Omnipay/PayPal/ProGatewayTest.php b/tests/Omnipay/PayPal/ProGatewayTest.php deleted file mode 100644 index 46cbdeaa..00000000 --- a/tests/Omnipay/PayPal/ProGatewayTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PayPal; - -use Omnipay\GatewayTestCase; -use Omnipay\Common\CreditCard; - -class ProGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new ProGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => '10.00', - 'card' => new CreditCard(array( - 'firstName' => 'Example', - 'lastName' => 'User', - 'number' => '4111111111111111', - 'expiryMonth' => '12', - 'expiryYear' => '2016', - 'cvv' => '123', - )), - ); - } - - public function testAuthorize() - { - $this->setMockHttpResponse('ProPurchaseSuccess.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('96U93778BD657313D', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testPurchase() - { - $this->setMockHttpResponse('ProPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('96U93778BD657313D', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/Payflow/Message/ResponseTest.php b/tests/Omnipay/Payflow/Message/ResponseTest.php deleted file mode 100644 index d4cf4ddc..00000000 --- a/tests/Omnipay/Payflow/Message/ResponseTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testConstructEmpty() - { - $response = new Response($this->getMockRequest(), ''); - } - - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertEquals('V19R3EF62FBE', $response->getTransactionReference()); - $this->assertEquals('Approved', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('User authentication failed', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Payflow/Mock/PurchaseFailure.txt b/tests/Omnipay/Payflow/Mock/PurchaseFailure.txt deleted file mode 100644 index 41eaed15..00000000 --- a/tests/Omnipay/Payflow/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTTP/1.1 200 OK -Connection: close -Server: VPS-3.033.00 -Date: Sat, 23 Feb 2013 05:17:32 GMT -Content-type: text/namevalue -Content-length: 43 - -RESULT=1&RESPMSG=User authentication failed \ No newline at end of file diff --git a/tests/Omnipay/Payflow/Mock/PurchaseSuccess.txt b/tests/Omnipay/Payflow/Mock/PurchaseSuccess.txt deleted file mode 100644 index 150c27a8..00000000 --- a/tests/Omnipay/Payflow/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,3 +0,0 @@ -HTTP/1.1 200 OK - -RESULT=0&PNREF=V19R3EF62FBE&RESPMSG=Approved&AUTHCODE=048747&CVV2MATCH=Y \ No newline at end of file diff --git a/tests/Omnipay/Payflow/ProGatewayTest.php b/tests/Omnipay/Payflow/ProGatewayTest.php deleted file mode 100644 index 2b68d93a..00000000 --- a/tests/Omnipay/Payflow/ProGatewayTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Payflow; - -use Omnipay\Common\CreditCard; -use Omnipay\GatewayTestCase; - -class ProGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new ProGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => '10.00', - 'card' => new CreditCard(array( - 'firstName' => 'Example', - 'lastName' => 'User', - 'number' => '4111111111111111', - 'expiryMonth' => '12', - 'expiryYear' => '2016', - 'cvv' => '123', - )), - ); - } - - public function testAuthorizeSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('V19R3EF62FBE', $response->getTransactionReference()); - } - - public function testAuthorizeError() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('User authentication failed', $response->getMessage()); - } - - public function testCapture() - { - $options = array( - 'amount' => '10.00', - 'transactionReference' => 'abc123', - ); - - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->gateway->capture($options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('V19R3EF62FBE', $response->getTransactionReference()); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('V19R3EF62FBE', $response->getTransactionReference()); - } - - public function testPurchaseError() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertSame('User authentication failed', $response->getMessage()); - } - - public function testRefund() - { - $options = array( - 'amount' => '10.00', - 'transactionReference' => 'abc123', - ); - - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->gateway->refund($options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('V19R3EF62FBE', $response->getTransactionReference()); - } -} diff --git a/tests/Omnipay/PaymentExpress/Message/PxPayAuthorizeResponseTest.php b/tests/Omnipay/PaymentExpress/Message/PxPayAuthorizeResponseTest.php deleted file mode 100644 index dc7a8a44..00000000 --- a/tests/Omnipay/PaymentExpress/Message/PxPayAuthorizeResponseTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -use Omnipay\TestCase; - -class PxPayAuthorizeResponseTest extends TestCase -{ - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PxPayPurchaseSuccess.txt'); - $response = new PxPayAuthorizeResponse($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://sec.paymentexpress.com/pxpay/pxpay.aspx?userid=Developer&request=v5H7JrBTzH-4Whs__1iQnz4RGSb9qxRKNR4kIuDP8kIkQzIDiIob9GTIjw_9q_AdRiR47ViWGVx40uRMu52yz2mijT39YtGeO7cZWrL5rfnx0Mc4DltIHRnIUxy1EO1srkNpxaU8fT8_1xMMRmLa-8Fd9bT8Oq0BaWMxMquYa1hDNwvoGs1SJQOAJvyyKACvvwsbMCC2qJVyN0rlvwUoMtx6gGhvmk7ucEsPc_Cyr5kNl3qURnrLKxINnS0trdpU4kXPKOlmT6VacjzT1zuj_DnrsWAPFSFq-hGsow6GpKKciQ0V0aFbAqECN8rl_c-aZWFFy0gkfjnUM4qp6foS0KMopJlPzGAgMjV6qZ0WfleOT64c3E-FRLMP5V_-mILs8a', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PxPayPurchaseFailure.txt'); - $response = new PxPayAuthorizeResponse($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Invalid Key', $response->getMessage()); - } -} diff --git a/tests/Omnipay/PaymentExpress/Message/ResponseTest.php b/tests/Omnipay/PaymentExpress/Message/ResponseTest.php deleted file mode 100644 index 4f968029..00000000 --- a/tests/Omnipay/PaymentExpress/Message/ResponseTest.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PxPostPurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('000000030884cdc6', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('Transaction Approved', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PxPostPurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('The transaction was Declined (U5)', $response->getMessage()); - } - - public function testCompletePurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PxPayCompletePurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('0000000103f5dc65', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('APPROVED', $response->getMessage()); - } - - public function testCompletePurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PxPayCompletePurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('Length of the data to decrypt is invalid.', $response->getMessage()); - } - - public function testCreateCardSuccess() - { - $httpResponse = $this->getMockHttpResponse('PxPostCreateCardSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('00000001040c73ea', $response->getTransactionReference()); - $this->assertSame('0000010009328404', $response->getCardReference()); - $this->assertSame('Transaction Approved', $response->getMessage()); - } - - public function testCreateCardFailure() - { - $httpResponse = $this->getMockHttpResponse('PxPostCreateCardFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->xml()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('An Invalid Card Number was entered. Check the card number', $response->getMessage()); - } -} diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPayCompletePurchaseFailure.txt b/tests/Omnipay/PaymentExpress/Mock/PxPayCompletePurchaseFailure.txt deleted file mode 100644 index 430b1091..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPayCompletePurchaseFailure.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 200 OK -Server: DPS_PX_SERVER -Cache-Control: private -Content-Length: 744 -Content-Type: application/xhtml+xml; charset=utf-8 -Expires: Sat, 23 Feb 2013 15:14:26 GMT -Date: Sat, 23 Feb 2013 15:15:26 GMT - -Length of the data to decrypt is invalid. \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPayCompletePurchaseSuccess.txt b/tests/Omnipay/PaymentExpress/Mock/PxPayCompletePurchaseSuccess.txt deleted file mode 100644 index 40359f50..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPayCompletePurchaseSuccess.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 200 OK -Server: DPS_PX_SERVER -Cache-Control: private -Content-Length: 866 -Content-Type: application/xhtml+xml; charset=utf-8 -Expires: Sat, 23 Feb 2013 15:11:45 GMT -Date: Sat, 23 Feb 2013 15:12:45 GMT - -1AuthNZD041211VisaJDFKL FDJKSL411111........110819115.67.229.192P075985DA31094D80000000103f5dc6510.00NZD20130224APPROVED0NotUsed00 \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPayPurchaseFailure.txt b/tests/Omnipay/PaymentExpress/Mock/PxPayPurchaseFailure.txt deleted file mode 100644 index 3105a06c..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPayPurchaseFailure.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 200 OK -Server: DPS_PX_SERVER -Cache-Control: private -Content-Length: 51 -Content-Type: application/xhtml+xml; charset=utf-8 -Expires: Sat, 23 Feb 2013 14:54:40 GMT -Date: Sat, 23 Feb 2013 14:55:40 GMT - -Invalid Key \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPayPurchaseSuccess.txt b/tests/Omnipay/PaymentExpress/Mock/PxPayPurchaseSuccess.txt deleted file mode 100644 index e0ff6957..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPayPurchaseSuccess.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 200 OK -Server: DPS_PX_SERVER -Cache-Control: private -Content-Length: 507 -Content-Type: application/xhtml+xml; charset=utf-8 -Expires: Sat, 23 Feb 2013 14:56:42 GMT -Date: Sat, 23 Feb 2013 14:57:41 GMT - -https://sec.paymentexpress.com/pxpay/pxpay.aspx?userid=Developer&request=v5H7JrBTzH-4Whs__1iQnz4RGSb9qxRKNR4kIuDP8kIkQzIDiIob9GTIjw_9q_AdRiR47ViWGVx40uRMu52yz2mijT39YtGeO7cZWrL5rfnx0Mc4DltIHRnIUxy1EO1srkNpxaU8fT8_1xMMRmLa-8Fd9bT8Oq0BaWMxMquYa1hDNwvoGs1SJQOAJvyyKACvvwsbMCC2qJVyN0rlvwUoMtx6gGhvmk7ucEsPc_Cyr5kNl3qURnrLKxINnS0trdpU4kXPKOlmT6VacjzT1zuj_DnrsWAPFSFq-hGsow6GpKKciQ0V0aFbAqECN8rl_c-aZWFFy0gkfjnUM4qp6foS0KMopJlPzGAgMjV6qZ0WfleOT64c3E-FRLMP5V_-mILs8a \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPostCreateCardFailure.txt b/tests/Omnipay/PaymentExpress/Mock/PxPostCreateCardFailure.txt deleted file mode 100644 index d525329f..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPostCreateCardFailure.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 200 OK -Server: DPS_PX_SERVER -Cache-Control: private -Content-Length: 2618 -Content-Type: application/xhtml+xml; charset=utf-8 -Expires: Tue, 26 Feb 2013 16:55:13 GMT -Date: Tue, 26 Feb 2013 16:56:12 GMT - -0QK2013022616561820130226165618UTC000.001.00554554NZD1.00NZDFJKSDL FJDKSL19800101Auth000000........0004199000QKInvalid Card Number00INVALID CARD NUMBERAn Invalid Card Number was entered. Check the card numberAn Invalid Card Number was entered. Check the card numberINVALID CARD NUMBERAn Invalid Card Number was entered. Check the card numberAn Invalid Card Number was entered. Check the card number0-099970040c754e000000010000000000000000-1QKINVALID CARD NUMBERAn Invalid Card Number was entered. Check the card number00000000000000000-1 \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPostCreateCardSuccess.txt b/tests/Omnipay/PaymentExpress/Mock/PxPostCreateCardSuccess.txt deleted file mode 100644 index a1887319..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPostCreateCardSuccess.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 200 OK -Server: DPS_PX_SERVER -Cache-Control: private -Content-Length: 2542 -Content-Type: application/xhtml+xml; charset=utf-8 -Expires: Tue, 26 Feb 2013 16:50:08 GMT -Date: Tue, 26 Feb 2013 16:51:09 GMT - -1002013022616511420130226165114UTCVisa00055111040c73ea000000010.001.00554554NZD1.00NZDFJKSDL FJDKSL20130227Auth411111........112BC202100419201302270551119001Undefined00APPROVED02APPROVEDThe Transaction was approvedThe Transaction was approvedAPPROVEDThe Transaction was approvedThe Transaction was approved0NotUsed10000000-1000402160744999700000001040c73ea10000010009328404040c73ea000000010000000000000000-100APPROVEDTransaction Approved100000001040c73ea0000000000000000-1 \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPostPurchaseFailure.txt b/tests/Omnipay/PaymentExpress/Mock/PxPostPurchaseFailure.txt deleted file mode 100644 index 54f0ed98..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPostPurchaseFailure.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTTP/1.1 200 OK -Server: DPS_PX_SERVER -Cache-Control: private -Content-Length: 2435 -Content-Type: application/xhtml+xml; charset=utf-8 -Expires: Sat, 23 Feb 2013 14:09:13 GMT -Date: Sat, 23 Feb 2013 14:10:12 GMT - -0U52013022314103020130223141030UTC000.0010.00554554NZD1.00NZDFJKSDL FJDKSL19800101Purchase411111........1104190D500DECLINEDThe transaction was Declined (U5)The transaction was Declined (U5)DECLINEDThe transaction was Declined (U5)The transaction was Declined (U5)0-0-1000000000000000010000000000000000-1U5DECLINEDThe transaction was Declined (U5)00000000000000000-1 \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/Mock/PxPostPurchaseSuccess.txt b/tests/Omnipay/PaymentExpress/Mock/PxPostPurchaseSuccess.txt deleted file mode 100644 index 81b05fa2..00000000 --- a/tests/Omnipay/PaymentExpress/Mock/PxPostPurchaseSuccess.txt +++ /dev/null @@ -1,3 +0,0 @@ -HTTP/1.1 200 OK - -00APPROVEDTransaction Approved1000000030884cdc6inv1278 \ No newline at end of file diff --git a/tests/Omnipay/PaymentExpress/PxPayGatewayTest.php b/tests/Omnipay/PaymentExpress/PxPayGatewayTest.php deleted file mode 100644 index 067558ba..00000000 --- a/tests/Omnipay/PaymentExpress/PxPayGatewayTest.php +++ /dev/null @@ -1,157 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress; - -use Omnipay\GatewayTestCase; - -class PxPayGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new PxPayGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - ); - } - - public function testAuthorizeSuccess() - { - $this->setMockHttpResponse('PxPayPurchaseSuccess.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://sec.paymentexpress.com/pxpay/pxpay.aspx?userid=Developer&request=v5H7JrBTzH-4Whs__1iQnz4RGSb9qxRKNR4kIuDP8kIkQzIDiIob9GTIjw_9q_AdRiR47ViWGVx40uRMu52yz2mijT39YtGeO7cZWrL5rfnx0Mc4DltIHRnIUxy1EO1srkNpxaU8fT8_1xMMRmLa-8Fd9bT8Oq0BaWMxMquYa1hDNwvoGs1SJQOAJvyyKACvvwsbMCC2qJVyN0rlvwUoMtx6gGhvmk7ucEsPc_Cyr5kNl3qURnrLKxINnS0trdpU4kXPKOlmT6VacjzT1zuj_DnrsWAPFSFq-hGsow6GpKKciQ0V0aFbAqECN8rl_c-aZWFFy0gkfjnUM4qp6foS0KMopJlPzGAgMjV6qZ0WfleOT64c3E-FRLMP5V_-mILs8a', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - } - - public function testAuthorizeFailure() - { - $this->setMockHttpResponse('PxPayPurchaseFailure.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Invalid Key', $response->getMessage()); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('PxPayPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://sec.paymentexpress.com/pxpay/pxpay.aspx?userid=Developer&request=v5H7JrBTzH-4Whs__1iQnz4RGSb9qxRKNR4kIuDP8kIkQzIDiIob9GTIjw_9q_AdRiR47ViWGVx40uRMu52yz2mijT39YtGeO7cZWrL5rfnx0Mc4DltIHRnIUxy1EO1srkNpxaU8fT8_1xMMRmLa-8Fd9bT8Oq0BaWMxMquYa1hDNwvoGs1SJQOAJvyyKACvvwsbMCC2qJVyN0rlvwUoMtx6gGhvmk7ucEsPc_Cyr5kNl3qURnrLKxINnS0trdpU4kXPKOlmT6VacjzT1zuj_DnrsWAPFSFq-hGsow6GpKKciQ0V0aFbAqECN8rl_c-aZWFFy0gkfjnUM4qp6foS0KMopJlPzGAgMjV6qZ0WfleOT64c3E-FRLMP5V_-mILs8a', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('PxPayPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Invalid Key', $response->getMessage()); - } - - public function testCompleteAuthorizeSuccess() - { - $this->getHttpRequest()->query->replace(array('result' => 'abc123')); - - $this->setMockHttpResponse('PxPayCompletePurchaseSuccess.txt'); - - $response = $this->gateway->completeAuthorize($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('0000000103f5dc65', $response->getTransactionReference()); - $this->assertSame('APPROVED', $response->getMessage()); - } - - public function testCompleteAuthorizeFailure() - { - $this->getHttpRequest()->query->replace(array('result' => 'abc123')); - - $this->setMockHttpResponse('PxPayCompletePurchaseFailure.txt'); - - $response = $this->gateway->completeAuthorize($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Length of the data to decrypt is invalid.', $response->getMessage()); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testCompleteAuthorizeInvalid() - { - $this->getHttpRequest()->query->replace(array()); - - $response = $this->gateway->completeAuthorize($this->options)->send(); - } - - public function testCompletePurchaseSuccess() - { - $this->getHttpRequest()->query->replace(array('result' => 'abc123')); - - $this->setMockHttpResponse('PxPayCompletePurchaseSuccess.txt'); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('0000000103f5dc65', $response->getTransactionReference()); - $this->assertSame('APPROVED', $response->getMessage()); - } - - public function testCompletePurchaseFailure() - { - $this->getHttpRequest()->query->replace(array('result' => 'abc123')); - - $this->setMockHttpResponse('PxPayCompletePurchaseFailure.txt'); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Length of the data to decrypt is invalid.', $response->getMessage()); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testCompletePurchaseInvalid() - { - $this->getHttpRequest()->query->replace(array()); - - $response = $this->gateway->completePurchase($this->options)->send(); - } -} diff --git a/tests/Omnipay/PaymentExpress/PxPostGatewayTest.php b/tests/Omnipay/PaymentExpress/PxPostGatewayTest.php deleted file mode 100644 index 7c3f0b57..00000000 --- a/tests/Omnipay/PaymentExpress/PxPostGatewayTest.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\PaymentExpress; - -use Omnipay\GatewayTestCase; - -class PxPostGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new PxPostGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->options = array( - 'amount' => '10.00', - 'card' => $this->getValidCard(), - ); - } - - public function testAuthorizeSuccess() - { - $this->setMockHttpResponse('PxPostPurchaseSuccess.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('000000030884cdc6', $response->getTransactionReference()); - $this->assertSame('Transaction Approved', $response->getMessage()); - } - - public function testAuthorizeFailure() - { - $this->setMockHttpResponse('PxPostPurchaseFailure.txt'); - - $response = $this->gateway->authorize($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The transaction was Declined (U5)', $response->getMessage()); - } - - public function testCaptureSuccess() - { - $this->setMockHttpResponse('PxPostPurchaseSuccess.txt'); - - $options = array( - 'amount' => '10.00', - 'transactionReference' => '000000030884cdc6', - ); - - $response = $this->gateway->capture($options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('000000030884cdc6', $response->getTransactionReference()); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('PxPostPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('000000030884cdc6', $response->getTransactionReference()); - $this->assertSame('Transaction Approved', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('PxPostPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The transaction was Declined (U5)', $response->getMessage()); - } - - public function testRefundSuccess() - { - $this->setMockHttpResponse('PxPostPurchaseSuccess.txt'); - - $options = array( - 'amount' => '10.00', - 'transactionReference' => '000000030884cdc6', - ); - - $response = $this->gateway->refund($options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertEquals('000000030884cdc6', $response->getTransactionReference()); - } - - public function testCreateCardSuccess() - { - $this->setMockHttpResponse('PxPostCreateCardSuccess.txt'); - $response = $this->gateway->createCard($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('00000001040c73ea', $response->getTransactionReference()); - $this->assertSame('0000010009328404', $response->getCardReference()); - $this->assertSame('Transaction Approved', $response->getMessage()); - } - - public function testCreateCardFailure() - { - $this->setMockHttpResponse('PxPostCreateCardFailure.txt'); - $response = $this->gateway->createCard($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('An Invalid Card Number was entered. Check the card number', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Pin/GatewayTest.php b/tests/Omnipay/Pin/GatewayTest.php deleted file mode 100644 index 60f8ceae..00000000 --- a/tests/Omnipay/Pin/GatewayTest.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Pin; - -use Omnipay\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 testPurchaseSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertEquals('ch_fXIxWf0gj1yFHJcV1W-d-w', $response->getTransactionReference()); - $this->assertSame('Success!', $response->getMessage()); - } - - public function testPurchaseError() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The current resource was deemed invalid.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Pin/Message/ResponseTest.php b/tests/Omnipay/Pin/Message/ResponseTest.php deleted file mode 100644 index 8095176f..00000000 --- a/tests/Omnipay/Pin/Message/ResponseTest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Pin\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('ch_fXIxWf0gj1yFHJcV1W-d-w', $response->getTransactionReference()); - $this->assertSame('Success!', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The current resource was deemed invalid.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Pin/Mock/PurchaseFailure.txt b/tests/Omnipay/Pin/Mock/PurchaseFailure.txt deleted file mode 100644 index 835db275..00000000 --- a/tests/Omnipay/Pin/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,17 +0,0 @@ -HTTP/1.1 422 Unprocessable Entity -Cache-Control: no-cache -Content-Type: application/json; charset=utf-8 -Date: Fri, 15 Feb 2013 15:54:18 GMT -Server: Apache/2.2.20 (Ubuntu) -Status: 422 -Strict-Transport-Security: max-age=31536000 -Vary: User-Agent -X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11 -X-Rack-Cache: invalidate, pass -X-Request-Id: 293436e475bfc6face410e6ed241efe9 -X-Runtime: 0.161746 -X-UA-Compatible: IE=Edge,chrome=1 -Content-Length: 152 -Connection: keep-alive - -{"error":"invalid_resource","error_description":"The current resource was deemed invalid.","messages":[{"code":"invalid","message":"Processing error"}]} \ No newline at end of file diff --git a/tests/Omnipay/Pin/Mock/PurchaseSuccess.txt b/tests/Omnipay/Pin/Mock/PurchaseSuccess.txt deleted file mode 100644 index 1eaa0b05..00000000 --- a/tests/Omnipay/Pin/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,18 +0,0 @@ -HTTP/1.1 200 OK -Cache-Control: max-age=0, private, must-revalidate -Content-Type: application/json; charset=utf-8 -Date: Fri, 15 Feb 2013 15:42:42 GMT -ETag: "e0b6339dc44a19a2901de1447ec94ebb" -Server: Apache/2.2.20 (Ubuntu) -Status: 200 -Strict-Transport-Security: max-age=31536000 -Vary: User-Agent -X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11 -X-Rack-Cache: invalidate, pass -X-Request-Id: 6444d2d9467ed2a7ace471522f2d439b -X-Runtime: 0.245244 -X-UA-Compatible: IE=Edge,chrome=1 -Content-Length: 584 -Connection: keep-alive - -{"response":{"token":"ch_fXIxWf0gj1yFHJcV1W-d-w","success":true,"amount":1000,"currency":"USD","description":"first purchase","email":"fads","ip_address":"","created_at":"2013-02-15T15:42:42Z","status_message":"Success!","error_message":null,"card":{"token":"card_vRGOXvw3NSGR59-TSzVEiw","display_number":"XXXX-XXXX-XXXX-0000","scheme":"visa","address_line1":"jkl","address_line2":"jkl","address_city":"jkl","address_postcode":"jkl","address_state":"jkl","address_country":"jkl"},"transfer":[],"amount_refunded":0,"total_fees":null,"merchant_entitlement":null,"refund_pending":false}} \ No newline at end of file diff --git a/tests/Omnipay/SagePay/DirectGatewayTest.php b/tests/Omnipay/SagePay/DirectGatewayTest.php deleted file mode 100644 index 4e9066c3..00000000 --- a/tests/Omnipay/SagePay/DirectGatewayTest.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay; - -use Omnipay\GatewayTestCase; - -class DirectGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new DirectGateway($this->getHttpClient(), $this->getHttpRequest()); - - $this->purchaseOptions = array( - 'amount' => '10.00', - 'transactionId' => '123', - 'card' => $this->getValidCard(), - 'returnUrl' => 'https://www.example.com/return', - ); - - $this->captureOptions = array( - 'amount' => '10.00', - 'transactionReference' => '{"SecurityKey":"JEUPDN1N7E","TxAuthNo":"4255","VPSTxId":"{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}","VendorTxCode":"438791"}', - ); - } - - public function testAuthorizeFailureSuccess() - { - $this->setMockHttpResponse('DirectPurchaseSuccess.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('{"SecurityKey":"OUWLNYQTVT","TxAuthNo":"9962","VPSTxId":"{5A1BC414-5409-48DD-9B8B-DCDF096CE0BE}","VendorTxCode":"123"}', $response->getTransactionReference()); - $this->assertSame('Direct transaction from Simulator.', $response->getMessage()); - } - - public function testAuthorizeFailure() - { - $this->setMockHttpResponse('DirectPurchaseFailure.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The VendorTxCode \'984297\' has been used before. Each transaction you send should have a unique VendorTxCode.', $response->getMessage()); - } - - public function testAuthorize3dSecure() - { - $this->setMockHttpResponse('DirectPurchase3dSecure.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://test.sagepay.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl()); - - $redirectData = $response->getRedirectData(); - $this->assertSame('065379457749061954', $redirectData['MD']); - $this->assertSame('BSkaFwYFFTYAGyFbAB0LFRYWBwsBZw0EGwECEX9YRGFWc08pJCVVKgAANS0KADoZCCAMBnIeOxcWRg0LERdOOTQRDFRdVHNYUgwTMBsBCxABJw4DJHE+ERgPCi8MVC0HIAROCAAfBUk4ER89DD0IWDkvMQ1VdFwoUFgwXVYvbHgvMkdBXXNbQGIjdl1ZUEc1XSwqAAgUUicYBDYcB3I2AjYjIzsn', $redirectData['PaReq']); - $this->assertSame('https://www.example.com/return', $redirectData['TermUrl']); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('DirectPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->purchaseOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('{"SecurityKey":"OUWLNYQTVT","TxAuthNo":"9962","VPSTxId":"{5A1BC414-5409-48DD-9B8B-DCDF096CE0BE}","VendorTxCode":"123"}', $response->getTransactionReference()); - $this->assertSame('Direct transaction from Simulator.', $response->getMessage()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('DirectPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The VendorTxCode \'984297\' has been used before. Each transaction you send should have a unique VendorTxCode.', $response->getMessage()); - } - - public function testPurchase3dSecure() - { - $this->setMockHttpResponse('DirectPurchase3dSecure.txt'); - - $response = $this->gateway->purchase($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://test.sagepay.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl()); - - $redirectData = $response->getRedirectData(); - $this->assertSame('065379457749061954', $redirectData['MD']); - $this->assertSame('BSkaFwYFFTYAGyFbAB0LFRYWBwsBZw0EGwECEX9YRGFWc08pJCVVKgAANS0KADoZCCAMBnIeOxcWRg0LERdOOTQRDFRdVHNYUgwTMBsBCxABJw4DJHE+ERgPCi8MVC0HIAROCAAfBUk4ER89DD0IWDkvMQ1VdFwoUFgwXVYvbHgvMkdBXXNbQGIjdl1ZUEc1XSwqAAgUUicYBDYcB3I2AjYjIzsn', $redirectData['PaReq']); - $this->assertSame('https://www.example.com/return', $redirectData['TermUrl']); - } - - public function testCaptureSuccess() - { - $this->setMockHttpResponse('CaptureSuccess.txt'); - - $response = $this->gateway->capture($this->captureOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The transaction was RELEASEed successfully.', $response->getMessage()); - } - - public function testCaptureFailure() - { - $this->setMockHttpResponse('CaptureFailure.txt'); - - $response = $this->gateway->capture($this->captureOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('You are trying to RELEASE a transaction that has already been RELEASEd or ABORTed.', $response->getMessage()); - } - - public function testRefundSuccess() - { - $this->setMockHttpResponse('CaptureSuccess.txt'); - - $response = $this->gateway->refund($this->captureOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The transaction was RELEASEed successfully.', $response->getMessage()); - } - - public function testRefundFailure() - { - $this->setMockHttpResponse('CaptureFailure.txt'); - - $response = $this->gateway->refund($this->captureOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('You are trying to RELEASE a transaction that has already been RELEASEd or ABORTed.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/SagePay/Message/ResponseTest.php b/tests/Omnipay/SagePay/Message/ResponseTest.php deleted file mode 100644 index 7cab2290..00000000 --- a/tests/Omnipay/SagePay/Message/ResponseTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - public function testDirectPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('DirectPurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->getMockRequest()->shouldReceive('getTransactionId')->once()->andReturn('123456'); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('{"SecurityKey":"OUWLNYQTVT","TxAuthNo":"9962","VPSTxId":"{5A1BC414-5409-48DD-9B8B-DCDF096CE0BE}","VendorTxCode":"123456"}', $response->getTransactionReference()); - $this->assertSame('Direct transaction from Simulator.', $response->getMessage()); - } - - public function testDirectPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('DirectPurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The VendorTxCode \'984297\' has been used before. Each transaction you send should have a unique VendorTxCode.', $response->getMessage()); - } - - public function testDirectPurchase3dSecure() - { - $httpResponse = $this->getMockHttpResponse('DirectPurchase3dSecure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->getMockRequest()->shouldReceive('getReturnUrl')->once()->andReturn('https://www.example.com/return'); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://test.sagepay.com/Simulator/3DAuthPage.asp', $response->getRedirectUrl()); - - $redirectData = $response->getRedirectData(); - $this->assertSame('065379457749061954', $redirectData['MD']); - $this->assertSame('BSkaFwYFFTYAGyFbAB0LFRYWBwsBZw0EGwECEX9YRGFWc08pJCVVKgAANS0KADoZCCAMBnIeOxcWRg0LERdOOTQRDFRdVHNYUgwTMBsBCxABJw4DJHE+ERgPCi8MVC0HIAROCAAfBUk4ER89DD0IWDkvMQ1VdFwoUFgwXVYvbHgvMkdBXXNbQGIjdl1ZUEc1XSwqAAgUUicYBDYcB3I2AjYjIzsn', $redirectData['PaReq']); - $this->assertSame('https://www.example.com/return', $redirectData['TermUrl']); - } - - public function testCaptureSuccess() - { - $httpResponse = $this->getMockHttpResponse('CaptureSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertTrue($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The transaction was RELEASEed successfully.', $response->getMessage()); - } - - public function testCaptureFailure() - { - $httpResponse = $this->getMockHttpResponse('CaptureFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('You are trying to RELEASE a transaction that has already been RELEASEd or ABORTed.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/SagePay/Message/ServerAuthorizeResponseTest.php b/tests/Omnipay/SagePay/Message/ServerAuthorizeResponseTest.php deleted file mode 100644 index 751f30ef..00000000 --- a/tests/Omnipay/SagePay/Message/ServerAuthorizeResponseTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -use Omnipay\TestCase; - -class ServerAuthorizeResponseTest extends TestCase -{ - public function testServerPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('ServerPurchaseSuccess.txt'); - $response = new ServerAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Server transaction registered successfully.', $response->getMessage()); - $this->assertSame('https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl()); - } - - public function testServerPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('ServerPurchaseFailure.txt'); - $response = new ServerAuthorizeResponse($this->getMockRequest(), $httpResponse->getBody()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The Description field should be between 1 and 100 characters long.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/SagePay/Message/ServerCompleteAuthorizeResponseTest.php b/tests/Omnipay/SagePay/Message/ServerCompleteAuthorizeResponseTest.php deleted file mode 100644 index 378e77e2..00000000 --- a/tests/Omnipay/SagePay/Message/ServerCompleteAuthorizeResponseTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay\Message; - -use Omnipay\TestCase; - -class ServerCompleteAuthorizeResponseTest extends TestCase -{ - public function testServerCompleteAuthorizeResponseSuccess() - { - $response = new ServerCompleteAuthorizeResponse( - $this->getMockRequest(), - array( - 'Status' => 'OK', - 'TxAuthNo' => 'b', - 'AVSCV2' => 'c', - 'AddressResult' => 'd', - 'PostCodeResult' => 'e', - 'CV2Result' => 'f', - 'GiftAid' => 'g', - '3DSecureStatus' => 'h', - 'CAVV' => 'i', - 'AddressStatus' => 'j', - 'PayerStatus' => 'k', - 'CardType' => 'l', - 'Last4Digits' => 'm', - ) - ); - - $this->getMockRequest()->shouldReceive('getTransactionId')->once()->andReturn('123'); - $this->getMockRequest()->shouldReceive('getTransactionReference')->once()->andReturn('{"SecurityKey":"JEUPDN1N7E","TxAuthNo":"4255","VPSTxId":"{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}","VendorTxCode":"438791"}'); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('{"SecurityKey":"JEUPDN1N7E","TxAuthNo":"b","VPSTxId":"{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}","VendorTxCode":"123"}', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - public function testServerCompleteAuthorizeResponseFailure() - { - $response = new ServerCompleteAuthorizeresponse($this->getMockRequest(), array('Status' => 'INVALID')); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/SagePay/Mock/CaptureFailure.txt b/tests/Omnipay/SagePay/Mock/CaptureFailure.txt deleted file mode 100644 index a9cdaf55..00000000 --- a/tests/Omnipay/SagePay/Mock/CaptureFailure.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTTP/1.1 200 OK -Date: Sat, 16 Feb 2013 08:21:41 GMT -Server: Microsoft-IIS/6.0 -P3P: CP="CUR" -X-Powered-By: ASP.NET -Content-Length: 129 -Content-Type: Text/Plain -Set-Cookie: ASPSESSIONIDSEHSCTTR=NNBHGPBDLOMKKPGPNDDJFBAB; secure; path=/ -Cache-control: private - -VPSProtocol=2.23 -Status=INVALID -StatusDetail=You are trying to RELEASE a transaction that has already been RELEASEd or ABORTed. \ No newline at end of file diff --git a/tests/Omnipay/SagePay/Mock/CaptureSuccess.txt b/tests/Omnipay/SagePay/Mock/CaptureSuccess.txt deleted file mode 100644 index 69bc956b..00000000 --- a/tests/Omnipay/SagePay/Mock/CaptureSuccess.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTTP/1.1 200 OK -Date: Sat, 16 Feb 2013 08:21:03 GMT -Server: Microsoft-IIS/6.0 -P3P: CP="CUR" -X-Powered-By: ASP.NET -Content-Length: 85 -Content-Type: Text/Plain -Set-Cookie: ASPSESSIONIDSEHSCTTR=FNBHGPBDMGDJCNLCDCDPGKCA; secure; path=/ -Cache-control: private - -VPSProtocol=2.23 -Status=OK -StatusDetail=The transaction was RELEASEed successfully. \ No newline at end of file diff --git a/tests/Omnipay/SagePay/Mock/DirectPurchase3dSecure.txt b/tests/Omnipay/SagePay/Mock/DirectPurchase3dSecure.txt deleted file mode 100644 index a932333f..00000000 --- a/tests/Omnipay/SagePay/Mock/DirectPurchase3dSecure.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTTP/1.1 200 OK -Date: Sat, 16 Feb 2013 06:53:15 GMT -Server: Microsoft-IIS/6.0 -P3P: CP="CUR" -X-Powered-By: ASP.NET -Content-Length: 359 -Content-Type: Text/Plain -Set-Cookie: ASPSESSIONIDSEHSCTTR=FDNGGPBDBPAHLBIMINACENLN; secure; path=/ -Cache-control: private - -VPSProtocol=2.23 -Status=3DAUTH -3DSecureStatus=OK -MD=065379457749061954 -ACSURL=https://test.sagepay.com/Simulator/3DAuthPage.asp -PAReq=BSkaFwYFFTYAGyFbAB0LFRYWBwsBZw0EGwECEX9YRGFWc08pJCVVKgAANS0KADoZCCAMBnIeOxcWRg0LERdOOTQRDFRdVHNYUgwTMBsBCxABJw4DJHE+ERgPCi8MVC0HIAROCAAfBUk4ER89DD0IWDkvMQ1VdFwoUFgwXVYvbHgvMkdBXXNbQGIjdl1ZUEc1XSwqAAgUUicYBDYcB3I2AjYjIzsn \ No newline at end of file diff --git a/tests/Omnipay/SagePay/Mock/DirectPurchaseFailure.txt b/tests/Omnipay/SagePay/Mock/DirectPurchaseFailure.txt deleted file mode 100644 index 868f82c5..00000000 --- a/tests/Omnipay/SagePay/Mock/DirectPurchaseFailure.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTTP/1.1 200 OK -Date: Sat, 16 Feb 2013 06:40:30 GMT -Server: Microsoft-IIS/6.0 -P3P: CP="CUR" -X-Powered-By: ASP.NET -Content-Length: 156 -Content-Type: Text/Plain -Set-Cookie: ASPSESSIONIDSEHSCTTR=PIMGGPBDEAHAGKNHFGMICIAM; secure; path=/ -Cache-control: private - -VPSProtocol=2.23 -Status=INVALID -StatusDetail=The VendorTxCode '984297' has been used before. Each transaction you send should have a unique VendorTxCode. \ No newline at end of file diff --git a/tests/Omnipay/SagePay/Mock/DirectPurchaseSuccess.txt b/tests/Omnipay/SagePay/Mock/DirectPurchaseSuccess.txt deleted file mode 100644 index 7336ee33..00000000 --- a/tests/Omnipay/SagePay/Mock/DirectPurchaseSuccess.txt +++ /dev/null @@ -1,20 +0,0 @@ -HTTP/1.1 200 OK -Date: Sat, 16 Feb 2013 06:39:41 GMT -Server: Microsoft-IIS/6.0 -P3P: CP="CUR" -X-Powered-By: ASP.NET -Content-Length: 249 -Content-Type: Text/Plain -Set-Cookie: ASPSESSIONIDSEHSCTTR=CIMGGPBDFDIKICAGIIHCNFHJ; secure; path=/ -Cache-control: private - -VPSProtocol=2.23 -Status=OK -StatusDetail=Direct transaction from Simulator. -VPSTxId={5A1BC414-5409-48DD-9B8B-DCDF096CE0BE} -SecurityKey=OUWLNYQTVT -TxAuthNo=9962 -AVSCV2=ALL MATCH -AddressResult=MATCHED -PostCodeResult=MATCHED -CV2Result=MATCHED \ No newline at end of file diff --git a/tests/Omnipay/SagePay/Mock/ServerPurchaseFailure.txt b/tests/Omnipay/SagePay/Mock/ServerPurchaseFailure.txt deleted file mode 100644 index ea250b05..00000000 --- a/tests/Omnipay/SagePay/Mock/ServerPurchaseFailure.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTTP/1.1 200 OK -Date: Sat, 16 Feb 2013 08:59:41 GMT -Server: Microsoft-IIS/6.0 -P3P: CP="CUR" -X-Powered-By: ASP.NET -Content-Length: 113 -Content-Type: Text/Plain -Set-Cookie: ASPSESSIONIDSEHSCTTR=EODHGPBDGNKCCIGEMFBBCBPD; secure; path=/ -Cache-control: private - -VPSProtocol=2.23 -Status=INVALID -StatusDetail=The Description field should be between 1 and 100 characters long. \ No newline at end of file diff --git a/tests/Omnipay/SagePay/Mock/ServerPurchaseSuccess.txt b/tests/Omnipay/SagePay/Mock/ServerPurchaseSuccess.txt deleted file mode 100644 index e793dc22..00000000 --- a/tests/Omnipay/SagePay/Mock/ServerPurchaseSuccess.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTTP/1.1 200 OK -Date: Sat, 16 Feb 2013 09:02:04 GMT -Server: Microsoft-IIS/6.0 -P3P: CP="CUR" -X-Powered-By: ASP.NET -Content-Length: 281 -Content-Type: Text/Plain -Set-Cookie: ASPSESSIONIDSEHSCTTR=JAEHGPBDBOBICGBGJEHFJHPE; secure; path=/ -Cache-control: private - -VPSProtocol=2.23 -Status=OK -StatusDetail=Server transaction registered successfully. -VPSTxId={1E7D9C70-DBE2-4726-88EA-D369810D801D} -SecurityKey=IK776BWNHN -NextURL=https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D} \ No newline at end of file diff --git a/tests/Omnipay/SagePay/ServerGatewayTest.php b/tests/Omnipay/SagePay/ServerGatewayTest.php deleted file mode 100644 index a0e557f9..00000000 --- a/tests/Omnipay/SagePay/ServerGatewayTest.php +++ /dev/null @@ -1,165 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SagePay; - -use Omnipay\GatewayTestCase; - -class ServerGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new ServerGateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setVendor('example'); - - $this->purchaseOptions = array( - 'amount' => '10.00', - 'transactionId' => '123', - 'card' => $this->getValidCard(), - 'returnUrl' => 'https://www.example.com/return', - ); - - $this->completePurchaseOptions = array( - 'amount' => '10.00', - 'transactionId' => '123', - 'transactionReference' => '{"SecurityKey":"JEUPDN1N7E","TxAuthNo":"4255","VPSTxId":"{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}","VendorTxCode":"438791"}', - ); - } - - public function testInheritsDirectGateway() - { - $this->assertInstanceOf('Omnipay\SagePay\DirectGateway', $this->gateway); - } - - public function testAuthorizeSuccess() - { - $this->setMockHttpResponse('ServerPurchaseSuccess.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Server transaction registered successfully.', $response->getMessage()); - $this->assertSame('https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl()); - } - - public function testAuthorizeFailure() - { - $this->setMockHttpResponse('ServerPurchaseFailure.txt'); - - $response = $this->gateway->authorize($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The Description field should be between 1 and 100 characters long.', $response->getMessage()); - } - - public function testCompleteAuthorizeSuccess() - { - $this->getHttpRequest()->request->replace( - array( - 'Status' => 'OK', - 'TxAuthNo' => 'b', - 'AVSCV2' => 'c', - 'AddressResult' => 'd', - 'PostCodeResult' => 'e', - 'CV2Result' => 'f', - 'GiftAid' => 'g', - '3DSecureStatus' => 'h', - 'CAVV' => 'i', - 'AddressStatus' => 'j', - 'PayerStatus' => 'k', - 'CardType' => 'l', - 'Last4Digits' => 'm', - 'VPSSignature' => md5('{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}438791OKbexamplecJEUPDN1N7Edefghijklm'), - ) - ); - - $response = $this->gateway->completeAuthorize($this->completePurchaseOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('{"SecurityKey":"JEUPDN1N7E","TxAuthNo":"b","VPSTxId":"{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}","VendorTxCode":"123"}', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testCompleteAuthorizeInvalid() - { - $response = $this->gateway->completeAuthorize($this->completePurchaseOptions)->send(); - } - - public function testPurchaseSuccess() - { - $this->setMockHttpResponse('ServerPurchaseSuccess.txt'); - - $response = $this->gateway->purchase($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Server transaction registered successfully.', $response->getMessage()); - $this->assertSame('https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={1E7D9C70-DBE2-4726-88EA-D369810D801D}', $response->getRedirectUrl()); - } - - public function testPurchaseFailure() - { - $this->setMockHttpResponse('ServerPurchaseFailure.txt'); - - $response = $this->gateway->purchase($this->purchaseOptions)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('The Description field should be between 1 and 100 characters long.', $response->getMessage()); - } - - public function testCompletePurchaseSuccess() - { - $this->getHttpRequest()->request->replace( - array( - 'Status' => 'OK', - 'TxAuthNo' => 'b', - 'AVSCV2' => 'c', - 'AddressResult' => 'd', - 'PostCodeResult' => 'e', - 'CV2Result' => 'f', - 'GiftAid' => 'g', - '3DSecureStatus' => 'h', - 'CAVV' => 'i', - 'AddressStatus' => 'j', - 'PayerStatus' => 'k', - 'CardType' => 'l', - 'Last4Digits' => 'm', - 'VPSSignature' => md5('{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}438791OKbexamplecJEUPDN1N7Edefghijklm'), - ) - ); - - $response = $this->gateway->completePurchase($this->completePurchaseOptions)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertSame('{"SecurityKey":"JEUPDN1N7E","TxAuthNo":"b","VPSTxId":"{F955C22E-F67B-4DA3-8EA3-6DAC68FA59D2}","VendorTxCode":"123"}', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testCompletePurchaseInvalid() - { - $response = $this->gateway->completePurchase($this->completePurchaseOptions)->send(); - } -} diff --git a/tests/Omnipay/SecurePay/DirectPostGatewayTest.php b/tests/Omnipay/SecurePay/DirectPostGatewayTest.php deleted file mode 100644 index f496423b..00000000 --- a/tests/Omnipay/SecurePay/DirectPostGatewayTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay; - -use Omnipay\GatewayTestCase; - -class DirectPostGatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new DirectPostGateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setMerchantId('abc123'); - } - - public function testAuthorize() - { - $request = $this->gateway->authorize(array('amount' => '10.00')); - - $this->assertInstanceOf('\Omnipay\SecurePay\Message\DirectPostAuthorizeRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testCompleteAuthorize() - { - $request = $this->gateway->completeAuthorize(array('amount' => '10.00')); - - $this->assertInstanceOf('\Omnipay\SecurePay\Message\DirectPostCompletePurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testPurchase() - { - $request = $this->gateway->purchase(array('amount' => '10.00')); - - $this->assertInstanceOf('\Omnipay\SecurePay\Message\DirectPostPurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testCompletePurchase() - { - $request = $this->gateway->completePurchase(array('amount' => '10.00')); - - $this->assertInstanceOf('\Omnipay\SecurePay\Message\DirectPostCompletePurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } -} diff --git a/tests/Omnipay/SecurePay/Message/DirectPostAuthorizeRequestTest.php b/tests/Omnipay/SecurePay/Message/DirectPostAuthorizeRequestTest.php deleted file mode 100644 index dc2dd8e2..00000000 --- a/tests/Omnipay/SecurePay/Message/DirectPostAuthorizeRequestTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -use Omnipay\TestCase; - -class DirectPostAuthorizeRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new DirectPostAuthorizeRequest($this->getHttpClient(), $this->getHttpRequest()); - - $this->request->initialize( - array( - 'merchantId' => 'foo', - 'transactionPassword' => 'bar', - 'amount' => '12.00', - 'returnUrl' => 'https://www.example.com/return', - ) - ); - } - - public function testFingerprint() - { - // force timestamp for testing - $data = $this->request->getData(); - $data['EPS_TIMESTAMP'] = '20130416123332'; - - $this->assertSame('46b6a59173c9fea66f71b8679558837895f0bce8', $this->request->generateFingerprint($data)); - } - - public function testSend() - { - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\SecurePay\Message\DirectPostAuthorizeResponse', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertNull($response->getCode()); - - $this->assertSame('https://api.securepay.com.au/live/directpost/authorise', $response->getRedirectUrl()); - $this->assertSame('POST', $response->getRedirectMethod()); - - $data = $response->getData(); - $this->assertArrayHasKey('EPS_FINGERPRINT', $data); - $this->assertSame('1', $data['EPS_TXNTYPE']); - } -} diff --git a/tests/Omnipay/SecurePay/Message/DirectPostCompletePurchaseRequestTest.php b/tests/Omnipay/SecurePay/Message/DirectPostCompletePurchaseRequestTest.php deleted file mode 100644 index 53a6e936..00000000 --- a/tests/Omnipay/SecurePay/Message/DirectPostCompletePurchaseRequestTest.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -use Omnipay\TestCase; - -class DirectPostCompletePurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new DirectPostCompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testGenerateResponseFingerprint() - { - $this->request->initialize(array( - 'amount' => '465.18', - 'transactionPassword' => 'abc123', - )); - - $data = array( - 'timestamp' => '20130602102927', - 'merchant' => 'ABC0030', - 'refid' => '222', - 'summarycode' => '2', - ); - - $this->assertSame('0516a31bf96ad89c354266afb9bd4be43aaf853f', $this->request->generateResponseFingerprint($data)); - } - - public function testSuccess() - { - $this->request->initialize(array( - 'amount' => '355.00', - 'transactionPassword' => 'abc123', - )); - - $this->getHttpRequest()->request->replace(array( - 'timestamp' => '20130602112954', - 'callback_status_code' => '', - 'fingerprint' => 'd9b40fc6f841f41ef3475220fe6316406a5256ce', - 'txnid' => '205861', - 'merchant' => 'ABC0030', - 'restext' => 'Approved', - 'rescode' => '00', - 'expirydate' => '032016', - 'settdate' => '20130602', - 'refid' => '226', - 'pan' => '444433...111', - 'summarycode' => '1', - )); - - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\\SecurePay\\Message\\DirectPostCompletePurchaseResponse', $response); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('205861', $response->getTransactionReference()); - $this->assertSame('Approved', $response->getMessage()); - $this->assertSame('00', $response->getCode()); - } - - public function testFailure() - { - $this->request->initialize(array( - 'amount' => '465.18', - 'transactionPassword' => 'abc123', - )); - - $this->getHttpRequest()->request->replace(array( - 'timestamp' => '20130602102927', - 'callback_status_code' => '', - 'fingerprint' => '0516a31bf96ad89c354266afb9bd4be43aaf853f', - 'txnid' => '205833', - 'merchant' => 'ABC0030', - 'restext' => 'Customer Dispute', - 'rescode' => '18', - 'expirydate' => '052016', - 'settdate' => '20130602', - 'refid' => '222', - 'pan' => '444433...111', - 'summarycode' => '2', - )); - - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\\SecurePay\\Message\\DirectPostCompletePurchaseResponse', $response); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('205833', $response->getTransactionReference()); - $this->assertSame('Customer Dispute', $response->getMessage()); - $this->assertSame('18', $response->getCode()); - } -} diff --git a/tests/Omnipay/SecurePay/Message/DirectPostPurchaseRequestTest.php b/tests/Omnipay/SecurePay/Message/DirectPostPurchaseRequestTest.php deleted file mode 100644 index 6317f0a0..00000000 --- a/tests/Omnipay/SecurePay/Message/DirectPostPurchaseRequestTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\SecurePay\Message; - -use Omnipay\TestCase; - -class DirectPostPurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new DirectPostPurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - - $this->request->initialize( - array( - 'merchantId' => 'foo', - 'transactionPassword' => 'bar', - 'amount' => '12.00', - 'returnUrl' => 'https://www.example.com/return', - ) - ); - } - - public function testFingerprint() - { - // force timestamp for testing - $data = $this->request->getData(); - $data['EPS_TIMESTAMP'] = '20130416123332'; - - $this->assertSame('652856e75b04c5916a41082e04c9390961497f65', $this->request->generateFingerprint($data)); - } - - public function testSend() - { - $response = $this->request->send(); - - $this->assertInstanceOf('Omnipay\SecurePay\Message\DirectPostAuthorizeResponse', $response); - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertNull($response->getCode()); - - $this->assertSame('https://api.securepay.com.au/live/directpost/authorise', $response->getRedirectUrl()); - $this->assertSame('POST', $response->getRedirectMethod()); - - $data = $response->getData(); - $this->assertArrayHasKey('EPS_FINGERPRINT', $data); - $this->assertSame('0', $data['EPS_TXNTYPE']); - } -} diff --git a/tests/Omnipay/Stripe/GatewayTest.php b/tests/Omnipay/Stripe/GatewayTest.php deleted file mode 100644 index 2a7a3985..00000000 --- a/tests/Omnipay/Stripe/GatewayTest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - } - - public function testAuthorize() - { - $request = $this->gateway->authorize(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Stripe\Message\AuthorizeRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testCapture() - { - $request = $this->gateway->capture(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Stripe\Message\CaptureRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testPurchase() - { - $request = $this->gateway->purchase(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Stripe\Message\PurchaseRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testRefund() - { - $request = $this->gateway->refund(array('amount' => '10.00')); - - $this->assertInstanceOf('Omnipay\Stripe\Message\RefundRequest', $request); - $this->assertSame('10.00', $request->getAmount()); - } - - public function testFetchTransaction() - { - $request = $this->gateway->fetchTransaction(array()); - - $this->assertInstanceOf('Omnipay\Stripe\Message\FetchTransactionRequest', $request); - } - - public function testCreateCard() - { - $request = $this->gateway->createCard(array('description' => 'foo')); - - $this->assertInstanceOf('Omnipay\Stripe\Message\CreateCardRequest', $request); - $this->assertSame('foo', $request->getDescription()); - } - - public function testUpdateCard() - { - $request = $this->gateway->updateCard(array('cardReference' => 'cus_1MZSEtqSghKx99')); - - $this->assertInstanceOf('Omnipay\Stripe\Message\UpdateCardRequest', $request); - $this->assertSame('cus_1MZSEtqSghKx99', $request->getCardReference()); - } - - public function testDeleteCard() - { - $request = $this->gateway->deleteCard(array('cardReference' => 'cus_1MZSEtqSghKx99')); - - $this->assertInstanceOf('Omnipay\Stripe\Message\DeleteCardRequest', $request); - $this->assertSame('cus_1MZSEtqSghKx99', $request->getCardReference()); - } -} diff --git a/tests/Omnipay/Stripe/Message/AuthorizeRequestTest.php b/tests/Omnipay/Stripe/Message/AuthorizeRequestTest.php deleted file mode 100644 index 7e3f28b2..00000000 --- a/tests/Omnipay/Stripe/Message/AuthorizeRequestTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class AuthorizeRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new AuthorizeRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize( - array( - 'amount' => '12.00', - 'currency' => 'USD', - 'card' => $this->getValidCard(), - ) - ); - } - - public function testCaptureIsFalse() - { - $data = $this->request->getData(); - $this->assertSame('false', $data['capture']); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidRequestException - * @expectedExceptionMessage The card parameter is required - */ - public function testCardRequired() - { - $this->request->setCard(null); - $this->request->getData(); - } - - public function testDataWithCardReference() - { - $this->request->setCardReference('xyz'); - $data = $this->request->getData(); - - $this->assertSame('xyz', $data['customer']); - } - - public function testDataWithToken() - { - $this->request->setToken('xyz'); - $data = $this->request->getData(); - - $this->assertSame('xyz', $data['card']); - } - - public function testDataWithCard() - { - $card = $this->getValidCard(); - $this->request->setCard($card); - $data = $this->request->getData(); - - $this->assertSame($card['number'], $data['card']['number']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('ch_1IU9gcUiNASROd', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendError() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('Your card was declined', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/CaptureRequestTest.php b/tests/Omnipay/Stripe/Message/CaptureRequestTest.php deleted file mode 100644 index d1f7c8b7..00000000 --- a/tests/Omnipay/Stripe/Message/CaptureRequestTest.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class CaptureRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new CaptureRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->setTransactionReference('foo'); - } - - public function testEndpoint() - { - $this->assertSame('https://api.stripe.com/v1/charges/foo/capture', $this->request->getEndpoint()); - } - - public function testAmount() - { - // defualt is no amount - $this->assertArrayNotHasKey('amount', $this->request->getData()); - - $this->request->setAmount('10.00'); - - $data = $this->request->getData(); - $this->assertSame(1000, $data['amount']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('CaptureSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('ch_1lvgjcQgrNWUuZ', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendError() - { - $this->setMockHttpResponse('CaptureFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('Charge ch_1lvgjcQgrNWUuZ has already been captured.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/CreateCardRequestTest.php b/tests/Omnipay/Stripe/Message/CreateCardRequestTest.php deleted file mode 100644 index e09e174b..00000000 --- a/tests/Omnipay/Stripe/Message/CreateCardRequestTest.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class CreateCardRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new CreateCardRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->setCard($this->getValidCard()); - } - - public function testEndpoint() - { - $this->assertSame('https://api.stripe.com/v1/customers', $this->request->getEndpoint()); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidRequestException - * @expectedExceptionMessage The card parameter is required - */ - public function testCard() - { - $this->request->setCard(null); - $this->request->getData(); - } - - public function testDataWithToken() - { - $this->request->setToken('xyz'); - $data = $this->request->getData(); - - $this->assertSame('xyz', $data['card']); - } - - public function testDataWithCard() - { - $card = $this->getValidCard(); - $this->request->setCard($card); - $data = $this->request->getData(); - - $this->assertSame($card['number'], $data['card']['number']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('CreateCardSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('cus_1MZSEtqSghKx99', $response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('CreateCardFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('You must provide an integer value for \'exp_year\'.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/DeleteCardRequestTest.php b/tests/Omnipay/Stripe/Message/DeleteCardRequestTest.php deleted file mode 100644 index 9857b3ee..00000000 --- a/tests/Omnipay/Stripe/Message/DeleteCardRequestTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class DeleteCardRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new DeleteCardRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->setCardReference('cus_1MZSEtqSghKx99'); - } - - public function testEndpoint() - { - $this->assertSame('https://api.stripe.com/v1/customers/cus_1MZSEtqSghKx99', $this->request->getEndpoint()); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('DeleteCardSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('DeleteCardFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/FetchTransactionTest.php b/tests/Omnipay/Stripe/Message/FetchTransactionTest.php deleted file mode 100644 index 31fbd7ba..00000000 --- a/tests/Omnipay/Stripe/Message/FetchTransactionTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class FetchTransactionRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new FetchTransactionRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->setTransactionReference('ch_29yrvk84GVDsq9'); - } - - public function testEndpoint() - { - $this->assertSame('https://api.stripe.com/v1/charges/ch_29yrvk84GVDsq9', $this->request->getEndpoint()); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('FetchTransactionSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('ch_29yrvk84GVDsq9', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendError() - { - $this->setMockHttpResponse('FetchTransactionFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('No such charge: ch_29yrvk84GVDsq9fake', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/PurchaseRequestTest.php b/tests/Omnipay/Stripe/Message/PurchaseRequestTest.php deleted file mode 100644 index 52f12828..00000000 --- a/tests/Omnipay/Stripe/Message/PurchaseRequestTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class PurchaseRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->initialize( - array( - 'amount' => '10.00', - 'currency' => 'USD', - 'card' => $this->getValidCard(), - ) - ); - } - - public function testCaptureIsTrue() - { - $data = $this->request->getData(); - $this->assertSame('true', $data['capture']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('PurchaseSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('ch_1IU9gcUiNASROd', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendError() - { - $this->setMockHttpResponse('PurchaseFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('Your card was declined', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/RefundRequestTest.php b/tests/Omnipay/Stripe/Message/RefundRequestTest.php deleted file mode 100644 index 2df7fa23..00000000 --- a/tests/Omnipay/Stripe/Message/RefundRequestTest.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class RefundRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new RefundRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->setTransactionReference('ch_12RgN9L7XhO9mI') - ->setAmount('10.00'); - } - - public function testEndpoint() - { - $this->assertSame('https://api.stripe.com/v1/charges/ch_12RgN9L7XhO9mI/refund', $this->request->getEndpoint()); - } - - public function testAmount() - { - $data = $this->request->getData(); - $this->assertSame(1000, $data['amount']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('RefundSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('ch_12RgN9L7XhO9mI', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendError() - { - $this->setMockHttpResponse('RefundFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('Charge ch_12RgN9L7XhO9mI has already been refunded.', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/ResponseTest.php b/tests/Omnipay/Stripe/Message/ResponseTest.php deleted file mode 100644 index 871c5cb0..00000000 --- a/tests/Omnipay/Stripe/Message/ResponseTest.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class ResponseTest extends TestCase -{ - public function testPurchaseSuccess() - { - $httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('ch_1IU9gcUiNASROd', $response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testPurchaseFailure() - { - $httpResponse = $this->getMockHttpResponse('PurchaseFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('Your card was declined', $response->getMessage()); - } - - public function testCreateCardSuccess() - { - $httpResponse = $this->getMockHttpResponse('CreateCardSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('cus_1MZSEtqSghKx99', $response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testCreateCardFailure() - { - $httpResponse = $this->getMockHttpResponse('CreateCardFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('You must provide an integer value for \'exp_year\'.', $response->getMessage()); - } - - public function testUpdateCardSuccess() - { - $httpResponse = $this->getMockHttpResponse('UpdateCardSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('cus_1MZeNih5LdKxDq', $response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testUpdateCardFailure() - { - $httpResponse = $this->getMockHttpResponse('UpdateCardFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage()); - } - - public function testDeleteCardSuccess() - { - $httpResponse = $this->getMockHttpResponse('DeleteCardSuccess.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testDeleteCardFailure() - { - $httpResponse = $this->getMockHttpResponse('DeleteCardFailure.txt'); - $response = new Response($this->getMockRequest(), $httpResponse->json()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Message/UpdateCardRequestTest.php b/tests/Omnipay/Stripe/Message/UpdateCardRequestTest.php deleted file mode 100644 index c46af31b..00000000 --- a/tests/Omnipay/Stripe/Message/UpdateCardRequestTest.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\Stripe\Message; - -use Omnipay\TestCase; - -class UpdateCardRequestTest extends TestCase -{ - public function setUp() - { - $this->request = new UpdateCardRequest($this->getHttpClient(), $this->getHttpRequest()); - $this->request->setCardReference('cus_1MZSEtqSghKx99'); - } - - public function testEndpoint() - { - $this->assertSame('https://api.stripe.com/v1/customers/cus_1MZSEtqSghKx99', $this->request->getEndpoint()); - } - - public function testDataWithToken() - { - $this->request->setToken('xyz'); - $data = $this->request->getData(); - - $this->assertSame('xyz', $data['card']); - } - - public function testDataWithCard() - { - $card = $this->getValidCard(); - $this->request->setCard($card); - $data = $this->request->getData(); - - $this->assertSame($card['number'], $data['card']['number']); - } - - public function testSendSuccess() - { - $this->setMockHttpResponse('UpdateCardSuccess.txt'); - $response = $this->request->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('cus_1MZeNih5LdKxDq', $response->getCardReference()); - $this->assertNull($response->getMessage()); - } - - public function testSendFailure() - { - $this->setMockHttpResponse('UpdateCardFailure.txt'); - $response = $this->request->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getCardReference()); - $this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage()); - } -} diff --git a/tests/Omnipay/Stripe/Mock/CaptureFailure.txt b/tests/Omnipay/Stripe/Mock/CaptureFailure.txt deleted file mode 100644 index 12033e98..00000000 --- a/tests/Omnipay/Stripe/Mock/CaptureFailure.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTTP/1.1 400 Bad Request -Server: nginx -Date: Sun, 05 May 2013 08:52:09 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 127 -Connection: keep-alive -Cache-Control: no-cache, no-store -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true - -{ - "error": { - "type": "invalid_request_error", - "message": "Charge ch_1lvgjcQgrNWUuZ has already been captured." - } -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/CaptureSuccess.txt b/tests/Omnipay/Stripe/Mock/CaptureSuccess.txt deleted file mode 100644 index 1038d16d..00000000 --- a/tests/Omnipay/Stripe/Mock/CaptureSuccess.txt +++ /dev/null @@ -1,57 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx -Date: Sun, 05 May 2013 08:51:15 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 997 -Connection: keep-alive -Cache-Control: no-cache, no-store -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true - -{ - "id": "ch_1lvgjcQgrNWUuZ", - "object": "charge", - "created": 1367743707, - "livemode": false, - "paid": true, - "amount": 1000, - "currency": "usd", - "refunded": false, - "fee": 59, - "fee_details": [ - { - "amount": 59, - "currency": "usd", - "type": "stripe_fee", - "description": "Stripe processing fees", - "application": null, - "amount_refunded": 0 - } - ], - "card": { - "object": "card", - "last4": "4242", - "type": "Visa", - "exp_month": 9, - "exp_year": 2015, - "fingerprint": "dfB0t0avO0bWr9eY", - "country": "US", - "name": "fdsa asdf", - "address_line1": "", - "address_line2": "", - "address_city": "", - "address_state": "", - "address_zip": "", - "address_country": "", - "cvc_check": "pass", - "address_line1_check": "pass", - "address_zip_check": "pass" - }, - "captured": true, - "failure_message": null, - "amount_refunded": 0, - "customer": null, - "invoice": null, - "description": "", - "dispute": null -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/CreateCardFailure.txt b/tests/Omnipay/Stripe/Mock/CreateCardFailure.txt deleted file mode 100644 index e936fbba..00000000 --- a/tests/Omnipay/Stripe/Mock/CreateCardFailure.txt +++ /dev/null @@ -1,17 +0,0 @@ -HTTP/1.1 402 Payment Required -Server: nginx -Date: Tue, 26 Feb 2013 16:17:02 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 139 -Connection: keep-alive -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true -Cache-Control: no-cache, no-store - -{ - "error": { - "message": "You must provide an integer value for 'exp_year'.", - "type": "card_error", - "param": "exp_year" - } -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/CreateCardSuccess.txt b/tests/Omnipay/Stripe/Mock/CreateCardSuccess.txt deleted file mode 100644 index 3b06e72f..00000000 --- a/tests/Omnipay/Stripe/Mock/CreateCardSuccess.txt +++ /dev/null @@ -1,41 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx -Date: Tue, 26 Feb 2013 16:11:12 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 694 -Connection: keep-alive -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true -Cache-Control: no-cache, no-store - -{ - "object": "customer", - "created": 1361895072, - "id": "cus_1MZSEtqSghKx99", - "livemode": false, - "description": "fdsa", - "active_card": { - "object": "card", - "last4": "4242", - "type": "Visa", - "exp_month": 9, - "exp_year": 2019, - "fingerprint": "dfB0t0avO0bWr9eY", - "country": "US", - "name": "fdjsk fdjksl", - "address_line1": "", - "address_line2": "", - "address_city": "", - "address_state": "", - "address_zip": "", - "address_country": "", - "cvc_check": "pass", - "address_line1_check": "pass", - "address_zip_check": "pass" - }, - "email": null, - "delinquent": false, - "subscription": null, - "discount": null, - "account_balance": 0 -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/DeleteCardFailure.txt b/tests/Omnipay/Stripe/Mock/DeleteCardFailure.txt deleted file mode 100644 index 30626646..00000000 --- a/tests/Omnipay/Stripe/Mock/DeleteCardFailure.txt +++ /dev/null @@ -1,17 +0,0 @@ -HTTP/1.1 404 Not Found -Server: nginx -Date: Tue, 26 Feb 2013 16:32:51 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 131 -Connection: keep-alive -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true -Cache-Control: no-cache, no-store - -{ - "error": { - "type": "invalid_request_error", - "message": "No such customer: cus_1MZeNih5LdKxDq", - "param": "id" - } -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/DeleteCardSuccess.txt b/tests/Omnipay/Stripe/Mock/DeleteCardSuccess.txt deleted file mode 100644 index 53748c5d..00000000 --- a/tests/Omnipay/Stripe/Mock/DeleteCardSuccess.txt +++ /dev/null @@ -1,14 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx -Date: Tue, 26 Feb 2013 16:33:08 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 52 -Connection: keep-alive -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true -Cache-Control: no-cache, no-store - -{ - "deleted": true, - "id": "cus_1MZSEtqSghKx99" -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/FetchTransactionFailure.txt b/tests/Omnipay/Stripe/Mock/FetchTransactionFailure.txt deleted file mode 100644 index 4eda434b..00000000 --- a/tests/Omnipay/Stripe/Mock/FetchTransactionFailure.txt +++ /dev/null @@ -1,17 +0,0 @@ -HTTP/1.1 404 Not Found -Server: nginx -Date: Wed, 24 Jul 2013 13:40:31 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 132 -Connection: keep-alive -Access-Control-Allow-Credentials: true -Access-Control-Max-Age: 300 -Cache-Control: no-cache, no-store - -{ - "error": { - "type": "invalid_request_error", - "message": "No such charge: ch_29yrvk84GVDsq9fake", - "param": "id" - } -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/FetchTransactionSuccess.txt b/tests/Omnipay/Stripe/Mock/FetchTransactionSuccess.txt deleted file mode 100644 index a20aa39d..00000000 --- a/tests/Omnipay/Stripe/Mock/FetchTransactionSuccess.txt +++ /dev/null @@ -1,59 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx -Date: Wed, 24 Jul 2013 07:14:02 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 1092 -Connection: keep-alive -Access-Control-Allow-Credentials: true -Access-Control-Max-Age: 300 -Cache-Control: no-cache, no-store - -{ - "id": "ch_29yrvk84GVDsq9", - "object": "charge", - "created": 1373290882, - "livemode": false, - "paid": true, - "amount": 4200, - "currency": "gbp", - "refunded": false, - "fee": 152, - "fee_details": [ - { - "amount": 152, - "currency": "gbp", - "type": "stripe_fee", - "description": "Stripe processing fees", - "application": null, - "amount_refunded": 0 - } - ], - "card": { - "object": "card", - "last4": "4242", - "type": "Visa", - "exp_month": 5, - "exp_year": 2015, - "fingerprint": "o7bnpaR6swBKn5O7", - "customer": null, - "country": "US", - "name": "John Doe", - "address_line1": "", - "address_line2": "", - "address_city": "", - "address_state": "", - "address_zip": "", - "address_country": "", - "cvc_check": "pass", - "address_line1_check": "pass", - "address_zip_check": "pass" - }, - "captured": true, - "failure_message": null, - "failure_code": null, - "amount_refunded": 0, - "customer": null, - "invoice": null, - "description": "A12BCD/2", - "dispute": null -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/PurchaseFailure.txt b/tests/Omnipay/Stripe/Mock/PurchaseFailure.txt deleted file mode 100644 index 1fa9095b..00000000 --- a/tests/Omnipay/Stripe/Mock/PurchaseFailure.txt +++ /dev/null @@ -1,18 +0,0 @@ -HTTP/1.1 402 Payment Required -Server: nginx -Date: Fri, 15 Feb 2013 18:26:37 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 151 -Connection: keep-alive -Cache-Control: no-cache, no-store -Access-Control-Allow-Credentials: true -Access-Control-Max-Age: 300 - -{ - "error": { - "message": "Your card was declined", - "type": "card_error", - "code": "card_declined", - "charge": "ch_1IUAZQWFYrPooM" - } -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/PurchaseSuccess.txt b/tests/Omnipay/Stripe/Mock/PurchaseSuccess.txt deleted file mode 100644 index 803f94c4..00000000 --- a/tests/Omnipay/Stripe/Mock/PurchaseSuccess.txt +++ /dev/null @@ -1,56 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx -Date: Fri, 15 Feb 2013 18:25:28 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 995 -Connection: keep-alive -Cache-Control: no-cache, no-store -Access-Control-Allow-Credentials: true -Access-Control-Max-Age: 300 - -{ - "id": "ch_1IU9gcUiNASROd", - "object": "charge", - "created": 1360952728, - "livemode": false, - "paid": true, - "amount": 1000, - "currency": "usd", - "refunded": false, - "fee": 59, - "fee_details": [ - { - "amount": 59, - "currency": "usd", - "type": "stripe_fee", - "description": "Stripe processing fees", - "application": null, - "amount_refunded": 0 - } - ], - "card": { - "object": "card", - "last4": "4242", - "type": "Visa", - "exp_month": 9, - "exp_year": 2018, - "fingerprint": "dfB0t0avO0bWr9eY", - "country": "US", - "name": "jkfdsl fdjksl", - "address_line1": "", - "address_line2": "", - "address_city": "", - "address_state": "", - "address_zip": "", - "address_country": "", - "cvc_check": "pass", - "address_line1_check": "pass", - "address_zip_check": "pass" - }, - "failure_message": null, - "amount_refunded": 0, - "customer": null, - "invoice": null, - "description": "first purchase", - "dispute": null -} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/RefundFailure.txt b/tests/Omnipay/Stripe/Mock/RefundFailure.txt deleted file mode 100644 index 0b0aff0b..00000000 --- a/tests/Omnipay/Stripe/Mock/RefundFailure.txt +++ /dev/null @@ -1,3 +0,0 @@ -HTTP/1.1 200 OK - -{"error":{"message":"Charge ch_12RgN9L7XhO9mI has already been refunded."}} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/RefundSuccess.txt b/tests/Omnipay/Stripe/Mock/RefundSuccess.txt deleted file mode 100644 index 3fe294ea..00000000 --- a/tests/Omnipay/Stripe/Mock/RefundSuccess.txt +++ /dev/null @@ -1,3 +0,0 @@ -HTTP/1.1 200 OK - -{"id":"ch_12RgN9L7XhO9mI","object": "charge"} \ No newline at end of file diff --git a/tests/Omnipay/Stripe/Mock/UpdateCardFailure.txt b/tests/Omnipay/Stripe/Mock/UpdateCardFailure.txt deleted file mode 100644 index 127dd50c..00000000 --- a/tests/Omnipay/Stripe/Mock/UpdateCardFailure.txt +++ /dev/null @@ -1,17 +0,0 @@ -HTTP/1.1 404 Not Found -Server: nginx -Date: Tue, 26 Feb 2013 16:32:51 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 131 -Connection: keep-alive -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true -Cache-Control: no-cache, no-store - -{ - "error": { - "type": "invalid_request_error", - "message": "No such customer: cus_1MZeNih5LdKxDq", - "param": "id" - } -} diff --git a/tests/Omnipay/Stripe/Mock/UpdateCardSuccess.txt b/tests/Omnipay/Stripe/Mock/UpdateCardSuccess.txt deleted file mode 100644 index 23e93454..00000000 --- a/tests/Omnipay/Stripe/Mock/UpdateCardSuccess.txt +++ /dev/null @@ -1,23 +0,0 @@ -HTTP/1.1 200 OK -Server: nginx -Date: Tue, 26 Feb 2013 16:11:12 GMT -Content-Type: application/json;charset=utf-8 -Content-Length: 694 -Connection: keep-alive -Access-Control-Max-Age: 300 -Access-Control-Allow-Credentials: true -Cache-Control: no-cache, no-store - -{ - "object": "customer", - "created": 1365771516, - "id": "cus_1MZeNih5LdKxDq", - "livemode": false, - "description": "fdsa", - "active_card": null, - "email": null, - "delinquent": false, - "subscription": null, - "discount": null, - "account_balance": 0 -} diff --git a/tests/Omnipay/TestCase.php b/tests/Omnipay/TestCase.php deleted file mode 100644 index 9213cef0..00000000 --- a/tests/Omnipay/TestCase.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay; - -use Mockery as m; -use PHPUnit_Framework_TestCase; -use ReflectionObject; -use Guzzle\Common\Event; -use Guzzle\Http\Client as HttpClient; -use Guzzle\Http\Message\Response; -use Guzzle\Http\Message\RequestInterface as GuzzleRequestInterface; -use Guzzle\Plugin\Mock\MockPlugin; -use Symfony\Component\HttpFoundation\Request as HttpRequest; - -/** - * Base class for all Omnipay tests - * - * Guzzle mock methods area based on those in GuzzleTestCase - */ -abstract class TestCase extends PHPUnit_Framework_TestCase -{ - private $mockHttpRequests = array(); - private $mockRequest; - private $httpClient; - private $httpRequest; - - /** - * Mark a request as being mocked - * - * @param GuzzleRequestInterface $request - * - * @return self - */ - public function addMockedHttpRequest(GuzzleRequestInterface $request) - { - $this->mockHttpRequests[] = $request; - - return $this; - } - - /** - * Get all of the mocked requests - * - * @return array - */ - public function getMockedRequests() - { - return $this->mockHttpRequests; - } - - /** - * Get a mock response for a client by mock file name - * - * @param string $path Relative path to the mock response file - * - * @return Response - */ - public function getMockHttpResponse($path) - { - if ($path instanceof Response) { - return $path; - } - - $ref = new ReflectionObject($this); - $dir = dirname($ref->getFileName()); - - // if mock file doesn't exist, check parent directory - if (!file_exists($dir.'/Mock/'.$path) && file_exists($dir.'/../Mock/'.$path)) { - return MockPlugin::getMockFile($dir.'/../Mock/'.$path); - } - - return MockPlugin::getMockFile($dir.'/Mock/'.$path); - } - - /** - * Set a mock response from a mock file on the next client request. - * - * This method assumes that mock response files are located under the - * Mock/ subdirectory of the current class. A mock response is added to the next - * request sent by the client. - * - * @param string $paths Path to files within the Mock folder of the service - * - * @return MockPlugin returns the created mock plugin - */ - public function setMockHttpResponse($paths) - { - $this->mockHttpRequests = array(); - $that = $this; - $mock = new MockPlugin(null, true); - $this->getHttpClient()->getEventDispatcher()->removeSubscriber($mock); - $mock->getEventDispatcher()->addListener('mock.request', function(Event $event) use ($that) { - $that->addMockedHttpRequest($event['request']); - }); - - foreach ((array) $paths as $path) { - $mock->addResponse($this->getMockHttpResponse($path)); - } - - $this->getHttpClient()->getEventDispatcher()->addSubscriber($mock); - - return $mock; - } - - /** - * Helper method used by gateway test classes to generate a valid test credit card - */ - public function getValidCard() - { - return array( - 'firstName' => 'Example', - 'lastName' => 'User', - 'number' => '4111111111111111', - 'expiryMonth' => rand(1, 12), - 'expiryYear' => date('Y') + rand(1, 5), - 'cvv' => rand(100, 999), - ); - } - - public function getMockRequest() - { - if (null === $this->mockRequest) { - $this->mockRequest = m::mock('\Omnipay\Common\Message\RequestInterface'); - } - - return $this->mockRequest; - } - - public function getHttpClient() - { - if (null === $this->httpClient) { - $this->httpClient = new HttpClient; - } - - return $this->httpClient; - } - - public function getHttpRequest() - { - if (null === $this->httpRequest) { - $this->httpRequest = new HttpRequest; - } - - return $this->httpRequest; - } -} diff --git a/tests/Omnipay/TwoCheckout/GatewayTest.php b/tests/Omnipay/TwoCheckout/GatewayTest.php deleted file mode 100644 index b04d364d..00000000 --- a/tests/Omnipay/TwoCheckout/GatewayTest.php +++ /dev/null @@ -1,73 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout; - -use Omnipay\GatewayTestCase; -use Omnipay\Common\CreditCard; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setAccountNumber('123456'); - $this->gateway->setSecretWord('secret'); - - $this->options = array( - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - ); - } - - public function testPurchase() - { - $source = new CreditCard; - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertContains('https://www.2checkout.com/checkout/purchase?', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - $this->assertNull($response->getRedirectData()); - } - - /** - * @expectedException Omnipay\Common\Exception\InvalidResponseException - */ - public function testCompletePurchaseError() - { - $this->getHttpRequest()->request->replace(array('order_number' => '5', 'key' => 'ZZZ')); - - $response = $this->gateway->completePurchase($this->options)->send(); - } - - public function testCompletePurchaseSuccess() - { - $this->getHttpRequest()->request->replace( - array( - 'order_number' => '5', - 'key' => md5('secret123456510.00'), - ) - ); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('5', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/TwoCheckout/Message/CompletePurchaseResponseTest.php b/tests/Omnipay/TwoCheckout/Message/CompletePurchaseResponseTest.php deleted file mode 100644 index 4ca2d367..00000000 --- a/tests/Omnipay/TwoCheckout/Message/CompletePurchaseResponseTest.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout\Message; - -use Omnipay\TestCase; - -class CompletePurchaseResponseTest extends TestCase -{ - public function testConstruct() - { - $response = new CompletePurchaseresponse($this->getMockRequest(), array('order_number' => 'abc123')); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('abc123', $response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/TwoCheckout/Message/PurchaseResponseTest.php b/tests/Omnipay/TwoCheckout/Message/PurchaseResponseTest.php deleted file mode 100644 index fb5dd826..00000000 --- a/tests/Omnipay/TwoCheckout/Message/PurchaseResponseTest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\TwoCheckout\Message; - -use Omnipay\TestCase; - -class PurchaseResponseTest extends TestCase -{ - public function testConstruct() - { - $response = new Purchaseresponse($this->getMockRequest(), array('sid' => '12345', 'total' => '10.00')); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://www.2checkout.com/checkout/purchase?sid=12345&total=10.00', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - $this->assertNull($response->getRedirectData()); - } -} diff --git a/tests/Omnipay/WorldPay/GatewayTest.php b/tests/Omnipay/WorldPay/GatewayTest.php deleted file mode 100644 index 67dd4bb8..00000000 --- a/tests/Omnipay/WorldPay/GatewayTest.php +++ /dev/null @@ -1,91 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay; - -use Omnipay\GatewayTestCase; - -class GatewayTest extends GatewayTestCase -{ - public function setUp() - { - parent::setUp(); - - $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); - $this->gateway->setCallbackPassword('bar123'); - - $this->options = array( - 'amount' => '10.00', - 'returnUrl' => 'https://www.example.com/return', - ); - } - - public function testPurchase() - { - $response = $this->gateway->purchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertContains('https://secure.worldpay.com/wcc/purchase?', $response->getRedirectUrl()); - } - - public function testCompletePurchaseSuccess() - { - $this->getHttpRequest()->request->replace( - array( - 'callbackPW' => 'bar123', - 'transStatus' => 'Y', - 'transId' => 'abc123', - 'rawAuthMessage' => 'hello', - ) - ); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertEquals('abc123', $response->getTransactionReference()); - $this->assertSame('hello', $response->getMessage()); - } - - /** - * @expectedException \Omnipay\Common\Exception\InvalidResponseException - */ - public function testCompletePurchaseInvalidCallbackPassword() - { - $this->getHttpRequest()->request->replace( - array( - 'callbackPW' => 'fake', - ) - ); - - $response = $this->gateway->completePurchase($this->options)->send(); - } - - public function testCompletePurchaseError() - { - $this->getHttpRequest()->request->replace( - array( - 'callbackPW' => 'bar123', - 'transStatus' => 'N', - 'rawAuthMessage' => 'Declined', - ) - ); - - $response = $this->gateway->completePurchase($this->options)->send(); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Declined', $response->getMessage()); - } -} diff --git a/tests/Omnipay/WorldPay/Message/CompletePurchaseResponseTest.php b/tests/Omnipay/WorldPay/Message/CompletePurchaseResponseTest.php deleted file mode 100644 index 863e8204..00000000 --- a/tests/Omnipay/WorldPay/Message/CompletePurchaseResponseTest.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay\Message; - -use Omnipay\TestCase; - -class CompletePurchaseResponseTest extends TestCase -{ - public function testCompletePurchaseSuccess() - { - $response = new CompletePurchaseresponse( - $this->getMockRequest(), - array( - 'transStatus' => 'Y', - 'transId' => 'abc123', - 'rawAuthMessage' => 'Success Message' - ) - ); - - $this->assertTrue($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertSame('abc123', $response->getTransactionReference()); - $this->assertSame('Success Message', $response->getMessage()); - } - - public function testCompletePurchaseFailure() - { - $response = new CompletePurchaseresponse( - $this->getMockRequest(), - array( - 'transStatus' => 'N', - 'transId' => null, - 'rawAuthMessage' => 'Declined' - ) - ); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertSame('Declined', $response->getMessage()); - } - - public function testCompletePurchaseInvalid() - { - $response = new CompletePurchaseresponse($this->getMockRequest(), array()); - - $this->assertFalse($response->isSuccessful()); - $this->assertFalse($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - } -} diff --git a/tests/Omnipay/WorldPay/Message/PurchaseResponseTest.php b/tests/Omnipay/WorldPay/Message/PurchaseResponseTest.php deleted file mode 100644 index f3864cbc..00000000 --- a/tests/Omnipay/WorldPay/Message/PurchaseResponseTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Omnipay\WorldPay\Message; - -use Omnipay\TestCase; - -class PurchaseResponseTest extends TestCase -{ - public function testPurchaseSuccess() - { - $response = new PurchaseResponse($this->getMockRequest(), array( - 'amount' => 1000, - 'returnUrl' => 'https://www.example.com/return', - )); - - $this->getMockRequest()->shouldReceive('getEndpoint')->once()->andReturn('https://secure.worldpay.com/wcc/purchase'); - - $this->assertFalse($response->isSuccessful()); - $this->assertTrue($response->isRedirect()); - $this->assertNull($response->getTransactionReference()); - $this->assertNull($response->getMessage()); - $this->assertSame('https://secure.worldpay.com/wcc/purchase?amount=1000&returnUrl=https%3A%2F%2Fwww.example.com%2Freturn', $response->getRedirectUrl()); - $this->assertSame('GET', $response->getRedirectMethod()); - $this->assertNull($response->getRedirectData()); - } -} diff --git a/tests/OmnipayTest.php b/tests/OmnipayTest.php new file mode 100644 index 00000000..766ce5d1 --- /dev/null +++ b/tests/OmnipayTest.php @@ -0,0 +1,35 @@ +assertInstanceOf('Omnipay\Common\GatewayFactory', $factory); + } + + + /** + * Verify a new Client instance can be instantiated + */ + public function testNewClient() + { + $client = new Client(); + + $this->assertInstanceOf('Omnipay\Common\Http\Client', $client); + } +} \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 370e9c78..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,9 +0,0 @@ -add('Omnipay', __DIR__);