PHP code example of royalcms / omnipay

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

    

royalcms / omnipay example snippets


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

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

dd($response->getMessage());

RC_Omnipay::setGateway('eway');

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

dd($response->getMessage());

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