-
-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Guzzle7 as default implementation #615
Conversation
Just for a bit of background, are the drivers likely to need any updates for this, or should it be working seamlessly? |
They should work without issue, if Guzzle 7 implements the interface correctly. |
I'm trying to pull this into a dev env using composer, and getting this error:
The "require": {
"omnipay/common": "dev-feat-guzzle7"
}, Same with or without: "repositories": [
{
"type": "vcs",
"url": "https://github.com/thephpleague/omnipay.git"
}
] Using PHP 7.3. |
This is not omnipay/common, but the league/omnipay package |
I did say I was probably being dumb...thanks. |
I'm getting no client discovery with Guzzle 7.0.1
Hope this is helpful. It should just work with omnipay common 3.0.4 and Guzzle 7.0.1, and an Omnipay 3.x driver, without any further concrete implementations of factories or clients, shouldn't it? |
Meh, PSR17 support is not yet released: guzzle/psr7#327 |
I know http-interop/http-factory-guzzle isn't a great long-term fix but for those of us who are stuck, is it possible to temporarily switch to it until the Guzzle team decides to implement PSR-17 directly? |
You can use it directly, if you use omnipay/common |
That's the problem - I'm actually using one of your packages ( |
Ah, we should probably change that to omnipay common with the factory then |
Would that just be a matter of updating the composer.json to change the reference from league/omnipay to omnipay/common and add a reference to http-interop/http-factory-guzzle? If so, I will update my open PR to include those changes. I apologize for the stupid questions, I'm not super clear on how PSR-17 works and if it's really that easy to solve. |
I've added some tests. I hope this one is failing, then I will add the factory and have it passing. |
Ah we're using the old HttpClient, should probably change the discovery also.. |
Pff, so guzzle7-adapter is just a few days old, but not supported in the Discovery yet. Guzzle/psr7 2.x is 'close to release' but not ready yet. So if we want to unblock Guzzle 7:
Or wait until either guzzle7 adapter is discovered, of guzzle/psr7 2.x is released. Preferably we would upgrade the PSR support anyways though |
Discovery PR is here: php-http/discovery#189 |
Aaaaaand we're green. So what do you think, good like this? Bump to Guzzle 7 for the people using this now, should be able to still use guzzle6 with the older tags, right? |
Merged this so we can test this with |
|
@barryvdh still receiving the issue posted above |
Trying to install omnipay with
What am I missing? |
@barryvdh have you had a chance to have a look at the issues posted after the PR was merges? |
What do you do exactly? If I create a new project: composer require league/omnipay:^3.1@dev omnipay/mollie <?php
require __DIR__ . '/vendor/autoload.php';
$gateway = \Omnipay\Omnipay::create('Mollie');
$gateway->setApiKey('test_foobar');
$response = $gateway->purchase(
[
"amount" => "10.00",
"currency" => "EUR",
"description" => "My first Payment",
"returnUrl" => "https://webshop.example.org/mollie-return.php"
]
)->send();
print_r($response->getData()); It works fine for me. It installs Guzzle 7.2.0:
And calls the API
|
I can't get it to break in the same way anymore. Perhaps I had another dependency causing a conflict. Sorry for the trouble. |
Guzzle 7 implements the HttpClient interface directly. So no longer required to use the adapter.
This is just the wrapper package, so 3.0 will still be fine for those on older versions/guzzle (I think). Composer should detect that 3.1 only works with Guzzle 7/newer PHP versions hopefully.
We might need to run some actual tests, but http-client/discovery 1.9+ should find Guzzle7 already: https://github.com/php-http/discovery/releases