• Resolved firebird75

    (@firebird75)


    Hello,

    There is an issue with Stripe payment gateway for Woocommerce. It will reject orders in the following scenario :
    1/ Email entered isn’t a valid email (even if email has been set to not be required)
    2/ Email entered is valid but contain a trailing space

    I have used Woocommerce filters to make the email not required. User can put it if they want to but this isn’t mandatory. It is up to them. If the field is left empty, the order goes through correctly. But in the 2 scenarios described above, the order won’t go through which isn’t good. A user can sometime put a trailing space without noticing it. Then, some people don’t know what an email address is or just don’t have one so they will either leave the field empty or just put a dummy value. In both cases, this should be accepted as the email field was set as not required via hooks.

    This was tested with latest versions of Woocommerce and Stripe plugin.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @firebird75,

    I’ve tried duplicating this locally, but I’m not experiencing the same results.

    This could be caused by a conflict with your theme or with another plugin.

    The best way to determine if the issue is being caused by a theme and/or plugin is to temporarily switch your theme to Storefront (https://woocommerce.com/storefront/?aff=10486&cid=1131038) and disable all plugins except for WooCommerce and Stripe. Finally, test to see if the issue is resolved by checking out with a product and using a trailing space behind the email address.

    To figure out which plugin is causing the problem, continue to the next step – reactivate your other plugins one by one, testing after each, until you find the one causing conflict.

    Here’s a more extensive explanation in our docs: https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Let us know how that goes!

    Thank you,
    Joey

    Thread Starter firebird75

    (@firebird75)

    Hello Joey,

    Have you set the email to not be required via hooks? Here is the code I use to achieve that :

    add_filter('woocommerce_checkout_fields','custom_override_checkout_fields');
      
    function custom_override_checkout_fields($fields)
    {
    	$fields['billing']['billing_email']['required'] = false;	
    
    	return $fields;
    }

    Thank you!

    Hi there @firebird75,

    Have you set the email to not be required via hooks?

    I actually have just tested it with our Checkout Field Editor plugin – I made billing_email field optional and got the same result – I could place an order with an empty email string, but whenever I typed something, it is checked to be in a proper email format.

    I then confirmed with our developers that even if the field is optional, its input is still validated by Stripe itself so this is not something that we can change.

    Hope it still helps!

    Thread Starter firebird75

    (@firebird75)

    Hello,

    Thank you for testing! I guess the right thing to do would be to not pass the email to Stripe if it isn’t valid and not a mandatory requirement in current configuration. That way, Stripe wouldn’t check it out and reject the order.

    A lot of people don’t have a mail or don’t want to share it. They will eventually fill in dummy data just to make sure they have filled in all fields. This is a natural behavior. Rejecting orders because of that isn’t a good business practice. Control is ok as long as it doesn’t hurt business ??

    Hi there @firebird75,

    I guess the right thing to do would be to not pass the email to Stripe if it isn’t valid and not a mandatory requirement in current configuration. That way, Stripe wouldn’t check it out and reject the order.

    I’d encourage you to share your thoughts on Stripe GitHub repository – https://github.com/woocommerce/woocommerce-gateway-stripe/issues?q=is%3Aopen+is%3Aissue – where you can discuss this approach with our developers directly and get first-hand insight from them ??

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Orders with invalid emails rejected’ is closed to new replies.