Omnipay: paypro
PayPro gateway for the Omnipay PHP payment processing library, (*1)
, (*2)
Omnipay is a framework agnostic, multi-gateway payment
processing library for PHP 5.3+. This package implements paypro support for Omnipay., (*3)
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what
PSRs you support to avoid any confusion with users and contributors., (*4)
Install
This gateway can be installed with Composer:, (*5)
``` bash
$ composer require paypronl/omnipay-paypro:0.1.x@dev, (*6)
## Usage
The following gateways are provided by this package:
* PayPro
## Example
```php
require_once __DIR__ . '/vendor/autoload.php';
use Omnipay\Omnipay;
/** @var \Omnipay\PayPro\Gateway $gateway */
$gateway = Omnipay::create('PayPro');
$gateway->initialize([
'apiKey' => 'YOUR API KEY HERE',
'productId' => null,
'testMode' => true,
]);
$params = array(
'amount' => 12.34,
'description' => 'Payment test',
'returnUrl' => 'www.your-domain.nl/return_here',
'notifyUrl' => 'www.your-domain.nl/notify_here', //see http://www.paypro.nl/postback
'transactionId' => 'abc12345',
'issuer' => 'ideal/RABONL2U',
'productId' => 12345,
'card' => array(
'email' => 'info@example.com',
'name' => 'My name',
),
);
$response = $gateway->purchase($params)->send();
if ($response->isSuccessful()) {
echo 'Success!';
} elseif ($response->isRedirect()) {
$response->redirect();
} else {
echo 'Failed';
}
For general usage instructions, please see the main Omnipay repository., (*7)
Parameters
You can set the following parameters:, (*8)
- apiKey (required): The PayPro.nl Api Key
- amount (required): The amount, as float/decimal
- productId: Your PayPro.nl product Id
- description: The order description
- transactionId: A custom transactionId
- issuer: A payment method, see http://www.paypro.nl/api for all pay methods (select get_all_pay_methods)
- vat: The VAT percentage
- returnUrl: The URL to show after payment has been completed.
- notifyUrl: The URL to post the status to (postback url)
- testMode: Boolean to indicate testing.
You can set the following information, using the Card object., (*9)
- name / firstName + lastName
- email
- address1 / billingAddress1
- address2 / billingAddress2
- postcode / billingPostcode
- city / billingCity
- country / billingCountry
See http://omnipay.thephpleague.com/api/cards/ for more information., (*10)
Payment methods
You can get all available payment methods with fetchPaymentMethods() and the available issuers for all methods with fetchIssuers().
The Issuer ID can be passed to the purchase() method to directly configure the payment method., (*11)
$methods = $gateway->fetchPaymentMethods()->send()->getPaymentMethods();
/** @var \Omnipay\Common\PaymentMethod $method */
foreach ($methods as $method) {
echo $method->getId();
echo $method->getName();
}
$issuers = $gateway->fetchIssuers()->send()->getIssuers();
/** @var \Omnipay\Common\Issuer $issuer */
foreach ($issuers as $issuer) {
echo $issuer->getId();
echo $issuer->getName();
echo $issuer->getPaymentMethod();
}
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., (*12)
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., (*13)
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., (*14)
Change log
Please see CHANGELOG for more information what has changed recently., (*15)
Testing
bash
$ composer test, (*16)
Contributing
Please see CONTRIBUTING for details., (*17)
Security
If you discover any security related issues, please email support@paypro.nl instead of using the issue tracker., (*18)
Credits
License
The MIT License (MIT). Please see License File for more information., (*19)