Save Ubercart order in database, processed through custom payment gateway I am developing a custom payment gateway module for ubercart, I am able to complete an order on the third party payment system using their api and its working fine, the problem I am facing is how to save that completed order in the database. If we will see in paypal payment gateway for ubercart when we complete an order, Under store option we have an option to view the orders and there status (please check screenshot below), this is the same thing I want to achieve, in-short how can I keep track of orders processed through a custom payment gateway.



I know there is a hook uc_order_save($order) in ubercart, but I am confused how to implement it, so that it can interact with the internal values of ubercart orders. I am sure there will be a way in ubercart to achieve it.
You do not need to implement that hook. 

First you need to be sure whether the payment service method is gateway or redirect. Depending on this, the payment complete function is different.

Within that function, regardless how it is implemented, here is a list of functions that are helpful.


uc_cart_complete_sale() 



  This function is utilized by the default checkout system and can be
  used by third party checkout integration modules to complete a sale.



uc_order_comment_save() 


to leave comments in the order regarding the payment outcome, as well as watchdog()


uc_payment_enter()



  This function logs a payment for an order in the payment receipts table.