2017 © Pedro Peláez
 

library omnipay-molpayid

MOLPayID gateway for Omnipay payment processing library

image

gstearmit/omnipay-molpayid

MOLPayID gateway for Omnipay payment processing library

  • Friday, September 8, 2017
  • by gstearmit
  • Repository
  • 1 Watchers
  • 0 Stars
  • 52 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

Omnipay: MOLPayID

** MOLPayID driver for the Omnipay PHP payment processing library**, (*1)

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements MOLPayID support for Omnipay., (*3)

MOLPayID is a payment gateway offering from MOLPayID Sdn Bhd. This package follows the MOLPayID API Specification (Version 12.1: Updated on 12 April 2015)., (*4)

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:, (*5)

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

or, (*6)

{
    "require": {
        "weshop/omnipaymolpayid": "~2.0"
    }
}

And run composer to update your dependencies:, (*7)

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

Basic Usage

The following gateways are provided by this package:, (*8)

  • MOLPayID (MOLPayID Payment)

For general usage instructions, please see the main Omnipay repository., (*9)

Example

Create a purchase request

The example below explains how you can create a purchase request then send it., (*10)

$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

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., (*11)

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

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

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., (*12)


  1. PHPUNIT $ phpunit --bootstrap src/Message/PurchaseRequest.php tests/Message/PurchaseRequestTest.php $ phpunit --coverage-text $ phpunit, (*13)

  2. $ composer update --verbose, (*14)

  3. composer dump-autoload, (*15)

  4. Bao cao tien do kiem tra nhanh $ phpunit --testdox, (*16)

    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, (*17)

    Omnipay\MOLPayID\Message\CompletePurchaseRequest [ ] Get data [ ] Send success [ ] Send pending, (*18)

    Omnipay\MOLPayID\Message\CompletePurchaseResponse [x] Complete purchase success [x] Complete purchase pending, (*19)

    Omnipay\MOLPayID\Message\PurchaseRequest [x] Get data [x] Send success, (*20)

    Omnipay\MOLPayID\Message\PurchaseResponse [x] Purchase success, (*21)

  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, (*22)

    Time: 1.09 seconds, Memory: 19.00MB, (*23)

    There were 3 errors:, (*24)

    1) Omnipay\MOLPayID\Message\CompletePurchaseRequestTest::testGetData Omnipay\Common\Exception\InvalidResponseException: Invalid security key, (*25)

    /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/src/Message/CompletePurchaseRequest.php:203 /Applications/XAMPP/xamppfiles/htdocs/omnipay-molpayid/tests/Message/CompletePurchaseRequestTest.php:29, (*26)

    2) Omnipay\MOLPayID\Message\CompletePurchaseRequestTest::testSendSuccess Omnipay\Common\Exception\InvalidResponseException: Invalid security key, (*27)

    /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, (*28)

    3) Omnipay\MOLPayID\Message\CompletePurchaseRequestTest::testSendPending Omnipay\Common\Exception\InvalidResponseException: Invalid security key, (*29)

    /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, (*30)

    ERRORS! Tests: 38, Assertions: 87, Errors: 3, (*31)

The Versions

08/09 2017

dev-develop_add_enviroment

dev-develop_add_enviroment https://github.com/gstearmit/omnipay-molpayid.git

MOLPayID gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gstearmit

payment pay gateway merchant purchase omnipay molpay molpayid

06/09 2017

dev-master

9999999-dev https://github.com/gstearmit/omnipay-molpayid.git

MOLPayID gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gstearmit

payment pay gateway merchant purchase omnipay molpay molpayid

06/09 2017

dev-develop

dev-develop https://github.com/gstearmit/omnipay-molpayid.git

MOLPayID gateway for Omnipay payment processing library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gstearmit

payment pay gateway merchant purchase omnipay molpay molpayid