PHPackages                             litvinjuan/laravel-payments - 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. [Payment Processing](/categories/payments)
4. /
5. litvinjuan/laravel-payments

ActiveLibrary[Payment Processing](/categories/payments)

litvinjuan/laravel-payments
===========================

A Payments package for Laravel

1.0.0(6y ago)029MITPHPPHP &gt;=7.2

Since Aug 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/litvinjuan/laravel-payments)[ Packagist](https://packagist.org/packages/litvinjuan/laravel-payments)[ Docs](https://juanlitvin.com)[ RSS](/packages/litvinjuan-laravel-payments/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (3)Versions (32)Used By (0)

Easily store payments and handle payment gateways in Laravel
============================================================

[](#easily-store-payments-and-handle-payment-gateways-in-laravel)

This package provides traits and interfaces that will let you easily create and store payments, as well as provide you with a streamlined interface to interact with payment gateways.

---

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

[](#installation)

You can install the package via composer:

```
composer require litvinjuan/laravel-payments
```

If you are using a `Laravel version below 5.5`, you need to add the following to your `config/app.php` file:

```
'providers' => [
    litvinjuan\LaravelPayments\LaravelPaymentsServiceProvider::class,
]
```

Next, you need to publish the config and migration files. Run the following command in your project's root:

```
php artisan vendor:publish --provider="litvinjuan\LaravelPayments\LaravelPaymentsServiceProvider"
```

Last, run the migrations so that your payments table is created:

```
php artisan migrate
```

Usage
-----

[](#usage)

You will have to create a Model that implements the `Payable` interface and the `HasPayment` trait. This is the model your users will be paying for (ej. Order, Product).

The `Payable` interface has 3 methods you'll need to implement yourself: `getPayablePrice()` should return the total price that should be paid, `getPayableDescription()` should return the payment description that should be used in the bank statement and for future reference, `payer()` should return a reference to whoever should make the payment.

Here's an example:

```
