open-pix / php-sdk
PHP OpenPix/Woovi SDK
Installs: 2 246
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 5
Forks: 2
Open Issues: 4
Requires
- php: ^7.3 || ^8.0
- php-http/discovery: ^1.18
- psr/http-client: ^1.0
- psr/http-client-implementation: *
- psr/http-factory: ^1.0
- psr/http-factory-implementation: *
- psr/http-message: ^1.0 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.17
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2025-02-21 00:25:25 UTC
README
Welcome to the OpenPix PHP SDK! This SDK provides convenient access to the OpenPix REST API, allowing you to easily integrate payment services into your PHP applications.
Documentation
See SDK documentation and Rest API documentation.
Installation
Install the SDK with the necessary dependencies using Composer:
$ composer require open-pix/php-sdk guzzlehttp/guzzle guzzlehttp/psr7
Basic usage
Here is the basic usage of the SDK. See SDK documentation for more details.
use OpenPix\PhpSdk\Client; // Load autoload of Composer. require_once __DIR__ . "/vendor/autoload.php"; $client = Client::create("YOUR_APP_ID"); // Create a customer. $customer = [ "name" => "Dan PHP-SDK", "taxID" => "00000000000", // CPF "email" => "email0@example.com", "phone" => "5511999999999", "correlationID" => "test-php-sdk-customer-" . mt_rand(1, 10000), ]; $client->customers()->create($customer); // Create a charge using above customer. $charge = [ // Charge value. "value" => 1000, // (R$ 10,00) // Your correlation ID to keep track of this charge. "correlationID" => "test-php-sdk-charge-" . mt_rand(1, 10000), // Charge customer. "customer" => $customer, ]; $result = $client->charges()->create($charge); // Get the generated dynamic BR code to be rendered as a QR Code. echo $result["brCode"] . "\n";
Contributing
If you have suggestions for how OpenPix PHP SDK could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.
License
OpenPix PHP SDK is distributed under the terms of the MIT license.