PHPackages                             leesiongchan/omnipay-molpay - 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. leesiongchan/omnipay-molpay

ActiveLibrary[Payment Processing](/categories/payments)

leesiongchan/omnipay-molpay
===========================

MOLPay gateway for Omnipay payment processing library

v2.1.0(8y ago)53.3k14[1 PRs](https://github.com/leesiongchan/omnipay-molpay/pulls)MITPHP

Since Apr 1Pushed 4y ago2 watchersCompare

[ Source](https://github.com/leesiongchan/omnipay-molpay)[ Packagist](https://packagist.org/packages/leesiongchan/omnipay-molpay)[ Docs](https://github.com/leesiongchan/omnipay-molpay)[ RSS](/packages/leesiongchan-omnipay-molpay/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (2)Versions (10)Used By (0)

Omnipay: MOLPay
===============

[](#omnipay-molpay)

**MOLPay driver for the Omnipay PHP payment processing library**

[![Build Status](https://camo.githubusercontent.com/f8e5acb7f9d29d1d6263a1e6ca718ca6a97fe869025222da511273d26282f20c/68747470733a2f2f7472617669732d63692e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d6d6f6c7061792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/leesiongchan/omnipay-molpay)[![Latest Stable Version](https://camo.githubusercontent.com/6408a0b933276ab652ea0fea2638b03a3f76c1783f04eda3784cb679bf9ff6d0/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d6d6f6c7061792f762f737461626c65)](https://packagist.org/packages/leesiongchan/omnipay-molpay)[![Total Downloads](https://camo.githubusercontent.com/bb5e73d3cd8398f2b2fff9deb95b18dbf717af4e2058b1b103d726308b326743/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d6d6f6c7061792f646f776e6c6f616473)](https://packagist.org/packages/leesiongchan/omnipay-molpay)[![Latest Unstable Version](https://camo.githubusercontent.com/3687183887913dd5e299aa8c0a7e71add00aeb570aa5ac9afb8a01e3c116ed9d/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d6d6f6c7061792f762f756e737461626c65)](https://packagist.org/packages/leesiongchan/omnipay-molpay)[![License](https://camo.githubusercontent.com/e87dc4bf8c38e220580b451bbec5c1eb3432faea366c8b8de0724a9bc5182729/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d6d6f6c7061792f6c6963656e7365)](https://packagist.org/packages/leesiongchan/omnipay-molpay)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements MOLPay support for Omnipay.

[MOLPay](http://www.molpay.com) is a payment gateway offering from MOLPay Sdn Bhd. This package follows the **MOLPay API Specification (Version 13.7: Updated on 10 Oct 2017)**.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "leesiongchan/omnipay-molpay": "~2.0"
    }
}
```

And run composer to update your dependencies:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

```

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- MOLPay (MOLPay Payment)

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)repository.

Example
-------

[](#example)

### Create a purchase request

[](#create-a-purchase-request)

The example below explains how you can create a purchase request then send it.

```
$gateway = Omnipay::create('MOLPay');

$gateway->setCurrency('MYR');
$gateway->setEnableIPN(true); // Optional
$gateway->setLocale('en'); // Optional
$gateway->setMerchantId('test1234');
$gateway->setVerifyKey('abcdefg');

$options = [
    'amount' => '10.00',
    'card' => new CreditCard(array(
        'country' => 'MY',
        'email' => 'abc@example.com',
        'name' => 'Lee Siong Chan',
        'phone' => '0123456789',
    )),
    'description' => 'Test Payment',
    'transactionId' => '20160331082207680000',
    'paymentMethod' => 'credit', // Optional
];

$response = $gateway->purchase($options)->send();

// Get the MOLPay payment URL (https://www.onlinepayment.com.my/MOLPay/pay/...)
$redirectUrl = $response->getRedirectUrl();
```

### Complete a purchase request

[](#complete-a-purchase-request)

When the user submit the payment form, the gateway will redirect you to the return URL that you have specified in MOLPay. The code below gives an example how to handle the server feedback answer.

```
$response = $gateway->completePurchase($options)->send();

if ($response->isSuccessful()) {
    // Do something
    echo $response->getTransactionReference();
} elseif ($response->isPending()) {
    // Do something
} else {
    // Error
}
```

### Void or Reverse a 'captured' transaction

[](#void-or-reverse-a-captured-transaction)

###### Only available for limited merchants and channels

[](#only-available-for-limited-merchants-and-channels)

The following is the example to void a captured transaction, your can refer to MOLPay Reversal Request api spec.

```
$gateway = Omnipay::create('MOLPay');

$gateway->setMerchantId('your_merchant_id');
$gateway->setVerifyKey('your_verify_key');
$gateway->setSecretKey('your_secret_key');

$request = $gateway->void([
    'transactionReference' => '25248208'
]);

$response = $request->send();

if ($response->isSuccessful()) {
    // Update your data model
} else {
    echo $response->getMessage();
}
```

### Request Partial Refund for a 'captured' or 'settled' transaction

[](#request-partial-refund-for-a-captured-or-settled-transaction)

###### Only available for limited merchants and channels

[](#only-available-for-limited-merchants-and-channels-1)

To perform a partial refund, you need to specify more parameters as below

```
$gateway = Omnipay::create('MOLPay');

$gateway->setMerchantId('your_merchant_id');
$gateway->setVerifyKey('your_verify_key');
$gateway->setSecretKey('your_secret_key');

$request = $gateway->refund([
    'transactionReference'  => '25248208',
    'refId'                 => 'merchant_refund_red_id',
    'amount'                => '10.00',
    'channel'               => $transaction_channel, // data saved from $gateway->purchase() response, e.g FPX_MB2U
    'bankCode'              => $bank_code, // from user who request to refund
    'beneficiaryName'       => $beneficiary_name, // from user who request to refund
    'beneficiaryAccountNo'  => $beneficiary_account_no, // from user who request to refund
]);

$response = $request->send();

// The refund process will take about 7-14 days after the request sent
if ($response->isSuccessful() || $response->isPending() ) {
    // Update your data model
} else {
    echo $response->getMessage();
}
```

Out Of Scope
------------

[](#out-of-scope)

Omnipay does not cover recurring payments or billing agreements, and so those features are not included in this package. Extensions to this gateway are always welcome.

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/leesiongchan/omnipay-molpay/issues), or better yet, fork the library and submit a pull request.

###  Health Score

35

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 81.3% 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 ~84 days

Total

9

Last Release

2968d ago

Major Versions

v2.0.4 → 3.0.x-dev2017-03-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/bc0e96542a9d98d7b17e6d82fb821ee552a2ee72268de11e4adf2dabf5b10a4b?d=identicon)[leesiongchan](/maintainers/leesiongchan)

---

Top Contributors

[![siewmai](https://avatars.githubusercontent.com/u/8692108?v=4)](https://github.com/siewmai "siewmai (13 commits)")[![leesiongchan](https://avatars.githubusercontent.com/u/324418?v=4)](https://github.com/leesiongchan "leesiongchan (3 commits)")

---

Tags

paymentgatewaypaymerchantomnipaypurchasemolpay

### Embed Badge

![Health badge](/badges/leesiongchan-omnipay-molpay/health.svg)

```
[![Health](https://phpackages.com/badges/leesiongchan-omnipay-molpay/health.svg)](https://phpackages.com/packages/leesiongchan-omnipay-molpay)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

558420.4k10](/packages/lokielse-omnipay-alipay)

PHPackages © 2026

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