如何使用Spring控制器中Instamojo的webhook url更新mysql数据库

时间:2016-09-20 13:32:33

标签: webhooks instamojo

当我尝试使用instamojo支付网关的webhook网址中的付款详细信息更新数据库表时,它根本无法正常工作

以下是控制器类

@Async
@Controller
public class PaymentWebhook {

    @Autowired
    private UserService userService;

    @ResponseBody
    @RequestMapping(value = "/payment", method = RequestMethod.POST)
    public String savePaymentDetails(@RequestParam Map<String, String> params) {

        System.out.println(params.get("buyer"));
        System.out.println(params.get("buyer_name"));
        System.out.println(params.get("status"));
        System.out.println(params.get("payment_id"));
        System.out.println(params.get("amount"));

        PaymentDetails details = new PaymentDetails();
        details.setUser_name(params.get("buyer_name"));
        details.setPayment_id(params.get("payment_id"));
        details.setPayment_status(params.get("status"));
        details.setMail(params.get("buyer"));
        details.setAmount(Integer.parseInt(params.get("amount")));
        userService.savePaymentDetails(details);

        return "success";

    }

}

sop能够打印细节,但方法永远不会被执行

1 个答案:

答案 0 :(得分:0)