/** * @param string $key */ public function create($key) { if (!$this->helloPayApiEndPointUrlMap->has($key)) { throw new ApiEndPointUrlFactoryException('The Api Endpoint URL of ' . $key . ' does not exist.'); } return $this->helloPayConfigManager->getConfig()->getApiUrl() . $this->helloPayApiEndPointUrlMap->get($key); }
/** * @param string $transactionId * * @return HelloPayResponse */ public function cancelTransaction($transactionId) { $cancelTransactionRequest = $this->cancelTransactionRequestFactory->create($transactionId, $this->helloPayConfigManager->getConfig()->getShopConfig()); if (!$this->cancelTransactionRequestValidator->isValidRequestData($cancelTransactionRequest)) { throw new CancelTransactionManagerException('Invalid request provided'); } $cancelTransactionResponse = $this->cancelTransactionHttpClient->send($cancelTransactionRequest); if (!$this->cancelTransactionResponseValidator->isValid($cancelTransactionResponse)) { throw new CancelTransactionManagerException('Server responded with invalid response'); } return $cancelTransactionResponse; }