Skip to content

Commit

Permalink
Improve error handling where no response received
Browse files Browse the repository at this point in the history
Bumped version to 1.2.1
  • Loading branch information
incarnate committed Feb 17, 2016
1 parent e38c9a0 commit 736794b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions eWAY.Rapid.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
2 changes: 0 additions & 2 deletions eWAY.Rapid/Internals/Models/Customer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System;

namespace eWAY.Rapid.Internals.Models
{
internal class Customer
Expand Down
8 changes: 4 additions & 4 deletions eWAY.Rapid/Internals/Services/MappingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ public static void RegisterResponseMapping()
Mapper.CreateMap<CreateAccessCodeSharedResponse, CreateTransactionResponse>()
.IncludeBase<CreateAccessCodeResponse, CreateTransactionResponse>()
.ForMember(dest => dest.SharedPaymentUrl, opt => opt.MapFrom(src => src.SharedPaymentUrl));

Mapper.CreateMap<TransactionSearchResponse, QueryTransactionResponse>()
.ForMember(dest => dest.Transaction, opt => opt.MapFrom(src => src.Transactions.FirstOrDefault()))
.ForMember(dest => dest.TransactionStatus, opt => opt.MapFrom(src => src.Transactions.FirstOrDefault()))
.IncludeBase<BaseResponse, Rapid.Models.BaseResponse>();
.IncludeBase<BaseResponse, Rapid.Models.BaseResponse>()
.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<TransactionResult, QueryTransactionResponse>()
.ForMember(dest => dest.Transaction, opt => opt.MapFrom(src => src))
Expand Down
12 changes: 10 additions & 2 deletions eWAY.Rapid/Internals/Services/RapidService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,16 @@ public TResponse JsonGet<TResponse>(string method)
try
{
AddHeaders(webRequest, HttpMethods.GET.ToString());
var result = GetWebResponse(webRequest);
response = JsonConvert.DeserializeObject<TResponse>(result);
string result = GetWebResponse(webRequest);
if (String.IsNullOrEmpty(result))
{
var errors = RapidSystemErrorCode.COMMUNICATION_ERROR;
response.Errors = errors;
}
else
{
response = JsonConvert.DeserializeObject<TResponse>(result);
}
}
catch (WebException ex)
{
Expand Down
4 changes: 2 additions & 2 deletions eWAY.Rapid/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 736794b

Please # to comment.