if (isCallSuccessful($response)) { print "Found account with id: " . $merchantAccountId . PHP_EOL; $fetchedAutoBills = $response['data']->autobills; foreach ($fetchedAutoBills as $autobill) { // process each autobill found here print "Found autobill with id: " . $autobill->getMerchantAutoBillId() . PHP_EOL; print "Start Date: " . $autobill->startTimestamp . PHP_EOL; print "NextBilling: " . PHP_EOL; print "Date: " . $autobill->nextBilling->getTimestamp() . " "; print "Amount: " . $autobill->nextBilling->getAmount() . PHP_EOL; $autobillVid = $autobill->VID; $autobill = new AutoBill(); $autobill->setVID($autobillVid); $numberOfFutureRebillsToFetch = 24; logCall('Autobill->fetchFutureRebills ' . $merchantAccountId); $response = $autobill->fetchFutureRebills($numberOfFutureRebillsToFetch); if (isCallSuccessful($response)) { $futureTxns = $response['data']->transactions; print "Fetched " . $numberOfFutureRebillsToFetch . " future rebills." . PHP_EOL; print "This subscription will be billed at the following dates and amounts:" . PHP_EOL; foreach ($futureTxns as $futureTxn) { print "Date: " . $futureTxn->getTimestamp() . " "; print "Amount: " . $futureTxn->getAmount() . PHP_EOL; } } } } $transactionAPI = new Transaction(); logCall('transaction->fetchByAccount ' . $merchantAccountId); $response = $transactionAPI->fetchByAccount($account, false); if (isCallSuccessful($response)) {