PHP code example of byjg / omnipay-komerci
1. Go to this page and download the library: Download byjg/omnipay-komerci 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/ */
byjg / omnipay-komerci example snippets
// Setup payment gateway
$gateway = Omnipay::create('Komerci');
$gateway->setApiKey('00000000');
$gateway->setUsername('user');
$gateway->setPassword('pass');
$gateway->setTestMode(true);
// Example form data
$formData = [
'name' => 'Joao Magalhaes',
'number' => '4242424242424242',
'expiryMonth' => '6',
'expiryYear' => '2016',
'cvv' => '123'
];
// Send purchase request
$response = $gateway->purchase(
[
'amount' => '10.00',
'transactionId' => '1234',
'card' => $formData,
]
)->send();