zf-fr / zfr-stripe

ZfrStripe is a PHP library based on Guzzle for Stripe payment system
MIT License
44 stars 10 forks source link

Update to Guzzle 5 #10

Open bakura10 opened 10 years ago

mohdsadiq1 commented 10 years ago

i am having following error while calling StripeClientTest('My_Api_Key');

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/survival/vendor/zfr/zfr-stripe/tests/ZfrStripeTest/Client/StripeClientTest.php on line 29

please let me know what i am doing wrong

bakura10 commented 10 years ago

Why are you using the test client ? You should use the Stripe Client (\ZfrStripe\Client\StripeClient)

Envoyé de mon iPhone

Le 13 oct. 2014 à 12:55, mohdsadiq1 notifications@github.com a écrit :

i am having following error while calling StripeClientTest('My_Api_Key');

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/survival/vendor/zfr/zfr-stripe/tests/ZfrStripeTest/Client/StripeClientTest.php on line 29

please let me know what i am doing wrong

— Reply to this email directly or view it on GitHub.

mohdsadiq1 commented 10 years ago

as with the Stripe Client (\ZfrStripe\Client\StripeClient) i am not able the use the test credit cards and i need to test all the param return by stripe so that i can update my record on successful payment , i am very new to zf2 and stripe also

On Mon, Oct 13, 2014 at 4:38 PM, Michaël Gallego notifications@github.com wrote:

Why are you using the test client ? You should use the Stripe Client (\ZfrStripe\Client\StripeClient)

Envoyé de mon iPhone

Le 13 oct. 2014 à 12:55, mohdsadiq1 notifications@github.com a écrit :

i am having following error while calling StripeClientTest('My_Api_Key');

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/survival/vendor/zfr/zfr-stripe/tests/ZfrStripeTest/Client/StripeClientTest.php on line 29

please let me know what i am doing wrong

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/zf-fr/zfr-stripe/issues/10#issuecomment-58876858.

Regards: MOHD SADIQ 8802720277

bakura10 commented 10 years ago

Testing an API is always hard. I think the simplest way is to simply "simulate" an API response by saving the response into an array.

I'm not sure to understand your problem actually :p

Envoyé de mon iPhone

Le 13 oct. 2014 à 15:33, mohdsadiq1 notifications@github.com a écrit :

i need to test all the param return by stripe so that i can update my record on successful payment , i am very new to zf2 and stripe also

On Mon, Oct 13, 2014 at 4:38 PM, Michaël Gallego notifications@github.com wrote:

Why are you using the test client ? You should use the Stripe Client (\ZfrStripe\Client\StripeClient)

Envoyé de mon iPhone

Le 13 oct. 2014 à 12:55, mohdsadiq1 notifications@github.com a écrit :

i am having following error while calling StripeClientTest('My_Api_Key');

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/survival/vendor/zfr/zfr-stripe/tests/ZfrStripeTest/Client/StripeClientTest.php on line 29

please let me know what i am doing wrong

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/zf-fr/zfr-stripe/issues/10#issuecomment-58876858.

Regards: MOHD SADIQ 8802720277 — Reply to this email directly or view it on GitHub.

Ocramius commented 10 years ago

He's using a test file in his own project, while that file shouldn't be used in first place except from zf-fr/zfr-stripe.

Ocramius commented 10 years ago

Update to Guzzle 4

Artax plox :P

bakura10 commented 10 years ago

Especially when Guzzle 5 was released today :( :too_much_major_versions:

Ocramius commented 10 years ago

png image 600 x 600 pixels

bakura10 commented 10 years ago

Guzzle 4 was supposed to be "the major version for the next few years" :trollface:

Ocramius commented 10 years ago

Major versions happen: :8ball: :game_die:

bakura10 commented 10 years ago

It's understandable for Guzzle (because of PSR-7... I hope the spec won't move now :/)

Ocramius commented 10 years ago

The spec isn't stable yet :-\

ukaner commented 9 years ago

I get this as well;

zfr/zfr-stripe v2.9.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.6.0, v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4, v3.8.0, v3.8.1, v3.9.0].

bakura10 commented 9 years ago

hhmm this should work haha :p. I don't have any issue using ZfrStripe, can you please show me your full composer.json file ?

joshhornby commented 9 years ago

I am also getting the issue that @ukaner mentioned.

    "require": {
        "laravel/framework": "4.2.*",
        "dingo/api": "0.8.*",
        "lucadegasperi/oauth2-server-laravel": "3.*",
        "league/flysystem": "~1.0",
        "aws/aws-sdk-php": "~2.7",
        "league/flysystem-aws-s3-v2": "~1.0",
        "aws/aws-sdk-php-laravel": "~1.1",
        "league/commonmark": "0.6.*",
        "laravel/cashier": "2.0.*"
    },
zfr/zfr-stripe v2.12.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.6.0, v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4, v3.8.0, v3.8.1, v3.9.0].
bakura10 commented 9 years ago

Grrr I don't understnad, it's working perfectly here. V3.9 should indeed match isn't it ? :(

bakura10 commented 9 years ago

Can you try forcing guzzle to 3.9 in your composer JSON? I'm wondering if another dependency of yours does not force a guzzle version prior 3.6 (if that's the case, you should ask those maintainers to allow newer versions)

joshhornby commented 9 years ago

Very odd, I have updated my composer like so:

"guzzle/guzzle": "3.9.*"

And I now get this

 Problem 1
    - zfr/zfr-stripe v2.0.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.0.1 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.0.2 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.0.3 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.0.4 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.1.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.10.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.10.1 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.10.2 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.11.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.11.1 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.12.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.2.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.2.1 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.2.2 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.2.3 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.2.4 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.3.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.3.1 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.3.2 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.3.3 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.3.4 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.3.5 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.3.6 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.4.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.5.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.6.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.7.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.8.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.8.1 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - zfr/zfr-stripe v2.9.0 requires guzzle/guzzle >=3.6,<=3.9 -> satisfiable by guzzle/guzzle[v3.9.0].
    - Conclusion: don't install guzzle/guzzle v3.9.0
    - Installation request for zfr/zfr-stripe 2.* -> satisfiable by zfr/zfr-stripe[v2.0.0, v2.0.1, v2.0.2, v2.0.3, v2.0.4, v2.1.0, v2.10.0, v2.10.1, v2.10.2, v2.11.0, v2.11.1, v2.12.0, v2.2.0, v2.2.1, v2.2.2, v2.2.3, v2.2.4, v2.3.0, v2.3.1, v2.3.2, v2.3.3, v2.3.4, v2.3.5, v2.3.6, v2.4.0, v2.5.0, v2.6.0, v2.7.0, v2.8.0, v2.8.1, v2.9.0].
bakura10 commented 9 years ago

Mehhhh... There is some black magic happening.

Can you try to remove zfr-stripe from your composer.josn and instead add "zfr/zfr-stripe-module": ~3.0 ?

This is exactly what I have in my application and it's working correctly. I honestly don't explain it myself. the strangest is that it does not report any conflicting libraries. Only that zfr stripe request 3.9, but cannot use 3.9 u_u

joshhornby commented 9 years ago

Same error again, one of these packages must be breaking it.

bakura10 commented 9 years ago

I had a look at all your direct dependencies, and none of them require Guzzle directly (except the AWS SDK but it requires Guzzle ~3.7, which should resolve). I'm going to push an update of ZfrStripe to have a simpler dependency to Guzzle (~3.6 instead of an explicit range). I did that in the past because Guzzle used to introduce BC even if minor versions, but as Guzzle 5 is out, I suspect they won't change it now.

bakura10 commented 9 years ago

I've just tagged v2.12.1, which requires guzzle ~3.6 instead of >=3.6,<=3.9.

Can you try again (just wait a few minutes so that Packagist correctly update everything)

joshhornby commented 9 years ago

Seems to be working now :+1:

bakura10 commented 9 years ago

Yeah \o/. Thanks!

lunetics commented 8 years ago

what about guzzle6? :dancer:

bakura10 commented 8 years ago

Still waiting for Guzzle services to be available in v6 :). Guzzle commands have been updated to v6 but Guzzle services (which ZfrStripe relies on) not yet. You can see their branch here: https://github.com/guzzle/guzzle-services/tree/guzzle6

sisve commented 7 years ago

Huzzah! https://github.com/guzzle/guzzle-services/commit/3bdd887a61710fea959779937c383821930c8f16

bakura10 commented 7 years ago

Not tagged yet isn't it ? But definitely seeems on good tracks :D

bakura10 commented 7 years ago

Oh sorry @sisve , I've didn't realized it was tagged.

Indeed, this means that this package could now be upgraded to Guzzle Services 1.0.0 which rely on Guzzle 6 :). unfortuantely at the moment I really don't have any availability as it's pretty long to upgrade it.

However if anyone would like to take the lead of that, I've already upgraded another package of mine that I need currently to this new version: https://github.com/zf-fr/zfr-shopify. That could serve as a reference for anyone wanting to tackle an upgrade.

The only small problem is that there are still some issues like this one (https://github.com/guzzle/guzzle-services/pull/129) that make me think we should wait a bit :). But if anyone has time, please go on and submit a PR :).