Giter Site home page Giter Site logo

vanssatapagonlinesdk's Introduction

PagOnline Sdk Library

This sdk is same as mattiabasone/PagOnline but whit remove all laravel dependency

This library can be used with PagOnline Payment Gateway and it can be easily integrated in Laravel.

With this package I'm trying to improve the crappy IGFS CG PHP Library provided by PagOnline Payment gateway.

Basic Usage

Demo scripts can be found in tests/demo, example Init Request:

<?php 

require __DIR__.'/vendor/autoload.php';

$init = new \VanssataPagOnlineSDK\Init\IgfsCgInit();
$init->serverURL = "https://payment-gateway-example.com/IGFS_CG_SERVICES/services";
$init->tid = "MY-TID-CODE";
$init->kSig = '1234567890987654321';
$init->shopID = 'my-transaction-id';
$init->shopUserRef = "[email protected]";
$init->trType = "AUTH";
$init->currencyCode = "EUR";
$init->amount = 500; // Amount without comma (500 = 5,00)
$init->langID = "IT";
$init->notifyURL = "http://my-domain.tld/verify.php";
$init->errorURL = "http://my-domain.tld/error.php";
$init->addInfo1 = 'myFirstAddintionalInfo';

// if you need to edit http client parameters...
$init->setRequestTimeout(10); // Seconds
$init->setConnectTimeout(5); // Seconds
$init->setHttpProxy('tcp://some.proxy'); // Proxy server for requests
$init->setHttpAuthUser('username'); // HTTP Basic Auth username
$init->setHttpAuthPass('password'); // HTTP Basic Auth password

if (!$init->execute()) {
    // Something went wrong
} else {
    // Redirect user to payment gateway
    header("location: ".$init->redirectURL);
}

.env file configuration

Set the following environment variables in your .env file:

  • PAGONLINE_SERVER_URL payment gateway server url (default: null)
  • PAGONLINE_REQUEST_TIMEOUT maximum timeout in seconds for completing a request (default: 15)
  • PAGONLINE_CONNECT_TIMEOUT maximum timeout in seconds for connecting to the server (default: 5)
  • PAGONLINE_TERMINAL_ID identifier provided by the payment gateway (default: null)
  • PAGONLINE_SIGNATURE_KEY signature key provided by the payment gateway (default: null)
  • PAGONLINE_CURRENCY_CODE currency code (default: EUR)
  • PAGONLINE_LANGUAGE_ID language code (default: IT)

vanssatapagonlinesdk's People

Contributors

ikakarov avatar vanssata avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.