首页 > 解决方案 > Cashier (Stripe) integration in Lumen

问题描述

I have integrated cashier in laravel 8 without any problem but when I am integrating cashier in lumen 8 it has become a panic process I have spent a lot of time integrating it I even googled everywhere but no luck. Can anyone help me integrating cashier in lumen 8. what I have done so far is as follow

  1. installed cashier by using this command: composer require laravel/cashier
  2. then run: php artisan migrate
  3. php artisan vendor:publish --tag="cashier-migrations"
  4. Added: use Laravel\Cashier\Billable; and use Billable; in User Model
  5. Set stripe api keys in .env file: STRIPE_KEY=my-stripe-key , STRIPE_SECRET=my-stripe-secret
  6. in my code when I coded $user->createSetupIntent();

When I execute line#6 I am getting this error

No API key provided. (HINT: set your API key using "Stripe::setApiKey()". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.

It seems like lumen is unable to read cashier module can anyone help fixing this issue?

标签: phpstripe-paymentslumenlaravel-cashier

解决方案


推荐阅读