PHPackages                             marcguyer/assembly-callback - 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. marcguyer/assembly-callback

ActiveLibrary[Payment Processing](/categories/payments)

marcguyer/assembly-callback
===========================

Library for interacting with callbacks as sent by Assembly Payments

0.0.3(9y ago)1357MITPHPPHP ^5.3 || ^7.0

Since Mar 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/marcguyer/assembly-callback)[ Packagist](https://packagist.org/packages/marcguyer/assembly-callback)[ RSS](/packages/marcguyer-assembly-callback/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/ac42a559f60f4d5f4b8f55cdc43e8418b947cf0106cae0d68e90d27dd928edb6/68747470733a2f2f7472617669732d63692e6f72672f6d61726367757965722f617373656d626c792d63616c6c6261636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/marcguyer/assembly-callback)

Assembly Payments Callback Objects
==================================

[](#assembly-payments-callback-objects)

A structured set of objects designed to enable some abstraction handling of [Assembly Payments Callback](https://docs.assemblypayments.com/feature-guides/guides/callbacks/) payloads.

Install
-------

[](#install)

```
composer require assembly-callback
```

Usage Example
-------------

[](#usage-example)

### Basic Usage

[](#basic-usage)

Basic usage simply instantiates a new Callback object of the type provided by your listener.

```
use Assembly\Callback;

// get the request body in your preferred way
$requestBody = file_get_contents("php://input");

// use the factory to create an object of the proper type
$callback = Callback\CallbackFactory::factory($requestBody);
```

### With Payload Validation

[](#with-payload-validation)

You may optionally use the validation feature which requires the availability of the [stock SDK](https://github.com/PromisePay/promisepay-php) by default. This uses the `id` from the callback payload to request the same object from the Assembly API according the the object type.

```
use Assembly\Callback;
use PromisePay\PromisePay;

// get the request body in your preferred way
$requestBody = file_get_contents("php://input");

// use the factory to create an object of the proper type
$callback = Callback\CallbackFactory::factory($requestBody);

// config the PromisePay client
PromisePay::Configuration()->environment('prelive');
PromisePay::Configuration()->login('');
PromisePay::Configuration()->password('');

// validate the callback
$callback->validate();
```

### Extend a Callback Type

[](#extend-a-callback-type)

You may want to add some functionality to an object. To do that, you can define your own type handler.

#### Example extension

[](#example-extension)

```
use Assembly\Callback\Transaction;

class MyTransaction extends Transaction
{
    public function someSpecialHandling() {
        // do something extra special
    }
}
```

#### Use the extension

[](#use-the-extension)

```
use Assembly\Callback;

// get the request body in your preferred way
$requestBody = file_get_contents("php://input");

// when the type is "transactions", use this extention
Callback\CallbackFactory::registerType(
    'transactions',
    'My_Assembly_Callback_Transaction'
);

// use the factory to create an object of the proper type
$callback = Callback\CallbackFactory::factory($requestBody);
```

Contribute
----------

[](#contribute)

Pull Requests are encouraged. [Learn how](https://guides.github.com/activities/contributing-to-open-source/#contributing)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

3347d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35496?v=4)[Marc Guyer](/maintainers/marcguyer)[@marcguyer](https://github.com/marcguyer)

---

Top Contributors

[![marcguyer](https://avatars.githubusercontent.com/u/35496?v=4)](https://github.com/marcguyer "marcguyer (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marcguyer-assembly-callback/health.svg)

```
[![Health](https://phpackages.com/badges/marcguyer-assembly-callback/health.svg)](https://phpackages.com/packages/marcguyer-assembly-callback)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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