pagamastarde / shopper-library
Library with the models of the shop modules and shopper client
Installs: 3 689
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: ^4.8
README
Shopper Library
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.