PHP code example of matteocacciola / vopay-php-sdk

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

    

matteocacciola / vopay-php-sdk example snippets


use DataMat\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 DataMat\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));
});