PHP code example of gtsvetanov / omnipay-raiffeisen

1. Go to this page and download the library: Download gtsvetanov/omnipay-raiffeisen 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/ */

    

gtsvetanov / omnipay-raiffeisen example snippets


$gateway = Omnipay::create('Raiffeisen');

$gateway->setMerchantId($config['merchantId'])
    ->setTerminalId($config['terminalId'])
    ->setPrivateKey($config['privateKey'])
    ->setCurrency($config['currency'])
    ->setTestMode($config['testMode'])
    ->setGatewayCertificate($config['production_gateway_certificate']);

$response = $gateway->purchase(
    [
        'TotalAmount' => 100,
        'OrderID' => 'OrderID',
    ]
)->send();

// Process response
if ($response->isSuccessful()) {
    // Payment was successful
    print_r($response);
} elseif ($response->isRedirect()) {
    // Redirect to offsite payment gateway
    $response->redirect();
} else {
    // Payment failed
    echo $response->getMessage();
}

$response = $gateway->completePurchase()->send();

print_r($response->getData());
print_r($response->isSuccessful());
print_r($response->getCode());
print_r($response->getTransactionReference());


$response = $gateway->refund([
    'TotalAmount' => 100,
    'RefundAmount' => 100,
    'OrderID' => 'OrderID',
    'Rrn' => 'Rrn',
    'ApprovalCode' => 'ApprovalCode',
])->send();

print_r($response->getData());
print_r($response->isSuccessful());
print_r($response->getCode());
print_r($response->getMessage());


$response = $gateway->fetchTransaction([
    'TotalAmount' => 100,
    'OrderID' => 'OrderID',
    'PurchaseTime' => 'PurchaseTime',
])->send();

print_r($response->getData());
print_r($response->isSuccessful());
print_r($response->isReversal());
print_r($response->getCode());
print_r($response->getMessage());
print_r($response->getTransactionReference());


$response = $gateway->acceptNotification()->send();

print_r($response->getData());
print_r($response->isSuccessful());
print_r($response->getCode());
print_r($response->getMessage());
print_r($response->getTransactionReference());
print_r($response->getTransactionStatus());
print_r($response->getBody());


$response = $gateway->payByToken([
    'TotalAmount' => 100,
    'OrderID' => 'OrderID',
    'UPCToken' => 'UPCToken',
])->send();

print_r($response->getData());
print_r($response->isSuccessful());
print_r($response->getCode());
print_r($response->getMessage());
print_r($response->getTransactionReference());
print_r($response->getTransactionStatus());
print_r($response->getBody());