PHPackages                             postfinancecheckout/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. postfinancecheckout/plugin-core

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

postfinancecheckout/plugin-core
===============================

Core functionality for the PostFinanceCheckout plugins.

0.2.0(1mo ago)091Apache-2.0PHPPHP &gt;=8.2

Since Feb 13Pushed 3mo agoCompare

[ Source](https://github.com/pfpayments/plugin-core)[ Packagist](https://packagist.org/packages/postfinancecheckout/plugin-core)[ RSS](/packages/postfinancecheckout-plugin-core/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (11)Versions (5)Used By (1)

PostFinanceCheckout Plugin Core Library
=======================================

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

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

This library abstracts the complexity of the PostFinanceCheckout 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 `postfinancecheckout/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.

### 1. Webhook Processing

[](#1-webhook-processing)

A robust engine for handling asynchronous events from the PostFinanceCheckout Portal. It is designed to handle **high-concurrency** environments and **out-of-order** delivery without data corruption.

- **Self-Healing State Machine:** Automatically detects missing or out-of-order webhooks and "catches up" the local state to match the remote reality.
- **Concurrency Safe:** Implements a sophisticated, two-stage locking strategy (Entity + Resource) to prevent race conditions between different webhook types modifying the same order.
- **Idempotent:** Intelligently handles duplicate events without redundant processing.
- **Data Integrity Guard:** Enforces "Safe Updates" by checking for protected states (e.g., preventing an automated process from overwriting a manual review status).

### 2. Portal Synchronization (Planned)

[](#2-portal-synchronization-planned)

*Future implementation.*

### 3. Transaction Management (Planned)

[](#3-transaction-management-planned)

*Future implementation.*
------------------------

[](#future-implementation)

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

[](#documentation)

### 1. Webhook Processing

[](#1-webhook-processing-1)

Everything you need to implement the robust, concurrent-safe webhook engine.

- **[Integration Guide](docs/Webhook/README.md):** A step-by-step guide to implementing the `WebhookProcessor` and its required adapters.
- **[Architecture Overview](docs/Webhook/ARCHITECTURE.md):** A deep dive into the concurrency, locking, and state management strategies.
- **[Running Example](docs/Webhook/example/):** A complete, runnable PHP implementation (CLI) showing how to wire up the Processor, Lifecycle Handler, and Commands. Use this as a reference blueprint before diving into a complex shop integration.

---

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

[](#installation)

```
composer require postfinancecheckout/plugin-core
```

---

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

[](#unit-tests)

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

```
composer test
```

License
-------

[](#license)

\[License Information Here\]

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance85

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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 ~16 days

Total

4

Last Release

46d 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 (1 commits)")[![andrewrowanwallee](https://avatars.githubusercontent.com/u/73881084?v=4)](https://github.com/andrewrowanwallee "andrewrowanwallee (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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