private static PaymentInfoItemList loadPaymentInfoFromService(string distributorID, string locale) { if (string.IsNullOrEmpty(distributorID)) { return(null); } string country = (locale.Length > 2) ? locale.Substring(3) : locale; var proxy = ServiceClientProvider.GetOrderServiceProxy(); try { if (HLConfigManager.Configurations.DOConfiguration.IsChina) { var response = proxy.GetPaymentInfo(new GetPaymentInfoRequest1(new GetPaymentInfoRequest_V02() { ID = 0, MaxCardsToGet = 0, DistributorID = distributorID, CountryCode = country })).GetPaymentInfoResult as GetPaymentInfoResponse_V01; if (response != null && response.Status == ServiceResponseStatusType.Success && response.PaymentInfoList != null) { var payInfoItems = response.PaymentInfoList.GroupBy(p => string.Concat(p.CardNumber, "/", p.Alias)).Select( g => g.First()); var distinctCards = new PaymentInfoItemList(); foreach (PaymentInformation pi in payInfoItems) { distinctCards.Add(pi); } return(distinctCards); } } else { var response = proxy.GetPaymentInfo(new GetPaymentInfoRequest1(new GetPaymentInfoRequest_V01() { ID = 0, MaxCardsToGet = 0, DistributorID = distributorID, CountryCode = country })).GetPaymentInfoResult as GetPaymentInfoResponse_V01; if (response != null && response.Status == ServiceResponseStatusType.Success && response.PaymentInfoList != null) { var payInfoItems = response.PaymentInfoList.GroupBy(p => string.Concat(p.CardNumber, "/", p.Alias)).Select( g => g.First()); var distinctCards = new PaymentInfoItemList(); foreach (PaymentInformation pi in payInfoItems) { distinctCards.Add(pi); } return(distinctCards); } } } catch (Exception ex) { WebUtilities.LogServiceExceptionWithContext <IOrderService>(ex, proxy); } return(null); }