Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zhiyong's avatar

How to use official stripe-php library in Laravel 5?

Hi,

I am trying to add stripe into my website. So far I am able to charge a test card by using Catalyst/stripe-laravel package. But somehow , that package cannot catch exceptions like "Your card is declined etc." even after I place all Stripe related operations into a try{} catach{}. So I figure I may just have to use the official library.

The reason I am not using cashier is, it seems Cashier is particularly designed for subscriptions not for one-off charges.

Update: I thought it was going to be tricky, it is actually not to use the stripe-php library. I basically followed the link below, and fiver minutes later, I am up and running.

http://stackoverflow.com/questions/15190772/using-a-non-laravel-package-on-laravel-4

0 likes
2 replies
halperiano's avatar

si pero yo no uso LARAVEL 4 y no entendí, como hago para llamar la clase de STRIPE HELP!!

halperiano's avatar

Yes but I do not use LARAVEL 4 and I did not understand, as I do to call the STRIPE class, help me please

Please or to participate in this conversation.