How to Customize the Apple Pay Button custom code in Shopify

Topic summary

A user is experiencing issues with a custom Apple Pay button implementation on their Shopify store. When clicked, the button processes but fails to complete the transaction.

Technical Details:

  • The user shared custom JavaScript code for handling Apple Pay sessions, shipping rates, and payment completion
  • The code appears to fetch shipping rates from Shopify’s API and calculate totals including shipping costs

Current Problem:

  • Apple Pay button displays inconsistently on iOS devices (iPhone 16 Pro Max, iPad)
  • Most of the time, only the “Buy with Shop” or “Buy It Now” button appears instead
  • Issue persists even after theme adjustments and disabling the “Buy with Shop” button
  • Testing URL provided: https://brizofan.com/products/test

Troubleshooting Attempts:

  • Another user suggested using Shopify’s built-in Dynamic Checkout button instead of custom code
  • Verified the issue occurs specifically on iOS devices where Apple Pay should be available
  • Multiple devices tested with same inconsistent results

Status: The user has contacted Shopify support, who acknowledged the issue and said they would work on it. Discussion remains open pending support team response.

Summarized with AI on November 3. AI used: claude-sonnet-4-5-20250929.

What is the issue in the code below? When I click on “Apply,” it processes but then fails to complete.

<?xml version="1.0" ?> select a size

1 Like

@ahmer oh sorry for facing this issue

can you please use Shopify Dynamic checkout button its would be great for your store please check this article.

@KetanKumar The Apple Pay button sometimes appears, but most of the time, the “Buy with Shop” button is displayed.

1 Like

@ahmer yes Apple Pay button show only IOs Device

@KetanKumar

I am checking this on iOS. On iOS, it sometimes shows the Apple Pay button but always displays the “Buy with Shop” button. I am using an iPhone 16 Pro Max.

1 Like

@ahmer oh sorry if possible to share video further issue?

@KetanKumar

I tried adjusting the theme as well, but the issue remains the same. I turned off the “Buy with Shop” button, and now it only shows “Buy It Now,” but the Apple Pay button still doesn’t appear.

https://streamable.com/bl44ar

1 Like

@ahmer can you please share your store url

@KetanKumar
https://brizofan.com/products/test

1 Like

@ahmer i have check my friend iPhone its work

@KetanKumar

I’ve checked almost 100 times on my brother’s iPhone, my iPhone, and my iPad, but it’s still not showing.

1 Like

@ahmer oh sorry this that issue can you please just inform these Shopify support team

I already informed them, and they said they would work on it and let me know

@ahmer sounds good so can you please wait support response