How to conditionally remove a payment option from checkout?

Topic summary

Goal: Hide the AfterPay option at checkout whenever a specific product (ID 7025617862758) is in the cart, allowing only Credit Card, regardless of other items.

Initial idea: Build a custom app using GraphQL to inspect the cart and conditionally remove a payment method.

Key constraint: This level of checkout payment-method control requires Shopify Plus (enterprise tier enabling checkout customization). The store is on a Plus dev environment.

Proposed solution: Use the “PayRules: Hide Payment Methods” app to conditionally hide AfterPay.

  • Add “AfterPay” under Additional payment methods.
  • In Products, choose “Hide if found” and include the specific product.
  • Result: AfterPay is hidden when that product is in the cart.

Reference: An included screenshot shows the exact PayRules configuration (image is central to understanding the setup).

Status: A clear path forward is provided via the app; no confirmation from the original poster on implementation. The discussion suggests using an app over building a custom solution.

Summarized with AI on December 25. AI used: gpt-5.

Just looking for some guidance on this.

Let’s say I have a product id of 7025617862758 and payments options that are Credit Card and AfterPay. When this product has been added to the cart, regardless of what other products are in the cart, I’d like to hide the AfterPay payment option, and only allow for Credit Card.

I was thinking of creating an app for this (I have no experience doing so), and then using graphql to do a cart query to check what products it has. If that ID is in the cart then remove the payment option.

Does this sound like the correct approach? or am I over complicating it?

Need Shopify Plus for this

Yeah I’m using shopify plus, just a dev environment site

You can conditionally remove a payment option from checkout using the PayRules: Hide Payment Methods app. Here’s how you can do it:

  1. Add “AfterPay” in the “Additional payment methods” field.
  2. In the “Products” field, select “Hide if found” and add the specific product.

This will ensure that the AfterPay option is hidden when the specified product is in the cart.