WordPress.org

Forums

Striper - Stripe Integration for WooCommerce
[resolved] [closed] Test Mode, Orders Succeed but Failure Message: Your Session has Expired (22 posts)

  1. dirkse
    Member
    Posted 1 year ago #

    Hi, I am testing the plugin with the latest RC of Woocommerce and my theme and get the following when I try to submit a test payment:

    {"result":"failure","messages":" \n\t\t\t Sorry, your session has expired.

    The orders seem to succeed, both on stripe side and in woocommerce, the error message (and the fact that I get logged out) is the only issue.

    Also, I have tried as a gues/guest creating an account and the same issue happens.

    Thanks,
    Anne

    https://wordpress.org/plugins/striper/

  2. Sean Voss
    Member
    Plugin Author

    Posted 1 year ago #

    Hey Anne,

    By RC do you mean release candidate?

    I'm not sure what I'd be able to do without more information here, I'm not doing anything I know of to the session, but I'll check the code.

    Cheers,

    Sean

  3. wolnik
    Member
    Posted 1 year ago #

    Hi Anne, Sean,

    I have actually got the same issue with WooCommerce 2.1.

    The problem was in /plugins/wp-content/striper/stripe_gateway.php file.

    Line: 188.

    WooCommerce 2.1. doesn't have 'woocommerce_thanks_page_id' option anymore. I have added my own page number instead and it works now. But I still need to find the new WooCommerce 2.1. thank you page :)

    The problem was because get_permalink was returing /wp-admin/ajax.php as a URL.

    Kind regards

  4. wolnik
    Member
    Posted 1 year ago #

    Replace below code located in /plugins/stripes/strip-gateway.php#177:

    if ($this->send_to_stripe())
    {
      $this->completeOrder();
      return array(
    	'result'   => 'success',
    	'redirect' => add_query_arg(
    	  'order',
    	  $this->order->id,
    	  add_query_arg(
    		  'key',
    		  $this->order->order_key,
    		  get_permalink(get_option('woocommerce_thanks_page_id'))
    	  )
    	)
      );
    }

    to [1]

    if ($this->send_to_stripe())
    {
      $this->completeOrder();
    
      wp_redirect($this->get_return_url($this->order));
      exit;
    }

    [1] http://develop.woothemes.com/woocommerce/2013/11/woocommerce-2-1-beta-1-is-ready/ (Getting page permalinks (e.g. in gateways))

  5. wolnik
    Member
    Posted 1 year ago #

    Actually it should be replaced by below:

    if ($this->send_to_stripe())
    {
    	$this->completeOrder();
    
    	$result = array(
    		'result' => 'success',
    		'redirect' => $this->get_return_url($this->order)
    	);
    	return $result;
    }

    Now it works!

  6. dirkse
    Member
    Posted 1 year ago #

    thanks so much! I too had found someone having the same error with other payment types where the page was missing and notice that it was newly changed, but I had *no* idea how to fix it.

  7. wolnik
    Member
    Posted 1 year ago #

    You're welcome, dirkse!

    The newest 0.27 version of the plugin hasn't got above fix applied so the operation needs to be repeated.

  8. Sean Voss
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry about that wolnik, I'll get it in the next version here, I need to see if the get_return_url works with the current version of wp, or if i need to make an if statement.

    Thanks so much for your work on this!

  9. Sean Voss
    Member
    Plugin Author

    Posted 1 year ago #

    Wolnik,

    Check out 0.28 I've added your code, does it work for you out of the box?

  10. wolnik
    Member
    Posted 1 year ago #

    Sean, thanks! It does work out of the box now.

    Great plugin!

  11. Sean Voss
    Member
    Plugin Author

    Posted 1 year ago #

    Awesome!

  12. bahbondo1
    Member
    Posted 1 year ago #

    I am getting this same error after checkout, but with Authorize.net. Does that mean the issue is in the Authorize.net plugin? Thanks for any response.

  13. wolnik
    Member
    Posted 1 year ago #

    The problem is with below deprecated option in WooCommerce version 2.1:

    get_permalink(get_option('woocommerce_thanks_page_id'))

    Above needs to be replaced with the following, where $this is an instance of WC_Order class:

    $this->get_return_url($this->order)

  14. bahbondo1
    Member
    Posted 1 year ago #

    Excellent, Here is the snippet of code to be altered, yes?

    public function get_checkout_order_received_url() {

    $order_received_url = wc_get_endpoint_url( 'order-received', $this->id, get_permalink( wc_get_page_id( 'checkout' ) ) );
    $this->get_return_url($this->order)
    if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) {
    $order_received_url = str_replace( 'http:', 'https:', $order_received_url );
    }

    $order_received_url = add_query_arg( 'key', $this->order_key, $order_received_url );

    return apply_filters( 'woocommerce_get_checkout_order_received_url', $order_received_url, $this );
    }

  15. bahbondo1
    Member
    Posted 1 year ago #

    Sorry I posted too soon, without the ability to edit..

    $this->get_return_url($this->order)
    replaces
    $this->id, get_permalink( wc_get_page_id( 'checkout' )

    Does that appear correct?

    Thanks for the help Wolnik!

  16. dylanwalsh
    Member
    Posted 1 year ago #

    Hi. I'm having the same problem as the above — using the Authorize.net gateway. I see that others have fixed the problem by replacing snippets of code. My question is... can you tell me which specific file in Woocommerce 2.1.2 I can find the code? Thank you all so much!

  17. brianj
    Member
    Posted 1 year ago #

    It's line 169 in class.authorizenetextension.php in the Authorize.net plugin if you bought it from codecanyon. I'm not sure about the official Woocommerce extension.

  18. dustjackettech
    Member
    Posted 1 year ago #

    The problem is with below deprecated option in WooCommerce version 2.1:

    get_permalink(get_option('woocommerce_thanks_page_id'))

    Above needs to be replaced with the following, where $this is an instance of WC_Order class:

    $this->get_return_url($this->order)

    wolnik, I wish I could like your post 100 times.

  19. claytord
    Member
    Posted 12 months ago #

    Holy crow, this just saved my day. God bless you wolnik! I second dustjackettech's 100 likes.

  20. madssingers
    Member
    Posted 11 months ago #

    So I'm battling with the same problem.
    I tried replacing:
    This: get_permalink(get_option('woocommerce_thanks_page_id'))
    with this: $this->get_return_url($this->order)
    However this created fatal plugin error.

    public function set_main_form_data($order_id, $order) {
    $this->payment_form_data["PSPID"] = $this->pspid;
    $this->payment_form_data["ORDERID"] = $order_id;
    $this->payment_form_data["AMOUNT"] = $order->order_total * 100;
    $this->payment_form_data["CURRENCY"] = get_option("woocommerce_currency");
    $this->payment_form_data["LANGUAGE"] = "en_US";
    $this->payment_form_data["ACCEPTURL"] = add_query_arg("key", $order->order_key, add_query_arg("order", $order_id, get_permalink(get_option("woocommerce_thanks_page_id"))));
    $this->payment_form_data["DECLINEURL"] = $order->get_cancel_order_url();
    }

  21. raingear
    Member
    Posted 11 months ago #

    Good day

    I am having the same issue, however we use beanstream for our payment gateway. Can anyone provide information on how to update this?

    Thank you

    Janie

  22. esmi
    Forum Moderator
    Posted 11 months ago #

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else's topic.

    I am now closing this 3 month old, resolved, topic as it references an older version of WordPress..

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Striper - Stripe Integration for WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.