private async Task <ApiResponse> RegisterPostcode(string postcode, string apiKey)
        {
            const string url            = EhlApiEntryPointUrl + StartSwitchUrl;
            var          switchTemplate = await _ehlHttpClient.GetApiResponse <ApiResponse>(url, Environment);

            ApplyReference(switchTemplate, "partnerReference", PartnerReference);
            ApplyReference(switchTemplate, "apiKey", apiKey);
            switchTemplate.DataTemplate.Groups[0].Items[0].Data = postcode;

            return(await _ehlHttpClient.PostApiGetResponse(url, switchTemplate, Environment));
        }
Beispiel #2
0
        public async Task <EhlApiResponse> GetSupplierEhlApiResponse(GetPricesRequest request, string environment)
        {
            var currentSwitchesApiResponse = await _ehlHttpClient.GetApiResponse <ApiResponse>(request.CurrentSupplyUrl, environment).ConfigureAwait(false);

            CheckSuccessReponse("CustomerSupplyStage", currentSwitchesApiResponse);

            request.PopulateCurrentSupplyWithRequestData(currentSwitchesApiResponse);
            var currentSwitchesApiPostResponse = await _ehlHttpClient.PostApiGetResponse(request.CurrentSupplyUrl, currentSwitchesApiResponse, environment).ConfigureAwait(false);

            return(ApiCallResponse("CustomerSupplyStage", currentSwitchesApiPostResponse, EhlApiConstants.UsageRel));
        }