bummzack / omnipay-postfinance
Postfinance Gateway for the Omnipay payment processing library
Installs: 48 256
Dependents: 2
Suggesters: 1
Security: 0
Stars: 6
Watchers: 2
Forks: 5
Open Issues: 4
Requires
- guzzlehttp/guzzle: ^6.3||^7.0
- league/omnipay: ^3
- omnipay/common: ^3.0
Requires (Dev)
- omnipay/tests: ^3.0
README
Postfinance Gateway for the Omnipay PHP payment processing library.
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+.
This Gateway implements offsite payments via Postfinance. Purchase and Authorization are available, capturing an authorized payment has to be performed via Postfinance backend (not currently implemented for this Gateway).
Please note: This gateway cannot successfully complete your requests if you don't use an SHA-OUT signature. If you don't set the SHA-OUT signature in the Postfinance backend, callback URLs won't be supplied with any parameters, which makes it impossible to determine success or failure of a payment-request.
Installation
Omnipay can be installed using Composer. Installation instructions.
Run the following command to install omnipay and the postfinance gateway:
composer require bummzack/omnipay-postfinance ~1.0
Configuration in the Postfinance Backend
This is the easiest way to setup your Postfinance account to work with the Omnipay Gateway:
- In the Global Security Parameters tab, choose Each parameter followed by the passphrase. as the way to hash parameters.
- The Hash algorithm can be chosen freely, but must be supplied as
hashingMethod
parameter to the gateway if you're using anything else than the default (sha1
) - Make sure to supply an SHA-IN pass phrase in the Data and origin verification tab
- Under Transaction feedback, make sure to check I would like to receive transaction feedback parameters on the redirection URLs and supply a SHA-OUT pass phrase.
Basic Usage
Payment requests to the Postfinance Gateway must at least supply the following parameters:
pspId
Your postfinance account IDtransactionId
unique transaction IDamount
monetary amountcurrency
currencylanguage
locale code indicating the customer language preference, example:en_US
It is highly recommended to use SHA-IN and -OUT signatures for your requests.
$gateway = Omnipay::create('Postfinance'); $gateway->setPspId('myPspId'); $gateway->setShaIn('MyShaInSecret'); $gateway->setShaOut('MyShaOutSecret'); $gateway->setLanguage('de_DE'); // Send purchase request $response = $gateway->purchase( [ 'transactionId' => '17', 'amount' => '10.00', 'currency' => 'CHF' ] )->send(); // This is a redirect gateway, so redirect right away $response->redirect();