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.
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 omnipay/omnipay,
but otherwise you need to required your own implementation (see PHP HTTP Clients)
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 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.
The package is renamed from omnipay/omnipay to league/omnipay and no longer installs all gateways by default.
Upgrade 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
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 a 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 omnipay/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)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps omnipay/common from 2.5.2 to 3.2.1.
Release notes
Sourced from omnipay/common's releases.
... (truncated)
Upgrade guide
Sourced from omnipay/common's upgrade guide.
... (truncated)
Commits
80545e9
require php-http/message-factory directly (#261)e278ff0
Allow Symfony 6 (#254)b4fc179
Fixed PHP 8.1 errors (#256)d97c76d
Merge pull request #255 from Ocramius/feature/money-v4-supportadefebe
Allow usage ofmoneyphp/money:^4.0.3
006a45b
Merge pull request #251 from successopen/fix-typo3c34bea
Fix typo in comments30c6db3
Check FQCNd403e69
Merge pull request #250 from Mouke/master38b960e
allowing Classname::class syntax for getGatewayClassName()Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)