I am trying to integrate the sagePay in an ASP.NET MVC project. I used Iframe mode of the SagePay. After I submit the credit card details using pay button, I am able to get response to my notification Controller (Which I sent us the notification URL) with a message "0000: The Authorization is successfull" and WasTransactionSuccessful as true.

Controller Code:

public ActionResult Notify(SagePayResponse response)
        {

            if (string.IsNullOrEmpty(response.VendorTxCode))
            {
                return new ErrorResult();
            }

            if (response.WasTransactionSuccessful)
            {
                return RedirectToAction("Success", new { vendorTxCode = response.VendorTxCode });
            }
            else
            {
                return RedirectToAction("Failed", new { vendorTxCode = response.VendorTxCode });
            }
        }

The same controller has called five times repeatedly with same values.

enter image description here

However the final response comes with an error "5004 : The transaction state is invalid". And the variable WasTransactionSuccessful is false. As give in the image.

enter image description here

Finally I believe because of these errors I get following error in the same page which the IFrame is included.

enter image description here

After seven to eight minutes, my PaymentResponse Controller again got called with the error message "2008: The transaction timed out".

enter image description here

Please help me to find out the actual cause of this error.

有帮助吗?

解决方案

Solved there was an extra field for USA country users need to pass, that is the State Code, That was missing.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top