• Resolved paulwessiack

    (@paulwessiack)


    Hi,

    We see a strange behavior when using the Apple Pay button on the product detail page: https://www.magped.com/en/shop/magped-sport2/

    When you change the attribute to 200N magnet size and then click the Apple Pay button then the wallet opens but 6€ shipping fee are included – but in WooCommerce free shipping is configured > 95€ for EU countries.

    please see the screenshot of the iPhone here: https://1drv.ms/i/s!At48GCH6HFrwkeZJHDv-5IhkCq_FBw?e=Cl6VZ6

    When I put the product in the webshop basket and go to checkout no shipping fees are calculated – which is correct.

    This behavior only happens on iPhone not on the Mac using Safari. If I try it in Safari on Mac the Apple Wallets opens correct and no shipping fees are calculated.

    kind regards

    :: Paul

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter paulwessiack

    (@paulwessiack)

    I was able to reproduce the problem now also on the Mac with Safari.

    When you go to https://www.magped.com/shop/magped-sport2/

    choose 200N press Apple pay button 119€ will show up in the wallet with free shipping –> which is correct.

    When I then cancel that Apple Pay payment and remove the product from the mini cart basket (top right corner) and then choose the 200N again and press the Apple Pay button again, then it shows 125€ with 6€ shipping –> which is not correct.

    If I then choose for example another color the Apple Pay button refreshes again and when I click Apple Pay button the wallet opens again, but now with the correct 119€ and free shipping.

    Hope this helps to reproduce the issue on your end.

    we are hosted on kinsta and caching is disabled for all shop pages /shop/

    and of course I disabled WP-Rocket to test it. But the issue is still there when WP-Rocket is disabled.

    kid regards

    :: Paul

    • This reply was modified 1 year, 3 months ago by paulwessiack.
    • This reply was modified 1 year, 3 months ago by paulwessiack.
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @

    I was able to re-create the described issue by following your instructions.

    Are you using any 3rd party plugins for your shipping integration?

    Here is an explanation of why I think this is happening.

    1. When you make a product variation select, or when the product page loads, the Stripe plugin makes a request to the https://www.magped.com/en/?wc-ajax=wc_stripe_frontend_request&path=/wc-stripe/v1/cart/cart-calculation endpoint.
    2. This endpoint performs a cart calculation, using the WooCommerce cart, so the Stripe plugin can get the request object that Apple Pay needs when launching the Apple Pay wallet. The click event for the Apple Pay button must be synchronous, which means you have to have all of the request data at the time of the button being clicked.

    Here is the response from your server when performing that cart calculation:

    {
        "data": {
            "stripe_applepay": {
                "total": "128.00",
                "subtotal": "119.00",
                "totalCents": 12800,
                "displayItems": [
                    {
                        "label": "magped SPORT2 - 200N, green",
                        "pending": false,
                        "amount": 11900
                    },
                    {
                        "label": "Shipping",
                        "pending": false,
                        "amount": 900
                    }
                ],
                "shippingOptions": [
                    {
                        "id": "0:flat_rate:13",
                        "label": "Shipping fee",
                        "detail": "",
                        "amount": 900
                    }
                ]
            },
            "stripe_payment_request": {
                "total": "128.00",
                "subtotal": "119.00",
                "totalCents": 12800,
                "displayItems": [
                    {
                        "label": "magped SPORT2 - 200N, green",
                        "pending": false,
                        "amount": 11900
                    },
                    {
                        "label": "Shipping",
                        "pending": false,
                        "amount": 900
                    }
                ],
                "shippingOptions": [
                    {
                        "id": "0:flat_rate:13",
                        "label": "Shipping fee",
                        "detail": "",
                        "amount": 900
                    }
                ]
            }
        }
    }

    You will notice that the shippingOptions array only contains a single option, which is the flat rate fee. The Stripe plugin simply calls WooCommerce provided methods when performing the cart calculation, so for some reason your shipping logic is deciding to not include the free shipping option.

    Subsequent changes to the Apple Pay shipping address will result in the free shipping option being included.

    I suspect what’s going on is your shipping integration is not playing nice with the WooCommerce cart session and the address data used to calculate the available shipping options isn’t persisting across requests.

    Kind Regards

    Thread Starter paulwessiack

    (@paulwessiack)

    many thanks for your super fast response!

    I disabled all plugins except WPML, WooCommerce and “Payment Plugins for Stripe WooCommerce” but the problem is still there.

    Then enabled all plugins again and disabled “WooCommerce and Payment Plugins” but installed and enabled my “old” Stripe plugin: “WooCommerce Stripe-Gateway”

    With the old Stripe plugin the Apple Pay button works fine and the shipping fees are calculated correct. I don’t know if the Stripe plugin from WooCommerce uses the same API request to get the shipping information from WooCommerce as your plugin does??

    How can we proceed with that issue? I have setup a staging environment where “Payment Plugins for Stripe WooCommerce” is enabled and in test mode. I can send you credentials for the staging if needed on a private channel?

    Staging: https://stg-magpedcom-integration.kinsta.cloud/shop/magped-sport2/

    Would love to switch to your plugin because the functionality is so much better and it includes Klarna which would be important for us….

    cheers

    :: Paul

    Plugin Author Payment Plugins

    (@mrclayton)

    I disabled all plugins except WPML, WooCommerce and “Payment Plugins for Stripe WooCommerce” but the problem is still there.

    So you aren’t using any plugins for shipping functionality, just standard WooCommerce?

    How can we proceed with that issue? I have setup a staging environment where “Payment Plugins for Stripe WooCommerce” is enabled and in test mode. I can send you credentials for the staging if needed on a private channel?

    Be cautious with mentioning the sharing of credentials as that’s against the www.ads-software.com policy.

    Given the complexity of your support request, I recommend you create a support ticket via our site.

    Disclaimer: the user is not being asked for login credentials nor are we implying we need access to solve their problem.

    Kind Regards

    Plugin Author Payment Plugins

    (@mrclayton)

    Update: Testing the staging site https://stg-magpedcom-integration.kinsta.cloud/shop/magped-sport2/ that you linked to in your previous reply, I am no longer able to re-create the reported issue.

    The free shipping option displays correctly in all the scenarios that were tested.

    Kind Regards

    Thread Starter paulwessiack

    (@paulwessiack)

    I’m still able to reproduce the problem on our staging environment. I will follow up creating a support ticket here: https://paymentplugins.com/contact-us/

    kind regards

    :: Paul

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Apple Pay free shipping not recognized’ is closed to new replies.