0

When I try to update database table with payment details from webhook url of the instamojo payment gateway it is not working at all

following is the controller class

@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's are able to print the details but method never get executed

  • Please test your webhook endpoint using their Webhook testing tool: https://www.instamojo.com/integrations/ and check the error message received there. – Ashwini Chaudhary Sep 21 '16 at 12:58

1 Answers1

0

You need to get the data from webhook use: https://support.instamojo.com/hc/en-us/articles/208485745-Webhook-URL-in-PHP-Python

JWC May
  • 605
  • 8
  • 14