Search by

fabriciogferreira / abacatepay-php-sdk

fabriciogferreira

An unofficial PHP SDK for integrating AbacatePay payment solutions into your applications.

Package info

github.com/fabriciogferreira/abacatepay-php-sdk

pkg:composer/fabriciogferreira/abacatepay-php-sdk

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.0.0 2026-07-29 00:17 UTC

This package is auto-updated.

Last update: 2026-08-29 00:31:47 UTC


README

Community-maintained unofficial PHP SDK for integrating AbacatePay payment solutions.

PHP Version License: MIT Packagist Version Packagist Downloads

⚠️ This is an unofficial community-maintained SDK and is not affiliated with AbacatePay.

Menu

📋 Requirements

  • PHP 8.0 or higher
  • Guzzle 7.0 or higher
  • Composer
  • Valid AbacatePay account and API credentials
  • SSL enabled for production environments

💻 Installation

Install the SDK via Composer:

composer require fabriciogferreira/abacatepay-php-sdk

🔧 Configuration

First, initialize the SDK with your API token:

use AbacatePay\v2\Clients\AbacatePayClient;

$abacatePayClient = new AbacatePayClient('YOUR_ABACATE_PAY_TOKEN');

⚠️ Never commit your API tokens to version control. Use environment variables instead.

📘 Usage Examples

Customer

Initialization

use AbacatePay\v2\Clients\AbacatePayClient;
use AbacatePay\v2\RequestData\Customer\CustomerCreateRequestData;

$abacatePayClient = new AbacatePayClient('YOUR_ABACATE_PAY_TOKEN');

Create

$customerCreateRequestData = CustomerCreateRequestData::make('fabriciof481@gmail.com')
  ->name('Fabrício')
  ->metadata([
    'herói favorito' => 'flash',
    'idade' => 24
  ]);

$customerCreateResponseBody = $abacatePayClient->customers()
  ->create($customerCreateRequestData);

Returns an instance of:

AbacatePay\v2\ResponseBody\Customer\CustomerCreateResponseBody

🌟 Features

Customers

  • ✅ Create customers
  • ✅ Retrieve customers
  • ✅ Delete customers

Subscriptions

  • ✅ Create subscriptions
  • ✅ Cancel subscriptions

More features will be added in future releases.

Supported Versions

Version Status
2.x Active development
1.x Maintenance only

Changelog

See CHANGELOG.md for release history.

Versioning

This project follows Semantic Versioning (SemVer):

  • MAJOR: Breaking changes
  • MINOR: New backward-compatible features
  • PATCH: Bug fixes

⚡ Best Practices

  • Use environment variables for API tokens
  • Enable error reporting in development
  • Always validate customer input
  • Handle exceptions appropriately

🔍 Error Handling

use AbacatePay\v2\Exceptions\AbacatePayNetworkException;
use AbacatePay\v2\Exceptions\AbacatePayValidationException;
use AbacatePay\v2\Exceptions\AbacatePayInvalidRequestException;
use AbacatePay\v2\Exceptions\AbacatePayAuthorizationException;
use AbacatePay\v2\Exceptions\AbacatePayAuthenticationException;
use AbacatePay\v2\Exceptions\AbacatePayRateLimitException;
use AbacatePay\v2\Exceptions\AbacatePayNotFoundException;
use AbacatePay\v2\Exceptions\AbacatePayApiException;

try {
  $customerCreateResponseBody = $abacatePayClient->customers()
      ->create($customerCreateRequestData);
} catch (AbacatePayNetworkException $e) {
  // Handle network error (0)
} catch (AbacatePayValidationException $e) {
  // Handle validation error (422)
} catch (AbacatePayInvalidRequestException $e) {
  // Handle invalid request error(400)
} catch (AbacatePayAuthorizationException $e) {
  // Handle authorization (403)
} catch (AbacatePayAuthenticationException $e) {
  // Handle authentication error (401)
} catch (AbacatePayRateLimitException $e) {
  // Handle rate limit error (429)
} catch (AbacatePayNotFoundException $e) {
  // Handle not found error (404)
} catch (AbacatePayApiException $e) {
  // Handle unexpected API errors (500)
}

📚 Documentation

For AbacatePay API documentation and integration guides:

AbacatePay Documentation

🤝 Contributing

We welcome contributions! Please follow the steps below.

  1. Fork the repository
  2. Create a feature branch (feature/my-feature)
  3. Make your changes
  4. Add or update tests
  5. Run composer check
  6. Open a Pull Request on GitHub

🛠️ Development

Installing packages

composer install

Running Tests

composer test      # Run tests
composer analyse   # Run PHPStan analysis
composer lint      # Check code style
composer fix       # Fix code style
composer check     # Run all checks

🔒 Security

For security issues, please see our Security Policy.

❤️ Support the Project

This SDK is developed and maintained independently.

If it has been useful to you and you'd like to support its maintenance, you can contribute via PIX:

fabriciof481@gmail.com

Thank you for your support!

📄 License

This project is licensed under the MIT License.

💬 Support

--

Made with ❤️ by the community.