2017 © Pedro Peláez
 

library comgate

Comgate wrapper for Nette Framework.

image

lzaplata/comgate

Comgate wrapper for Nette Framework.

  • Thursday, May 3, 2018
  • by Zap
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Comgate

This is small Nette Framework wrapper for Comgate., (*1)

Installation

The easiest way to install library is via Composer., (*2)

$ composer require lzaplata/comgate: dev-master

or edit composer.json in your project, (*3)

"require": {
        "lzaplata/comgate": "dev-master"
}

You have to register the library as extension in config.neon file., (*4)

extensions:
        comgate: LZaplata\Comgate\DI\Extension

Now you can set parameters..., (*5)

comgate:
        merchant        : *
        secret          : *
        sandbox         : true
        preauth         : false                    

...and autowire library to presenter, (*6)

use LZaplata\Comgate\Service;

/** @var Service @inject */
public $comgate;

Usage

Create payment., (*7)

$payment = $this->comgate->createPayment(
    $price                  // total price - float
);

Get payment ID and save it to database., (*8)

$payId = $payment->getPayId();

Send payment., (*9)

$response = $payment->send();

Redirect to payment gateway., (*10)

$this->sendResponse($response->getRedirectResponse());

...or get redirect url., (*11)

$response->getRedirectUrl();

After return from gateway

Get response and check if payment was successful, (*12)

$response = $this->comgate->getReturnResponse();

if ($response->isOk()) {
    $payId = $response->getPayId();

    // do something
}

// output must be clean, so you have to terminate presenter and turn off Tracy
$this->terminate();

The Versions

03/05 2018

dev-master

9999999-dev https://github.com/LZaplata/Comgate

Comgate wrapper for Nette Framework.

  Sources   Download

The Requires

 

by Lukáš Záplata

gateway nette comgate