PHP code example of uskur / omnipay-pelecard

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

    

uskur / omnipay-pelecard example snippets


use Omnipay\Omnipay;

$gateway = Omnipay::create('Pelecard_Iframe');
$gateway->setUser(getenv('PELECARD_USER'));
$gateway->setPassword(getenv('PELECARD_PASSWORD'));
$gateway->setTerminal(getenv('PELECARD_TERMINAL'));

$response = $gateway->purchase([
    'transactionId' => 'order-123',
    'amount' => '100.00',
    'currency' => 'ILS',
    'card' => $card,
    'returnUrl' => 'https://merchant.example/payments/return',
    'cancelUrl' => 'https://merchant.example/payments/cancel',
])->send();

if ($response->isRedirect()) {
    $response->redirect();
}

$gateway->setTestMode(true);
$gateway->setTestUser(getenv('PELECARD_TEST_USER'));
$gateway->setTestPassword(getenv('PELECARD_TEST_PASSWORD'));
$gateway->setTestTerminal(getenv('PELECARD_TEST_TERMINAL'));

$status = $gateway->status([
    'transactionReference' => $transactionReference,
])->send();