/** * Returns url for payment method, based on request data * * @param Request $request Request for url creation * * @return string Url */ protected function getUrl(Request $request) { if (strpos($request->getApiMethod(), 'sync-') === 0) { $apiMethod = 'sync/' . substr($request->getApiMethod(), strlen('sync-')); } else { $apiMethod = $request->getApiMethod(); } if (strlen($request->getEndPointGroup()) > 0) { $endPoint = "group/{$request->getEndPointGroup()}"; } else { $endPoint = (string) $request->getEndPoint(); } return "{$request->getGatewayUrl()}/{$apiMethod}/{$endPoint}"; }