PHPackages                             idimensionz/affirm-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. [API Development](/categories/api)
4. /
5. idimensionz/affirm-php-sdk

ActiveLibrary[API Development](/categories/api)

idimensionz/affirm-php-sdk
==========================

Unofficial PHP SDK for Affirm Transaction API

2.0.0(2y ago)045.8k↓42.9%MITPHP

Since Dec 4Pushed 2y agoCompare

[ Source](https://github.com/idimensionz/affirm-php-sdk)[ Packagist](https://packagist.org/packages/idimensionz/affirm-php-sdk)[ RSS](/packages/idimensionz-affirm-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (6)Used By (0)

Unofficial Affirm PHP SDK
=========================

[](#unofficial-affirm-php-sdk)

[Affirm Transaction API Docs](https://docs.affirm.com/developers/reference/transaction-api-endpoints)[Affirm Charge API Docs](https://docs.affirm.com/developers/reference/the-charge-object)

Install:
--------

[](#install)

```
composer require idimensionz/affirm-php-sdk
```

Usage:
------

[](#usage)

```
// get an Affirm PHP Transaction API client sdk instance
$config = [
    'public_api_key' => 'MY_AFFIRM_PUBLIC_API_KEY',
    'private_api_key' => 'MY_AFFIRM_PRIVATE_API_KEY',
    'is_sandbox' => true,
];
$affirm = new \iDimensionz\Affirm\Api\TransactionApiClient($config);

// Authorize an Affirm payment by checkout token
/** @var \stdClass $response decoded json from response */
$optionalData = ['order_id' => 'OPTIONAL_ORDER_ID'];
$response = $affirm->authorize('MY_CHECKOUT_TOKEN', $optionalData);

// capture an authorized affirm payment by transaction id
$optionalData = [
    'order_id' => 'abc123',
    'shipping_carrier' => 'my carrier',
    'shipping_confirmation' => 'abc123',
];
$response = $affirm->capture('MY_TRANSACTION_ID', $optionalData);

// read the details of an authorized transaction by transaction id
$optionalData = [
    'expand' => 'checkout,events',
];
$response = $affirm->read('MY_TRANSACTION_ID', $optionalData);
```

Using the Charge API client is similar to the Transaction API Client.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~703 days

Total

4

Last Release

978d ago

Major Versions

1.1.1 → 2.0.02023-09-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/75031cc08726160448843e9ecf682ee70f21e1232ffa9f7c06a56e02b5a74d0e?d=identicon)[idimensionz](/maintainers/idimensionz)

---

Top Contributors

[![idimensionz](https://avatars.githubusercontent.com/u/1318604?v=4)](https://github.com/idimensionz "idimensionz (4 commits)")[![mikedfunk](https://avatars.githubusercontent.com/u/661038?v=4)](https://github.com/mikedfunk "mikedfunk (3 commits)")[![stsibel](https://avatars.githubusercontent.com/u/1758206?v=4)](https://github.com/stsibel "stsibel (2 commits)")[![jhonnykhadra](https://avatars.githubusercontent.com/u/7204771?v=4)](https://github.com/jhonnykhadra "jhonnykhadra (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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