PHP code example of kayzorelabs / omnipay-checkoutcom

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

    

kayzorelabs / 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
}

$response = $gateway->cardTokenPurchase([
    'amount' => $amount, 
    'currency' => $currency, 
    'email' => '[email protected]', 
    'cardToken' => 'some_token', 
    'description' => 'some nice description'
]);