MVC中的Worldpay集成问题

我正在尝试在我的MVC项目中实施worldpay支付方法并尝试进行测试付款,但它向我显示此错误

  • 您已完成或取消了付款。
  • 您已禁用Cookie。 要完成付款,请通过更改浏览器中的隐私设置来启用Cookie。 然后返回商家网站并重新提交付款。
  • 您在WorldPay上的会话已超时。 请返回商家网站并重新提交付款。

我正在尝试的代码

尝试通过WorldPay测试订单放置

 

然后在视图文件中添加此脚本

   

现在在控制器中添加此订单放置代码

 public ActionResult payment(string token) { var restClient = new WorldpayRestClient("https://api.worldpay.com/v1", "Your_Service_Key"); var orderRequest = new OrderRequest() { token = token, amount = 500, currencyCode = CurrencyCode.GBP.ToString(), name = "test name", orderDescription = "Order description", customerOrderCode = "Order code" }; var address = new Address() { address1 = "123 House Road", address2 = "A village", city = "London", countryCode = CountryCode.GB, postalCode = "EC1 1AA" }; orderRequest.billingAddress = address; try { OrderResponse orderResponse = restClient.GetOrderService().Create(orderRequest); Console.WriteLine("Order code: " + orderResponse.orderCode); } catch (WorldpayException e) { Console.WriteLine("Error code:" + e.apiError.customCode); Console.WriteLine("Error description: " + e.apiError.description); Console.WriteLine("Error message: " + e.apiError.message); } return Json(null, JsonRequestBehavior.AllowGet); }