Skip to content

antonis0490/paysec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Paysec: Paysec

Paysec driver for the Paysec PHP payment processing library

Installation

Paysec is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "Paysec/paysec": "dev-master"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage

To make a request:

use Omnipay\Omnipay;
use Omnipay\Paysec\Message\StatusCallback;

$gateway = Omnipay::create('Paysec');

$gateway->initialize(array(
    'clientId' => "your client id",
    'secret' => "your secret,
    'testMode' =>  // Or false when you are ready for live transactions
));

$options = array
(

    "header" => "3",
    "clientId" => "",
    "channelCode" => "BANK_TRANSFER",
    "notifyURL" => "",
    "returnURL" => "",
    "amount" => "",
    "orderTime" => (string)round(microtime(true) * 1000),
    "cartId" => "",
    "currency" => "",
    "email" => "",
    "name" => "",
    "lname" => ""

);

$transaction = $gateway->purchase($options);
$response = $transaction->send();
$resData = $response->getData();

Notify function:

$status = new StatusCallback($_REQUEST);

$secret = "";
$wallet = "";
$validSignature = "";

if ($validSignature && $status->isSuccessful()) {
    //sucess
} else if ($validSignature && $status->isPending()) {
    //pending
} else if ($validSignature) {
    //failed
} else {
    //error
}

The following gateways are provided by this package:

  • Paysec

For general usage instructions, please see the main Omnipay site.

About

omnipay driver for paysec

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages