}
}
$transactionAPI = new Transaction();
logCall('transaction->fetchByAccount ' . $merchantAccountId);
$response = $transactionAPI->fetchByAccount($account, false);
if (isCallSuccessful($response)) {
    $fetchedTxns = $response['data']->transactions;
    if ($fetchedTxns != null) {
        foreach ($fetchedTxns as $fetchedTx) {
            print "Transaction VID " . $fetchedTx->getVID() . PHP_EOL;
            print "Transaction amount " . $fetchedTx->getAmount() . PHP_EOL;
            print "Transaction status " . PHP_EOL;
            print $fetchedTx->statusLog[0]->status . PHP_EOL;
        }
    } else {
        print "No transactions found \n";
    }
}
$refundAPI = new Refund();
logCall('refundAPI->fetchByAccount ' . $merchantAccountId);
$response = $refundAPI->fetchByAccount($account, false);
if (isCallSuccessful($response)) {
    $refunds = $response['data']->refunds;
    if ($refunds != null) {
        foreach ($refunds as $refund) {
            print 'Refund of ' . $refund->amount . ' with Refund Id ' . $refund->merchantRefundId . ' had been issued against payment (transaction Id ' . $refund->transaction->merchantTransactionId . ') of ' . $refund->transaction->amount . ' made on ' . $refund->transaction->timestamp . PHP_EOL;
        }
    } else {
        print "No refunds found \n";
    }
}