PHP code example of ardani / fio-payment-wrapper

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

    

ardani / fio-payment-wrapper example snippets



nloader = new FioApi\Downloader('TOKEN@todo');
$transactionList = $downloader->downloadSince(new \DateTimeImmutable('-1 week'));

foreach ($transactionList->getTransactions() as $transaction) {
    var_dump($transaction); //object with getters
}



en = get_your_fio_token();
$uploader = new FioApi\Uploader($token);
// currency, iban, bic is not needed
$account = new FioApi\Account('XXXXXXXXXX', 'ZZZZ', NULL, NULL, NULL);
$tx = Transaction::create((object) [
    'accountNumber' => 'YYYYYYYYYY',
    'bankCode' => 'WWWW',
    'date' => new \DateTime('2016-07-20'),
    'amount' => 6.66,
    'currency' => 'CZK',
    'userMessage' => 'money wasting',
    'comment' => 'fioapi.test'
]);

$builder = new FioApi\DomesticPaymentBuilder();
$request = $builder->build($account, [$tx]);
$response = $uploader->sendRequest($request);

echo $response->getStatus();