rodineiti / smartfastpay-sdk-php
SDK with PHP for Smartfastpay to process payments and payouts
Requires
- php: ^7.2 || ^8.0
- guzzlehttp/guzzle: ^7.0
- symfony/cache: ^5.0
Requires (Dev)
- phpunit/phpunit: ^7.2 || ^8.0
This package is auto-updated.
Last update: 2024-05-30 00:36:42 UTC
README
Welcome to the initial release of the Smartfastpay SDK for PHP - a powerful and flexible library for processing payments and payouts.
Key Features:
-
Payments and Payouts Implementation: Full support for processing payments and payouts.
-
Design Patterns and Best Practices: Utilizes design patterns like Strategy, following best practices for clean and maintainable code.
-
Flexible Configurations: Easily configure client keys and secrets.
-
Guzzle HTTP Requests: Integrates with Guzzle HTTP for efficient and reliable requests.
-
Exception Handling: Implements specific exceptions for each resource, along with the use of HTTP exceptions for error handling.
-
Secure Authentication: Implements secure authentication with automatic access token renewal.
Getting Started:
-
Installation via Composer:
composer require rodineiti/smartfastpay-sdk-php
-
Quick Setup:
use Rodineiti\SmartfastpaySdk\Config\Config; use Rodineiti\SmartfastpaySdk\Payment; use Rodineiti\SmartfastpaySdk\Strategy\Payment\Pix\PixPaymentStrategy; $config = new Config('client_id', 'client_secret'); $payment = new Payment($config); $payment->setStrategy(new PixPaymentStrategy());
-
Payment Processing:
use Rodineiti\SmartfastpaySdk\Strategy\Payment\Pix\PixParams; try { $respose = $payment->processPayment(new PixParams( uniqid(), 'John Doe', 'john.doe@example.com', '12345678909', 2.00, 'BRL', 'http://example.com/callback', uniqid(), )); header("Content-Type: application/json"); echo $respose; } catch (Exception $e) { var_dump("Error on create payment: {$e->getMessage()}"); }