To provide Stripe payment integration for the Laravel Webshop package.
- Laravel 8+
- PHP >=8.1
$ composer require dv5150/shop-stripe
- Set up
config/shop-stripe.php
config file with your Stripe access keys. - Set the
active
status of your newly created StripePaymentMode
entity to true. Do not change the value of theprovider
field. - Attach the Stripe
PaymentMode
entity to the desiredShippingMode
entities. - Register the Stripe payment mode in your application:
namespace App\Providers;
use DV5150\Shop\Facades\Shop;
use DV5150\Shop\Stripe\StripeProvider;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function register()
{
Shop::registerPaymentProviders([
StripeProvider::class,
]);
}
}
Listen to the successful payment webhooks locally:
docker run --network="host" --rm -it stripe/stripe-cli listen --forward-to https://webshop.test/api/shop/payment/stripe/webhook --skip-verify --api-key <secret_key> --events=checkout.session.completed
Trigger successful payment events:
docker run --rm -it stripe/stripe-cli trigger checkout.session.completed --api-key <secret_key>