pagamastarde/pmt-api-client

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

PagaMasTarde Api Client in PHP. Use the api with simple methods and using POO.

v1.2.4 2018-02-15 10:24 UTC

This package is auto-updated.

Last update: 2019-03-13 15:36:39 UTC


README

Build Status Latest 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/pmtApiClient/releases/latest

  • Using Composer:
composer require pagamastarde/pmt-api-client

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 pmtApiClient also available.

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

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.