PHPackages                             framepayments/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. framepayments/php-sdk

ActiveLibrary

framepayments/php-sdk
=====================

Frame Payments PHP SDK

v1.0.7(3mo ago)06MITPHPPHP ^8.1 || ^8.2 || ^8.3CI passing

Since Oct 22Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/Frame-Payments/frame-php)[ Packagist](https://packagist.org/packages/framepayments/php-sdk)[ RSS](/packages/framepayments-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (11)Used By (0)

Frame PHP SDK
=============

[](#frame-php-sdk)

This is a lightweight PHP SDK for the Frame payment gateway. It uses Guzzle for making API requests and returns the responses as an array/object by default. The SDK communicates with the `https://api.framepayments.com` endpoint.

Installation
------------

[](#installation)

To install the SDK, add the following to your `composer.json` file:

```
"require": {
    "frame-payments/frame-php": "^1.0"
}
```

Then run `composer install` to add the SDK to your project.

Usage
-----

[](#usage)

First, set your API key using the `setApiKey` method in the `Auth` class:

```
use Frame\Auth;

Auth::setApiKey('YOUR_API_KEY');
```

After setting the API key, you can use the `Client` class to make requests to the Frame API. The `Client` class has four methods: `create`, `get`, `update`, and `delete`. Each of these methods takes two parameters: the endpoint and an optional body.

Here are some examples:

```
use Frame\Client;

$create = Client::create('charges', [] /* body can be placed here */);

$get = Client::get('charges', [] /* body can be placed here */);

$update = Client::update('charges', [] /* body can be placed here */);

$delete = Client::delete('charges', [] /* body can be placed here */);
```

By default, the response from these methods will be an object. If you want to get the response as an array, you can use the `toArray` method.

```
$response = Frame\Client::get('charges');
$arrayResponse = $response->toArray();
```

Error Handling
--------------

[](#error-handling)

This SDK uses exceptions for error handling. If an error occurs during a request, an `Exception` will be thrown. You can catch these exceptions to handle errors in your application.

```
try {
    $response = Frame\Client::get('charges');
} catch (Frame\Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Helpers
-------

[](#helpers)

The SDK also includes a `Helpers` class with useful methods. For example, you can use the `convertAlpha2ToAlpha3` method to convert a country code from ISO 3166-1 alpha-2 to ISO 3166-1 alpha-3.

```
$alpha3 = Frame\Helpers::convertAlpha2ToAlpha3('US');
```

Testing
-------

[](#testing)

The SDK includes a comprehensive test suite using PHPUnit. To run the tests:

### Prerequisites

[](#prerequisites)

- PHP 8.1 or higher
- Composer
- Docker (for containerized testing)

### Running Tests

[](#running-tests)

#### Option 1: Using Docker (Recommended)

[](#option-1-using-docker-recommended)

```
# Build the test image
docker build -t frame-php-sdk-tests .

# Run all tests
docker run --rm frame-php-sdk-tests ./vendor/bin/phpunit

# Run tests with pretty output
docker run --rm frame-php-sdk-tests ./vendor/bin/phpunit --testdox

# Run specific test suites
docker run --rm frame-php-sdk-tests ./vendor/bin/phpunit tests/Unit/
docker run --rm frame-php-sdk-tests ./vendor/bin/phpunit tests/Integration/
```

#### Option 2: Local PHP/Composer

[](#option-2-local-phpcomposer)

```
# Install dependencies
composer install

# Run all tests
composer test
# or
./vendor/bin/phpunit

# Run tests with coverage
composer test-coverage
# or
./vendor/bin/phpunit --coverage-html coverage
```

Contributing
------------

[](#contributing)

Contributions are welcome. Please submit a pull request or create an issue if you have any improvements or find any bugs.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~28 days

Total

8

Last Release

94d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^8.1 || ^8.2 || ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2f4ec1b3795ac319a8cd2750388456ae2aaabbae49c4e15b27c4736db04b2e2?d=identicon)[townsendeb](/maintainers/townsendeb)

---

Top Contributors

[![townsendeb](https://avatars.githubusercontent.com/u/16887846?v=4)](https://github.com/townsendeb "townsendeb (25 commits)")[![Saadlulu](https://avatars.githubusercontent.com/u/2941475?v=4)](https://github.com/Saadlulu "Saadlulu (4 commits)")[![frame-eric](https://avatars.githubusercontent.com/u/243653431?v=4)](https://github.com/frame-eric "frame-eric (2 commits)")[![Saad-Lulu](https://avatars.githubusercontent.com/u/195824474?v=4)](https://github.com/Saad-Lulu "Saad-Lulu (2 commits)")[![dvnkshl](https://avatars.githubusercontent.com/u/3625028?v=4)](https://github.com/dvnkshl "dvnkshl (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/framepayments-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/framepayments-php-sdk/health.svg)](https://phpackages.com/packages/framepayments-php-sdk)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
