openbuildings / paypal
PayPal SDK for ExpressCheckout 和 Adaptive Payments。支持周期性支付、简单支付、并行支付和链式支付。
0.5.0
2020-02-20 17:23 UTC
Requires
- php: ^7.1
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-09-11 21:45:38 UTC
README
PayPal SDK for ExpressCheckout 和 Adaptive Payments。
功能
- 周期性支付
- 简单支付
- 并行支付
- 链式支付
安装
您可以通过运行以下命令将此库用于您的项目:
php composer.phar install
用法
以下是一个使用ExpressCheckout执行支付的简单示例
// Get a Payment instance using the ExpressCheckout driver $payment = OpenBuildings\PayPal\Payment::instance('ExpressCheckout'); // Set the order $payment->order(array( 'items_price' => 10, 'shipping_price' => 3, 'total_price' => 13 )); // Set additional params needed for ExpressCheckout $payment->return_url('example.com/success'); $payment->cancel_url('example.com/success'); // Send a SetExpressCheckout API call $response = $payment->set_express_checkout(); // Finish the payment with the token and the payer id received. $payment->do_express_checkout_payment($response['TOKEN'], $response['PAYERID']);
文档
贡献
阅读贡献指南。
许可证
在BSD-3-Clause开源许可证下许可。