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.
$ composer require devsdmf/payu-php-sdk
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();Soon
$ composer install --dev
$ ./vendor/bin/phpunit
This library is licensed under the MIT License.