PHPackages                             barstec/laravel-stripe-simple-payment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. barstec/laravel-stripe-simple-payment

ActiveLibrary[Framework](/categories/framework)

barstec/laravel-stripe-simple-payment
=====================================

Package for easily integrating stripe one-time payments with Laravel.

v1.0.4(2y ago)010MITPHP

Since Dec 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Bartlomiej-Stec/barstec-laravel-stripe-simple-payment)[ Packagist](https://packagist.org/packages/barstec/laravel-stripe-simple-payment)[ RSS](/packages/barstec-laravel-stripe-simple-payment/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Stripe simple one-time checkout for Laravel
===========================================

[](#stripe-simple-one-time-checkout-for-laravel)

This package is designed for seamless integration of simple Stripe payments with Laravel. It enables only one-time payments for a single item. The package encompasses table creation, payment generation using the Stripe API and PHP library, and payment verification.

Support
-------

[](#support)

If this package is helpful for you, you can support my work on Ko-fi.

[![ko-fi](https://camo.githubusercontent.com/201ef269611db7eb6b5d08e9f756ab8980df3014b64492770bdf13a6ed924641/68747470733a2f2f6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/S6S6PH8KM)

Installation
------------

[](#installation)

1. Install composer package using command:

```
composer require barstec/laravel-stripe-simple-payment
```

2. Publish configuration files to your project

```
php artisan vendor:publish --provider="Barstec\Stripe\StripeServiceProvider"
```

4. Run migrations

```
php artisan migrate
```

Setup
-----

[](#setup)

Firstly you need to move environmental variables from .env.example to .env:

```
STRIPE_API_KEY=
STRIPE_WEBHOOK_SECRET=
```

To enable testing mode, simply copy and paste the values from the Stripe testing environment above.

In the configuration file, you can define return routes, default values, the database table name, and the columns to be collected. After modifying columns, rerun the migration process.

In Stripe settings create webhook with endpoint matching notification\_route from config and choose events: checkout.session.expired, checkout.session.completed

Usage/Examples
--------------

[](#usageexamples)

To initiate a transaction, create a **Payload** object in your controller and assign values. Then, create a **Payment** object, pass the **Payload**, and call **redirect()**. This action will start the transaction and redirect the user to the Stripe payment page. By default **Payload** object is configured to handle single-item payment without delivery or additional costs. You can modify it using predefined methods. If you want to add value that is not available in **Payload** class, you can use **addAdditionalParam** method to pass it manually.

```
