PHPackages                             tomato-technologies/tomato-omipay - 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. tomato-technologies/tomato-omipay

ActiveLibrary[Payment Processing](/categories/payments)

tomato-technologies/tomato-omipay
=================================

OmiPay for Laravel project

v1.0.2(7y ago)0221[1 PRs](https://github.com/tomato-technologies/tomato-omipay/pulls)MITPHP

Since Dec 7Pushed 7y agoCompare

[ Source](https://github.com/tomato-technologies/tomato-omipay)[ Packagist](https://packagist.org/packages/tomato-technologies/tomato-omipay)[ RSS](/packages/tomato-technologies-tomato-omipay/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

OmiPay Laravel wrapper
----------------------

[](#omipay-laravel-wrapper)

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

[](#installation)

```
composer require tomato-technologies/tomato-omipay
```

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

### Laravel 5.5+:

[](#laravel-55)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
Tomato\OmiPay\ServiceProvider::class,
```

If you want to make it easier to access Pusher or Event class, add this to your facades in app.php:

```
'TomatoOmiPay' => Tomato\OmiPay\Facade::class,
```

Usage
-----

[](#usage)

Before usage, please remember to set your `OMIPAY_MERCHANT_NO` and `OMIPAY_MERCHANT_KEY` in `.env` file. The merchant number should be a number with "M", eg. "000034".

If you want to get more config on this wrapper, you can pull a configuration file into your application by running on of the following artisan command:

```
php artisan vendor:publish --provider="Tomato\OmiPay\ServiceProvider"

```

Example Coding
--------------

[](#example-coding)

Making a QRorder:

```
    $qrRequest=new \Tomato\OmiPay\Requests\Payment\QROrderRequest();
    $qrRequest->setOrderName("Test Product 1");
    $qrRequest->setCurrency("AUD");
    $qrRequest->setAmount(1*100);//1 dollar
    $qrRequest->setNotifyUrl(route("opmipay-notification"));
    $qrRequest->setOutOrderNo("10001");
    $qrRequest->setPlatform("ALIPAY");
    $result=\TomatoOmiPay::qrOrder($qrRequest);

    var_dump($result);
```

Here is what you will see from `var_dump($result)`, then using `pay_url` to redirect use for payment

```
array (size=8)
  'order_no' => string 'TR1812060010011263009795' (length=24)
  'qrcode' => string 'https://qr.alipay.com/bax06022po8u7fm93zxp200b' (length=46)
  'pay_url' => string 'https://www.omipay.com.cn/Omipay/H5Pay/QRcode_Pay.html?paycode=TR1812060010011263009795&m_number=0010011263&platform=WECHATPAY&timestamp=1544088240364&nonce_str=jinwuwc8hyzi67itxwf9x0fjxjz00q&sign=F49FC0DFFB81EDF639AB8BF4A0FE7252' (length=229)
  'platform' => string 'ALIPAY' (length=6)
  'error_msg' => null
  'msg' => null
  'success' => boolean true
  'return_code' => string 'SUCCESS' (length=7)

```

Example of How to receive Notification from OmiPay
--------------------------------------------------

[](#example-of-how-to-receive-notification-from-omipay)

Only verified request will be fired on this event, so there is not need to check the sign.

Listen `omipay.got-notification` in you EventServiceProvider and map it to you own handler.

```
'omipay.got-notification'=>[
            'App\Http\Controllers\Site\HomeController@onOmipayNotice'
        ],
```

Here is example handler, `$data` is an array containing all request data ([https://www.omipay.com.au/Help/API\_new.html#nine](https://www.omipay.com.au/Help/API_new.html#nine)).

```
    public function onOmipayNotice($data=[]){
        \Log::info(json_encode($data));
    }
```

### Change Logs

[](#change-logs)

Updates on 19 Dec 2018:

For any Omipay order which support "redirect\_url", this package will include the "redirect\_url" to the "pay\_url", for example

Before:

```
    $qrRequest=new \Tomato\OmiPay\Requests\Payment\QROrderRequest();
    $qrRequest->setOrderName("Test Product 1");
    $qrRequest->setCurrency("AUD");
    $qrRequest->setAmount(1*100);//1 dollar
    $qrRequest->setNotifyUrl(route("opmipay-notification"));
    $qrRequest->setOutOrderNo("10001");
    $qrRequest->setPlatform("ALIPAY");
    $result=\TomatoOmiPay::qrOrder($qrRequest);

    $redirectURL=route("thank-you-page",["order_id"=>10001]);
    $directCusomterToURL=data_get($result,"pay_url")."&redirect_url=".urlencode($redirectURL);
```

After:

```
    $qrRequest=new \Tomato\OmiPay\Requests\Payment\QROrderRequest();
    $qrRequest->setOrderName("Test Product 1");
    $qrRequest->setCurrency("AUD");
    $qrRequest->setAmount(1*100);//1 dollar
    $qrRequest->setNotifyUrl(route("opmipay-notification"));
    $qrRequest->setRedirectUrl(route("thank-you-page",["order_id"=>10001]))
    $qrRequest->setOutOrderNo("10001");
    $qrRequest->setPlatform("ALIPAY");
    $result=\TomatoOmiPay::qrOrder($qrRequest);

    $directCusomterToURL=data_get($result,"pay_url");
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~15 days

Total

3

Last Release

2682d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/970173305592257c4780282a39fb8997a835d7a781eaab0ef1570ceebe41dce8?d=identicon)[wayne.w](/maintainers/wayne.w)

---

Top Contributors

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

---

Tags

tomato technologies

### Embed Badge

![Health badge](/badges/tomato-technologies-tomato-omipay/health.svg)

```
[![Health](https://phpackages.com/badges/tomato-technologies-tomato-omipay/health.svg)](https://phpackages.com/packages/tomato-technologies-tomato-omipay)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[yansongda/laravel-pay

专注 Alipay/WeChat/Unipay 的 laravel 支付扩展包

1.1k353.2k9](/packages/yansongda-laravel-pay)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.5M178](/packages/illuminate-broadcasting)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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