omnipay/common
Framework-agnostic core for Omnipay payment gateways. Provides shared interfaces, request/response handling, HTTP client integration, and common utilities used by gateway drivers so apps can add and swap payment providers with a consistent API.
Full Changelog: https://github.com/thephpleague/omnipay-common/compare/v3.5.0...v3.5.1
Full Changelog: https://github.com/thephpleague/omnipay-common/compare/v3.4.0...v3.5.0
Full Changelog: https://github.com/thephpleague/omnipay-common/compare/v3.3.0...v3.4.0
Full Changelog: https://github.com/thephpleague/omnipay-common/compare/v3.2.1...v3.3.0
Support Symfony 6
Officially test and support PHP8. Drop old PHP versions because of PHPUnit 9
Fixes #217
Support Symfony 5
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.
redirect() method no calls exit() after sending the content. This is up to the developer now.omnipay/omnipay,
but otherwise you need to required your own implementation (see PHP HTTP Clients)setAmountInteger(integer $value) to set the amount in the base units of the currency.setMoney(Money $money) the Amount and Currency are set.The primary difference is the HTTP Client. We are now using HTTPlug (http://httplug.io/) but rely on our own interface.
Omnipay\Common\Http\ClientInterface$client->get('..')/$client->post('..') etc are removed, you can call $client->request('GET', '').$request->send(), requests are sent directly.$client->createRequest(..) you can create+send the request directly with $client->request(..).json_encode() and set the correct Content-Type.$response->getBody()->getContents() to get the body as string.$response->json() and $response->xml() are gone, but you can implement the logic directly.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).$headers parameters should be an array (not null, but can be empty)Examples:
// 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());
// 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);
PHPUnit is upgraded to PHPUnit 6. Common issues:
setExpectedException() is removed// PHPUnit 5:
$this->setExpectedException($class, $message);
// PHPUnit 6:
$this->expectException($class);
$this->expectExceptionMessage($message);
[@doesNotPerformAssertions](https://github.com/doesNotPerformAssertions)Adds setAmountInteger instead of the Money object. getMoney() is used to private, gateways should use the getAmount or getAmountInteger instead. This is a BC break between the v3-betas, but same as v2.
Uses our own Exceptions instead of the PSR package (with unknown timeline)
Should be a public API freeze hopefully :)
Implement PSR-18 Exceptions
$client->request('GET', '/path', ...)Incorporating outstanding PRs. This includes changed functionality about the use and detection of card brands.
Incorporated outstanding PRs, mostly minor/cosmetic/docblock changes.
Adds notification interfaces
Fix composer issue
Added better documentation
Update composer to include all third party gateways, as well as those supported by the package directly.
How can I help you explore Laravel packages today?