PHPackages                             mothership-ec/cog-mothership-ecommerce - 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. [Framework](/categories/framework)
4. /
5. mothership-ec/cog-mothership-ecommerce

AbandonedLibrary[Framework](/categories/framework)

mothership-ec/cog-mothership-ecommerce
======================================

Cog module for processing E-Commerce in Mothership

3.8.0(10y ago)21.8k1[51 issues](https://github.com/mothership-ec/cog-mothership-ecommerce/issues)[5 PRs](https://github.com/mothership-ec/cog-mothership-ecommerce/pulls)4GPL-3.0+PHPPHP &gt;=5.4.0

Since Oct 30Pushed 10y ago5 watchersCompare

[ Source](https://github.com/mothership-ec/cog-mothership-ecommerce)[ Packagist](https://packagist.org/packages/mothership-ec/cog-mothership-ecommerce)[ Docs](http://mothership.ec)[ RSS](/packages/mothership-ec-cog-mothership-ecommerce/feed)WikiDiscussions develop Synced today

READMEChangelogDependencies (7)Versions (96)Used By (4)

Mothership Ecommerce
====================

[](#mothership-ecommerce)

Configuration
-------------

[](#configuration)

### Dispatch

[](#dispatch)

- **printer-name**: ...

### Payment

[](#payment)

- **gateway**: Name of gateway to use. Note the gateway must be available to the system.
- **use-test-payments**: Use the test environment of external payment gateways.
- **salt**: Used when hashing data in the payment processes.

Gateways
--------

[](#gateways)

Payment gateways allow you to process payments through an external service.

There are two components to a gateway within mothership; an implementation of `Gateway\GatewayInterface` to communicate with the external service, and controllers to handle purchase and refund requests.

### Default gateways

[](#default-gateways)

#### ZeroPayment

[](#zeropayment)

The zero payment gateway is the most basic implementation, it simply completes the order and redirects straight to the success url.

#### LocalPayment

[](#localpayment)

The local payment gateway is an extension of zero payment.

### Extending with new gateway providers

[](#extending-with-new-gateway-providers)

To add a new gateway provider you'll need to create a new adapter that implements `Gateway\GatewayInterface` and append it to the `gateway.collection` service.

Secondly you'll need to implement the `Controllers\Gateway\PurchaseControllerInterface` and `Controllers\Gateway\RefundControllerInterface`. If your new gateway does not support refunds then the `refund()` method should just return `$this->createNotFoundException()`.

Of course your gateway and controller(s) can use additional methods for handling the specific functionality and process flow for the new provider, such as callbacks from the external service.

Purchases
---------

[](#purchases)

A purchase process is a system which sends a payment request to a gateway and creates / modifies an object on a success response and reacts accordingly to cancelled and failed purchases. For example, the standard checkout process which on success saves the order to the database and records the payment against it.

When writing a new purchase process the 'continue to payment' action should forward the request to the current gateway's purchase controller reference using `$this->get('gateway')->getPurchaseControllerReference()`.

This forward request should pass the instance of `PayableInterface` that is being purchased and the stages configuration.

```
$controller = 'Message:Mothership:Foo::Controller:Bar';
return $this->forward($this->get('gateway')->getPurchaseControllerReference(), [
    'payable' => $instanceOfPayableInterface,
    'stages'  => [
        'cancel'  => $controller . '#cancel',  // Method for reacting to cancelled purchases
        'failure' => $controller . '#failure', // Method for reacting to failed purchases
        'success' => $controller . '#success', // Method for reacting to successful purchases
    ]
]);
```

The purchase process requires a controller that implements `Controllers\Gateway\CompleteControllerInterface`. This should implement the `success`, `cancel` and `failure` methods.

The `success()` method should turn the payable into a saved instance of the object it represents, e.g. an order, store any payments as necessary and return a success url in a `JsonResponse`. This completion process should be called by the gateway purchase controller when confirming the purchase with the external provider.

Refunds
-------

[](#refunds)

A refund process works in the same way as a purchase purchase, except you forward the request to `$this->get('gateway')->getRefundControllerReference()` and pass an additional `reference` parameter. The `cancel` stage is not required for refunds.

```
$controller = 'Message:Mothership:Foo::Controller:Bar';
return $this->forward($this->get('gateway')->getRefundControllerReference(), [
    'payable'   => $instanceOfPayableInterface,
    'reference' => 'reference for the payment made previously being refunded',
    'stages'    => [
        'failure' => $controller . '#failure', // Method for reacting to failed refunds
        'success' => $controller . '#success', // Method for reacting to successful refunds
    ]
]);
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity74

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

Recently: every ~26 days

Total

65

Last Release

3755d ago

Major Versions

1.4.3 → 2.0.02014-06-11

2.8.1 → 3.0.02015-02-24

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

1.2.4PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4520924?v=4)[Thomas Marchant](/maintainers/thomasjthomasj)[@thomasjthomasj](https://github.com/thomasjthomasj)

---

Top Contributors

[![lsjroberts](https://avatars.githubusercontent.com/u/3817697?v=4)](https://github.com/lsjroberts "lsjroberts (325 commits)")[![thomasjthomasj](https://avatars.githubusercontent.com/u/4520924?v=4)](https://github.com/thomasjthomasj "thomasjthomasj (267 commits)")[![dannyhannah](https://avatars.githubusercontent.com/u/1499449?v=4)](https://github.com/dannyhannah "dannyhannah (77 commits)")[![kuiche](https://avatars.githubusercontent.com/u/5089510?v=4)](https://github.com/kuiche "kuiche (74 commits)")[![irisSchaffer](https://avatars.githubusercontent.com/u/4313088?v=4)](https://github.com/irisSchaffer "irisSchaffer (37 commits)")[![joeholdcroft](https://avatars.githubusercontent.com/u/2511043?v=4)](https://github.com/joeholdcroft "joeholdcroft (31 commits)")[![eleanorshakeshaft](https://avatars.githubusercontent.com/u/5039349?v=4)](https://github.com/eleanorshakeshaft "eleanorshakeshaft (22 commits)")[![richmccartney](https://avatars.githubusercontent.com/u/1201618?v=4)](https://github.com/richmccartney "richmccartney (3 commits)")

---

Tags

moneyecommerceordersproductscogmothershiporder

### Embed Badge

![Health badge](/badges/mothership-ec-cog-mothership-ecommerce/health.svg)

```
[![Health](https://phpackages.com/badges/mothership-ec-cog-mothership-ecommerce/health.svg)](https://phpackages.com/packages/mothership-ec-cog-mothership-ecommerce)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[kartik-v/yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.

803.2M30](/packages/kartik-v-yii2-dynagrid)[sylius/product-bundle

Product catalog for your Symfony applications.

16347.5k17](/packages/sylius-product-bundle)[tomatophp/filament-ecommerce

Build your own ecommerce store with FilamentPHP with the Power of Tomato CMS Builder

984.5k1](/packages/tomatophp-filament-ecommerce)[sylius/order-bundle

Sales order management for Symfony applications.

11439.5k12](/packages/sylius-order-bundle)[sylius/taxation-bundle

Flexible taxation system for Symfony ecommerce applications.

17344.3k5](/packages/sylius-taxation-bundle)

PHPackages © 2026

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