devsdmf / payu-php-sdk
Payu payment gateway SDK for PHP projects
Installs: 10 319
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- guzzlehttp/guzzle: ^6.0
Requires (Dev)
- phpunit/phpunit: ~5.0
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.