public function setUp()
 {
     $this->operationHistoryRequest = new OperationHistoryRequest();
     $this->operationHistoryRequest->setDetails(true);
     $this->operationHistoryRequest->setFrom("899998999");
     $this->operationHistoryRequest->setTill("899998999");
     $this->operationHistoryRequest->setLabel("label");
     $this->operationHistoryRequest->setStartRecord(1);
     $this->operationHistoryRequest->setRecords(20);
     $this->operationHistoryRequest->setType("type");
 }
Example #2
0
            $app['session']->set('token', $oAuthTokenResponse->getAccessToken());
            $result = $oAuthTokenResponse->getAccessToken();
        } else {
            $result = $oAuthTokenResponse->getError();
        }
    }
    return $app['twig']->render('get_token.twig', array('result' => $result));
});
/**
 *  for testing
 */
$app->get('/operation-history', function (Request $request) use($app) {
    $token = $request->query->get('token');
    $operationHistoryRequest = new OperationHistoryRequest();
    $operationHistoryRequest->setStartRecord(0);
    $operationHistoryRequest->setRecords(3);
    $apiFacade = YandexMoney::getApiFacade();
    $apiFacade->setLogFile(__DIR__ . '/ym.log');
    $response = null;
    $operationCount = -1;
    try {
        $response = $apiFacade->operationHistory($token, $operationHistoryRequest);
        $operationCount = count($response->getOperations());
    } catch (\Exception $e) {
        echo $e->getMessage();
    }
    return new Response(http_build_query(array("operations_amount" => "{$operationCount}")), 200);
});
/**
 *  for testing
 */