PHPackages                             gstearmit/omnipay-molpayid - 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. gstearmit/omnipay-molpayid

ActiveLibrary[Payment Processing](/categories/payments)

gstearmit/omnipay-molpayid
==========================

MOLPayID gateway for Omnipay payment processing library

067PHP

Since Sep 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/gstearmit/omnipay-molpayid)[ Packagist](https://packagist.org/packages/gstearmit/omnipay-molpayid)[ RSS](/packages/gstearmit-omnipay-molpayid/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Omnipay: MOLPayID
=================

[](#omnipay-molpayid)

\*\* MOLPayID driver for the Omnipay PHP payment processing library\*\*

[![Build Status](https://camo.githubusercontent.com/6f875263072430afac5ef40c2663d52af166129d3ae56764fff6c027138e89c3/68747470733a2f2f7472617669732d63692e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d4d4f4c50617949442e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/leesiongchan/omnipay-MOLPayID)[![Latest Stable Version](https://camo.githubusercontent.com/b78bae9ddcab81aac3a4def8320c3e4a8f2b6c562d484b44a82ea21b5bd71ba3/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d4d4f4c50617949442f762f737461626c65)](https://packagist.org/packages/leesiongchan/omnipay-MOLPayID)[![Total Downloads](https://camo.githubusercontent.com/dc9cb95853f125569ca37bbecd7facea700b2fb3fd6605cbf5fa0c697603039d/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d4d4f4c50617949442f646f776e6c6f616473)](https://packagist.org/packages/leesiongchan/omnipay-MOLPayID)[![Latest Unstable Version](https://camo.githubusercontent.com/ef31247a4a02373c1257cb516f54783b3e9833a6561ba35d3efe6dd571413e78/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d4d4f4c50617949442f762f756e737461626c65)](https://packagist.org/packages/leesiongchan/omnipay-MOLPayID)[![License](https://camo.githubusercontent.com/d59eb241274dff935296a4354cc6626e6737569e93c4c56c8bd419181250d54b/68747470733a2f2f706f7365722e707567782e6f72672f6c656573696f6e676368616e2f6f6d6e697061792d4d4f4c50617949442f6c6963656e7365)](https://packagist.org/packages/leesiongchan/omnipay-MOLPayID)

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

[MOLPayID](http://www.MOLPayID.com) is a payment gateway offering from MOLPayID Sdn Bhd. This package follows the **MOLPayID API Specification (Version 12.1: Updated on 12 April 2015)**.

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

[](#installation)

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

```
{
    "require": {
        "gstearmit/omnipay-molpayid": "~2.0"
    }
}
```

or

```
{
    "require": {
        "weshop/omnipaymolpayid": "~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:

- MOLPayID (MOLPayID 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('MOLPayID');

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

$options = [
    'amount' => '10.00',
    'card' => new CreditCard(array(
        'country' => 'ID',
        '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 MOLPayID payment URL (https://www.onlinepayment.com.my/MOLPayID/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 MOLPayID. 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
}
```

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.

---

1. PHPUNIT $ phpunit --bootstrap src/Message/PurchaseRequest.php tests/Message/PurchaseRequestTest.php $ phpunit --coverage-text $ phpunit
2. $ composer update --verbose
3. composer dump-autoload
4. Bao cao tien do kiem tra nhanh $ phpunit --testdox

    Omnipay\\MOLPayID\\Gateway \[x\] Purchase \[x\] Complete purchase success \[x\] Complete purchase invalid s key \[x\] Complete purchase error \[x\] Get name not empty \[x\] Get short name not empty \[x\] Get default parameters returns array \[x\] Default parameters have matching methods \[x\] Test mode \[x\] Currency \[x\] Supports authorize \[x\] Supports complete authorize \[x\] Supports capture \[x\] Supports purchase \[x\] Supports complete purchase \[x\] Supports refund \[x\] Supports void \[x\] Supports create card \[x\] Supports delete card \[x\] Supports update card \[x\] Authorize parameters \[x\] Complete authorize parameters \[x\] Capture parameters \[x\] Purchase parameters \[x\] Complete purchase parameters \[x\] Refund parameters \[x\] Void parameters \[x\] Create card parameters \[x\] Delete card parameters \[x\] Update card parameters

    Omnipay\\MOLPayID\\Message\\CompletePurchaseRequest \[ \] Get data \[ \] Send success \[ \] Send pending

    Omnipay\\MOLPayID\\Message\\CompletePurchaseResponse \[x\] Complete purchase success \[x\] Complete purchase pending

    Omnipay\\MOLPayID\\Message\\PurchaseRequest \[x\] Get data \[x\] Send success

    Omnipay\\MOLPayID\\Message\\PurchaseResponse \[x\] Purchase success
5. $ phpunit --debug : Xuất thông tin gỡ lỗi như tên của một bài kiểm tra khi bắt đầu thực hiện

    Time: 1.09 seconds, Memory: 19.00MB

    There were 3 errors:

    1. Omnipay\\MOLPayID\\Message\\CompletePurchaseRequestTest::testGetData Omnipay\\Common\\Exception\\InvalidResponseException: Invalid security key

    /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/src/Message/CompletePurchaseRequest.php:203 /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/tests/Message/CompletePurchaseRequestTest.php:29

    2. Omnipay\\MOLPayID\\Message\\CompletePurchaseRequestTest::testSendSuccess Omnipay\\Common\\Exception\\InvalidResponseException: Invalid security key

    /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/src/Message/CompletePurchaseRequest.php:203 /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/vendor/omnipay/common/src/Omnipay/Common/Message/AbstractRequest.php:676 /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/tests/Message/CompletePurchaseRequestTest.php:40

    3. Omnipay\\MOLPayID\\Message\\CompletePurchaseRequestTest::testSendPending Omnipay\\Common\\Exception\\InvalidResponseException: Invalid security key

    /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/src/Message/CompletePurchaseRequest.php:203 /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/vendor/omnipay/common/src/Omnipay/Common/Message/AbstractRequest.php:676 /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/tests/Message/CompletePurchaseRequestTest.php:54

    ERRORS! Tests: 38, Assertions: 87, Errors: 3
6.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/153b57763835ec70a99891b09b59be9ae515c9f7fc40e58d614646de569d3c9a?d=identicon)[gstearmit](/maintainers/gstearmit)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/gstearmit-omnipay-molpayid/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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