PHPackages                             sunveloper/teepluss-gateway - 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. sunveloper/teepluss-gateway

ActiveLibrary[Payment Processing](/categories/payments)

sunveloper/teepluss-gateway
===========================

Laravel gateway is payment gateway adapter.

2.0.2(5y ago)01MITPHPPHP &gt;=5.4.0

Since Oct 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sunveloper/teepluss-gateway)[ Packagist](https://packagist.org/packages/sunveloper/teepluss-gateway)[ Docs](https://github.com/teepluss/laravel-gateway)[ RSS](/packages/sunveloper-teepluss-gateway/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Gateway for Laravel
-------------------

[](#gateway-for-laravel)

### For Laravel 4, please use the [v1.x branch](https://github.com/teepluss/laravel-gateway/tree/v1.x)!

[](#for-laravel-4-please-use-the-v1x-branch)

Gateway is payment gateway adapters that support Paypal, Paysbuy, Bangkok Bank, Kasikorn Bank, True Money.

### Installation

[](#installation)

- [Gateway on Packagist](https://packagist.org/packages/teepluss/gateway)
- [Gateway on GitHub](https://github.com/teepluss/laravel-gateway)

To get the lastest version of Gateway simply require it in your `composer.json` file.

```
"teepluss/gateway": "dev-master"

```

You'll then need to run `composer install` to download it and have the autoloader updated.

Once Gateway is installed you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.

```
'providers' => [
    ...
    Teepluss\Gateway\GatewayServiceProvider::class,
)

```

Gateway also ships with a facade which provides the static syntax for creating collections. You can register the facade in the `aliases` key of your `app/config/app.php` file.

```
'aliases' => [
    ...
    'Gateway' => Teepluss\Gateway\Facades\Gateway::class,

]

```

Usage
-----

[](#usage)

Generate payment form.

```
$adapter = Gateway::driver('Paypal');

$adapter->setSandboxMode(true);

$adapter->setSuccessUrl('http://www.domain/foreground/success')
        ->setCancelUrl('http://www.domain/foreground/cancel')
        ->setBackendUrl('http://www.domain/background/invoice/00001');

$adapter->setMerchantAccount('demo@gmail.com');

$adapter->setLanguage('TH')
        ->setCurrency('THB');

$adapter->setInvoice(00001)
        ->setPurpose('Buy a beer.')
        ->setAmount(100);

$adapter->setRemark('Short note');

$generated = $adapter->render();

var_dump($generated);
```

You can use intialize also.

```
$adapter = Gateway::driver('Paypal')->initialize(array(
    'sandboxMode'     => true,
    'successUrl'      => 'http://www.domain/foreground/success',
    'cancelUrl'       => 'http://www.domain/foreground/cancel',
    'backendUrl'      => 'http://www.domain/background/invoice/00001',
    'merchantAccount' => 'seller@domain.to',
    'language'        => 'TH',
    'currency'        => 'THB',
    'invoice'         => uniqid(),
    'purpose'         => 'Buy a beer.',
    'amount'          => 100,
    'remark'          => 'Short note'
));

$generated = $adapter->render();

var_dump($generated);
```

How to set TrueMoneyApi and PaysbuyApi

```
// True Money
$gateway = Gateway::driver('TrueMoneyApi');
$gateway->setMerchantAccount('appId:shopCode:secret:bearer');

// Paysbuy
$gateway = Gateway::driver('PaysbuyApi');
$gateway->setMerchantAccount('merchantId:username:secureCode');

// Paysbuy having non-apu version.
$gateway = Gateway::driver('Paysbuy');
$gateway->setMerchantAccount('email');
```

Checking foregound process.

```
$adapter = Gateway::driver('Paypal');

$adapter->setSandboxMode(true);

$adapter->setMerchantAccount('seller@domain.to');

$adapter->setInvoice(00001);

$result = $adapter->getFrontendResult();

var_dump($result);
```

Checking background process (IPN).

```
$adapter = Gateway::driver('Paypal');

$adapter->setSandboxMode(true);

$adapter->setMerchantAccount('demo@gmail.com');

$adapter->setInvoice(00001);

$result = $adapter->getBackendResult();

var_dump($result);
```

Extending the core.

```
use Teepluss\Gateway\Drivers\DriverAbstract;
use Teepluss\Gateway\Drivers\DriverInterface;

class Strip extends DriverAbstract imlements DriverInterface {
    //....
}

use Teepluss\Gateway\Repository;

Gateway::extend('Stripe', function()
{
    return new Repository(new Strip);
});
```

TrueMoneyApi adapter need more addition required data to make it works!

```
$gateway = Gateway::driver('TrueMoneyApi');

$gateway->setMerchantAccount('appId:shopCode:secret:bearer');

$gateway->setSandboxMode(true);
$gateway->setSuccessUrl(URL::to('demo/thankyou'))
        ->setCancelUrl(URL::to('demo/thankyou'))
        ->setBackendUrl(URL::to('demo/background'));

$gateway->setLanguage('TH')
        ->setCurrency('THB');

$gateway->setInvoice(uniqid())
        ->setPurpose('sale');

$gateway->payer(array(
    'installment'       => null,
    'fundingInstrument' => null,
    'payerInfo' => array(
        'email'     => 'tee@gmail.com',
        'firstName' => 'Tee',
        'lastName'  => 'Plus',
        'payerId'   => '11',
        'phone'     => '9999999'
    ),
    'paymentMethod' => 'creditcard'
));

$gateway->address(array(
    'cityDistrict'  => 'Patumwan',
    'companyName'   => 'eCommerce Solution',
    'companyTaxId'  => '3334567',
    'country'       => 'Thailand',
    'email'         => 'me@email.com',
    'forename'      => 'Tee',
    'line1'         => 'Ratchadapisak Rd.',
    'line2'         => 'OX',
    'phone'         => '0888773390',
    'postalCode'    => '10310',
    'stateProvince' => 'Bangkok',
    'surname'       => 'Pluss',
));

$gateway->payment(array(
    'ref1' => 1,
    'ref2' => 2,
    'ref3' => 3
));

$gateway->product()->add(array(
    'shopCode'  => null,
    'itemId'    => 1,
    'service'   => 'bill',
    'productId' => 'p1',
    'detail'    => 'd1',
    'price'     => 5000,
    'ref1'      => '1',
    'ref2'      => '2',
    'ref3'      => '3',
));

$gateway->product()->add(array(
    'shopCode'  => null,
    'itemId'    => 2,
    'service'   => 'bill',
    'productId' => 'p1',
    'detail'    => 'd1',
    'price'     => 300,
    'ref1'      => '1',
    'ref2'      => '2',
    'ref3'      => '3',
));

echo $gateway->includeSubmitButton()->render();
```

For old version of TrueMoney, we call TruePaymentApi instead.

```
$gateway = Gateway::driver('TruePaymentApi');

$gateway->setAppId('AppId')
        ->setShopId('ShopId')
        ->setPassword('Password')
        ->setPrivateKey('PrivateKey')
        ->setRC4Key('RC4Key');

// $gateway->setMerchantAccount('appId:ShopId:Password:PrivateKey:RC4Key');

$gateway->setSandboxMode(true);
$gateway->setSuccessUrl(URL::to('demo/thankyou'))
        ->setCancelUrl(URL::to('demo/thankyou'))
        ->setBackendUrl(URL::to('demo/background'));

$gateway->setLanguage('TH')
        ->setCurrency('THB');

$gateway->setRemark('Something');

$gateway->setInvoice(uniqid());

$gateway->payer(array(
    'ssoId'     => '4620762',
    'trueId'    => 'teepluss@gmail.com',
    'fullName'  => 'Test Dev2',
    'address'   => 'RS ห้วยขวาง ห้วยขวาง',
    'district'  => 'ห้วยขวาง',
    'province'  => 'กรุงเทพมหานคร',
    'zip'       => '11115',
    'country'   => 'Thailand',
    'mphone'    => '0890000001',
    'citizenId' => '4100799036048'
));

$gateway->billing(array(
    'fullname' => 'Teepluss',
    'address'  => '33/1 Pattanakarn',
    'district' => 'Pattanakarn',
    'province' => 'Bangkok',
    'zip'      => '10220',
    'country'  => 'Thailand'
));

$gateway->product()->add(array(
    'pid'         => 18051,
    'productId'   => 'ME161',
    'topic'       => 'Winnie Jewelry : ต่างหูสแควร์ไดมอนด์ (ME162)',
    'quantity'    => 1,
    'totalPrice'  => 10,
    'shopIdRef'   => 'inherit',
    'marginPrice' => 0
));

$gateway->product()->add(array(
    'pid'         => 18052,
    'productId'   => 'ME162',
    'topic'       => 'Winnie Jewelry : ต่างหูสแควร์ไดมอนด์ (ME162)',
    'quantity'    => 3,
    'totalPrice'  => 10,
    'shopIdRef'   => 'inherit',
    'marginPrice' => 0
));

echo $gateway->includeSubmitBtn()->render();
```

Support or Contact
------------------

[](#support-or-contact)

If you have some problem, Contact

[![Support via PayPal](https://camo.githubusercontent.com/1c4c2a63b268ab949717893dda9628735444f61b8eb8eece283a534338b5b0e5/68747470733a2f2f7261776769746875622e636f6d2f63687269732d2d2d2f446f6e6174696f6e2d4261646765732f6d61737465722f70617970616c2e6a706567)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9GEC8J7FAG6JA)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

2039d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9681770f6a38904fed365d5465307bf69efe9c1fc4af1d12f0f6d3cf8e0bfcf8?d=identicon)[sunveloper](/maintainers/sunveloper)

---

Top Contributors

[![sunveloper](https://avatars.githubusercontent.com/u/50315313?v=4)](https://github.com/sunveloper "sunveloper (1 commits)")

---

Tags

laravelgatewaypaypal

### Embed Badge

![Health badge](/badges/sunveloper-teepluss-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/sunveloper-teepluss-gateway/health.svg)](https://phpackages.com/packages/sunveloper-teepluss-gateway)
```

###  Alternatives

[larabook/gateway

A Laravel package for connecting to all Iraninan payment gateways

24553.7k](/packages/larabook-gateway)

PHPackages © 2026

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