⚠️   Shopify Scripts will no longer be supported as of June 30, 2026  ⚠️   read the Shopify article 

Shopify Functions Payment Customization Guide

Table of Contents

  1. Introduction
  2. The Shift to Shopify Functions for Payment Logic
  3. Understanding the Payment Customization API
  4. Platform Constraints and Plan Requirements
  5. Real-World Scenarios for Payment Customization
  6. Choosing the Right Implementation Path
  7. The Technical Deep Dive: GraphQL Input and Output
  8. Migration: Moving from Shopify Scripts to Functions
  9. Safety, QA, and Rollback Procedures
  10. Enhancing Checkout Beyond Payments
  11. Measuring the Impact
  12. Nextools Shopify App Suite (Quick Links)
  13. Conclusion
  14. FAQ

Introduction

Managing a high-volume Shopify store often involves navigating the friction between default checkout behavior and complex business requirements. For years, Shopify Plus merchants relied on Shopify Scripts to modify payment gateways, but as the platform evolves toward Checkout Extensibility, the limitations of the old system have become a bottleneck. Brittle Ruby scripts are being replaced by Shopify Functions, offering a more performant and scalable way to handle logic. At Nextools, we specialize in this transition, providing the infrastructure and expertise needed to implement advanced checkout logic without the traditional overhead of custom app development.

This guide is designed for Shopify Plus merchants, agencies, and developers who need to master shopify functions payment customization to improve operational efficiency and customer experience. We will explore how to hide, reorder, and rename payment methods based on cart attributes, customer tags, and geographical data.

Following the Nextools Playbook, we approach payment customization through a structured engineering workflow: we first clarify your specific goals and plan constraints, confirm what the platform allows, choose the most durable approach using Shopify Functions, implement safely in a staging environment, and finally measure the impact on conversion and checkout completion. Whether you are looking for a pre-built solution like our Nextools Shopify App Suite or a way to migrate custom legacy scripts, this technical breakdown provides the roadmap.

The Shift to Shopify Functions for Payment Logic

The introduction of Shopify Functions represents a fundamental shift in how the Shopify backend operates. Unlike Shopify Scripts, which executed in a sandboxed Ruby environment at the moment of checkout, Functions are compiled to WebAssembly (Wasm). This allows them to run on Shopify’s global infrastructure with near-zero latency, ensuring that even the most complex payment logic doesn’t slow down the buyer’s journey.

From Scripts to Functions: Why It Matters

For developers and merchants accustomed to payment_gateways.rb, the transition might seem daunting. However, the benefits are significant:

  • Performance: Functions are executed in under 10ms, significantly faster than the execution time allowed for legacy scripts.
  • Reliability: Functions are versioned and deployed as part of an app, reducing the “breaking change” risks associated with manual script edits.
  • Native Integration: Payment customizations built via Functions appear natively within the Shopify Admin under the “Payments” settings, making them accessible to non-technical staff once deployed.

At Nextools, we focus on making this power accessible. Our Shopify App Suite utilizes these APIs to give merchants granular control without requiring them to write their own Wasm modules from scratch.

Understanding the Payment Customization API

To effectively implement shopify functions payment customization, one must understand the specific capabilities of the Payment Customization API. This API is responsible for modifying how payment methods are presented to the buyer during the final stages of the checkout.

Core Operations

The API supports three primary operations on payment methods:

  1. Hide: Remove a payment method from the checkout based on specific conditions (e.g., hiding Cash on Delivery for orders over $1,000).
  2. Rename: Change the display name of a gateway to provide better clarity (e.g., renaming “Standard Credit Card” to “Secure Credit Card Payment”).
  3. Reorder: Move preferred payment methods to the top of the list to increase conversion rates (e.g., pushing local payment methods to the top for specific Markets).

Advanced Capabilities for Shopify Plus

While basic hiding and renaming are available to many, Shopify Plus merchants unlock advanced features through this API:

  • Payment Terms: Setting deferred payment terms (Net 30, Fixed Date) directly in the checkout flow.
  • Review Requirements: For B2B transactions, you can force an order into a “Review” state before payment is processed, which is critical for high-value wholesale accounts.

Platform Constraints and Plan Requirements

Before implementing any shopify functions payment customization, it is vital to understand the “guardrails” Shopify has put in place. Misunderstanding these limits often leads to failed deployments or logic that doesn’t trigger as expected.

Plan-Based Limitations

Shopify’s approach to payment customization is tiered.

  • Basic, Shopify, and Advanced Plans: In certain regions like the US and Canada, merchants on these plans can customize alternative payment methods but cannot modify the presentation of primary credit card fields.
  • Shopify Plus: This plan offers full access. Plus merchants can hide, rename, and reorder any payment method, including major credit card gateways and wallets.
  • Point of Sale (POS): Currently, Payment Customization Functions do not run on Shopify POS. Logic applied to the online checkout will not automatically translate to in-person transactions.

Functional Limits

  • Max Functions: You can activate a maximum of 25 payment customization functions per store.
  • Wallet Restrictions: While you can hide express checkout buttons (like Apple Pay or Google Pay), you generally cannot rename them if they use a logo-based brand name. You also cannot reorder wallets within the Express Checkout section; reordering only applies to the standard payment method list.
  • Subscription Compatibility: Payment terms (deferred payments) are currently incompatible with subscription products. If a cart contains a subscription, any function attempting to set payment terms will be ignored.

Real-World Scenarios for Payment Customization

Technical capabilities are only useful when applied to solve merchant problems. Below are several scenarios where we frequently implement shopify functions payment customization for our clients.

1. High-Risk and High-Value Order Mitigation

Fraud prevention is a top priority for high-growth stores. A common strategy involves hiding “risky” payment methods like Cash on Delivery (COD) when certain thresholds are met.

  • The Logic: If cart.total_price > 500 AND customer.tags contains 'High Risk', then HIDE 'Cash on Delivery'.
  • The Implementation: This requires a Function that queries the cart total and customer tags. Using a tool like HidePay, this logic can be set up in minutes without custom code.

2. B2B and Wholesale Workflows

Wholesale buyers often have different requirements than retail customers. A merchant might want to offer “Bank Transfer” only to tagged wholesale accounts while hiding “Buy Now, Pay Later” (BNPL) options for those same users to avoid high merchant fees on large orders.

  • The Logic: If customer.tags contains 'B2B', then HIDE 'Klarna' and RENAME 'Bank Deposit' TO 'Wholesale Net-30 Transfer'.
  • The Benefit: This ensures the B2B experience is professional and aligned with the company’s financial agreements.

3. Market-Specific Localization

Global expansion requires localized checkout experiences. A merchant selling in both Italy and the US might want to prioritize different gateways.

  • The Logic: If localization.market.handle == 'italy', then REORDER 'Satispay' TO position 1.
  • The Context: This creates a familiar experience for the local buyer, which may improve checkout completion rates.

4. Shipping and Payment Method Synergy

Sometimes, the choice of shipping method dictates which payment methods are viable. For example, if a customer chooses “In-Store Pickup,” a merchant might want to hide “Cash on Delivery” to ensure payment is captured before the customer arrives.

  • The Logic: If delivery_groups.selected_delivery_option.title contains 'Pickup', then HIDE 'COD'.

Choosing the Right Implementation Path

When deciding how to build your payment logic, Nextools suggests a “simplest durable approach” strategy. You have three main paths:

Path A: Pre-built Apps (The “No-Code” Approach)

For standard rules (hiding by country, total, or tags), a specialized app is often the best choice. Our app, HidePay, is built specifically for this. It provides a clean UI to manage rules that are then executed via Shopify Functions.

  • Best for: Most merchants who need reliable logic without maintaining a codebase.
  • Advantage: Fast deployment and live chat support.

Path B: Shopify Functions Generators (The “Low-Code” Approach)

If your logic is slightly more complex—perhaps involving custom metafields or unique logic combinations—you might use SupaEasy. SupaEasy acts as a bridge, allowing you to generate and deploy Shopify Functions via an AI-assisted wizard or a visual editor.

  • Best for: Developers and agencies who need to migrate Shopify Scripts quickly or create custom logic without setting up a full local development environment for Wasm.

Path C: Custom App Development (The “Full-Code” Approach)

For the most complex, proprietary logic that requires external API calls or highly specific data schemas, building a custom app to host your Function is the ultimate solution.

  • Best for: Enterprise-level Plus merchants with dedicated dev teams.
  • Constraint: Requires hosting, maintenance, and deeper knowledge of Rust or JavaScript (for Wasm).

The Technical Deep Dive: GraphQL Input and Output

For developers looking to understand the “why” behind the code, shopify functions payment customization relies heavily on GraphQL. Your function receives an Input object and returns an Output object (the FunctionRunResult).

The Input Object

The Input object contains the context of the checkout. Key fields include:

  • cart: Contains merchandise, total price, and attributes.
  • customer: Provides tags, email, and historical spend.
  • paymentMethods: The list of gateways currently available before your function runs.
  • localization: Details about the market and country.

The Output Object (Operations)

Your function doesn’t “delete” a payment method; it returns a list of operations for Shopify to perform.

{
  "operations": [
    {
      "hide": {
        "paymentMethodId": "gid://shopify/PaymentCustomizationValue/1"
      }
    },
    {
      "rename": {
        "paymentMethodId": "gid://shopify/PaymentCustomizationValue/2",
        "name": "New Name"
      }
    }
  ]
}

Migration: Moving from Shopify Scripts to Functions

If you are currently running payment_gateways.rb in the Script Editor, the clock is ticking. Shopify has announced the deprecation of Scripts in favor of Functions. The migration process should be handled with care.

Step 1: Audit Your Scripts

List every script currently running. Identify the “Why” behind each one. Is it for fraud? For B2B? For a specific promotion?

Step 2: Map to Function APIs

Most payment scripts map directly to the Payment Customization API. However, if your script was performing complex cart validations (e.g., preventing checkout if a certain item was present with a certain gateway), you might need to combine a Payment Function with a Cart Block validation rule.

Step 3: Test in a Sandbox

Never deploy a new Function directly to a live Plus store. Use a development store or a sandbox to replicate your production environment, including customer tags and shipping zones. SupaEasy includes a Script Migrator tool designed to simplify this specific workflow, helping you convert Ruby logic into the Function schema.

Safety, QA, and Rollback Procedures

Payment is the most sensitive part of the checkout. A failure here directly stops revenue. At Nextools, we emphasize “implementing safely” as part of our core playbook.

  1. Use Development Stores: Shopify allows unlimited testing in dev stores. Always verify that your logic handles “null” states (e.g., a guest customer with no tags).
  2. Monitor the 25-Function Limit: If you have multiple apps installed, they all count toward the 25-function limit. Check Settings > Payments > Payment Customizations to see your current count.
  3. Draft Orders: Remember that payment customizations can behave differently on draft order invoices. Test the “Pay Now” link experience for wholesale customers.
  4. Performance Check: Although Functions are fast, overly complex GraphQL input queries can theoretically impact performance. Request only the fields you need.

Enhancing Checkout Beyond Payments

While shopify functions payment customization is a powerful tool, it is often part of a broader checkout optimization strategy. To truly maximize the performance of your store, consider how payment logic interacts with other elements.

Checkout Branding and UI

A renamed payment method is only effective if the surrounding UI is clear. Using SupaElements, you can add custom banners or informational text near the payment section to explain why certain methods are available or to highlight “Fastest Payment” options.

Shipping Customization

Often, the same logic that hides a payment method should also hide a shipping method. If you are hiding COD, you might also need to hide a specific “Local Delivery” option that relies on COD. Using HideShip in tandem with HidePay ensures a consistent logic stack across the entire checkout experience.

Measuring the Impact

The final stage of the Nextools Playbook is to measure and iterate. After deploying your shopify functions payment customization, track the following metrics:

  • Checkout Completion Rate: Does hiding certain methods reduce friction or cause abandonment?
  • Average Order Value (AOV): If you’ve reordered BNPL options to the top, has your AOV increased?
  • Fraud Rate: If you implemented logic to hide COD for high-risk users, have your chargebacks decreased?
  • Support Tickets: Are customers asking why a certain payment method is missing? This might indicate a need for better UI communication via SupaElements.

Nextools Shopify App Suite (Quick Links)

At Nextools, we provide a comprehensive suite of tools designed to help Shopify Plus merchants and developers master the checkout.

Conclusion

Mastering shopify functions payment customization is no longer an optional skill for high-growth merchants; it is a necessity for the modern Shopify era. By moving away from brittle scripts and embracing the performant, native capabilities of Shopify Functions, you can build a checkout that is not only secure and fast but also perfectly tailored to your business logic.

Remember the Nextools Playbook as you begin your implementation:

  1. Clarify the goal: What specific payment problem are you solving?
  2. Confirm limits: Is your store on the right plan (Basic vs. Plus) for the customization you want?
  3. Choose the simplest approach: Can HidePay solve it, or do you need the advanced generation power of SupaEasy?
  4. Implement safely: Test extensively in dev environments before going live.
  5. Measure impact: Monitor conversion and fraud metrics to ensure the logic is working for you.

The future of Shopify is extensible. We invite you to explore our Nextools Shopify App Suite to see how our tools can simplify your journey from legacy scripts to cutting-edge payment logic.

FAQ

Does shopify functions payment customization require Shopify Plus?

Many basic customizations, such as hiding alternative payment methods based on cart total or country, are available to merchants on the Basic Shopify plan or higher via apps like HidePay. However, specific capabilities—such as customizing primary credit card fields in the US/Canada, setting deferred payment terms, and adding review requirements—are exclusively available to Shopify Plus merchants.

How do I test payment customizations without affecting live customers?

The safest way to test is by using a Shopify Development Store or a Plus Sandbox store. These environments allow you to install apps and deploy Functions for free. You should simulate various scenarios, such as guest checkouts, logged-in VIP customers, and different shipping destinations, to ensure your logic triggers correctly before deploying it to your production store.

Can I use Shopify Functions to hide express checkout buttons like Apple Pay?

Yes, Shopify Functions can target express checkout wallets. You can hide these buttons based on the same logic used for standard gateways (e.g., hiding them for specific product types). However, keep in mind that you generally cannot rename or reorder these buttons within the express checkout section due to brand compliance and platform layout restrictions.

Will migrating from Shopify Scripts to Functions improve my checkout speed?

In almost all cases, yes. Shopify Scripts run in a Ruby sandbox that has strict execution time limits and can occasionally introduce latency. Shopify Functions are compiled to WebAssembly and run natively on Shopify’s core infrastructure, typically executing in under 10 milliseconds. This performance boost helps maintain a fast, high-converting checkout experience even with complex logic.

SupaEasy is a product built & designed by Nextools

Company

© [2024] website by Nextools. All Rights Reserved. PIVA: 16711981007