Below you will find a few more functions which you may use in your gateway.
This function is a helper that handles the credentials and some settings of the gateway. It makes the code cleaner, because in our example we needed those credentials in both taketogateway_function() and processgateway_function().
get_common_details( $gateway, $orderid, $currency )
This function returns the information about a particular order, or inserts a new one.
(string) (Required) The gateway unique slug, like: $this->unique_slug
(int) (Optional) The order ID that you want to retrieve. If it is 0, it inserts a new order.
Default value: 0
(string) (Optional) The currency in which to process the payment. By default, the current site currency.
Default value: ”
/* Array( [price] => 109 // job price [post] => WP_Post Object // job object [uid] => 3 // buyer id [pid] => 3318 // job id [selected] => USD // selected currency [job_title] => Title Example // job title [wpjobster_final_payable_amount] => 134.72 // final price including all taxes [order_id] => 768 // order id [current_user] => Object // current user object [currency] => USD // currency ) */
wpjobster_mark_job_prchase_completed( $orderid, $status, $response, $details )
This function updates the order with the info received from the payment gateway.
(int) (Required) The order ID that you want to update.
(string) (Optional) Can be either ‘completed’ or ‘failed’. Empty ‘’ is also ‘completed’.
(string) (Optional) Usually the serialized $_POST data for debug purposes
(string) (Optional) Any other info that you may find useful