• Resolved barnabas1

    (@barnabas1)


    Hello @mrclayton,

    In the past 2 months, I had 3 orders that were paid using Apple Pay or Google Pay and the order was created with incomplete customer’s details. Only City, country and half of the postcode was captured each time, and once the email and phone number was captured as well. . It’s strange as this does not happen with all the customers who use the express payment methods but only scarcely. One person today verified to me that his address details were filled in correctly in his Apple Pay and he uses Apple Pay often when buying online, but when he placed the order his details were captured fragmented. This is the reason I’m filing this support thread.

    What could be the problem? How can I debug such an issue?

    Kind regards,

    Barnabas

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

    (@mrclayton)

    Hi @barnabas1

    What could be the problem? How can I debug such an issue?

    This issue isn’t related to or caused by the Stripe plugin. Here is how the checkout process works within WooCommerce:

    1. A customer fills out their billing and shipping address info or they use a wallet payment method like Apple Pay which populates the address info for them.
    2. The checkout form submits and WooCommerce uses ajax to submit the data to the server.
    3. In file class-wc-checkout.php, WooCommerce performs the following actions
      • Validate the checkout data including billing and shipping address. If any required fields are missing data, WooCommerce will return an error message
      • If all required fields have valid values, create the WC_Order object.
      • Passes the WC_Order to the payment gateway so payment can be processed.
      • Once the payment gateway responds with a success result, WooCommerce redirects to the thank you page.

    If you go to stripe.com > payments you can see all the data passed to Stripe and I am confident the address data will have been passed in it’s complete form. If the Stripe plugin wasn’t providing all of the address data, the WooCommerce validations would prevent the payment processing step from happening.

    You likely have some plugin that’s either changing the order’s data after the checkout process, or it’s holding a stale version of the WooCommerce order and it’s saving that stale object which is overriding the address data.

    Kind Regards

    Thread Starter barnabas1

    (@barnabas1)

    Hello @mrclayton,

    Indeed, you are right, Stripe has all all the customer’s data.

    Thank you for the thorough explanation, it’s crystal clear now in my head. Much appreciated.

    Best regards,

    Barnabas

    jackpd

    (@jackpd)

    Apologies for jumping in on someone else’s thread, but we’re having the same issue and thought replying would preferable than starting a new thread. If not, please let me know and I’ll start a new one.

    We’re using both your Stripe plugin (with cards and apple pay active) and PayPal plugin. Approx 10 out of 1000 odd orders we’ve received since going live have incomplete address data. Shipping address completely empty with billing address partially complete against the order. As you stated above, it is the case that the complete address details can be found on the Stripe transaction.

    The issue is very sporadic and so far 9 affected orders have been Apple Pay and 1 PayPal. There was also one instance where the same customer purchased with Apple pay about an hour apart, one order was fine, with the other affected as above.

    You mention it will likely be another plugin causing the issue, we’re fairly light on plugins:

    Active Plugins (15)
    
    The SEO Framework: by The SEO Framework Team – 5.0.6
    CommerceGurus CommerceKit: by CommerceGurus – 2.2.9
    Contact Form 7: by Takayuki Miyoshi – 5.9.4
    GTM Kit: by GTM Kit – 1.22.4
    Index WP MySQL For Speed: by Oliver Jones
    Rick James – 1.4.18
    
    Kirki Customizer Framework: by Themeum – 5.1.0
    Klaviyo: by Klaviyo
    Inc. – 3.3.5
    
    Payment Plugins for PayPal WooCommerce: by Payment Plugins
    support@paymentplugins.com – 1.0.47
    
    Premmerce Permalink Manager for WooCommerce: by Premmerce – 2.3.11
    Payment Plugins for Stripe WooCommerce: by Payment Plugins
    support@paymentplugins.com – 3.3.62
    
    WooCommerce Brands: by WooCommerce – 1.6.66
    WooCommerce Dynamic Pricing: by Element Stark – 3.2.6
    WooCommerce Google Product Feed: by Ademti Software Ltd. – 10.12.5
    WooCommerce: by Automattic – 8.7.0 (update to version 8.9.2 is available)
    WP Redis: by Pantheon
    Josh Koenig
    Matthew Boynes
    Daniel Bachhuber
    Alley Interactive – 1.4.4
    

    As far as I’m aware the only plugin which could be causing issues like this with stale data is wp-redis. Do you agree this is likely the culprit out of the above list?

    And if so, I can exclude certain keys from redis. Is there a way to exclude keys related to this particular issue?

    Thanks in advance,
    Jack

    Thread Starter barnabas1

    (@barnabas1)

    Hi @jackpd,

    The only plugin we have in common apart from WooCommerce is the SEO Framework. Just saying for information here. I don’t know what the exact issue might be. I’ll wait for @mrclayton to reply for more information.

    I also user Redis, but by another author: https://en-gb.wordpress.org/plugins/redis-cache/

    • This reply was modified 2 months ago by barnabas1.
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @jackpd

    Do you agree this is likely the culprit out of the above list?

    I don’t know how that plugin works but I’d say that’s a very good place to start. I would recommend contacting the team behind the Redis plugin and showing them this thread. They will have a better idea of what keys you can exclude, if this issue is caused by their plugin.

    It’s probably occurring at some point during the WC_Order::payment_complete call because that’s when the order’s status gets updated and saved.

    Kind Regards

    jackpd

    (@jackpd)

    Thanks both for your replies.

    @barnabas1 out of interest, do you use any sort of object caching? E.g. Redis, Memcache or similar?

    @mrclayton okay, will do. WP-redis just enables an object cache via a redis instance. I might even try disabling it for a week and I can at least rule it out if the issue reoccurs.

    If it is indeed stale order data, I’m just wondering where the partial/incomplete address data is coming from? In all cases, it’s been the city, country and half of the postcode I.e AB1 or CM12, it’s never complete.

    e.g. a customer adds some items to the basket, goes to checkout and clicks pay with Apple Pay express checkout (before entering any address details at all) – at what point would WooCommerce get the customers city and half the postcode – which is later set against the order instead of the complete Stripe address details?

    Many thanks,

    Jack

    Thread Starter barnabas1

    (@barnabas1)

    @jackpd I have exactly the same issue with city, country and half postcode being saved to the order.

    I’m using this Redis plugin on Nginx server.

    [edit] I just noticed that you use another one plugin that I also use ->Index WP MySQL For Speed

    • This reply was modified 2 months ago by barnabas1.
    jackpd

    (@jackpd)

    @barnabas1 if that’s the case then I’ve got a strong suspicion it’s something to do with Redis as both plugins are basically just a sort of WP interface for Redis and effectively do the same thing. We’re also on Nginx funnily enough but I’d like to rule out Redis first before looking into Nginx being a cause as in my opinion it’s less likely.

    I will run some tests and if need be, I’ll disable Redis for a period of time to see if the issue goes away. I’ll be sure to let you know if I do get to the bottom of it as your input has been helpful.

    On an unrelated side note: We used to use the same plugin as you but switched as it doesn’t fail gracefully like wp-redis does. Something to keep in mind if you ever see Redis errors in your logs.

    • This reply was modified 2 months ago by jackpd.
    Thread Starter barnabas1

    (@barnabas1)

    @jackpd Thanks for the tip. I’ll keep it in mind for the future.

    All the best with the testing. I hope you figure out what’s going on. Please keep us posted if you do get to the bottom of it.

    jackpd

    (@jackpd)

    @barnabas1 Just one last clarification to make sure the problem we are seeing is identical.

    When you view an affected order on WooCommerce, the incomplete/fragmented address shows in the billing address section only and the shipping address is empty/blank?

    Thread Starter barnabas1

    (@barnabas1)

    @jackpd Exactly! You could not be more accurate than this. Our problem is identical.

    Does deactivating The SEO Framework resolve the issue? If not, then the problem might indeed lie with Redis object caching.

    Thread Starter barnabas1

    (@barnabas1)

    Update: I had Redis deactivated for several days for testing this, but it happened again with a couple of order that used Apple Pay.

    So, Redis is not the issue it seems.

    • This reply was modified 1 month, 2 weeks ago by barnabas1.

    @barnabas1 Surprisingly Redis was/is not the cause for us either.

    We still are getting about 3-5 of these per day, always Apple Pay or PayPal payments. It has never affected a standard Stripe card payment order.

    @mrclayton can you think of a reason why the only orders to be impacted by this would be Apple Pay / PayPal orders? Is the “order save” flow different for these orders as opposed to standard card payment orders?

    It’s beyond just a trend now, we have enough data to say for sure it has zero impact on the credit/debit card orders, so figuring out how Apple Pay/PayPal differs seems like the next obvious place to investigate.

    Thanks in advance

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @jackpd

    can you think of a reason why the only orders to be impacted by this would be Apple Pay

    The same code base is used regardless of whether it’s a credit card gateway payment or an Apple Pay payment. Neither the Stripe plugin nor the PayPal plugin store a reference to the WC_Order object.

    Here is a link to the code that populates the payment intent’s shipping address info directly from the WC_Order:

    https://plugins.trac.wordpress.org/browser/woo-stripe-payment/tags/3.3.71/includes/abstract/abstract-wc-stripe-payment.php#L220

    https://plugins.trac.wordpress.org/browser/woo-stripe-payment/tags/3.3.71/includes/abstract/abstract-wc-stripe-payment.php#L304

    You confirmed that the payment intent within Stripe has the complete shipping address. So that means at the time the Stripe plugin is called to process the payment, the order’s address info is complete. That would point toward something manipulating the order’s info after the payment process is complete.

    If you perform a code search in both plugins you will see there isn’t any code that updates the WC_Order address info.

    For what it’s worth, of the tens of thousands of test orders that have been created in testing this plugin I’ve never seen this issue occur. I’d recommend you creating a support ticket here and we can continue to troubleshoot.

    Kind Regards

Viewing 15 replies - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.