Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaymentMethod Authorisation response not mapping correctly in Automapper #33

Open
attomman opened this issue Aug 26, 2019 · 1 comment

Comments

@attomman
Copy link

When authorising a payment the TransactionStatus is not mapped in the response. This is critical to get the status and the transactionID to Capture or Cancel the Authorisation later.

When the automapper maps DirectAuthorisationResponse to CreateTransactionResponse the TransactionID and status are lost becuase the TransactionStatus object is not mapped from the source.

To fix this I change the ResponseMapProfile.cs

FROM

        CreateMap<DirectAuthorisationResponse, CreateTransactionResponse>(MemberList.Destination)
            .IncludeBase<BaseResponse, Rapid.Models.BaseResponse>();

TO

        CreateMap<DirectAuthorisationResponse, CreateTransactionResponse>(MemberList.Destination)
            .IncludeBase<BaseResponse, Rapid.Models.BaseResponse>()
            .ForMember(dest => dest.TransactionStatus, opt => opt.MapFrom(src => src));

Now the TransactionID information is returned by the Client when trying the authorise a payment. Can you please add the additional line to the mapper so the TransactionID can be used.

@attomman
Copy link
Author

Sorry I forgot to add this issue is in v1.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant