sveawebpay / dotnet-integration

SDK for Sveas standalone payment methods
Other
5 stars 14 forks source link

bug in card payment cancellation #23

Closed paradisehuman closed 8 years ago

paradisehuman commented 9 years ago

Hi. there is a bug inside card payment. when we redirect to bank url for payment in first page we can cancel the process. when we press cancel , we face an error in code that says transaction number is not found. but if we choose a card (visa , master ) and press cancel in second page , there is no problem and everything is fine. Thanks in advanced.

kilskrift commented 9 years ago

Thanks for the report and sorry for having tarried so long in getting back to you.

When building the createOrder request, have you defined a cancel url with setCancelUrl()?

There is a difference in how the service handles the cancel button in the PayPage (i.e. at the first page that the customer is sent to), and the cancel button at Certitrade (i.e. the second page where the customer enters their card credentials):

The PayPage cancel button behaviour is dependant on the whether you used setCancelUrl(). If you did, the cancel button will return the customer to the defined cancel url, with the order reference given via setClientOrderNumber() returned in the get parameter customerrefno. There is no other response returned. This is the legacy PayPage cancel button behaviour.

If you did not use setCancelUrl() in the createOrder request, the cancel button will still be shown on the PayPage, but will return the customer the the defined return url, in the exact same manner as for the Certitrade page below.

If the customer cancels out of the Certitrade page, they will be redirected to the defined return url. There you must receive and parse the createOrder response. The default status for a cancelled createOrder response from Certitrade is 108. The same status will be returned when cancelling from the Paypage if you did not define a cancel url. In order to disambiguate between status 108 responses originating from Certitrade and PayPage, respecively, you need to use setCancelUrl().

Note that the default behaviour of the PayPage changed when we launched the revamped PayPage early 2015; before that no cancel button was presented on PayPage unless setCancelUrl() had been set.

Hope that the above explanation was of help, I'll make sure to update the package documentation.

/kgm

paradisehuman commented 9 years ago

Thank you . Your explanation was perfect. My problem was solved.

kilskrift commented 9 years ago

Thanks, glad to be of help.

/kgm