PHP code example of maher1337 / vopay-php-sdk

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

    

maher1337 / vopay-php-sdk example snippets


use PaymentProcessor\VoPay\VoPay;

$client = new VoPay('account_id', 'api-key', 'api_secret');

$account = $client->account();

$account = $client->electronicFundsTransfer();

/**
 * @param string $endpoint
 *
 * @return VoPayContract
 * @throws \Exception
 */
protected function buildVopayEndpointGroup(string $endpoint) : VoPayContract
{
    return $this->apiVopay->{$endpoint}();
}

use Mockery\MockInterface;
use PaymentProcessor\VoPay\Endpoints\Mocks\ElectronicFundsTransfer;

// $shouldTestSucceed is a boolean: true if the mocked response from the VoPay API should succeed, false otherwise
$this->partialMock(SomeClass::class, function (MockInterface $mock) use ($shouldTestSucceed) {
    $mock->shouldReceive('buildVopayEndpointGroup')
        ->with('electronicFundsTransfer')
        ->andReturn(new ElectronicFundsTransfer($shouldTestSucceed));
});