Skip to content

Mastercard Payment Gateway Service (MPGS) driver for the Omnipay PHP payment processing library

Notifications You must be signed in to change notification settings

assadnazar/omnipay-mpgs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Omnipay: Mastercard Payment Gateway Service (MPGS)

MPGS Rest API v56 driver for the Omnipay PHP payment processing library

MPGS Rest API: https://test-gateway.mastercard.com/api/documentation/integrationGuidelines/index.html?locale=en_US

Currently only supports purchases with one available method:

  • purchase()

Usage

<?php
use Omnipay\Omnipay;
use Omnipay\Common\CreditCard;

// Create a gateway for the Mpgs Gateway
// (routes to GatewayFactory::create)
/* @var \Omnipay\Mpgs\Gateway $gateway */
$gateway = Omnipay::create('Mpgs');

$gateway->setTestMode(true);
$gateway->setEndpointBase('https://test-gateway.mastercard.com');
$gateway->setMerchantId('merchantIdValue');
$gateway->setPassword('passwordValue');


// Charge using a card
/* @var \Omnipay\Mpgs\Message\PurchaseResponse $response */
$response = $gateway->purchase([
    'card' => new CreditCard([
        'number' => '5111111111111118',
        'cvv' => '100',
        'expiryMonth' => '05',
        'expiryYear' => '2021',
        'firstName' => 'John',
        'lastName' => 'Doe',
    ]),
    'amount' => '50.00',
    'currency' => 'AUD',
    'description' => 'Merchant Reference',
])->send();

About

Mastercard Payment Gateway Service (MPGS) driver for the Omnipay PHP payment processing library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%