PHP code example of lokielse / laravel-omnipay

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

    

lokielse / laravel-omnipay example snippets


'providers' => [

	'Ignited\LaravelOmnipay\LaravelOmnipayServiceProvider',

]

	'Omnipay' => 'Ignited\LaravelOmnipay\Facades\OmnipayFacade',

$app->register(Ignited\LaravelOmnipay\LumenOmnipayServiceProvider::class);

$app->configure('laravel-omnipay');

$cardInput = [
	'number'      => '4444333322221111',
	'firstName'   => 'MR. WALTER WHITE',
	'expiryMonth' => '03',
	'expiryYear'  => '16',
	'cvv'         => '333',
];

$card = Omnipay::creditCard($cardInput);
$response = Omnipay::purchase([
	'amount'    => '100.00',
	'returnUrl' => 'http://bobjones.com/payment/return',
	'cancelUrl' => 'http://bobjones.com/payment/cancel',
	'card'      => $cardInput
])->send();

dd($response->getMessage());

Omnipay::setGateway('eway');

$response = Omnipay::purchase([
	'amount' => '100.00',
	'card'   => $cardInput
])->send();

dd($response->getMessage());

$gateway = Omnipay::gateway('eway');