PHP code example of behzadbabaei / omnipay-payop

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

    

behzadbabaei / omnipay-payop example snippets


    use Omnipay\Omnipay;


    $gateway = Omnipay::create('Payop');
    $gateway->setAccessToken('Access-Token');
    $gateway->setLanguage('EN'); // Language



         $purchase = $gateway->purchase();
         $purchase->setAmount(12.12);
         $result = $purchase->send()->getData();



         $result1 = $gateway->purchase([
              'amount'      => 12.12,
              'currency'    => 'USD',
              'description' => 'order test',
         ])->send()->getData();



        $fetch = $gateway->fetchTransaction();
        $fetch->setOrderId(1);
        $result1 = $fetch->send()->getData();



        $result = $gateway->fetchTransaction([
            'orderId'                => 1,
        ])->send()->getData();