• I think you should do something like that in the redirectpage() function :

    
    $success_redirect_page_slug = get_post_field( 'post_name', $this->success_redirect_page_id );
    $pending_redirect_page_slug = get_post_field( 'post_name', $this->pending_redirect_page_id );
    $failure_redirect_page_slug = get_post_field( 'post_name', $this->failure_redirect_page_id );
    
    if($status == 'COMPLETE'){
          $redirect = $home . '/' .$success_redirect_page_slug.'/order-received/'.$order_id.'/?key='.$dusupay_transactionReference;
     }
    elseif($status == 'PENDING'){
         $redirect = $home . '/' .$slug.'/order-received/'.$order_id.'/?key='.$dusupay_transactionReference;
     }
    elseif($status == 'FAILED' || $status == 'CANCELLED'){
           	$redirect = $home . '/' .$failure_redirect_page_slug.'/order-received/'.$order_id.'/?key='.$dusupay_transactionReference;
              	}else{
               		wc_print_notice(__('Payment Status is currently unknown. Please contact us.','woocommerce'), 'notice');
    	        	echo "<div><a href='".$home."'>Return Home</a></div>";
    	        	exit();
              	}
    

    So you could use the order_id if you want to. It helped me.

    • This topic was modified 6 years, 6 months ago by jonnuggets.
  • The topic ‘Good But’ is closed to new replies.