pagamastarde / pmt-api-client
PagaMasTarde Api Client in PHP. Use the api with simple methods and using POO.
Installs: 3 745
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 2
Requires
- php: >=5.3
- nategood/httpful: *
- nayjest/str-case-converter: ^1.0
Requires (Dev)
- phpunit/phpunit: ^4.8
README
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.