Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between stripe-php and stripe-cartalyst APIs when using laravel

I want to use stripe payment gateway for my php application developed using laravel.I found this https://cartalyst.com/manual/stripe/1.0 package which makes using stripe with laravel easy, but I am afraid if it will be able to provide me each and very api that is mentioned on the official php API on the stripe website ?

For eg the code to retrieve my account balance using stripe official php doc is :

\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");

\Stripe\Balance::retrieve();

while to do same in cartalyst-stripe is:

Stripe::setApiKey(env('STRIPE_SECRET'));

$balance = Stripe::balance()->current(); 
like image 728
Jitender Yadav Avatar asked Oct 20 '25 13:10

Jitender Yadav


1 Answers

Cartalyst/stripe-laravel is a Platform-Agnostic package

Instead, you should be using Laravel Cashier

Then your User model will get a billable trait. So you can attach Stripe functionality directly to your customer.

like image 125
Ohgodwhy Avatar answered Oct 23 '25 05:10

Ohgodwhy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!