PHP code example of eoler / omnipay-corvuspay

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

    

eoler / omnipay-corvuspay example snippets


    use Omnipay\Omnipay;

    $gateway = Omnipay::create('CorvusPay');
    $gateway->initialize([
        'apiKey'   => env('API_KEY'),
        'storeId'  => env('STORE_ID'),
        'testMode' => env('APP_DEBUG'),
        'language' => \App::getLocale(),
    ]);

    $response = $gateway->purchase([
        'transactionId' => $order->id,
        'amount'      => $order->amount,
        'currency'    => $order->currencyCode,
        'description' => $order->products->list(),
        'email'       => $order->customer->email,
    ])->send();
    return $response->getRedirectResponse();

    $gateway = Omnipay::create('CorvusPay');
    $gateway->initialize([
        'apiKey'   => env('API_KEY'),
        'storeId'  => env('STORE_ID'),
        'testMode' => env('APP_DEBUG'),
        'language' => \App::getLocale(),
    ]);

    $purchase = $gateway->completePurchase()->send();   
    if ($purchase->isSuccessful()) {
        // Bookkeeping: save completed status, etc.
    }