PHPackages                             ggphp/laravel-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. ggphp/laravel-payment

ActiveLibrary

ggphp/laravel-payment
=====================

Package payment for Laravel

v1.0(5y ago)23MITPHP

Since Nov 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/phuockhanh94/laravel-payment)[ Packagist](https://packagist.org/packages/ggphp/laravel-payment)[ RSS](/packages/ggphp-laravel-payment/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

Payment Package for Laravel
===========================

[](#payment-package-for-laravel)

This is a Laravel Package for Payment Gateway Integration.

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

[](#installation)

#### Composer

[](#composer)

```
composer require ggphp/laravel-payment
```

Configuration
-------------

[](#configuration)

#### Config File

[](#config-file)

Publish the default config file `payment.php` to your application

```
php artisan config:publish --force
```

Then choose `payment-config`

#### Run Migrations

[](#run-migrations)

```
php artisan migrate
```

#### Customer Model Setup

[](#customer-model-setup)

Next, add the CustomerBillableTrait to your customer model definition:

```
use GGPHP\Payment\CustomerPaymentTrait;

class User extends Eloquent
{
  use CustomerPaymentTrait;
}
```

Customers
---------

[](#customers)

#### Creating A Customer

[](#creating-a-customer)

Once you have a customer model instance, you can create simple the customer in the billing gateway:

```
$user = User::find(1);

$user->payment()->create();
```

If you would like create customer with properties:

```
$user->payment()->create([
  'email' => $email,
]);
```

#### Updating A Customer

[](#updating-a-customer)

To update an existing customers:

```
$user->payment()->update([
  'email' => $email,
]);
```

#### Deleting A Customer

[](#deleting-a-customer)

Deleting a customer:

```
$user->payment()->delete();
```

#### Create Credit Cards

[](#create-credit-cards)

You may add more than one credit card on a customer:

```
$card = $user->card()->create('credit_card_token');
```

#### Create A Charge

[](#create-a-charge)

Creating a new charge on a customer:

```
$charge = $user->charges()->create(5996, ['description' => 'description']);
```

Cards
-----

[](#cards)

#### Creating Card on a Customer

[](#creating-card-on-a-customer)

Once you have a customer model instance, you can create simple the card:

```
$user = User::find(1);

$card = $user->card()->create('credit_card_token');
```

#### Get all cards on a Customer

[](#get-all-cards-on-a-customer)

Get all cards on a Customer:

```
$cards $user->card()->all();
```

#### Get first card on a Customer

[](#get-first-card-on-a-customer)

Get first card on a Customer:

```
$card = $user->card()->first();
```

#### Find A Card

[](#find-a-card)

To find an existing card:

```
$card = $user->card()->find('id_card');
```

#### Update card on a Customer

[](#update-card-on-a-customer)

To update an existing card:

```
$card = $card->update([
  'exp_month' => '1'
]);
```

#### Delete A Card

[](#delete-a-card)

To delete an existing card:

```
$card->delete();
```

Charge
------

[](#charge)

#### Creating A Charge

[](#creating-a-charge)

Creating a new charge on a customer:

```
$charge = $user->charges()->create(499);
```

If you would like create charge with properties:

```
$user->charges()->create(499, [
  'email' => $email,
]);
```

To charge on a new credit card token:

```
$charge = $user->charges()->withCardToken('token')->create(499);
```

You may also specify an existing credit card to use for a charge:

```
$charge = $user->charges()->withCard('card_id')->create(499);
```

#### Capturing A Charge

[](#capturing-a-charge)

To Capturing A Charge:

```
$charge = $user->charges()->create(499, array('capture' => false));

$charge->capture();
```

#### Refunding A Charge

[](#refunding-a-charge)

Refunding a charge is also possible:

```
$charge->refund();
```

If you would like refund charge with properties:

```
$charge->refund([
  'amount' => 399,
  'reason' => 'reason'
]);
```

#### Get all charges on a Customer

[](#get-all-charges-on-a-customer)

Get all charges on a Customer:

```
$cards $user->charges()->all();
```

#### Get first charges on a Customer

[](#get-first-charges-on-a-customer)

Get first card on a Customer:

```
$card = $user->charges()->first();
```

#### Update charge

[](#update-charge)

To update an existing charge:

```
$card = $charge->update([
  'description' => 'description'
]);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1993d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/609502854cbb1d6729aedbf88d8c0d1cc149eb466ceef41d4593a42800342e00?d=identicon)[phuockhanh94](/maintainers/phuockhanh94)

---

Top Contributors

[![phuockhanh94](https://avatars.githubusercontent.com/u/22462489?v=4)](https://github.com/phuockhanh94 "phuockhanh94 (26 commits)")[![khanhgg](https://avatars.githubusercontent.com/u/34016637?v=4)](https://github.com/khanhgg "khanhgg (18 commits)")

### Embed Badge

![Health badge](/badges/ggphp-laravel-payment/health.svg)

```
[![Health](https://phpackages.com/badges/ggphp-laravel-payment/health.svg)](https://phpackages.com/packages/ggphp-laravel-payment)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[duncanmcclean/simple-commerce

A simple, yet powerful e-commerce addon for Statamic.

16313.2k2](/packages/duncanmcclean-simple-commerce)[flux-se/sylius-stripe-plugin

Sylius Stripe plugin using Payment Request

1029.3k](/packages/flux-se-sylius-stripe-plugin)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

322.8k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
