PHPackages                             simtecsystem/cakephp-sofortcom-plugin - 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. simtecsystem/cakephp-sofortcom-plugin

ActiveCakephp-plugin[Payment Processing](/categories/payments)

simtecsystem/cakephp-sofortcom-plugin
=====================================

CakePHP Sofort.com payment plugin

v2.0(5y ago)04GPL-2.0PHP

Since Sep 13Pushed 3y agoCompare

[ Source](https://github.com/simtecsystem/CakePHP-SofortCom-Plugin)[ Packagist](https://packagist.org/packages/simtecsystem/cakephp-sofortcom-plugin)[ Docs](https://github.com/hakito/CakePHP-SofortCom-Plugin)[ RSS](/packages/simtecsystem-cakephp-sofortcom-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/cc6eb60596f5799d518109cd3bc62ffe0275a401412f9a2059362e39c45a4daa/68747470733a2f2f706f7365722e707567782e6f72672f68616b69746f2f63616b657068702d736f666f7274636f6d2d706c7567696e2f762f737461626c652e737667)](https://packagist.org/packages/hakito/cakephp-sofortcom-plugin) [![Total Downloads](https://camo.githubusercontent.com/6c6bd962e9d4d6eabaa4d311c5536db841b247ab56500edd104fb52faa456cef/68747470733a2f2f706f7365722e707567782e6f72672f68616b69746f2f63616b657068702d736f666f7274636f6d2d706c7567696e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/hakito/cakephp-sofortcom-plugin) [![Latest Unstable Version](https://camo.githubusercontent.com/2e3d33a95240b67362e95eab60d874d479893aafde84147ecdf25ac670473c48/68747470733a2f2f706f7365722e707567782e6f72672f68616b69746f2f63616b657068702d736f666f7274636f6d2d706c7567696e2f762f756e737461626c652e737667)](https://packagist.org/packages/hakito/cakephp-sofortcom-plugin) [![License](https://camo.githubusercontent.com/12bd17d88c33560627ec136ae21f1b1bc644137c76f104e60a3693e0ef4d98a1/68747470733a2f2f706f7365722e707567782e6f72672f68616b69746f2f63616b657068702d736f666f7274636f6d2d706c7567696e2f6c6963656e73652e737667)](https://packagist.org/packages/hakito/cakephp-sofortcom-plugin)

CakePHP-SofortCom-Plugin
========================

[](#cakephp-sofortcom-plugin)

[![Build Status](https://camo.githubusercontent.com/b0d5a259e8efbc8c280e053195db0f295da723e6a0dc05b581733b897899933a/68747470733a2f2f7472617669732d63692e6f72672f68616b69746f2f43616b655048502d536f666f7274436f6d2d506c7567696e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hakito/CakePHP-SofortCom-Plugin)[![Coverage Status](https://camo.githubusercontent.com/b087e3230a64c91a485378697298921fee454eed4e0a34a6e3f3a15938fa6f70/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f68616b69746f2f43616b655048502d536f666f7274436f6d2d506c7567696e2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/hakito/CakePHP-SofortCom-Plugin?branch=master)

CakePHP 4.x Sofort.com payment plugin

Installation
============

[](#installation)

If you are using composer simply add the plugin using the command

```
composer require hakito/sofortcom-plugin
```

Otherwise download the plugin to app/Plugin/SofortCom. Add a PSR-4 compatible autoloader to your bootstrap.

Load the plugin in your bootstrap:

```
public function bootstrap()
{
    // Call parent to load bootstrap from files.
    parent::bootstrap();

    $this->addPlugin(\SofortCom\Plugin::class, ['routes' => true]);
}
```

Creating tables
===============

[](#creating-tables)

Create the database tables with the following command:

```
bin/cake migrations migrate -p SofortCom
```

Configuration
=============

[](#configuration)

In your app.local.php add an entry for SofortCom

```
[
  'SofortCom' => [
    // enter your configuration key
    // you only can create a new configuration key by
    // creating a new Gateway project in your account at sofort.com
    'configkey' => 'dummy:key',

    // Encryption key for sending encrypted data to SofortCom
    'encryptionKey' => 'A_SECRET_KEY_MUST_BE_32_BYTES_LONG',

    // Default CurrencyCode.
    // You can override this when preparing the payment request.
    'currency' => 'EUR',

    // The conditions are used if you use the
    // SofortlibComponent::NeutralizeFee function
    'conditions' => [
        'fee' => 25,              // sofort.com fixed fee in cents
        'fee_relative' => '0.009' // relative sofort.com fee
    ]
  ]
];
```

Usage
=====

[](#usage)

In your payment handling controller:

```
    // Load the component
    public function initialize()
    {
        parent::initialize();
        $this->loadComponent('SofortCom.Sofortlib');
    }

    // Sample checkout
    private function _checkoutSofortCom($orderId)
    {
        $this->Sofortlib->setAmount(12.34);
        $this->Sofortlib->setCurrencyCode('EUR');
        $this->Sofortlib->setReason('Buying Great Stuff', 'Order ' . $orderId); // Displayed as payment reason to the user
        $this->Sofortlib->setSuccessUrl('http://your-shop.example.com/success'); // The URL your clients are redirected upon success
        $this->Sofortlib->setAbortUrl('http://your-shop.example.com/abort'); // The URL your clients are redirected upon abort
        $this->Sofortlib->setShopId($orderId);

        try
        {
            $this->Sofortlib->PaymentRedirect();
        } catch (SofortLibException $ex) {
            Log::error(sprintf('SofortCom payment redirect errors: "%s"', var_export($ex->errors, true)));
            $this->Flash->set(__('Could not redirect to online banking (Error {0}). Please choose another payment method.', $ex->getMessage()));
            return $this->redirect('http://your-shop.example.com/recover');
        }
    }
```

Event handlers
--------------

[](#event-handlers)

You must implement at least the following eventhandler:

### SofortCom.Notify

[](#sofortcomnotify)

```
\Cake\Event\EventManager::instance()->on('SofortCom.Notify',
function ($event, $args)
{
  // $args =
  // [
  //   'shop_id' => 'order123',                   // Some id defined by you upon payment initialization
  //   'notifyOn' => 'pending',                   // SofortCom notification URL suffix
  //   'transaction' => '99999-53245-5483-4891',  // SofortCom transaction id
  //   'time' => '2010-04-14T19:01:08+02:00',     // SofortCom timestamp of notification
  //   'data' => {object},                        // Instance of Sofort\SofortLib\TransactionData
  // ]

  return ['handled' => true]; // If you don't set the handled flag to true
                              // the plugin will throw an UnhandledNotificationException
});
```

### SofortCom.NewTransaction

[](#sofortcomnewtransaction)

This event is optional and fired before the user is redirected to the payment URL. It provides the following arguments:

```
$args =
[
  'transaction' => '99999-53245-5483-4891',    // SofortCom transaction id
  'payment_url' => 'http://sofort.com/example' // SofortCom payment redirect url
]
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity67

Established project with proven stability

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

Total

4

Last Release

2158d ago

Major Versions

v1.1.1 → v2.02020-06-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fa21215cfd3df464f376b331dd62e00a635bd7ed46e3567437ee480b676df61?d=identicon)[simtecsystem](/maintainers/simtecsystem)

---

Top Contributors

[![hakito](https://avatars.githubusercontent.com/u/320853?v=4)](https://github.com/hakito "hakito (42 commits)")

---

Tags

cakephppaymentsofortcom

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/simtecsystem-cakephp-sofortcom-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/simtecsystem-cakephp-sofortcom-plugin/health.svg)](https://phpackages.com/packages/simtecsystem-cakephp-sofortcom-plugin)
```

###  Alternatives

[alexanderpoellmann/paymentfont

PaymentFont - A sleek webfont for your favourite payment operators and methods

1.6k1.1k](/packages/alexanderpoellmann-paymentfont)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

154.6k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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