Payment entry in erpnext after successful payment in razorpay

I have integrated razorpay with my custom erpenxt app . I am able to create payment in razorpay via checkout url ,but after successsful payment done in razorpay corresponding payment entry is not done in erpnext . I want to know how these two are connected .
Also i found the difference in order id created while create razorpay order and the order id returned by the razorpay api ,then how to map them.