Skip to content

Commit eb24fe0

Browse files
committed
Update upgrade guide
1 parent 513e0f7 commit eb24fe0

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

UPGRADE.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
The primary difference is the HTTP Client. We are now using HTTPlug (http://httplug.io/) but rely on our own interface.
77

88
### 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.
1314
- 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.
1616
- An HTTP Client is no longer added by default by `omnipay/common`, but `omnipay/omnipay` will add Guzzle.
1717
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`).
2019
- 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

Comments
 (0)