santanamic / php-picpay-sdk
v1
2019-04-04 05:39 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-10-16 09:07:27 UTC
README
SDK for integration of PHP applications with the PicPay API. This is an unofficial open source project.
Requirements
- PHP 5.5 and later
- Composer installed
- PicPay Token E-commerce
Structure
docs/
src/
example/
lib/
tests/
Installation & Usage
Composer
To install the bindings via composer
:
$ composer require santanamic/php-picpay-sdk
Tests
To run the unit tests:
composer test
Getting Started
This example shows how to get payment URLs. Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: E-commerce Token $config = PicPay\Configuration::getDefaultConfiguration()->setApiKey('x-picpay-token', 'YOUR_API_KEY'); $apiInstance = new PicPay\SDK\RequisioDePagamentoApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client([ 'verify' => false, 'headers' => [ 'Content-Type' => 'text/html; charset=UTF-8', 'Cache-Control' => 'no-cache', 'Accept-Encoding' => 'none' ] ]), $config ); //Pass the parameters and make the magic happen. //Law the official documentation to know more details about the parameters $body = new \PicPay\modelPackage\PaymentRequest([ 'reference_id' => '123456', 'callback_url' => 'https://example.com/', 'return_url' => 'https://example.com/return', 'value' => '230.22', 'buyer' => [ 'firstName' => 'João', 'lastName' => 'Da Silva', 'document' => '123.456.789-10', 'email' => 'teste@picpay.com', 'phone' => '+55 27 12345-6789' ] ]); try { $result = $apiInstance->postPayments($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling RequisioDePagamentoApi->postPayments: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://appws.picpay.com/ecommerce/public/
Documentation Official
How to get a PicPay Token
- To communicate with the API you need to obtain the PicPay access credentials
Talk to the author
- Please let me know if you need anything. Send me an email.
License and About Project
- The MIT License (MIT). Please see License File for more information.
- This project was built with OpenAPI Specification and Swagger CLI