pagamastarde/shopper-library

This package is abandoned and no longer maintained. The author suggests using the pagantis/orders-api-client package instead.

Library with the models of the shop modules and shopper 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

Shopper Library 68747470733a2f2f706167616d617374617264652e636f6d2f696d672f69636f6e732f6c6f676f2e737667

CircleCILatest Stable Version composer.lock Scrutinizer Code Quality

Shopper Library offers the shops connected to Paga+Tarde a way to get the payment form using objects. The library provides stubs for each type of shop connected to the shopper service. For communication with the shopper service includes a client to create the CURL request.

All the code is tested and inspected by external services.

How to use

Install the library by:

  • Downloading it from here

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

  • Using Composer:
composer require pagamastarde/shopper-library

Finally, be sure to include the autoloader:

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

Once you have the library ready inside your project you will have the stub objects available and the ShopperClient also available. For fields explanation or mandatory check our paymentForm documentation here

//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;

Help us to improve

We are happy to accept suggestions or pull requests. If you are willing to help us develop better software please create a pull request here following the PSR-2 code style and we will use reviewable to check the code and if al test pass and no issues are detected by SensioLab Insights you could will be ready to merge.