Solved there was an extra field for USA country users need to pass, that is the State Code, That was missing.
SagePay Response Issues
-
21-06-2023 - |
题
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.
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.
Finally I believe because of these errors I get following error in the same page which the IFrame is included.
After seven to eight minutes, my PaymentResponse Controller again got called with the error message "2008: The transaction timed out".
Please help me to find out the actual cause of this error.
解决方案