pagamastarde / pmt-api-client
v1.2.4
2018-02-15 10:24 UTC
Requires
- php: >=5.3
- nategood/httpful: *
- nayjest/str-case-converter: ^1.0
Requires (Dev)
- phpunit/phpunit: ^4.8
README
购物者库为连接到Paga+Tarde的商店提供了一种通过对象获取支付表单的方法。该库为连接到购物者服务的每种类型的商店提供占位符。与购物者服务的通信包括用于创建CURL请求的客户端。
所有代码都经过外部服务测试和检查。
如何使用
通过以下方式安装库
- 从这里下载这里
https://github.com/PagaMasTarde/pmtApiClient/releases/latest
- 使用Composer
composer require pagamastarde/pmt-api-client
最后,请确保包含自动加载器
require_once '/path/to/your-project/vendor/autoload.php';
一旦您在项目中准备好库,您将获得可用的占位符对象和pmtApiClient。
//Create a pmtApi object, for example: $pmtApiClient = new PmtApiClient($privateKey); //Example: verify a loan exists before notification arrives: $isOrderPaid = $pmtApiClient->charge->validatePaymentForOrderId($orderId); //then you can: if ($isOrderPaid){ //order is paid mark it as paid in your DB and show order-confirm page. } else { //order is not paid, redirect to checkout. } // You can investigate the rest of the methods. And find all the documentation of the API here: // http://docs.pagamastarde.com/api/
帮助我们改进
我们很高兴接受建议或拉取请求。如果您愿意帮助我们开发更好的软件,请在此创建拉取请求,遵循PSR-2代码风格,我们将使用reviewable来检查代码,如果所有测试通过且没有SensioLab Insights检测到问题,您就可以合并了。