Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: thephpleague/omnipay
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.3.1
Choose a base ref
...
head repository: thephpleague/omnipay
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Sep 17, 2014

  1. upped omnipay/mollie to 3.0

    greydnls committed Sep 17, 2014
    Copy the full SHA
    5af5fdf View commit details

Commits on Oct 13, 2014

  1. Update README.md

    Adrian Macneil committed Oct 13, 2014
    Copy the full SHA
    07920ce View commit details

Commits on Oct 29, 2014

  1. Update README.md

    added Cybersource Gateway
    greydnls committed Oct 29, 2014
    Copy the full SHA
    2963741 View commit details
  2. Change Omnipay repo

    See #192
    barryvdh committed Oct 29, 2014
    Copy the full SHA
    08ea4f1 View commit details
  3. Merge pull request #210 from barryvdh/patch-1

    Change Omnipay repo
    greydnls committed Oct 29, 2014
    Copy the full SHA
    7d1a377 View commit details

Commits on Nov 13, 2014

  1. Update README.md

    atastycookie committed Nov 13, 2014
    Copy the full SHA
    143a0f4 View commit details

Commits on Nov 25, 2014

  1. Merge pull request #214 from aTastyCookie/patch-1

    Update README.md
    greydnls committed Nov 25, 2014
    Copy the full SHA
    6a3ce8e View commit details

Commits on Dec 2, 2014

  1. Update README.md

    greydnls committed Dec 2, 2014
    Copy the full SHA
    21fd181 View commit details

Commits on Dec 10, 2014

  1. ecoPayz Gateway added

    dercoder committed Dec 10, 2014
    Copy the full SHA
    0a75fa9 View commit details
  2. Merge pull request #221 from dercoder/master

    ecoPayz Gateway added
    greydnls committed Dec 10, 2014
    Copy the full SHA
    e9e6d95 View commit details

Commits on Jan 9, 2015

  1. Copy the full SHA
    2c63b26 View commit details
  2. adding PayU

    greydnls committed Jan 9, 2015
    Copy the full SHA
    d195d2e View commit details

Commits on Jan 15, 2015

  1. Adding Cybersource SOAP

    greydnls committed Jan 15, 2015
    Copy the full SHA
    c91c916 View commit details
  2. Update composer.json

    greydnls committed Jan 15, 2015
    Copy the full SHA
    beafc62 View commit details

Commits on Feb 4, 2015

  1. Copy the full SHA
    4e86aec View commit details

Commits on Feb 11, 2015

  1. Copy the full SHA
    7b5831d View commit details
  2. Name fix

    mfauveau committed Feb 11, 2015
    Copy the full SHA
    a988d96 View commit details

Commits on Feb 18, 2015

  1. Add Veritrans

    andylibrian committed Feb 18, 2015
    Copy the full SHA
    8be2977 View commit details

Commits on Feb 19, 2015

  1. updated docs and maintainers

    greydnls committed Feb 19, 2015
    Copy the full SHA
    517bdaf View commit details
  2. whoops

    greydnls committed Feb 19, 2015
    Copy the full SHA
    57273e5 View commit details

Commits on Feb 20, 2015

  1. typo

    randomer-droid committed Feb 20, 2015
    Copy the full SHA
    7cb869b View commit details
  2. Copy the full SHA
    3b1adb5 View commit details

Commits on Mar 2, 2015

  1. Added link to Barclays ePDQ driver

    This driver is now in production, so adding for others to use.
    Andrew Coates committed Mar 2, 2015
    Copy the full SHA
    2e43fe5 View commit details

Commits on Mar 3, 2015

  1. Merge pull request #232 from mfauveau/master

    Add Network Merchants Inc. (NMI) Gateway
    greydnls committed Mar 3, 2015
    Copy the full SHA
    d3e1deb View commit details
  2. Merge pull request #238 from coatesap/patch-1

    Added link to Barclays ePDQ driver
    greydnls committed Mar 3, 2015
    Copy the full SHA
    87f0840 View commit details
  3. merge Veritrans

    greydnls committed Mar 3, 2015
    Copy the full SHA
    be21b45 View commit details
  4. Knasher

    greydnls committed Mar 3, 2015
    Copy the full SHA
    154cae0 View commit details

Commits on Mar 19, 2015

  1. Update README.md

    update twocheckout -> omnipay/2checkout
    greydnls committed Mar 19, 2015
    Copy the full SHA
    a36cc54 View commit details

Commits on Mar 21, 2015

  1. Add gateway Fasapay

    andreas22 committed Mar 21, 2015
    Copy the full SHA
    b2cb79f View commit details
  2. Merge pull request #251 from andreas22/master

    New Gateway Fasapay
    greydnls committed Mar 21, 2015
    Copy the full SHA
    1b466ce View commit details
  3. Add AGMS Gateway

    maanas committed Mar 21, 2015
    Copy the full SHA
    0cf4455 View commit details

Commits on Mar 30, 2015

  1. Merge pull request #254 from agmscode/agms

    Add AGMS Gateway
    greydnls committed Mar 30, 2015
    Copy the full SHA
    a3d1862 View commit details

Commits on Apr 8, 2015

  1. Add Globalcloudpay Gateway

    dercoder committed Apr 8, 2015
    Copy the full SHA
    acdaf41 View commit details
  2. Merge pull request #256 from dercoder/master

    Add Globalcloudpay Gateway
    greydnls committed Apr 8, 2015
    Copy the full SHA
    d8b29d3 View commit details

Commits on Apr 13, 2015

  1. Added academe/omnipay-helcim

    Direct and HostedPages gateways are working. JS gateway is work-in-progress. A full set of tests is also very much work-in-progress.
    judgej committed Apr 13, 2015
    Copy the full SHA
    59b1f63 View commit details
  2. Merge pull request #257 from thephpleague/judgej-omnipay-helcim

    Added academe/omnipay-helcim
    greydnls committed Apr 13, 2015
    Copy the full SHA
    3d4f473 View commit details

Commits on Apr 14, 2015

  1. Copy the full SHA
    e31189f View commit details
  2. Merge pull request #258 from igaponov/omnipay-wirecard

    added link to omnipay-wirecard driver
    greydnls committed Apr 14, 2015
    Copy the full SHA
    8a8ade4 View commit details

Commits on May 18, 2015

  1. #261 declare transactionId

    In conjunction with #261 & thephpleague/omnipay-common#41
    eileenmcnaughton committed May 18, 2015
    Copy the full SHA
    bad34ca View commit details

Commits on May 22, 2015

  1. Add Fat Zebra

    greydnls committed May 22, 2015
    Copy the full SHA
    f22c424 View commit details

Commits on May 29, 2015

  1. Add paypro gateway

    barryvdh committed May 29, 2015
    Copy the full SHA
    86f17bb View commit details

Commits on Jun 5, 2015

  1. Added CardGate Gateway

    Martin committed Jun 5, 2015
    Copy the full SHA
    9a775de View commit details
  2. Added CardGate Gateway to composer.json

    Martin committed Jun 5, 2015
    Copy the full SHA
    35ace5a View commit details

Commits on Jun 8, 2015

  1. - Wrong packagename (lazy copy/paste error)

    Martin committed Jun 8, 2015
    Copy the full SHA
    52b8036 View commit details
  2. - Lazy copy/paste error

    Martin committed Jun 8, 2015
    Copy the full SHA
    2dfd29b View commit details
  3. - Forgot to tag it all for packagist..

    Martin committed Jun 8, 2015
    Copy the full SHA
    7d9694d View commit details

Commits on Jun 9, 2015

  1. Merge pull request #272 from cardgate/master

    Added CardGate Gateway
    greydnls committed Jun 9, 2015
    Copy the full SHA
    7c25a63 View commit details
  2. Merge pull request #270 from thephpleague/barryvdh-add-paypro

    Add paypro gateway
    greydnls committed Jun 9, 2015
    Copy the full SHA
    70ddeda View commit details

Commits on Jun 10, 2015

  1. Add 3rd party gateways to suggest

    Fixes #273
    barryvdh committed Jun 10, 2015
    2
    Copy the full SHA
    df3b318 View commit details
  2. Fix package names

    barryvdh committed Jun 10, 2015
    1
    Copy the full SHA
    a9f9175 View commit details
Showing with 598 additions and 192 deletions.
  1. +1 −0 .github/FUNDING.yml
  2. +43 −0 .github/workflows/run-tests.yml
  3. +1 −0 .gitignore
  4. +0 −20 .travis.yml
  5. +170 −0 CHANGELOG.md
  6. +1 −0 CONTRIBUTING.md
  7. +1 −1 LICENSE
  8. +299 −96 README.md
  9. +24 −75 composer.json
  10. +23 −0 phpunit.xml.dist
  11. +35 −0 tests/OmnipayTest.php
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [barryvdh]
43 changes: 43 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -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.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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@
composer.lock
composer.phar
phpunit.xml
.idea/*
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

170 changes: 170 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
Changelog
=========

## v3.2 - 2021-06-01

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

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.

## v3.0 - 2018-05-14

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.

The `omnipay/omnipay` package name has been changed to `league/omnipay`

### Upgrading applications from Omnipay 2.x to 3.x

#### 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.

#### 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.

### Upgrading Gateways from 2.x to 3.x

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).
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -6,5 +6,6 @@
* 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.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Loading