PHP code example of bummzack / omnipay-postfinance
1. Go to this page and download the library: Download bummzack/omnipay-postfinance library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bummzack / omnipay-postfinance example snippets
$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();