diff --git a/eWAY.Rapid.Tests/Properties/AssemblyInfo.cs b/eWAY.Rapid.Tests/Properties/AssemblyInfo.cs index 3e27c03..a62e82c 100644 --- a/eWAY.Rapid.Tests/Properties/AssemblyInfo.cs +++ b/eWAY.Rapid.Tests/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.0")] diff --git a/eWAY.Rapid/Internals/Models/Customer.cs b/eWAY.Rapid/Internals/Models/Customer.cs index 874172e..b23fbd8 100644 --- a/eWAY.Rapid/Internals/Models/Customer.cs +++ b/eWAY.Rapid/Internals/Models/Customer.cs @@ -1,5 +1,3 @@ -using System; - namespace eWAY.Rapid.Internals.Models { internal class Customer diff --git a/eWAY.Rapid/Internals/Services/MappingService.cs b/eWAY.Rapid/Internals/Services/MappingService.cs index 930e336..547794e 100644 --- a/eWAY.Rapid/Internals/Services/MappingService.cs +++ b/eWAY.Rapid/Internals/Services/MappingService.cs @@ -136,11 +136,11 @@ public static void RegisterResponseMapping() Mapper.CreateMap() .IncludeBase() .ForMember(dest => dest.SharedPaymentUrl, opt => opt.MapFrom(src => src.SharedPaymentUrl)); - + Mapper.CreateMap() - .ForMember(dest => dest.Transaction, opt => opt.MapFrom(src => src.Transactions.FirstOrDefault())) - .ForMember(dest => dest.TransactionStatus, opt => opt.MapFrom(src => src.Transactions.FirstOrDefault())) - .IncludeBase(); + .IncludeBase() + .ForMember(dest => dest.Transaction, opt => opt.MapFrom(src => !src.Transactions.Equals(null) ? src.Transactions.FirstOrDefault() : null)) + .ForMember(dest => dest.TransactionStatus, opt => opt.MapFrom(src => !src.Transactions.Equals(null) ? src.Transactions.FirstOrDefault() : null)); Mapper.CreateMap() .ForMember(dest => dest.Transaction, opt => opt.MapFrom(src => src)) diff --git a/eWAY.Rapid/Internals/Services/RapidService.cs b/eWAY.Rapid/Internals/Services/RapidService.cs index 46eba8d..561e0f5 100644 --- a/eWAY.Rapid/Internals/Services/RapidService.cs +++ b/eWAY.Rapid/Internals/Services/RapidService.cs @@ -208,8 +208,16 @@ public TResponse JsonGet(string method) try { AddHeaders(webRequest, HttpMethods.GET.ToString()); - var result = GetWebResponse(webRequest); - response = JsonConvert.DeserializeObject(result); + string result = GetWebResponse(webRequest); + if (String.IsNullOrEmpty(result)) + { + var errors = RapidSystemErrorCode.COMMUNICATION_ERROR; + response.Errors = errors; + } + else + { + response = JsonConvert.DeserializeObject(result); + } } catch (WebException ex) { diff --git a/eWAY.Rapid/Properties/AssemblyInfo.cs b/eWAY.Rapid/Properties/AssemblyInfo.cs index ac3fbe2..980ec7e 100644 --- a/eWAY.Rapid/Properties/AssemblyInfo.cs +++ b/eWAY.Rapid/Properties/AssemblyInfo.cs @@ -32,8 +32,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] +[assembly: AssemblyFileVersion("1.2.1.0")] [assembly: InternalsVisibleTo("eWAY.Rapid.Tests,PublicKey=00240000048000009400000006020000002400005253413100040000010001001fa88da23161933c177ff28430a896e9dc1d184b788db49eed5f7a6c101ed7cd4820b80a0f22949cc0077c5fa00d7c575a678e145d35f391caf1ec747a00602fc86df22717d7c0ee5fe4607f0c64ac2b99aa6d81198d7d308db51f457576d541e2318d58f3b54859a6ee60154193472f9d8a1bfdae9c16f26aa755d658d8f0f5")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]