1. Home
  2. Jobster
  3. Payment Gateways API
  4. processgateway_function()


This function is hooked to the wpjobster_processafter_sample_gateway action, which is called when your gateway responds to the site with the payment status.

Here, using the order ID that you have previously sent to the gateway, you get the order details and do the required verifications before marking the payment as completed or failed.

First of all you need to check if the answer from the gateway is successful. We also recommend checking if the amount paid is correct.

Below is a small example of a success case.

if ( $status == 'success' ) {

	// do your verifications below
	// we recommend checking at least if the amount is the same

	$payment_status = 'completed';
	$payment_response = maybe_serialize( $_POST ); // for later debug
	$payment_details = '';


	if ( get_option( 'wpjobster_sample_success_page' ) != '' ) {
			get_permalink( get_option( 'wpjobster_sample_success_page' ) ) );
	} else {
			get_bloginfo( 'siteurl' ) . '/?jb_action=chat_box&oid=' . $order_id );