devsdmf / payu-php-sdk
此包已被弃用且不再维护。没有推荐替代包。
PHP项目的Payu支付网关SDK
1.0.2
2017-05-30 15:55 UTC
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
这是一个为PHP项目提供的SDK,它提供了一个友好且易于使用的接口,以便将您的应用程序与PayU支付网关API集成。
此库提供了一个对现有API对象的包装,以及一个客户端来执行请求。
安装
$ composer require devsdmf/payu-php-sdk
使用方法
库的基本使用方法是
// 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和开发者文档
即将推出
测试
$ composer install --dev
$ ./vendor/bin/phpunit
许可证
此库采用MIT许可证授权。