jimmlog / payssion
Payssion PHP library
Installs: 2 628
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
- ext-curl: *
- ext-json: *
- ext-openssl: *
This package is auto-updated.
Last update: 2024-10-29 06:18:29 UTC
README
This library contains payssion php client with composer installation support. Forked and updated from originally library https://github.com/payssion/payssion-php
Integration
How to integrate your website with payssion see https://payssion.com/en/docs/#integration
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist jimmlog/payssion
or add
"jimmlog/payssion": "@stable"
to the require section of your composer.json.
How To Use
Example of use:
$payssion = new PayssionClient('your api key', 'your secretkey');
//please uncomment the following if you use sandbox api_key
//$payssion = new PayssionClient('your api key', 'your secretkey', false);
$response = null;
try {
$response = $payssion->create(array(
'amount' => 1,
'currency' => 'USD',
'pm_id' => 'alipay_cn',
'order_id' => 'your order id', //your order id
'return_url' => 'your return url' //optional, the return url after payments (for both of paid and non-paid)
));
} catch (Exception $e) {
//handle exception
echo "Exception: " . $e->getMessage();
}
if ($payssion->isSuccess()) {
//handle success
} else {
//handle failed
}
License
The MIT License (MIT). See LICENSE file.