IPN setup for third party payment gateway

I use NOWpayment cryptocurrency payment gateway on my Shopify store. Shopify doesn’t catch my order since it is a manual payment system. I had to mark each order as paid in order to fulfill. To avoid that, I am setting up NOWpayment IPN with Shopify. I have generated IPN secret key and also added endpoint address for receiving webhook in both NOWpayment and Shopify. I want to change financial status from “pending” to “paid” after receiving IPN from NOWpayment saying the customers has fully paid for the orders. How can I program this?