From c5cf67bb042c06b1b626ce2002c3725c5068b797 Mon Sep 17 00:00:00 2001 From: maurok Date: Wed, 17 May 2017 17:51:44 -0300 Subject: [PATCH] # Avoiding checking for default selected option (not all subsets have a default) --- .../PaymentsBot/Controllers/MessagesController.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CSharp/sample-payments/PaymentsBot/Controllers/MessagesController.cs b/CSharp/sample-payments/PaymentsBot/Controllers/MessagesController.cs index 9fb87c3d4a..7a317d64b0 100644 --- a/CSharp/sample-payments/PaymentsBot/Controllers/MessagesController.cs +++ b/CSharp/sample-payments/PaymentsBot/Controllers/MessagesController.cs @@ -148,10 +148,11 @@ private async Task OnInvoke(IInvokeActivity invoke, IConnectorClient connectorCl } } - if (result.Details.ShippingOptions.Count(option => option.Selected.HasValue && option.Selected.Value) != 1) - { - throw new ArgumentException("Expected exactly zero or one selected shipping option."); - } + // do not require or check default selected option + //if (result.Details.ShippingOptions.Count(option => option.Selected.HasValue && option.Selected.Value) != 1) + //{ + // throw new ArgumentException("Expected exactly zero or one selected shipping option."); + //} // update payment details after shipping changed await this.shippingService.UpdatePaymentDetailsAsync(result.Details, paymentRequestUpdate.ShippingAddress, catalogItem);