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

ActiveLibrary[Payment Processing](/categories/payments)

wysow/postfinance
=================

3.2.0(6y ago)226.6k↓29.2%83PHPPHP &gt;=5.3

Since Apr 14Pushed 6y ago3 watchersCompare

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

READMEChangelog (5)Dependencies (3)Versions (18)Used By (3)

PostFinance PHP library
=======================

[](#postfinance-php-library)

This library allows you to easily implement an [PostFinance](https://www.postfinance.ch/) integration into your project. It provides the necessary components to complete a correct payment flow with the [PostFinance](https://www.postfinance.ch/) platform.

Requirements:

- PHP 5.3+
- network connection between your webserver and the PostFinance platform

As always, this is work in progress. Please feel free to fork this project and get those pull requests coming!

Installation:
-------------

[](#installation)

The library is [PSR-4 compliant](http://www.php-fig.org/psr/psr-4/)and the simplest way to install it is via composer:

```
composer require wysow/postfinance

```

Overview
--------

[](#overview)

- Create an EcommercePaymentRequest or CreateAliasRequest, containing all the info needed by PostFinance.
- Generate a form
- Submit it to PostFinance (client side)
- Receive a PaymentResponse back from PostFinance (as a HTTP Request)

Both EcommercePaymentRequest, CreateAliasRequest and PaymentResponse are authenticated by comparing the SHA sign, which is a hash of the parameters and a secret passphrase. You can create the hash using a ShaComposer.

The library also allows:

- Fetching order information via PostFinance API using DirectLinkQueryRequest
- Executing maintenance request via PostFinance API using DirectLinkMaintenanceRequest

SHA Composers
=============

[](#sha-composers)

PostFinance provides 2 methods to generate a SHA sign:

- "Main parameters only"

    [![Main parameters only](http://github.com/marlon-be/marlon-ogone/raw/master/documentation/images/ogone_security_legacy.png)](http://github.com/marlon-be/marlon-ogone/raw/master/documentation/images/ogone_security_legacy.png)

    Implementation using this library is trivial:

```
