davidumoh/omnipay-gtpay

A Gtpay Driver for PHP League Omnipay

v0.2.0 2017-12-29 22:19 UTC

This package is not auto-updated.

Last update: 2024-04-23 15:20:01 UTC


README

Gtpay gateway for the Omnipay PHP payment processing library

Latest Version on Packagist Software License Build Status Coverage Status Quality Score

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements gtpay support for Omnipay.

Install

Via Composer

$ composer require davidumoh/omnipay-gtpay

Usage

use Omnipay\Omnipay;

define('HASH_KEY','D3D1D05AFE42AD50818167EAC73C109168A0F108F32645C8B59E897FA930DA44F9230910DAC9E20641823799A107A02068F7BC0F4CC41D2952E249552255710F');

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

        $gateway->setMerchantId('17');
        $gateway->setHashKey(self::HASH_KEY);
        $gateway->setGatewayFirst('no');
        $gateway->setGatewayName(Gateway::GATEWAY_BANK);
        $gateway->setCurrency('NGN');


try {
    $formData = [
        'amount'=>70000.00,
        'items'=>[
            'tithe'=>[
                'label'=>'Tithes',
                'value'=>15000.00
            ],
            'seed'=>[
                'label'=>'Seed Offering',
                'value'=>25000.00
            ],
            'thanksgiving'=>[
                'label'=>'Thanksgiving Offering',
                'value'=>30000.00
            ]
        ],
        'notifyUrl'=>'http://payadmin.celz5.dev/transactions/notify',
        Data::GATEWAY_NAME=>Gateway::GATEWAY_WEBPAY,
        Data::TRANSACTION_MEMO=>'offerings',
        Data::CUSTOMER_NAME=>'Anastasia Umoh',
        Data::CUSTOMER_ID=>1,
        Data::TRANSACTION_ID=>$this->transactionId
        ];

    $response = $gateway->purchase($formData)->send();

    if ($response->isRedirect()) {
        $response->redirect;

    }
} catch (Exception $e) {
    $e->getMessage();
}

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

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.

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.

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.

Testing

$ composer test

Security

If you discover any security related issues, please email umohdavid@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.