PHPackages                             eduardlleshi/omnipay-affirm - 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. eduardlleshi/omnipay-affirm

ActiveLibrary[Payment Processing](/categories/payments)

eduardlleshi/omnipay-affirm
===========================

Affirm driver for the Omnipay payment processing library

v3.0.0(5y ago)47.0k11MITPHP

Since Jan 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/eduardlleshi/omnipay-affirm)[ Packagist](https://packagist.org/packages/eduardlleshi/omnipay-affirm)[ Docs](https://eduardlleshi.com)[ RSS](/packages/eduardlleshi-omnipay-affirm/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (8)Used By (1)

Omnipay: Affirm
===============

[](#omnipay-affirm)

**Affirm gateway for the Omnipay PHP payment processing library**

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Affirm support for Omnipay.

Install
-------

[](#install)

##### For Omnipay v3:

[](#for-omnipay-v3)

Instal the gateway using require. Require the `league/omnipay` base package and this gateway.

```
$ composer require league/omnipay eduardlleshi/omnipay-affirm
```

##### For Omnipay v2:

[](#for-omnipay-v2)

Instal the gateway using require. Require the `league/omnipay` base package and this gateway.

```
$ composer require league/omnipay:^2.0 eduardlleshi/omnipay-affirm:^2.0
```

Usage
-----

[](#usage)

The following gateways are provided by this package:

- affirm

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay) repository.

#### Affirm.js

[](#affirmjs)

The Affirm integration is fairly straight forward. Essentially you just pass a `checkout_token ` field through to Affirm instead of the regular payment data.

Start by following the guide here: [Affirm Direct API](https://docs.affirm.com/payments/docs/direct-api-overview)

After that you will have a `checkout_token` field which will be submitted to your server. Simply pass this through to the gateway as `transaction_id`, instead of the usual `options` array:

```
        $transaction_id = $_POST['checkout_token'];

        $response = $gateway->authorize(
            'transaction_id' => $transaction_id,
        ])->send();

        $transaction_reference = $response->getTransactionReference();

        // you may use $transaction_reference in the upcoming calls.
```

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/eduardlleshi/omnipay-affirm/issues), or better yet, fork the library and submit a pull request.

#### TODO

[](#todo)

- Add unit testing.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~224 days

Recently: every ~94 days

Total

7

Last Release

2113d ago

Major Versions

v2.1.1 → 3.x-dev2020-09-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/80ad0ac5fc81d88db03e97eb771517ddcd4374028a236de62d2e17da79c6db19?d=identicon)[eduardlleshi](/maintainers/eduardlleshi)

---

Top Contributors

[![eduardlleshi](https://avatars.githubusercontent.com/u/6278258?v=4)](https://github.com/eduardlleshi "eduardlleshi (21 commits)")

---

Tags

paymentgatewaypaymerchantomnipayaffirm

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/eduardlleshi-omnipay-affirm/health.svg)

```
[![Health](https://phpackages.com/badges/eduardlleshi-omnipay-affirm/health.svg)](https://phpackages.com/packages/eduardlleshi-omnipay-affirm)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

557422.2k11](/packages/lokielse-omnipay-alipay)[omnipay/mollie

Mollie driver for the Omnipay payment processing library

631.8M10](/packages/omnipay-mollie)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1018.7k](/packages/sudiptpa-omnipay-nabtransact)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

155.1k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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