PHPackages                             weareplanet/plugin-core - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. weareplanet/plugin-core

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

weareplanet/plugin-core
=======================

Core functionality for the WeArePlanet plugins.

0.2.3(2w ago)02581Apache-2.0PHPPHP &gt;=8.2CI failing

Since Apr 2Pushed 1mo agoCompare

[ Source](https://github.com/weareplanet/plugin-core)[ Packagist](https://packagist.org/packages/weareplanet/plugin-core)[ RSS](/packages/weareplanet-plugin-core/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (28)Versions (12)Used By (1)

WeArePlanet Plugin Core Library
===============================

[](#weareplanet-plugin-core-library)

**The canonical, framework-agnostic business logic engine for WeArePlanet payment integrations.**

This library abstracts the complexity of the WeArePlanet SDK and provides a standardized, robust implementation of payment flows. It is designed to be used as a core dependency by platform-specific plugins (Magento, WooCommerce, Shopware, etc.), decoupling **business logic** from **platform infrastructure**.

---

Core Philosophy
---------------

[](#core-philosophy)

The goal of this project is to centralize all payment business logic into a single, reusable library, decoupling it from the specific constraints of platforms like Magento or WooCommerce.

Instead of duplicating complex logic across different shop systems, `plugin-core` implements the payment workflows once, using pure PHP. This shifts the role of the shop-specific plugin:

- **Plugin Core:** Implements the business logic, manages state machines, and handles all API interactions via the SDK.
- **Shop Plugin:** Acts as an **adapter**. It interchanges data between the shop and the Core, handles database persistence, manages configuration, and integrates into the shop's frontend/backend events.

### Key Architectural Benefits

[](#key-architectural-benefits)

- **Pure PHP:** Framework-agnostic code that runs anywhere PHP runs.
- **Minimal Dependencies:** Depends only on the official `weareplanet/php-sdk`, making it lightweight and easy to port to any environment.
- **Type Safety:** Written with strict typing to catch errors early.
- **Testability:** Designed for 100% unit test coverage with isolated components.
- **PSR Standards:** Fully compliant with PSR-3 (Logging) and other standard interfaces.
- **Contract-Driven:** Clear Interfaces and Abstract Base Classes guide developers to implement the necessary platform-specific adapters correctly.

---

Key Features
------------

[](#key-features)

The library is divided into major functional components, each designed for robustness and ease of integration.

### 1. Checkout Engine

[](#1-checkout-engine)

The core of the payment flow. Handles transaction creation and management with a sophisticated "upsert" strategy, ensuring seamless navigation without duplicate charges.

- **[Read Checkout Docs](docs/Checkout/README.md)**

### 2. Webhook Processor

[](#2-webhook-processor)

The engine for handling asynchronous events from the WeArePlanet Portal. It's built for scale and high concurrency.

- **[Read Webhook Processor Docs](docs/Webhook/Processor/README.md)**

### 3. Webhook Management

[](#3-webhook-management)

Tools for programmatically managing webhooks in the WeArePlanet Portal, including URL creation and Listener setup.

- **[Read Webhook Management Docs](docs/Webhook/Management/README.md)**

### 4. Transaction Completion (Capture &amp; Void)

[](#4-transaction-completion-capture--void)

Manage the final stages of the transaction lifecycle. Finalize payments (Capture) or cancel them (Void) with dedicated service handlers.

- **[Read Completion Docs](docs/Completion/README.md)**

### 5. Recurring Payments

[](#5-recurring-payments)

Enables Merchant Initiated Transactions (MIT) for seamless subscription renewals and unscheduled subsequent charges using saved tokens.

- **[Read Recurring Docs](docs/Recurring/README.md)**

### 6. Refund Management

[](#6-refund-management)

Support for full and partial refunds. Includes precise line-item logic and validation to prevent over-refunding.

- **[Read Refund Docs](docs/Refund/README.md)**

### 7. Document Management

[](#7-document-management)

Retrieve official PDF documents (Invoices, Packing Slips, Credit Notes) directly from the WeArePlanet Portal for the merchants.

- **[Read Document Docs](docs/Document/README.md)**

### 8. Payment Method Service

[](#8-payment-method-service)

A centralized service to fetch available payment method configurations from the WeArePlanet Portal, ensuring the shop systems have an up-to-date view of available payment methods.

- **[Read Payment Method Docs](docs/PaymentMethod/README.md)**

---

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

[](#documentation)

For a detailed look at how to implement each module, refer to the guides in the `docs/` directory:

- **[Checkout &amp; Transaction Flow](docs/Checkout/README.md)**: Handling the initial payment process.
- **[Webhook Integration](docs/Webhook/README.md)**: Master guide for both Processing and Management.
- **[Webhook Processor](docs/Webhook/Processor/README.md)**: Detailed guide for handling incoming notifications.
- **[Webhook Management](docs/Webhook/Management/README.md)**: Programmatic setup of listeners in the WeArePlanet Portal.
- **[Transaction Completion](docs/Completion/README.md)**: Capturing and voiding authorized transactions.
- **[Recurring Charges](docs/Recurring/README.md)**: Implementing tokenized subsequent payments.
- **[Refund Process](docs/Refund/README.md)**: Managing customer returns and credit notes.
- **[Official Documents](docs/Document/README.md)**: Downloading invoices and other PDF assets.
- **[Payment Method Service](docs/PaymentMethod/README.md)**: Retrieving and synchronizing payment methods configurations.

---

Examples
--------

[](#examples)

For a runnable example for each of the modules, refer to the `examples` subdirectories in each of the module directories.

- **[Checkout &amp; Transaction Flow](docs/Checkout/examples/)**: Handling the initial payment process.
- **[Webhook Processor](docs/Webhook/Processor/example/)**: Simulating state transitions and concurrent processing.
- **[Webhook Management](docs/Webhook/Management/example/)**: Lifecycle management (CLI scripts).
- **[Transaction Completion](docs/Completion/examples/)**: Capturing and voiding authorized transactions.
- **[Recurring Charges](docs/Recurring/examples/)**: Implementing tokenized subsequent payments.
- **[Refund Process](docs/Refund/examples/)**: Managing customer returns and credit notes.
- **[Official Documents](docs/Document/examples/)**: Downloading invoices and other PDF assets.
- **[Payment Method Service](docs/PaymentMethod/examples/)**: Retrieving and synchronizing payment methods configurations.

---

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

[](#installation)

```
composer require weareplanet/plugin-core
```

---

Unit Tests
----------

[](#unit-tests)

You can run the test suite to verify the library's behavior.

```
composer test
```

License
-------

[](#license)

Apache License. See \[LICENSE.txt\].

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance93

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~8 days

Total

11

Last Release

14d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79ce1a833759c18051edb71ae575a0cf5ac10625ae6cad91d0509b9da246488f?d=identicon)[andrewrowanwallee](/maintainers/andrewrowanwallee)

---

Top Contributors

[![alberto-wallee](https://avatars.githubusercontent.com/u/109144904?v=4)](https://github.com/alberto-wallee "alberto-wallee (5 commits)")[![aferri0](https://avatars.githubusercontent.com/u/98815683?v=4)](https://github.com/aferri0 "aferri0 (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/weareplanet-plugin-core/health.svg)

```
[![Health](https://phpackages.com/badges/weareplanet-plugin-core/health.svg)](https://phpackages.com/packages/weareplanet-plugin-core)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k122](/packages/oat-sa-tao-core)

PHPackages © 2026

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