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

ActiveLibrary

hongyukeji/laravel-payment
==========================

Laravel payment.

v1.2.2(5y ago)0143MITPHPPHP &gt;=7.0CI failing

Since May 23Pushed 5y agoCompare

[ Source](https://github.com/hongyukeji/laravel-payment)[ Packagist](https://packagist.org/packages/hongyukeji/laravel-payment)[ RSS](/packages/hongyukeji-laravel-payment/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (3)Versions (8)Used By (0)

Laravel Payment
===============

[](#laravel-payment)

💳 [Omnipay](https://github.com/thephpleague/omnipay) ServiceProvider for Laravel.

[![Build Status](https://camo.githubusercontent.com/63c126658940e645088c3026f1c983d7f31d97de04cd3143b35e99cf980d381a/68747470733a2f2f7472617669732d63692e6f72672f686f6e6779756b656a692f6c61726176656c2d7061796d656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hongyukeji/laravel-payment)[![Latest Stable Version](https://camo.githubusercontent.com/7112fb6eaaf78b5f8d0f06bbe902863789cde9ae8821c4b8c2c0d29905679f6c/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f6c61726176656c2d7061796d656e742f762f737461626c65)](https://packagist.org/packages/hongyukeji/laravel-payment)[![Total Downloads](https://camo.githubusercontent.com/f295c45a22d900506703b0af4418eda124dab4aa099b66028d4ff983941f7e11/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f6c61726176656c2d7061796d656e742f646f776e6c6f616473)](https://packagist.org/packages/hongyukeji/laravel-payment)[![License](https://camo.githubusercontent.com/10781741eb8d5aa4fff30739f478f78d7d2c3efdf2d8467f096901ad0a008272/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f6c61726176656c2d7061796d656e742f6c6963656e7365)](https://packagist.org/packages/hongyukeji/laravel-payment)[![composer.lock](https://camo.githubusercontent.com/11f4654038d826390e9a5967deb402a9cd02a9fbdf492de0890b015e1cf01b04/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f6c61726176656c2d7061796d656e742f636f6d706f7365726c6f636b)](https://packagist.org/packages/hongyukeji/laravel-payment)

Installing
----------

[](#installing)

```
$ composer require hongyukeji/laravel-payment

```

After updated composer, if you are using laravel version &lt; 5.5, you need to register service provider:

```
// config/app.php

    'providers' => [
        //...
        Hongyukeji\LaravelPayment\Providers\PaymentServiceProvider::class,
    ],

```

And publish the config file:

```
$ php artisan vendor:publish --provider="Hongyukeji\\LaravelPayment\\Providers\\PaymentServiceProvider"
```

if you want to use facade mode, you can register a facade name what you want to use, for example `LaravelPayment`:

```
// config/app.php

    'aliases' => [
        'Payment' => Hongyukeji\LaravelPayment\Facades\Payment::class, // This is default in laravel 5.5
    ],

```

### configuration

[](#configuration)

```
// config/payments.php

    // The default gateway name which configured in `gateways` section.
    'default_gateway' => 'paypal',

    // The default options for every gateways.
    'default_options' => [
        'test_mode' => true,
        // ...
    ],

    /*
     * The gateways, you can config option by camel case or snake_case name.
     *
     * the option name is followed from gateway class, for example:
     *
     * $gateway->setMchId('hongyukeji');
     *
     * you can configured as:
     *  'mch_id' => 'hongyukeji',
     * or:
     *  'mchId' => 'hongyukeji',
     */
    'gateways' => [
        'paypal' => [
            'driver' => 'PayPal_Express',
            'options' => [
                'username' => env('PAYPAL_USERNAME'),
                'password' => env('PAYPAL_PASSWORD'),
                'signature' => env('PAYPAL_SIGNATURE'),
                'test_mode' => env('PAYPAL_TEST_MODE'),
            ],
        ],
        // other gateways
    ],

```

### install payment gateways

[](#install-payment-gateways)

You need to install the gateway you want to use: [omnipay#payment-gateways](https://github.com/thephpleague/omnipay#payment-gateways)

Usage
-----

[](#usage)

Gateway instance:

```
Payment::gateway('GATEWAY NAME'); // GATEWAY NAME is key name of `gateways` configuration.
Payment::gateway('alipay');
Payment::gateway('paypal');

```

Using default gateway:

```
Payment::purchase(...);

```

Example:

```
$formData = [
    'number' => '4242424242424242',
    'expiryMonth' => '6',
    'expiryYear' => '2030',
    'cvv' => '123'
];

$response = Payment::purchase([
    'amount' => '10.00',
    'currency' => 'USD',
    'card' => $formData,
))->send();

if ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect();
} elseif ($response->isSuccessful()) {
    // payment was successful: update database
    print_r($response);
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

```

For more use about [Omnipay](https://github.com/omnipay/omnipay), please refer to [Omnipay Official Home Page](http://omnipay.thephpleague.com/)

License
-------

[](#license)

MIT

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~112 days

Recently: every ~134 days

Total

7

Last Release

1873d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/484917e0c99c9779961352578c18bae13504567d6ec43cc3c594b3e447aad436?d=identicon)[hongyukeji](/maintainers/hongyukeji)

---

Top Contributors

[![hongyukeji](https://avatars.githubusercontent.com/u/23145983?v=4)](https://github.com/hongyukeji "hongyukeji (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[microweber/microweber

New generation CMS with drag and drop

3.4k13.8k1](/packages/microweber-microweber)[offline/oc-mall-plugin

E-commerce solution for October CMS

1744.6k2](/packages/offline-oc-mall-plugin)

PHPackages © 2026

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