• Resolved jaydisc

    (@jaydisc)


    Hi,

    I reported something very similar to this once before:
    https://www.ads-software.com/support/topic/apple-pay-sheet-often-does-not-show-shipping-addressmethod/

    This time, it’s slightly different, but feels like the same issue.

    In a fresh browser session (I use a new private window), if I navigate to a product, and choose Buy with Apple Pay (not Adding it to Cart), when the Apple Pay sheet shows up, it says “SHIPPING ADDRESS INCORRECT” under my name under the shipping session. I can choose a different address, edit it, it doesn’t matter, it updates a few seconds later at the bottom with “Payment Not Completed” and the sheet retracts.

    If I Add to Cart, and then Buy with Apple Pay from the cart page, everything works fine. If I THEN return to the product page, and try it there, it now works correctly there.

    I’m using Australian addresses, e.g. Buderim, QLD 4556 as the City, State, Postcode.

    It’s something about new sessions… as I say, it’s very reminiscent of this problem here, which royho seemed to easily fix:
    https://www.ads-software.com/support/topic/apple-pay-sheet-often-does-not-show-shipping-addressmethod/

    • This topic was modified 7 years ago by jaydisc.
Viewing 9 replies - 16 through 24 (of 24 total)
  • Plugin Contributor royho

    (@royho)

    Please do test this logged in and logged out just in case. Thanks!

    Thread Starter jaydisc

    (@jaydisc)

    Cool. Refreshes didn’t work. It was the Add to Cart that would do it.

    But subsequent attempts would fail because the cart would be cleared out, and presumably the session with it.

    So what’s the story with 4.0.0? Stable enough for production?

    As always, thanks for your help.

    Thread Starter jaydisc

    (@jaydisc)

    Works logged in and out.

    Plugin Contributor royho

    (@royho)

    Every time you click on the Apple Pay, it would first clear the cart and then add the product in question to the cart. It will do that for each click.

    4.0.0 is now in RC and in private testing so it should be quite stable.

    • This reply was modified 7 years ago by royho.
    Plugin Contributor royho

    (@royho)

    Cool thanks for testing.

    Thread Starter jaydisc

    (@jaydisc)

    Sorry, that was a bit out of context. The changes in 3619d94 work fine.

    You wrote:

    > WC core does not generate session on first page load I believe. The session gets created if you refresh or if you add stuff to the cart.

    I was responding to say that in my case, when Buy with Apple Pay failed from the single product page, refreshes did not change anything. Buying from the single product page ONLY worked if I added to the cart first. But if I cancelled, and then tried again (after it started working), it would actually start failing again, presumably because it cleared the cart again reverting me back to the starting situation. ˉ\_(ツ)_/ˉ

    Thread Starter jaydisc

    (@jaydisc)

    One more question:

    If I just wanted to hide the Single Product Buy With Apple Pay button, this code used to work:

    if ( class_exists( 'WC_Stripe_Apple_Pay' ) ) {
    	remove_action( 'woocommerce_after_add_to_cart_quantity', array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_button' ), 1 );
    	remove_action( 'woocommerce_after_add_to_cart_button',   array( WC_Stripe_Apple_Pay::instance(), 'display_apple_pay_button' ), 1 );
    }

    I poked around, and updated it to this:

    if ( class_exists( 'WC_Stripe_Payment_Request' ) ) {
    	remove_action( 'woocommerce_after_add_to_cart_button', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 );
    	remove_action( 'woocommerce_after_add_to_cart_button', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 );
    	remove_action( 'woocommerce_after_add_to_cart_quantity', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 );
    	remove_action( 'woocommerce_after_add_to_cart_quantity', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 );
    }

    But it would appear that instance() isn’t available in the new class. Any suggestions as to how to accomplish this?

    Plugin Contributor royho

    (@royho)

    There is a new filter for that in 4.0

    wc_stripe_hide_payment_request_on_product_page Just return it to true and it will hide only in the single product page.

    Thread Starter jaydisc

    (@jaydisc)

    Perfect. Thanks.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Apple Pay fails with shipping address on product page, but works from cart’ is closed to new replies.