2017 © Pedro Peláez
 

library omnipay-payonline

PayOnline driver for the Omnipay payment processing library

image

webtoucher/omnipay-payonline

PayOnline driver for the Omnipay payment processing library

  • Tuesday, January 24, 2017
  • by webtoucher
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1,122 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 9 % Grown

The README.md

Omnipay: PayOnline

PayOnline payment processing driver for the Omnipay PHP payment processing library., (*1)

Latest Stable Version Total Downloads Daily Downloads Latest Unstable Version License, (*2)

Installation

The preferred way to install this library is through composer., (*3)

Either run, (*4)

$ php composer.phar require webtoucher/omnipay-payonline "*"

or add, (*5)

"webtoucher/omnipay-payonline": "*"

to the require section of your composer.json file., (*6)

Configure your PayOnline MID

Ask PayOnline support for switching off ok/fail page if you need it. So you will be redirected to your return/fail URL immediately. Then check your MID settings: - CallbackUrl method: POST - Callback Url for approved transactions: https://your.domain.com/your-callback/?result=1 - Callback Url for declined transactions: https://your.domain.com/your-callback/?result=0 - Enable Callback on approved transactions: ON - Enable Callback on declined transactions: ON, (*7)

Usage

The following gateways are provided by this package:, (*8)

  • PayOnline
    $gateway = \Omnipay\Omnipay::create('PayOnline');
    $gateway->setMerchantId('[MERCHANT_ID]');
    $gateway->setApiKey('[API_PRIVATE_KEY]');
    $gateway->setLanguage('ru'); // default - en

Then you should create payment url (for redirecting or using iframe)., (*9)

    try {
        $request = $this->gateway->purchase([
            'order_id' => 123,
            'amount' => 10,
            'currency' => 'EUR',
            'description' => 'Test payment',
            'user' => 1234,
            'email' => 'test@test.com',
            'return_url' => 'https://your.domain.com/your-callback/?result=1',
            'cancel_url' => 'https://your.domain.com/your-callback/?result=0',,
        ]);

        $response = $request->send();

        if ($response->isSuccessful()) {
            $url = $response->getUrl();
            // Use this url as iframe source or for redirect
        }
    } catch (\Omnipay\Common\Exception\OmnipayException $e) {
        // Your handler
    }

Create controller's action for catching PayOnline callbacks. Remember that you must use the same action for successful/unsuccessful callbacks (POST-requests) and as return/fail URL (GET-requests). Check type of request to know what should you do., (*10)

    if (/* is post request */) {
        try {
            $request = $this->gateway->completePurchase([
                'result' => $result,
                'datetime' => $DateTime,
                'transaction_id' => $TransactionID,
                'order_id' => $OrderId,
                'amount' => $Amount,
                'currency' => $Currency,
                'token' => $RebillAnchor,
                'card_number' => $CardNumber,
                'user' => $User,
                'error_code' => isset($Code) ? $Code : $ErrorCode,
            ]);

            $response = $request->send();

            $success = $response->isSuccessful();
        } catch (\Omnipay\Common\Exception\OmnipayException $e) {
            $success = false;
            // Your handler
        }
        // Your logic
    } else {
        // Your logic for return/fail URL
    }

Remember that PayOnline send rebill tokens for ssl-connection only. You can extract masked card number and token and save these into your system., (*11)

    $cardNumber = $request->getCardNumber();
    $token = $request->getToken();
    // Your logic

Use rebill request for recurring payments., (*12)

    try {
        $request = $this->gateway->rebill([
            'token' => $token,
            'order_id' => 124,
            'amount' => 10,
            'currency' => 'EUR',
        ]);

        $response = $request->send();

        $success = $response->isSuccessful();
    } catch (\Omnipay\Common\Exception\OmnipayException $e) {
        $success = false;
        // Your handler
    }

For general usage instructions, please see the main Omnipay repository., (*13)

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., (*14)

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., (*15)

If you believe you have found a bug, please report it using the GitHub issue tracker., (*16)

The Versions

24/01 2017

dev-master

9999999-dev https://github.com/webtoucher/omnipay-payonline

PayOnline driver for the Omnipay payment processing library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexey Kuznetsov

payment pay gateway merchant omnipay payments visa mastercard payonline

16/01 2017

0.1.3

0.1.3.0 https://github.com/webtoucher/omnipay-payonline

PayOnline driver for the Omnipay payment processing library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexey Kuznetsov

payment pay gateway merchant omnipay payments visa mastercard payonline

01/11 2016

0.1.2

0.1.2.0 https://github.com/webtoucher/omnipay-payonline

PayOnline driver for the Omnipay payment processing library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexey Kuznetsov

payment pay gateway merchant omnipay payments visa mastercard payonline

28/10 2016

0.1.1

0.1.1.0 https://github.com/webtoucher/omnipay-payonline

PayOnline driver for the Omnipay payment processing library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexey Kuznetsov

payment pay gateway merchant omnipay payments visa mastercard payonline

05/10 2016

0.1.0

0.1.0.0 https://github.com/webtoucher/omnipay-payonline

PayOnline driver for the Omnipay payment processing library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexey Kuznetsov

payment pay gateway merchant omnipay payments visa mastercard payonline