public async Task <IRestResponse <DeviceAddressStatus> > RetrieveService(string serialNumber, string apiKey, string acquirerCode, bool isTestMode) { var deviceAddressUri = isTestMode ? $"https://device-address-api-sb.{acquirerCode}.msp.assemblypayments.com/v1/{serialNumber}/ip" : $"https://device-address-api.{acquirerCode}.msp.assemblypayments.com/v1/{serialNumber}/ip"; var addressService = new HttpBaseService(deviceAddressUri); var request = new RestRequest(Method.GET); request.AddHeader(ApiKeyHeader, apiKey); var response = await addressService.SendRequest <DeviceAddressStatus>(request); return(response); }
public async Task <DeviceAddressStatus> RetrieveService(string serialNumber, string apiKey, bool isTestMode) { // TODO: Replace with sandbox and prod urls var deviceAddressUri = isTestMode ? $"https://device-address-api-dev.nonprod-wbc.msp.assemblypayments.com/v1/{serialNumber}/ip" : $"https://device-address-api-dev.nonprod-wbc.msp.assemblypayments.com/v1/{serialNumber}/ip"; var addressService = new HttpBaseService(deviceAddressUri); var request = new RestRequest(Method.GET); request.AddHeader(ApiKeyHeader, apiKey); var response = await addressService.SendRequest <DeviceAddressStatus>(request); return(response); }