This SDK provides convenient access to the Woovi (OpenPix) REST API, allowing you to easily integrate payment services into your PHP applications.
See SDK documentation and Rest API documentation.
The package is not published on Packagist; install it straight from GitHub with Composer, together with a PSR-18 HTTP client and PSR-17 factories:
composer config repositories.woovi-php-sdk vcs https://github.com/OwnerPro-Software/woovi-php-sdk
composer require ownerpro/woovi-php-sdk guzzlehttp/guzzle guzzlehttp/psr7It keeps the OpenPix\PhpSdk namespace of open-pix/php-sdk, so it conflicts with that package rather than installing alongside it.
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";OwnerPro-Software maintains this package as an independent fork of woovibr/php-sdk (open-pix/php-sdk), taken from its main after v1.1.4. Changes since the fork are listed in the CHANGELOG.
Distributed under the terms of the MIT license.
