Download the PHP package wysow/postfinance without Composer
On this page you can find all versions of the php package wysow/postfinance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package postfinance
PostFinance PHP library
This library allows you to easily implement an PostFinance integration into your project. It provides the necessary components to complete a correct payment flow with the PostFinance 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:
The library is PSR-4 compliant and the simplest way to install it is via composer:
composer require wysow/postfinance
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
PostFinance provides 2 methods to generate a SHA sign:
-
"Main parameters only"
Implementation using this library is trivial:
-
"Each parameter followed by the passphrase"
Implementation using this library is trivial:
This library currently supports both the legacy method "Main parameters only" and the new method "Each parameter followed by the passphrase". Either can be used with SHA-1 (default), SHA-256 or SHA-512 encryption.
EcommercePaymentRequest and FormGenerator
CreateAliasRequest
DirectLinkPaymentRequest
DirectLinkQueryRequest
DirectLinkQueryRequest
DirectLinkMaintenanceRequest
EcommercePaymentResponse
CreateAliasResponse
DirectLinkPaymentResponse
As the DirectLink payment gets an instant feedback from the server (and no async response) we don't use the SHA validation.
Parameter filters
ParameterFilters are used to filter the provided parameters (no shit Sherlock). Both ShaIn- and ShaOutParameterFilters are provided and are based on the parameter lists defined in the PostFinance documentation. Parameter filtering is optional, but we recommend using them to enforce expected parameters.