-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f29384d
commit bebd6cc
Showing
2 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# PayUMoney Php | ||
|
||
|
||
Library for integrating payumoney easily to your laravel/php apps. | ||
|
||
## Installation | ||
|
||
Use the package manager [composer](https://getcomposer.org/) to install package. | ||
|
||
```bash | ||
composer install ajuchacko/payumoney | ||
``` | ||
|
||
## Usage | ||
|
||
```php | ||
<?php | ||
|
||
use Ajuchacko\Payu\PayuGateway; | ||
|
||
|
||
$params = [ | ||
'txnid' => '134', | ||
'amount' => 12.00, | ||
'productinfo' => 'Iphone', | ||
'firstname' => 'Jon Doe', | ||
'email' => '[email protected]', | ||
'phone' => '9895309090', | ||
'surl' => 'https://example.com/success', | ||
'furl' => 'https://example.com/failure', | ||
'udf1' => 'Secret value', | ||
]; | ||
|
||
$payu = new PayuGateway([ | ||
"secret_key" => "testSecret", | ||
"merchant_key"=> "testMerchantKey", | ||
"merchant_id" => "7974556", | ||
"test_mode" => false, | ||
]); | ||
|
||
$payu->pay($params); // Redirects to PayUMoney | ||
|
||
// OR | ||
|
||
$hash = $payu->newChecksum($params); | ||
$payu->toArray(); // Returns array or parameters which can be submitted via web/mobile app. | ||
|
||
``` | ||
|
||
## Payment Response | ||
|
||
```php | ||
use Ajuchacko\Payu\PayuGateway; | ||
|
||
$payu = new PayuGateway([ | ||
"secret_key" => "testSecret", | ||
"merchant_key" => "testMerchantKey", | ||
"merchant_id" => "7974556", | ||
"test_mode" => true, | ||
]); | ||
|
||
|
||
try { | ||
$response = $payu->getPaymentResponse($request->all()); | ||
if ($response->getStatus() === PaymentStatusType::STATUS_COMPLETED) { | ||
# code... | ||
} | ||
|
||
// OR | ||
|
||
if ($response = $payu->paymentSuccess($request->all())) { | ||
# code... | ||
} | ||
} catch (InvalidChecksumException $e) { | ||
// Checksum is tampered | ||
} | ||
``` | ||
## Contributing | ||
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. | ||
|
||
Please make sure to update tests as appropriate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
{ | ||
"name": "ajuchacko/payumoney", | ||
"description": "PayUMoney library for PHP", | ||
"keywords": ["payu", "payuindia", "payumoney"], | ||
"homepage": "http://github.com/ajuchacko91/payumoney-php", | ||
"type": "library", | ||
"version": "1.1", | ||
"authors": [ | ||
{ | ||
"name": "Aju Chacko", | ||
"email": "[email protected]", | ||
"homepage": "http://github.com/ajuchacko91" | ||
} | ||
], | ||
"require": { | ||
"phpunit/phpunit": "^8.5", | ||
"symfony/options-resolver": "^5.0", | ||
|