Back to Blog

By Dylan Hunt

May 27th, 2026

shopifyfunctionscheckoutguides

Replacing Shopify payment Scripts with payment customization Functions

Replacing Shopify payment Scripts with payment customization Functions

If you use a Shopify Script to control which payment methods show at checkout, that code stops running when Scripts retires on June 30, 2026. The replacement is a payment customization function, and for most stores it is a quick, contained rebuild.

This is the focused version for payment methods. For discounts and shipping too, see the full Scripts to Functions migration guide.

What you have today

A payment Script in the Script Editor that does one or more of:

  • Hides a payment method (for example, hiding cash on delivery above a cart total, or hiding a wallet for certain products).
  • Renames a payment method to something clearer.
  • Reorders methods so your preferred option appears first.

What it becomes

A payment customization function, an app extension you build with the Shopify CLI. It reads the available payment methods and the cart, then returns operations: hide a method, rename a method, or move a method. You deploy the function, then add a payment customization in the admin that activates it.

The decision logic ports directly. A Script that hid cash on delivery over $500 becomes a function that reads the cart total from its input and returns a hide operation against the cash-on-delivery method when the total is at or above that threshold.

The migration in five steps

  1. Create a custom app if you do not have one. Functions ship as app extensions.
  2. Generate a payment customization function with the Shopify CLI.
  3. Request the inputs you need (cart total, payment methods, customer) in the function's input query.
  4. Port your rule into run: return hide, rename, or move operations that match what the Script did.
  5. Deploy, then add the payment customization in the admin so the function runs. Test in a real checkout, then delete the old Script.

Watch for these

  • A payment function does nothing until you add the matching customization in the admin. The extension alone is inert.
  • Match payment methods carefully. Method names and availability vary by region and gateway, so test the same cases your Script covered.
  • Do not hide every option. If a customer ends up with no payment method, they cannot check out, the same trap payment Scripts always had.

Do not leave it to the last week

Payment rules are small but high-stakes: a hidden method that should be visible quietly costs sales. Migrate and test well before June 30, 2026. If you want it handled, we migrate payment Scripts to Functions, send us your Script Editor list and we will rebuild and test each one.

Make your store agent-ready

Get found and recommended by AI shopping assistants.

AgentReady adds Schema.org structured data, an llms.txt directory, and an AI-readability audit to your Shopify store, so ChatGPT, Perplexity, and Google can understand and recommend your products. Free for stores under 500 products.

ShareXLinkedInFacebook

Written by Dylan Hunt, Founder, Caffeine and Commerce. We build Shopify stores that rank and that AI agents can read. Have a project? Get in touch.