pagamastarde/shopper-library

此包已被废弃,不再维护。作者建议使用 pagantis/orders-api-client 包。

包含商店模块和购物客户端模型的库

1.2.1 2018-11-27 16:59 UTC

This package is auto-updated.

Last update: 2019-03-13 15:37:46 UTC


README

购物库 68747470733a2f2f706167616d617374617264652e636f6d2f696d672f69636f6e732f6c6f676f2e737667

CircleCILatest Stable Version composer.lock Scrutinizer Code Quality

购物库为连接到 Paga+Tarde 的商店提供了一个使用对象获取支付表单的方法。库为连接到购物服务的每个类型的商店提供存根。与购物服务通信时,包括创建 CURL 请求的客户端。

所有代码都经过外部服务的测试和检查。

如何使用

通过以下方式安装库

https://github.com/PagaMasTarde/shopperLibrary/releases/latest

  • 使用 Composer
composer require pagamastarde/shopper-library

最后,请确保包含自动加载器

require_once '/path/to/your-project/vendor/autoload.php';

一旦您在项目中准备好库,您将拥有可用的存根对象,同时购物客户端也可用。有关字段说明或必填项检查,请参阅我们的 paymentForm 文档这里

//Create a Prestashop object, for example:
$prestashopObject = new PrestashopObjectModule();
//You will need to setup all the mandatory fields at least, find more information in
//http://docs.pagamastarde.com/avanzada/formulario/
$prestashopObject
    ->setEmail('test@email.com')
    ->setFullName('John Doe')
    ->setAmount(1234)
;

$shopperClient = new ShopperClient();
$shopperClient->setObjectModule($prestashopObject);
$apiResponse = $shopperClient->getPaymentForm();

//Print the resulting HTML
echo $apiResponse->data-form;

帮助我们改进

我们很高兴接受建议或拉取请求。如果您愿意帮助我们开发更好的软件,请在这里创建拉取请求,遵循 PSR-2 代码风格,我们将使用 reviewable 检查代码,如果所有测试都通过,并且 SensioLab Insights 没有检测到任何问题,则可以合并。