Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #911589

    photomeblack
    Participant

    X is a great theme! There’s only one problem I can’t seem to resolve. After my customers successfully checkout, they do not see the “order-received” page. 404 error “Oops! You blew up the Internet.” scares them into calling me to confirm that the order did, in fact, process. I’m using the X (4.4.2) Integrity stack, X-Child (1.0.0) theme on WordPress 4.5.1 with WooCommerce 2.5.5. I’ve tried flushing the permalinks, editing the functions.php file, disabling all plugins except WooCommerce, enabling plugins one at a time, and various other minor changes. All to returning no success.

    Is there anything else that might solve this disconnect/redirect problem?

    Otherwise, thanks for an awesome theme!

    #911593

    photomeblack
    Participant

    Little more info: URL to site – https://www.ganderlock.com, cornerstone version 1.2.4

    #911998

    Lely
    Moderator

    Hello There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #913207

    photomeblack
    Participant
    This reply has been marked as private.
    #913591

    photomeblack
    Participant
    This reply has been marked as private.
    #913655

    Rad
    Moderator

    Hi there,

    There are doubled entries within your site’s .htaccess. I removed the duplicates and flushed your site’s permalinks.

    Please test it again, I can’t check the checkout since it’s live and requires valid payment.

    Thanks!

    #914265

    photomeblack
    Participant

    Thanks Rad,

    I put the payment gateway in TEST mode and checked out, but still received the “Oops! You blew up the Internet.” error page.

    #943606

    Rahul
    Moderator

    Hi @Abes, you need to check which payment plugin you are using that caused the redirection problem.

    In the plugin folder, open up the plugin php file, find a function called ‘process_payment()’, there should be have few lines under comment section ‘redirect to order received page’:

    'redirect' => $this->get_return_url( .... )

    Please make sure you are using this:

    'redirect' => $this->get_return_url( $order )

    I hope this helps.

    Thanks

    #973326

    photomeblack
    Participant

    Hi Rahul,
    This is the only code I could find that was similar to yours. The file’s name is gateway.php in my payment plugin folder. About 3/4 the way down, it has a line that resembles your code above. Since the parentheses are empty can I simply insert ( $order )?

    Thanks for your input.

    /**
           * Process the payment and return the result
          **/
          function process_payment($order_id)
          {
             global $woocommerce;
             $order = new WC_Order($order_id);
    
             if($this->mode == 'true'){
               $process_url = $this->testurl;
             }
             else{
               $process_url = $this->liveurl;
             }
             
             $params = $this->generate_authorizeaim_params($order);
             
             $post_string = "";
             foreach( $params as $key => $value ){ 
                $post_string .= "$key=" . urlencode( $value ) . "&"; 
             }
             $post_string = rtrim( $post_string, "& " );
             
             $request = curl_init($process_url); // initiate curl object
             curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
             curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
             curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
             curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
             $post_response = curl_exec($request); // execute curl post and store results in $post_response
             curl_close ($request);
             
               
           $response_array = explode('|',$post_response);
       
          
             if ( count($response_array) > 1 ){
             
                if($response_array[0] == '1' ){
    
                    if ($order->status != 'completed') {
                        $order->payment_complete( $response_array[6]);
                         $woocommerce->cart->empty_cart();
    
                         $order->add_order_note($this->success_message. $response_array[3] . 'Transaction ID: '. $response_array[6] );
                         unset($_SESSION['order_awaiting_payment']);
                     }
    
                      return array('result'   => 'success',
                         <strong>'redirect'  => get_site_url().'/checkout/order-received/'.$order->id.'/?key='.$order->order_key );</strong>
    
                }
                else{
                
                    $order->add_order_note($this->failed_message .$response_array[3] );
                    wc_add_notice($message = '(Transaction Error) ' . $response_array[3], $notice_type = 'error'); 
                }
            }
            else {
                
                $order->add_order_note($this->failed_message);
                $order->update_status('failed');
                wc_add_notice($message = '(Transaction Error) Error processing payment.', $notice_type = 'error'); 
            }
             
             
             
          }
    #978231

    Rad
    Moderator

    Hi there,

    Yes please, but should be like this

    return array('result' => 'success', 'redirect' => get_site_url().'/checkout/order-received/'.$order->id.'/?key='.$order->order_key );

    Without <strong> and </strong>

    Thanks!

    #979306

    photomeblack
    Participant

    Hi Rad,

    Still no “order-received” page. This is the code that I inserted:

    return array('result'   => 'success',
                         'redirect'  => get_site_url( $order ).'/checkout/order-received/'.$order->id.'/?key='.$order->order_key );

    I even flushed my permalinks again, but I still blew up the Internet. Do you know of any other code I should check?

    Thanks.

    #979835

    Rad
    Moderator

    Hi there,

    Would you mind providing a screen recording of this issue? And please provide the card information we can use for testing.

    Thanks!

    #980321

    photomeblack
    Participant
    This reply has been marked as private.
    #980703

    Rad
    Moderator

    Hi there,

    Thanks, but it’s not continuing on my end. It says (Transaction Error) This transaction has been declined..

    Please contact the plugin/payment author as the coding is located to the gateway files under their plugin.

    Thanks!

    #983090

    photomeblack
    Participant

    Hi Rad,

    If I sent you the gateway.php file, would you be able to tell by looking at the code what the problem might be?

    Thanks.