|
6 | 6 | The primary difference is the HTTP Client. We are now using HTTPlug (http://httplug.io/) but rely on our own interface.
|
7 | 7 |
|
8 | 8 | ### Breaking
|
9 |
| -- Change typehint from Guzzle ClientInterface to `Omnipay\Common\Http\Client` |
10 |
| -- `$client->get('..')`/`$client->post('..')` will send the request directly, no longer need to call `->send()`. |
11 |
| -- Instead of `$client->createRequest(..)->send()`, you should call `$client->sendRequest($client->createRequest(..))`. |
12 |
| -- When sending an AJAX body, convert the body to a string with `json_encode`. |
| 9 | +- Change typehint from Guzzle ClientInterface to `Omnipay\Common\Http\ClientInterface` |
| 10 | +- `$client->get('..')`/`$client->post('..')` etc are removed, you can call `$client->request('GET', '')`. |
| 11 | +- No need to call `$request->send()`, requests are sent directly. |
| 12 | +- Instead of `$client->createRequest(..)` you can create+send the request directly with `$client->request(..)`. |
| 13 | +- When sending a JSON body, convert the body to a string with `json_encode()` and set the correct Content-Type. |
13 | 14 | - The response is a PSR-7 Response object. You can call `$response->getBody()->getContents()` to get the body as string.
|
14 |
| -- `$response->json()` and `$response->xml()` are gone, but `Omnipay\Common\Http\ResponseParser::json($response)` |
15 |
| -and `Omnipay\Common\Http\ResponseParser::xml($response)` can be used instead. |
| 15 | +- `$response->json()` and `$response->xml()` are gone, but you can implement the logic directly. |
16 | 16 | - An HTTP Client is no longer added by default by `omnipay/common`, but `omnipay/omnipay` will add Guzzle.
|
17 | 17 | Gateways should not rely on Guzzle or other clients directly.
|
18 |
| - |
19 |
| -### Deprecated |
| 18 | +- `$body` should be a string (eg. `http_build_query($data)` or `json_encode($data)` instead of just `$data`). |
20 | 19 | - The `$headers` parameters should be an `array` (not `null`, but can be empty)
|
21 |
| -- `$body` should be a string (eg. `http_build_query($data)` or `json_encode($data)` instead of just $data. |
| 20 | + |
| 21 | +Note: Prior to stable release, the goal is to migrate to PSR-18, once completed. |
| 22 | +This will not change the gateway implementations. |
| 23 | + |
0 commit comments