• Resolved niaccurshi

    (@niaccurshi)


    Have updated recently the store of a client to the latest woo and stripe gateway files. Found out today that GUEST customers (customers not logged in) are not able to complete payment because the following error shows:

    “Developers: Please make sure that you are including jQuery and there are no JavaScript errors on the page.”

    I have dutifully checked and there are neither JS errors nor is JQuery missing. I have searched through the code for this plugin, before that error message I can see…

    $source = $this->get_source( get_current_user_id(), $force_customer );
    
      if ( empty( $source->source ) && empty( $source->customer ) ) {
    
    I have output the "$force_customer" variable and can see it's false, and  have output the effects of the "get_source" funciton and can see it's returning false on all counts. The problem, clearly, is that you seem to require the person to be logged in using "get_current_user_id()" in order to ascertain their ID, of which they will have none if they are a guest customer.
    
    In a previous version of this plugin the code looked much more setup for dealing with guest accounts
    
    

    $customer_id = is_user_logged_in() ? get_user_meta( get_current_user_id(), ‘_stripe_customer_id’, true ) : 0;

    
    

    if ( ! $customer_id || ! is_string( $customer_id ) ) {

    		$customer_id = 0;
    

    }

    At no point in the 3.0.5 plugin is there any form of check to make sure that the person is not logged in.

    Am I missing something here with regards to how you’re choosing to handle guest customers? Or is it now a feature that you must be logged in to be able to pay via this Stripe Gateway plugin? I’m not entirely sure how much money our client has lost because of this, it would have been nice to know it was going to be a change from the functionality of its 2.6 iteration, but if it is a bug then do you have an estimate on how long it’ll take to resolve this problem?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Phil

    (@fullysupportedphil)

    Automattic Happiness Engineer

    Hi @niaccurshi

    The Gateway should function the same for customers regardless of if they log in or not. We haven’t been able to replicate this behaviour in version 3.0.5, but there seems to be a few scattered instances of this happening such as yours.

    Can you please try deactivating the plugin. Once it is deactivated, remove the plugin and then reinstall a fresh copy of if.

    If you can still replicate this behaviour after reinstalling, can you please submit a ticket to us at https://woocommerce.com. You can do that by going to Support > Helpdesk > Create a ticket > Free plugins.

    Please include admin credentials so that we can take a closer look at this.

    Thanks @niaccurshi ??

    Thread Starter niaccurshi

    (@niaccurshi)

    No luck with deactivating, removing, reinstalling and reactivating the plugin. I find it surprising that you can’t replicate this behaviour since I can see that the primary problem is a complete lack of the “stripe_token” POST variable as a “guest” that everything seems to hinge around.

    I’ll see about opening a ticket, as I’m sure you understand there are a ton of Data Protection Law issues with just handing over an admin login to you to look for the cause of this problem.

    Thread Starter niaccurshi

    (@niaccurshi)

    OK I found my problem, another plugin was removing the class “woocommerce-checkout” from the form.

    It feels to me that it’s not explicit enough in the documentation that for the functionality to work via stripe.js (or min.js) that you need to have the class of “woocommerce-checkout” on your checkout form. While I understand this is the default class to have on the form, there are lots of things that developers can end up doing and inheriting that can leave them, like me, tearing their hair out looking for a solution in all the wrong places.

    Please just list the requirements of the structure of the checkout page, such as the form needing the class “woocommerce-checkout”, so people can quickly check against these basics before anything else without needing to trawl through the code ??

    Phil

    (@fullysupportedphil)

    Automattic Happiness Engineer

    Hey Niaccurshi,

    Thanks for the followup and I’m glad that you found the solution. It’s good for us to know that is what caused the issue for you. We do all of our testing on stock WooCommerce and WordPress installations, which is why we would not have encountered this.

    I’m going to pass this along to our development team, as well as the team that handles our documentation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Guest customers can’t pay, getting “Developers:” error message in 3.05’ is closed to new replies.