package service.pay;

import util.PayUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.SortedMap;

/**
 * 付啦 统一下单后支付回调 接口测试
 * Created by wuming on 16/10/24.
 */
@WebServlet("/notify")
public class Notify extends HttpServlet{

    public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{
        try {
            SortedMap<String, String> param = PayUtil.readFulaNotify(req);
            if(PayUtil.verifyFulaParam(param)){
                // 根据修改业务逻辑 具体参数参见API文档
                System.out.println(param);
                res.getWriter().print("success");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return;
    }

}

@@ -704,122 +704,274 @@
     
-// %E6%A0%B9%E6%8D%AE%E4%BF%AE%E6%94%B9%E4%B8%9A%E5%8A%A1%E9%80%BB%E8%BE%91 %E5%85%B7%E4%BD%93%E5%8F%82%E6%95%B0%E5%8F%82%E8%A7%81API%E6%96%87%E6%A1%A3%0A                System.out.println(param);%0A                res.getWriter().print(%22success%22
+System.out.println(param);%0A                // %E6%A0%B9%E6%8D%AE%E4%BF%AE%E6%94%B9%E4%B8%9A%E5%8A%A1%E9%80%BB%E8%BE%91 %E5%85%B7%E4%BD%93%E5%8F%82%E6%95%B0%E5%8F%82%E8%A7%81API%E6%96%87%E6%A1%A3%0A                // TODO wuming 17/1/17 %E4%B8%8A%E5%8D%8811:57%0A                // ...%0A                res.getWriter().print(%22success%22);%0A                res.getWriter().flush();%0A                res.getWriter().close(
 );%0A 

update notify