spirit labs支付系统SDK

dev-master 2014-05-18 23:35 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:52:46 UTC


README

spirit labs API PHP SDK

这是spirit labs支付聚合网关的实现。

请注意:此SDK目前处于开发中且不稳定。如果您发现bug,请通过pull request修复!

此包符合PSR-0PSR-1PSR-2规范。如果您注意到符合性问题,请通过pull request发送补丁。

用法

此SDK可通过composer获得(https://packagist.org.cn/packages/spiritlabs-api/php-sdk),只需在composer.json的require列表中添加"spiritlabs-api/php-sdk": "dev-master"。

有关用法详情,请参阅examples/文件夹。

获取可用支付方式

$API = new \SpiritLabs\API\Client(new \SpiritLabs\API\Authentication_HTTPBasicAccessAuth(
	$ApiKey,
	$SecretKey
));
$PaymentCustomer = new \SpiritLabs\API\Payment_Customer(array('UserId' => $UserId));
$PaymentCustomer->firstname = $firstname;
$PaymentCustomer->lastname = $lastname;

$PaymentMethods = $API->getPaymentMethods(
	array(
		new \SpiritLabs\API\Payment_Price($price, $currency)
	),
	$PaymentCustomer,
	true
);

print_r($PaymentMethods);

待办事项

许可证

此库采用MIT许可证发布。