Plug 'N Pay driver for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Plug 'N Pay support for Omnipay.
Omnipay is installed via Composer. This package is still in development and can not be installed via composer yet.
This package strives to use Semantic Versioning as explained here.
The following gateways are provided by this package:
- PlugNPay
This package is still in development but will implement the following methods:
authorize($options)
– authorize an amount on the customer’s card.capture($options)
– capture an amount you have previously authorized.purchase($options)
– authorize and immediately capture an amount on the customer’s card.refund($options)
– refund an already processed (settled) transaction.void($options)
– reverse a previously authorized (unsettled) transaction.
For general usage instructions, please see the Omnipay documentation. For information on the parameters needed for each request, see the class documentation for that request in the Message folder.
use Omnipay\Omnipay;
// Setup payment gateway
$gateway = Omnipay::create('PlugNPay');
$gateway->setUsername('123456789');
$gateway->setPassword('abc123');
// Example form data
$formData = [
'number' => '4242424242424242',
'expiryMonth' => '6',
'expiryYear' => '2016',
'cvv' => '123'
];
// Send purchase request
$response = $gateway->purchase([
'amount' => '10.00',
'currency' => 'USD',
'transactionId' => '1234',
'card' => $formData
])->send();
// Process response
if ( $response->isSuccessful() )
{
// Payment was successful
print_r($response);
}
else
{
// Payment failed
echo $response->getMessage();
}
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.