gentor / omnipay-mobilpay
MobilPay driver for the Omnipay PHP payment processing library
Requires
- php: >=5.4.0
- ext-json: *
- omnipay/common: ~3.0
- php-http/guzzle6-adapter: ~1.1.1
Requires (Dev)
- omnipay/tests: ~2.0
README
MobilPay driver for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.4+. This package implements MOBILPAY support for Omnipay.
Installation
Omnipay is installed via Composer. To install, simply run:
composer require gentor/omnipay-mobilpay
Basic Usage
The following gateways are provided by this package:
- MobilPay
Initiating payment request
$gateway = Omnipay::create('MobilPay'); $gateway->setMerchantId('1234-5678-9012-3456-7890'); $gateway->setPublicKey('/path/to/public.cer'); $response = $gateway->purchase([ 'amount' => '10.00', 'currency' => 'RON', 'orderId' => 1, 'confirmUrl' => 'http://example.com/ipn', 'returnUrl' => 'http://www.google.com', 'details' => 'Test payment', 'testMode' => true, 'params' => [ 'selected_package' => 1 ] ])->send(); $response->redirect();
Processing IPN requests
$gateway = Omnipay::create('MobilPay'); $gateway->privateKeyPath('/path/to/private.key'); $response = $gateway->completePurchase($_POST)->send(); $response->sendResponse(); if ($response->isSuccessful()) { return STATUS_COMPLETED; } if ($response->isCancelled()) { return STATUS_CANCELED; } if ($response->isPending()) { return STATUS_PENDING; } if ($response->isRefunded()) { return STATUS_REFUNDED; }
For general usage instructions, please see the main Omnipay repository.
Support
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag 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 which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.