Portalum / Portalum.Zvt

A .NET Zvt Library for Payment Terminals (C#)
MIT License
88 stars 36 forks source link

Asynchronous completion with Worldline Valina fails #44

Open stimm4711 opened 6 months ago

stimm4711 commented 6 months ago

NuGet Package Version

3.3.1

Payment service provider

First Cash

Payment terminal

Worldline Valina, Ingenico Move 3500

Communication Logs

No response

More information

Hello,

I'm having a problem with asynchronous payment functionality. In the description of ZvtClientConfig.GetAsyncCompletionInfoLimit it says, that the payment terminal tries every 2-4 seconds to get the state if the goods are issued. But in my case I've set the limit to 255 and it reaches it within two seconds because it triggers CompletionDecisionRequested every few milliseconds.

I know this is pretty sure not an issue with this library but maybe you know if there is something wrong configured in the payment terminals? Any help is very much appreciated :)

stimm4711 commented 5 months ago

What I have found out is, that this library is missing a parameter for the 06 01 payment command. image

There is no possibility to set the 01 timeout. That says the PT that the response of the ECR is expected in this time. Otherwise the PT will abort the payment. If the ECR does not wait, it will send the response back directly and so the tries are counted up that fast.

What needs to be added is, that the parameter 01 is set for asynchronous payments (like it is already done for the retries) and the ECR must wait up to this timeout with sending the response if filling / issue of goods didn't happen yet.

stimm4711 commented 5 months ago

Here some more information from the ZVT documentation:

If the ECR cannot complete the issue of goods within time , the ECR responds to the PT a Status-Information with “84-9C”. In this case the PT waits 2 seconds and sends then a Status-Information again. The parameter prevents this sequence from running in an infinite-loop.

MLDMoritz commented 5 months ago

Use GetAsyncCompletionInfoLimit in ZvtClientConfig as a workaround. Default is 10, so you probably ran into timeout about ~20s after starting. Increasing GetAsyncCompletionInfoLimit to 255 (*2) would lead to a timeout of ~510s.

Edit: Didn't see it's counting up fast. Then you could just add it to ZvtClient.cs at PaymentAsync Method:


package.Add(0x01); // timeout
package.Add(0x255); // for ex.