2

I'm using Symfony 2.8 with Sylius 0.16.0-dev and despite of installing stripe-php library via composer composer require stripe/stripe-php this part of code throw an exception

if (!class_exists('Stripe')) {
            throw new \LogicException('You must install "stripe/stripe-php" library.');
}

Could you explain me why?

Starspire
  • 272
  • 3
  • 15
  • installation composer run correctly ? Are you sure that library is loaded ? – miltone Jan 25 '16 at 09:43
  • @darkomen composer runs successful and everything loads in vendor folder. Symfony has autoloader which loads everything from vendor folder. – Starspire Jan 25 '16 at 09:53
  • Wouldn't the class actually be `Stripe\Stripe`? – qooplmao Jan 25 '16 at 10:08
  • @qooplmao Maybe. I'll try in an hour. But is there any possibility to access this class like that? This is part of another library (payum) and I don't want to change its code. – Starspire Jan 25 '16 at 10:11
  • 1
    If you are using version 1.1.4 of Payum there aren't a lot of changes since then to the master (https://github.com/Payum/Payum/compare/1.1.4...master). You could use the master version in place of the actual one `"payum/payum": "dev-master as 1.1.4"` until the latest version is released. – qooplmao Jan 25 '16 at 10:28
  • Thank you very much, @qooplmao. That was the case! Please make an answer from this comment, in order I can mark it as an correct answer. – Starspire Jan 25 '16 at 11:04

2 Answers2

1

Add stripe/stripe-php in the require-dev section of your composer.json. Like this:

"require-dev": {
    ...
    "stripe/stripe-php": "~1.0"
},
ivansu
  • 59
  • 2
1

As requested..

If you are using version 1.1.4 of Payum there aren't a lot of changes since then to the master (https://github.com/Payum/Payum/compare/1.1.4...master). You could use the master version in place of the actual one "payum/payum": "dev-master as 1.1.4" until the latest version is released.

qooplmao
  • 17,622
  • 2
  • 44
  • 69