2017 © Pedro Peláez
 

library tcompayway

T-com PayWay Library (HT PayWay API)

image

locastic/tcompayway

T-com PayWay Library (HT PayWay API)

  • Friday, April 8, 2016
  • by antonioperic
  • Repository
  • 4 Watchers
  • 3 Stars
  • 2,489 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 3 Versions
  • 26 % Grown

The README.md

HP PayWay API (TcomPayWay)

Installation

Add repository to composer.json, (*1)

"repositories": [
        {
            "url": "https://github.com/locastic/TcomPayWay.git",
            "type": "git"
        }
    ],

And inside "require" "locastic/tcompayway": "@dev", (*2)

and use composer install, (*3)

Usage (Form)

use Locastic\TcomPayWay\AuthorizeForm\Model\Payment;, (*4)

Create object & populate data

$payment = new Payment(
    '1234556', //shop id
    'payway_secret',
    'order_id', //must be unique for each payment
    123, //amount
    0,
    'http://www.mojducan.com/success/narudžba456',
    'http://www.mojducan.com/failure/narudžba456'
    );
$payment->setPgwFirstName('name');
$payment->setPgwLastName('surname');
$payment->setPgwStreet('street');
$payment->setPgwPostCode('1234');
$payment->setPgwCity('Maribor');
$payment->setPgwCountry('Slovenia');
$payment->setPgwEmail('my.email@test.com');
$payment->setPgwPhoneNumber('1234567');

$payment->setPgwDisableInstallments(1);
$payment->setPgwAuthorizationType(0);
$payment->setPgwAuthorizationToken('');
$payment->setPgwReturnMethod('GET');
$payment->setPgwmerchantData('');
$payment->setPgwOrderInfo('');
$payment->setPgwOrderItems('');
$payment->setPgwLanguage('en');

Small test example on how send data (with Laravel 5)

{!! Form::open(['method' => 'POST', 'url' => 'https://pgwtest.ht.hr/services/payment/api/authorize-form']) !!}

{!! Form::hidden('pgw_shop_id', $payment->getPgwShopId()) !!}
{!! Form::hidden('pgw_order_id', $payment->getPgwOrderId()) !!}
{!! Form::hidden('pgw_language', $payment->getPgwLanguage()) !!}
{!! Form::hidden('pgw_amount', $payment->getPgwAmount()) !!}
{!! Form::hidden('pgw_authorization_type', $payment->getPgwAuthorizationType()) !!}
{!! Form::hidden('pgw_success_url', $payment->getPgwSuccessUrl()) !!}
{!! Form::hidden('pgw_failure_url', $payment->getPgwFailureUrl()) !!}
{!! Form::hidden('pgw_signature', Locastic\TcomPayWay\AuthorizeForm\Helpers\SignatureGenerator::generateSignature($payment)) !!}

{!! Form::hidden('pgw_authorization_token', $payment->getPgwAuthorizationToken()) !!}
{!! Form::hidden('pgw_return_method', $payment->getPgwReturnMethod()) !!}
{!! Form::hidden('pgw_first_name', $payment->getPgwFirstName()) !!}
{!! Form::hidden('pgw_last_name', $payment->getPgwLastName()) !!}
{!! Form::hidden('pgw_street', $payment->getPgwStreet()) !!}
{!! Form::hidden('pgw_city', $payment->getPgwCity()) !!}
{!! Form::hidden('pgw_post_code', $payment->getPgwPostCode()) !!}
{!! Form::hidden('pgw_country', $payment->getPgwCountry()) !!}
{!! Form::hidden('pgw_telephone', $payment->getPgwPhoneNumber()) !!}
{!! Form::hidden('pgw_email', $payment->getPgwEmail()) !!}
{!! Form::hidden('pgw_merchant_data', $payment->getPgwmerchantData()) !!}
{!! Form::hidden('pgw_order_info', $payment->getPgwOrderInfo()) !!}
{!! Form::hidden('pgw_order_items', $payment->getPgwOrderItems()) !!}
{!! Form::hidden('pgw_disable_installments', $payment->getPgwDisableInstallments()) !!}

{!! Form::submit("Add", ['class' => 'btn btn-success']) !!}


{!! Form::close() !!}

Reading response (example for Laravel 5.1)

$payment = new Payment(
    '1234556', //shop id
    'payway_secret',
    'order_id', //must be unique for each payment
    123, //amount
    0,
    'http://www.mojducan.com/success/narudžba456',
    'http://www.mojducan.com/failure/narudžba456'
    );

$payment->isPgwOrderedResponseValid($request->all()); //true or false
//or
$payment->isPgwResponseValid($request->all()); //true or false

The Versions

08/04 2016

dev-master

9999999-dev https://github.com/locastic/TcomPayWay

T-com PayWay Library (HT PayWay API)

  Sources   Download

MIT

The Requires

 

The Development Requires

08/04 2016

2.0

2.0.0.0 https://github.com/locastic/TcomPayWay

T-com PayWay Library (HT PayWay API)

  Sources   Download

MIT

The Requires

 

The Development Requires

16/02 2015

v1.0

1.0.0.0 https://github.com/locastic/TcomPayWay

T-com PayWay library

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Sandro Njegovan