digistorm / omnipay-mpgs
Mastercard Payment Gateway Service (MPGS) driver for the Omnipay payment processing library
Installs: 2 354
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 6
Open Issues: 1
Requires
- php: ^8.1
- omnipay/common: ^3
- symfony/http-client: ^7.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- http-interop/http-factory-guzzle: ^1.2
- nesbot/carbon: ^3.8
- omnipay/tests: ^4
- phpstan/phpstan: ^1.12
- rector/rector: ^1.2
- spaze/phpstan-disallowed-calls: ^3.5
This package is auto-updated.
Last update: 2025-03-01 00:45:45 UTC
README
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();