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. [Payment Processing](/categories/payments)
4. /
5. framepayments/php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

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

Frame Payments PHP SDK

v1.0.11(1mo ago)014MITPHPPHP ^8.1 || ^8.2 || ^8.3CI passing

Since Oct 22Pushed 1mo 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 today

READMEChangelog (8)Dependencies (21)Versions (15)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, use the endpoint classes under the `Frame\Endpoints` namespace to interact with the API:

```
use Frame\Endpoints\Customers;
use Frame\Endpoints\ChargeIntents;
use Frame\Endpoints\Subscriptions;

// Create a customer
$customers = new Customers();
$customer = $customers->create([
    'name'  => 'Alice Johnson',
    'email' => 'alice@example.com',
]);

// Create a charge intent
$chargeIntents = new ChargeIntents();
$intent = $chargeIntents->create([
    'amount'         => 10000,
    'currency'       => 'usd',
    'customer'       => $customer['id'],
    'payment_method' => 'pm_123456789',
]);
$chargeIntents->confirm($intent['id']);

// Create a subscription
$subscriptions = new Subscriptions();
$subscription = $subscriptions->create([
    'customer'      => $customer['id'],
    'product_phase' => 'pph_123456789',
    'payment_method' => 'pm_123456789',
]);
```

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.

```
use Frame\Endpoints\Charges;

try {
    $charges = new Charges();
    $charge = $charges->retrieve('ch_123456789');
} catch (\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

45

—

FairBetter than 91% of packages

Maintenance93

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.6% 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 ~20 days

Recently: every ~26 days

Total

12

Last Release

36d 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/6a6806f8d5ea53e9a7d0e18dfb294f0cc6ef7689ad8668ca930eb7ddce13e530?d=identicon)[frame-eric](/maintainers/frame-eric)

---

Top Contributors

[![townsendeb](https://avatars.githubusercontent.com/u/16887846?v=4)](https://github.com/townsendeb "townsendeb (25 commits)")[![frame-eric](https://avatars.githubusercontent.com/u/243653431?v=4)](https://github.com/frame-eric "frame-eric (5 commits)")[![Saadlulu](https://avatars.githubusercontent.com/u/2941475?v=4)](https://github.com/Saadlulu "Saadlulu (4 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

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[imdhemy/google-play-billing

Google Play Billing

491.5M5](/packages/imdhemy-google-play-billing)

PHPackages © 2026

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