Search by

jieyang / payssion-php

yangxiaocan

There is no license information available for the latest version (v1.0.0) of this package.

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Package info

gitee.com/jieyang/payssion-php

pkg:composer/jieyang/payssion-php

Statistics

Installs: 19

Dependents: 0

Suggesters: 0

v1.0.0 2023-06-11 08:46 UTC

This package is not auto-updated.

Last update: 2025-09-01 17:52:48 UTC


README

Prerequisites

  • PHP 5.3 or above
  • curl, json & openssl extensions must be enabled

Usage

$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()) {
    //redirect the users to the payment URL
    $payment_url = $response['redirect_url'];
} else {
	//handle failure
}

PAYSSION PHP library