PHP code example of thiio / exigo-php-sdk

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

    

thiio / exigo-php-sdk example snippets


 public function it_should_process_a_transaction(){

        $customer = $this->buildCustomerBlueprint();
        $customerTransaction = new Transaction();
        $customerTransaction->setName("CreateCustomerRequest");
        foreach($customer as $key => $value){
            $customerTransaction->addParameter($key,$value);
        }

        $order    = $this->buildOrderBlueprint();
        $orderTransaction = new Transaction();
        $orderTransaction->setName("CreateOrderRequest");
        foreach($order as $key => $value){
            $orderTransaction->addParameter($key,$value);
        }

        $charge   = $this->buildChargeCreditCardTokenBlueprint();
        $chargeTransaction = new Transaction();
        $chargeTransaction->setName("ChargeCreditCardTokenRequest");
        foreach($charge as $key => $value){
            $chargeTransaction->addParameter($key,$value);
        }

        $processTransaction = new ProcessTransaction();
        $processTransaction->addTransactions([$customerTransaction,$orderTransaction, $chargeTransaction]);

        $client = new ExigoApi($_ENV["TEST_USER"],$_ENV["TEST_PASSWORD"],$_ENV["TEST_COMPANY"]);
        
        $response = $client->processTransaction($processTransaction);

        $this->assertFalse($response->success);

    }
bash
composer