ASP.NET MVC付款响应HTTP 500错误

时间:2018-07-27 12:56:36

标签: asp.net-mvc integration pos

我在ASP.NET MVC网站中有一个虚拟pos集成。当我完成付款时,我的提供者将发布数组以确认付款。我必须使用函数将订单状态更改为“已付款”,并且必须将响应(“确定”)发送给我的提供商。但是,如果我在确认功能之前发送response(“ OK”)和response.End(),则我的订单无法确认。如果我在response(“ OK”)和response.End()之前确认订单,由于HTTP 500错误,我的付款未处理。 Http 500返回到提供程序。请帮忙。感谢您的回答。

if (status == "success")
        { //Payment Confirmed

            try
            {

                UpdateOrder(merchant_oid);

            }
            catch (Exception)
            {


            }finally
            {
                    context.Response.Clear(); // clear response buffer
                    context.Response.Write("OK"); // write your new text
                    context.Response.End();
            }

我的服务器返回给提供者

HTTP Hata Kodu: 500<br><!DOCTYPE html>
<html>
<head>
 <title>Object reference not set to an instance of an object.</title>

0 个答案:

没有答案