PHP code example of maciejmiara / omnipay-checkoutcom

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

    

maciejmiara / omnipay-checkoutcom example snippets


$response = $gateway->purchase(['amount' => $amount, 'currency' => $currency])->send();
if ($response->isRedirect()) {
    $token = $response->getTransactionReference();
}

$response = $gateway->completePurchase(['amount' => $amount, 'transactionReference' => $token])->send();
if ($response->isSuccessful()) {
    // approve Order
}