Created
March 18, 2017 07:14
-
-
Save JoachimL/7aab1cdf5732b61d8e48d15748a9dc51 to your computer and use it in GitHub Desktop.
Main entry point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task Run(string message, TraceWriter log) | |
{ | |
log.Info($"Processing incoming barcode: {message}"); | |
var incoming = IncomingBarcode.FromMessage(message); | |
var httpClient = await CreateKolonialHttpClientAsync(); | |
var kolonialProduct = await GetKolonialProductAsync(httpClient, incoming.Barcode); | |
if(kolonialProduct == null) | |
log.Warning($"Product with barcode {incoming.Barcode} is not available at Kolonial."); | |
else | |
await AddProductToCartAsync (httpClient, kolonialProduct, log); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment