コード例 #1
0
ファイル: PaymentDetails.cs プロジェクト: nikz2493/jkmobile
        /// Method Name     : ReturnServiceResponse
        /// Author          : Pratik Soni
        /// Creation Date   : 07 Feb 2018
        /// Purpose         : To return service response from CRM's dictionary response
        /// Revision        :
        /// </summary>
        private ServiceResponse <DTO.Payment> ReturnServiceResponse(Dictionary <string, string> crmResponse)
        {
            if (crmUtilities.ContainsNullValue(crmResponse))
            {
                logger.Info(resourceManager.GetString("CRM_STATUS_204"));
                return(new ServiceResponse <Payment> {
                    Message = resourceManager.GetString("CRM_STATUS_204")
                });
            }
            var validatedResponse = crmToDTOMapper.ValidateResponse <Payment>(crmResponse);

            if (validatedResponse.Message != null)
            {
                logger.Error(resourceManager.GetString("msgServiceUnavailable"));
                return(new ServiceResponse <Payment> {
                    Message = resourceManager.GetString("msgServiceUnavailable")
                });
            }
            else if (validatedResponse.Information != null)
            {
                logger.Error(resourceManager.GetString("CRM_STATUS_204"));
                return(new ServiceResponse <Payment> {
                    Information = resourceManager.GetString("CRM_STATUS_204")
                });
            }
            return(crmToDTOMapper.MapPaymentResponseToDTO(crmResponse));
        }