PHP code example of arbory / omnipay-everypay

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

    

arbory / omnipay-everypay example snippets


$gateway = Omnipay::create('EveryPay')->initialize([
  'username' => '', // EveryPay api username
  'secret' => '', // EveryPay api secret
  'accountName' => '', // merchant account name
  'gatewayUrl' => 'https://igw-demo.every-pay.com/api/v3', // use merchant provided url for production
]);

$authorize = $gateway
    ->authorize([
      'amount' => '1.28',
      'transactionId' => uniqid(),
      'email' => '[email protected]',
      'customerIp' => '1.2.3.4',
      'callbackUrl' => 'https://shop.example.com/cart',
      'customerUrl' => 'https://shop.example.com/cart'
    ]);

$response = $authorize->send();

// Gateway transaction reference
$response->getTransactionReference();

return $response->redirect(); // this will call redirect to payment portal

// Here, pass the payment array that we previously stored when creating the payment
$response = $gateway->completeAuthorize(['transactionReference' => 'foo')->send();

if ($response->isSuccessful()) {
  // Payment succeeded!
}

// Payment succeeded!
// Here's your payment reference number: $response->getTransactionReference()