PHP code example of digitickets / omnipay-payyo

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

    

digitickets / omnipay-payyo example snippets


$gateway = Omnipay::create('Payyo');
$gateway->setApiKey('api_...');
$gateway->setSecretKey('sec_...');
$gateway->setMerchantId('1234');
$gateway->setTestMode(true);

// Send purchase request
$response = $gateway->purchase([
    'transactionId' => '123456',
    'description' => '1x Book',
    'amount' => '10.00',
    'currency' => 'USD',
    'paymentMethods' => ['credit_card'],    
    'returnUrl' => 'https://example.org/success',
    'cancelUrl' => 'https://example.org/abort',
])->send();

// This is a redirect gateway, so redirect right away
$response->redirect();