Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @xinen,

    Thanks for contacting us. I don’t encounter this error when testing as a logged out user, but I also don’t have the billing email set as optional on my testing site. Can you please verify if you have the billing email set as not required or if it’s even visible on the checkout page for a logged out user?

    If you don’t have the billing email enabled or it’s optional you will want to enable it. If that’s not in line with your business practice let me know and I will respond with a snippet of code that removes the email address before the source object is sent to Stripe.

    Kind Regards,

    Thread Starter Cammy Ang

    (@xinen)

    Hi @mrclayton

    Billing email isn’t enabled, could you please provide a snippet of code that removes it?

    Amazing plugin. Stay safe always,

    Thanks,
    Cammy

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @xinen,

    Here is the snippet of code to add to your site:

    /**
     * Unset the owner email if empty, during source create api calls.
     */
    add_filter('wc_stripe_api_request_args', function ($args, $property, $method){
    	if('sources' === $property && 'create' === $method){
    		if(empty($args[0]['owner']['email'])){
    			unset($args[0]['owner']['email']);
    		}
    	}
    	return $args;
    }, 10, 3);

    In the next release I will add a validation that will automatically unset the owner email of it’s empty.

    Glad you like the plugin, if you have a moment we always appreciate a kind review:

    https://www.ads-software.com/support/plugin/woo-stripe-payment/reviews/

    Kind Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Alipay error – Email invalid’ is closed to new replies.