devsdmf/payu-php-sdk

This package is abandoned and no longer maintained. No replacement package was suggested.

Payu payment gateway SDK for PHP projects

1.0.2 2017-05-30 15:55 UTC

This package is auto-updated.

Last update: 2022-02-01 13:05:31 UTC


README

This is a SDK for PHP projects that provides a friendly and easy interface to integrate your application with the PayU payment gateway API.

This library provides a wrapper for the available API objects and a client to perform the requests.

Installation

$ composer require devsdmf/payu-php-sdk

Usage

The basic usage of the library is:

// importing the libraries
use PayU\PayU,
    PayU\Merchant\Credentials,
    PayU\Transaction\Transaction;

// creating a credentials instance
$credentials = Credentials::factory('myKey','myLogin');

// creating a new PayU client instance
$payU = PayU::factory(PayU::LANGUAGE_ENGLISH);

// configuring the client
$payU->setCredentials($credentials);
$payU->setMerchantId('myMerchantId');
$payU->setNotifyUrl('http://foo.bar/notifications/payu');

$transaction = new Transaction();
// ... configuring the transaction object

// performing the transaction
$response = $payU->doPayment($transaction);

// check if the payment was approved
$response->isApproved();

// getting order status
$response = $payU->getOrderById('orderId');

// getting the response payload
$data = $response->getPayload();

API and Developers Documentation

Soon

Tests

$ composer install --dev
$ ./vendor/bin/phpunit

License

This library is licensed under the MIT License.