PHPackages                             affinipay/chargeio-php - 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. affinipay/chargeio-php

ActiveLibrary[Payment Processing](/categories/payments)

affinipay/chargeio-php
======================

AffiniPay PHP Library

612.1k↑16.7%5[1 PRs](https://github.com/affinipay/chargeio-php/pulls)PHP

Since Jul 29Pushed 6y ago6 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

chargeio-php
============

[](#chargeio-php)

PHP Client Library for the AffiniPay Payment Gateway

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

[](#installation)

Download the PHP client library:

```
git clone git://github.com/charge-io/chargeio-php.git

```

To use the library in your application, add the following to your PHP script:

```
require_once '/path/to/chargeio-php/lib/ChargeIO.php';

```

### Set up ChargeIO credentials

[](#set-up-chargeio-credentials)

The library's APIs require credentials to access your merchant data on the AffiniPay servers. You can either:

- Provide credentials as arguments to each API call.
- Configure the library with default credentials.

    To set default credentials, call ChargeIO::setCredentials with an AffiniPay\_Credentials object. The AffiniPay\_Credentials object is instantiated with a public\_key and a secret\_key.

    ChargeIO::setCredentials(new AffiniPay\_Credentials('&lt;public\_key&gt;', '&lt;secret\_key&gt;'));

### Using AffiniPay hosted fields to create a charge token

[](#using-affinipay-hosted-fields-to-create-a-charge-token)

You must tokenize all sensitive payment information before you submit it to AffiniPay. On your payment form, use AffiniPay’s hosted fields to secure payment data and call window.AffiniPay.HostedFields.getPaymentToken to create a one-time payment token. See ["Creating payment forms using hosted fields"](https://developers.affinipay.com/collect/create-payment-form-hosted-fields.html). Then, POST the payment token ID to your PHP script.

### Making a charge

[](#making-a-charge)

Pass an amount and the one-time token ID returned from your payment page to complete a charge.

```
    $amount = $_POST['amount'];
    $token_id = $_POST['token_id'];
    $charge = ChargeIO_Charge::create(new ChargeIO_PaymentMethodReference(array('id' => $token_id)), $amount);

```

Documentation
-------------

[](#documentation)

The latest AffiniPay Payment Gateway API documentation is available at .

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e4bcfebd53d51244b842f34b3565d52c5719517987cd139c55e4616e8af440b?d=identicon)[Affinipay](/maintainers/Affinipay)

---

Top Contributors

[![udaysharma](https://avatars.githubusercontent.com/u/2013238?v=4)](https://github.com/udaysharma "udaysharma (3 commits)")[![jwsparrow](https://avatars.githubusercontent.com/u/5278576?v=4)](https://github.com/jwsparrow "jwsparrow (2 commits)")

### Embed Badge

![Health badge](/badges/affinipay-chargeio-php/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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