ewaypayment / eway-rapid-net Goto Github PK
View Code? Open in Web Editor NEWeWAY Rapid .NET library
Home Page: https://www.eway.com.au/
License: MIT License
eWAY Rapid .NET library
Home Page: https://www.eway.com.au/
License: MIT License
Hi,
I have been working on an ecommerce website that uses Umbraco, and was struggling for a long time to figure out why I could never connect to the gateway (always received S9992 errors).
I identified thanks to issue #20 that the change to enforce TLS1.2 was the cause for this issue, as I was forced to use v1.4, because Umbraco's core binaries are signed to use AutoMapper v3.3.1.
As a result, I cannot install the new 1.5.x versions that include the TLS1.2 fix that would allow me to properly connect to eWAY.
Given that as far as I can tell there is no reason why you need to have AutoMapper v4.1.1, (aside from the previous requests to upgrade it) would it be possible to change the dependency to range from >=3.3.1 && <=4.1.1?
This would solve this compatibility issue completely.
Thanks for your time,
Steve
On this line:
CreateTransactionResponse response = ewayClient.Create(PaymentMethod.Direct, transaction);
I am getting the following error:
AutoMapper.AutoMapperMappingException
Missing type map configuration or unsupported mapping. Mapping types: Object -> List1 System.Object -> System.Collections.Generic.List
1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Destination path: CreateTransactionResponse.Errors.Errors Source value: (null)
Automapper version: 4.2.1
Eway.rapid version: 1.5.3
We don't really want to update or downgrade automapper just because of eway.rapid, which version of eway.rapid can i use with automapper 4.2.1? What is the issue, is it really because of the automapper version?
I've tried to use this library in a .NET 4.5.2 API project but on line where I create the Rapid client:
IRapidClient ewayClient = RapidClientFactory.NewRapidClient(EwayApiKey, ApiPassword, EwayRapidEndpoint);
I get a MissingMethodException (in case it matters I use AutoMapper v5.0.2):
{
"Message":"An error has occurred.",
"ExceptionMessage":"Method not found: 'AutoMapper.IMappingExpression2<!!0,!!1> AutoMapper.Mapper.CreateMap()'.", "ExceptionType":"System.MissingMethodException", "StackTrace":" at eWAY.Rapid.Internals.Services.MappingService.RegisterRequestMapping()\r\n at eWAY.Rapid.Internals.Services.MappingService.RegisterMapping() in C:\\test_net\\eway-rapid-net-tls12\\eWAY.Rapid\\Internals\\Services\\MappingService.cs:line 44\r\n at eWAY.Rapid.RapidClientFactory.NewRapidClient(String apiKey, String password, String rapidEndpoint) in C:\\test_net\\eway-rapid-net-tls12\\eWAY.Rapid\\RapidClientFactory.cs:line 23\r\n at INBA.Api.Controllers.Members.PurchaseController.Eway(PurchaseModel model) in C:\\PROJECTS\\INBA.Api\\source\\INBA.Api\\Controllers\\Members\\PurchaseController.cs:line 61\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClassc.<GetExecutor>b__6(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary
2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"
}
Me again.
As per #9, I want to run a charge against the new payment details to ensure (at update time) there won't be any issues when next due for a recurring payment. And as suggested, I'm doing an update without payment details, followed by a recurring payment.
I've updated the same Gist as used in the previous issue (only new features added, no existing code changed). And it partially works.
If you register with a credit card, you can use the new method (Update details without payment THEN charge
) to change credit card details. This can be verified in MYeWAY that the charge went to the new card, and that the new card is stored against the token.
If you register with a credit card and use the new method to update to Paypal, this also works. From the MYeWAY home page we can see that the most recent transaction was against a Paypal account. We can't see the Paypal information against the token (see eWAY Support Case #00373651), but that's nothing new.
If you register with Paypal and use the new method to update to a different Paypal account, this works.
_However_, if you register with Paypal and use the new method to update to card, it does not work. The MYeWAY home page shows the charge still went to Paypal. As above we are unable to see what is stored on the token, however running another recurring charge still goes to Paypal.
TLDR: You can't update stored Paypal information to Credit card.
CC -> CC ok
CC -> PP ok
PP -> PP ok
PP -> CC fails.
My first thought was a timing issue: the charge came through before the update was finalised. However I wouldn't expect it to only occur for that one combination. I would expect that it would either be all cases from PP, or all cases to CC. Also, the next recurring charge against that token (seconds later) still goes against Paypal.
Since the 1.0 release of .net core. Eway.Rapid cannot be included since .net core requires Newtonsoft.Json 9.0.1. And Eway.Rapid is incompatiable with any version above 8.0.3
(Still the sandbox)
We provide a subscription based service. Whenever I create a customer or change payment details we like to do so with a $1 purchase transaction to try and minimise any chances of future recurring payments being denied.
I can create a new customer and save their details using a (transparent redirect) purchase transaction.
I can also update their credit card details using a purchase transaction.
However I can't update Paypal details using a purchase transaction.
(I haven't tested other payment methods yet, Visa Checkout or MasterPass)
I'm not sure what the intended behaviour is here. If you are not meant to be able to update details via a purchase, then the credit card behaviour is wrong. If you are meant to be able to update stored details via a purchase, the Paypal behaviour is wrong.
It took me a little while to work out exactly what was going on, so the linked Gist might be a little bit of overkill. However it has proven handy for testing. On each run it will register a new customer, then continue to update/charge that customer token until you click "Start over".
If you already have Paypal details on record, attempting to process a Payment (Transparent Redirect) with Paypal simply processes it using the stored credentials, it doesn't ask for new ones. Process to duplicate:
Similarly, if you try to process a Paypal payment on an account with no stored Paypal information, you get D4406 - "Error" (I searched Github for D4406 and found no places it gets raised, only the definition). Process to duplicate:
Lengthy yes, but I like to think of it as thorough.
I spoke with EWay support about a sandbox connection problem.
It appears Eway has updated the sandbox api to only accept TLS1.2 connections (a change which has not been made on production yet) and .NET does not automatically negotiate TLS1.2. I opened a PR with a code change that sets "ServicePointManager.SecurityProtocol" to TLS1.2. In hindsight, after talking to a colleague, this might of been short sighted on my part so have closed the PR.
I ran a test upgrading the project to target .NET 4.6 and .NET 4.6 seems to correctly negotiate TLS1.2.
Is anyone else experiencing this issue when connecting to sandbox and have any other suggestions to the ones I have mentioned above and in the comments in the closed PR?
Thanks,
Dave
Hi
In ResponsiveShared, Shipping Address and Items are not showing in eWay shared payment page.
I debug code and see that request (eWAY.Rapid.Models.Transaction) to CreateAccessCodeSharedRequest (eWAY.Rapid.Internals.Request.CreateAccessCodeSharedRequest ) mapping missing Shipping Address and Items objects.
see below code RapidClient.cs
private CreateTransactionResponse CreateTransaction<TRequest, TResponse>(Func<TRequest, TResponse> invoker, Transaction transaction)
{
var request = _mappingService.Map<Transaction, TRequest>(transaction);
var response = invoker(request);
return _mappingService.Map<TResponse, CreateTransactionResponse>(response);
}
Shipping Address and Items objects are in transaction but missing into request when it map to TRequest (CreateAccessCodeSharedRequest)
var request = _mappingService.Map<Transaction, TRequest>(transaction);
EWAY create customer token is accepting test credit card number for live eway account and same does on update credit card.
However it doesnot allow transaction>> Really need to solve this issue as it is effecting my work
I see there is an enum for RequestMethod, but I can't find a way to use it in a Transaction. In fact, searching the entire repo I don't see it used anywhere.
There is a duplicate enum under eWAY.Rapid.Internals.Enums.Method, and that gets used (such as eWAY.Rapid.Internals.Request.CreateAccessCodeRequest), but these are obviously unavailable. What is the correct method for setting the RequestMethod in a Transaction? The API doesn't show an example of actually doing this.
No support for the latest packages makes it difficult for everyone to update their entire projects.
This has been the case for a long time.
Can you simply update the dependencies when you receive notifications?
It would make developers lives a whole lot easier.
I have posted this question to stackoverflow... https://stackoverflow.com/questions/44520289/eway-rapid-error-s9992-keeps-occuring-on-asp-net-mvc-application
var ewayClient = RapidClientFactory.NewRapidClient(Platform.eWayApiKey, Platform.eWayPassword, EndPoint);
ewayClient.SetVersion(31);
var transaction = CreateTransaction();
var preAuthTransaction = ewayClient.Create(PaymentMethod.ResponsiveShared, transaction);
Assert.IsNull(preAuthTransaction.Errors);
It sets up a basic transaction but it is failing in 1 out of 4 contexts.
I have two solutions each with a web application and a unit test project. They all return a response with no Errors except for one of the web applications which returns that S9992 error code.
The web applications are running under IIS Express 10. The app that fails locally on IIS Express also fails when deployed to external web site.
I am pulling my hair out over this.
NOTE: I'm using NuGet package version 1.6.0-beta1
Hello
We are using eWAY to process payment in our system. However the API stops working and throw exception after we upgrade the AutoMapper plugin to 6.0.2:
Method not found: 'Void AutoMapper.IMapperConfigurationExpression.set_CreateMissingTypeMaps(Boolean)'
Stack Trace: at eWAY.Rapid.Internals.Services.MappingService.<>c.b__4_0(IMapperConfigurationExpression cfg)
at AutoMapper.MapperConfiguration.Build(Action1 configure) at AutoMapper.Mapper.Initialize(Action
1 config)
at eWAY.Rapid.Internals.Services.MappingService.RegisterMapping() in C:\test_net\eway-rapid-net\eWAY.Rapid\Internals\Services\MappingService.cs:line 34
at eWAY.Rapid.RapidClientFactory.NewRapidClient(String apiKey, String password, String rapidEndpoint) in C:\test_net\eway-rapid-net\eWAY.Rapid\RapidClientFactory.cs:line 23
I think it may because we also use static API to initial Automapper in our system and that has some conflicts with eWAY dll. I upgraded eWAY to 1.6.0 beta and the issue still exists.
Regards
Hi,
I believe the issue is fairly easy to sort out, I tried to fork and build it myself, but I don't have the signing cert to complete the build.
Go to this line: https://github.com/eWAYPayment/eway-rapid-net/blob/master/eWAY.Rapid/Internals/Services/RapidService.cs#L104
Should change QUERY_TRANSACTION to ACCESS_CODE_RESULT.
Correct me if I'm wrong? :)
Thanks.
There have been pull requests in the past. However, those have not been merged, let alone have they been made available as a new official version.
Is there anyone at eWay watching this repository and then doing something about this?
I am working with a client and this has now reached a point where the client needs to move to .NET Core 3.1 and then on to .NET 5.0. eWay.Rapid does not allow this and causes compile errors.
My client is therefore now considering to move to a different payment provider as it appears to them that eWay is not maintaining this client library.
My view: I think you are at risk losing customers to competitors who keep their client side libraries up-to-date. One such competitor is Stripe. Their client library is also available as a nuget package at https://www.nuget.org/packages/Stripe.net/ with the associated repository at https://github.com/stripe/stripe-dotnet Stripe's support of the developer community appears to be more active.
So what is an ETA for support of netstandard2.0 and net5.0? Or what is your recommendation if those are not happening any time soon? Is there a replacement library that can be used instead that you'd recommend?
Encryption Service is not supported yet. when you guys planing to add this as i want to use it in Direct Connection to avoid PCI compliant?
Paying with Paypal was the easiest thing in the world to set up. And yet sometime in the last few weeks it has stopped working. I suspect something in their API (or yours) has changed, because I don't believe I have changed anything. This gist is a very quick and easy test case to show what happens. It doesn't even worry about a results page, as we don't get that far. The redirect to Paypal fails and Paypal shows an error page:
Can you shed any light on the issue?
Hello Team,
I have used eWay-rapid-net library, but it is not working with my latest Newtonsoft Json Verson 10.0.0.
I know that it is having minimum requirement of Newtonsoft Json V9.0.1, but Is there any way through which it can work with any Newtonsoft Version which should be minimum V9.0.1 or any higher version.
Please help me , this is urgent?
regards
Kusum
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.
Got a feature request to lodge, the API shows all these lovely response messages, but all I receive is a string code (e.g. "D4433"). It would be nice if the SDK provided a way to translate that into meaningful strings (to provide to customer explaining why transaction was declined, e.g. "Expired Card, Capture").
I figure you could either make it as a readonly Dictionary
, or you could make a GetMessageFromResponseCode
helper method (similar to RapidClientFactory.UserDisplayMessage
).
Was just looking through the recent commit: I like the hasFraudCode
and getResponseMessages
. But the Customer.getTokenCustomerID()
seems flawed. public long? TokenCustomerID
is a nullable long
, so calling TokenCustomerID.ToString()
without a null check is just asking for trouble. Suggest you change it to return (TokenCustomerID == null) ? null : TokenCustomerID.ToString();
. Or return ""
, either is better than a NullReferenceException
.
Of course, the method itself seems redundant to me, but perhaps you have longer-term plans for it.
Hi,
eWAY.Rapid client Query Customer not returning any card details .
I m using mvc and eway 1.6.0.0 dll and auto mapper dll 6.2.1.0.
Please suggest
Thanks & Regards
Praveen Barawal
Due to dependency issues with library, I was forced to update to pre-release beta version that uses AutoMapper v5.*.
Update-Package eWAY.Rapid -Pre
Now having issues with all projects using eWay references:
Could not load file or assembly 'eWAY.Rapid, Version=1.4.0.0, Culture=neutral, PublicKeyToken=3ab6d5d95167133b' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I've checked:
This exception is very common - normally associated with references not being updated or multiple versions defined (imported from projects that have not been updated). I have checked all this as above and still get exception.
Am I missing something obvious or does library have bugs?
Thanks.
Steve
Hi guys
Could you help me? I'm a developer of some CMS system and I should integrate eWay gateway. I didn't find any information regarding recurring payments for this library. Can I use the eWAY Rapid for recurring payments? If yes could you give me some documentation or examples of how I should use it?
Thanks
The following line returns a QueryTransactionResponse, but all the properties of QueryTransactionResponse are null - such as AccessCode, Transaction, and TransactionStatus. What is the scenario where this happens?
QueryTransactionResponse response = ewayClient.QueryTransaction(toConfirm.AccessCode) ;
Are there any plans to implement async methods for calls to the eway servers? I had a quick look at the source, and RapidService.GetWebResponse seems like a good candidate.
This repo cannot be used with ASP.Net Core. The nuget packages are .net 4.5.1
Back again with another one for you incarnate.
When you create a transaction of the type Purchase, the InvoiceDescription and CurrencyCode aren't returned (as per the API). However when you perform a transaction of the type Recurring, it works fine. See this linked GIST.
The irony is that Purchase is a manual transaction where the end user is involved and would actually like to see the Description in the results page. A recurring transaction typically happens behind the scenes and doesn't involve user interaction.
Edit: I've also logged another defect about paying via Paypal. This one is the lower priority (and probably easier fix for you). This is a nice to have, but #5 is important.
Currently, this package does not support dot net 6.0.
Is there any plan to update this package with the latest dotnet release?
We cannot move forward unless this package is updated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.