PHPackages                             offline/postfinance - 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. offline/postfinance

AbandonedArchivedLibrary[Payment Processing](/categories/payments)

offline/postfinance
===================

Helper class to work with the PostFinance e-payment system

v1.0.1(8y ago)3852MITPHP

Since Aug 6Pushed 8y ago3 watchersCompare

[ Source](https://github.com/OFFLINE-GmbH/postfinance)[ Packagist](https://packagist.org/packages/offline/postfinance)[ RSS](/packages/offline-postfinance/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

PostFinance e-payment helper class
==================================

[](#postfinance-e-payment-helper-class)

This class helps to implement basic e-commerce features from PostFinance Switzerland. The implementation follows the [official documentation](https://e-payment.postfinance.ch/Ncol/PostFinance_e-Com-BAS_DE.pdf).

Install it
----------

[](#install-it)

```
composer require 'offline/postfinance'

```

Use it
------

[](#use-it)

See `index.php` for an example.

Define your parameters as an array. Get your SHA-IN signature at hand. Initialize a class instance and pass your parameter array to `setParamList`.

```
$shaInSignature = 'Configuration -> Technical information -> Data and origni verification -> SHA-IN pass phrase';
$params = [
    'PSPID'        => 'your-postfinance-username',
    'ORDERID'      => '1234',
    'AMOUNT'       => '200' * 100,
    'CURRENCY'     => 'CHF',
    'LANGUAGE'     => 'de_CH',
];

$postfinance = new Offline\PaymentGateways\PostFinance($shaInSignature);
$postfinance->setParamList($params);
```

In your view file call `getFormFields` wherever you want to output the hidden input fields.

```

```

### Using different algorithms

[](#using-different-algorithms)

To use SHA256 or SHA512 algorithms, simply pass the php MHASH constant as second parameter:

```
$postfinance256 = new Offline\PaymentGateways\PostFinance($shaInSignature, 'sha256');
$postfinance512 = new Offline\PaymentGateways\PostFinance($shaInSignature, 'sha512');
```

### Validating SHA-OUT signatures

[](#validating-sha-out-signatures)

Make sure you have the option `I would like to receive transaction feedback parameters on the redirection URLs.` under `Transaktion feedback` enabled.

```
$shaOutSignature = 'Configuration -> Transaction feedback -> SHA-OUT pass phrase';
$shaSign = isset($_GET['SHASIGN']) ? $_GET['SHASIGN'] : '';

$postfinance = new PostFinance($shaOutSignature);
$postfinance->setParamList($_GET);

$isValid = $postfinance->getDigest() === $shaSign;

var_dump($isValid);
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

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

Total

2

Last Release

3277d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8600029?v=4)[Tobias Kündig](/maintainers/tobias-kuendig)[@tobias-kuendig](https://github.com/tobias-kuendig)

---

Top Contributors

[![tobias-kuendig](https://avatars.githubusercontent.com/u/8600029?v=4)](https://github.com/tobias-kuendig "tobias-kuendig (3 commits)")

### Embed Badge

![Health badge](/badges/offline-postfinance/health.svg)

```
[![Health](https://phpackages.com/badges/offline-postfinance/health.svg)](https://phpackages.com/packages/offline-postfinance)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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