How to detect Shop pay in functions?

It seems that you’re not able to use payment customizations with ShopPay according to our experience and this link:
https://shopify.dev/docs/api/functions/latest/payment-customization#shop-pay-integration

However this causes an issue in one of our apps logic, where other functions that are not supposed to run if a certain cart attribute is present, still end up running if the user comes back to the cart using an abandoned cart link.

Is there anyway to detect ShopPay in other functions other than shopify.dev/docs/api/functions/latest/cart-transform or is there anyway to make cart transform communicate to other functions that ShopPay is present?

We thought about showing an error in CartTransform telling the user to go back to store and coming back to cart, but I’m not sure if that’s the best solution, since it is quite confusing for users who already abandoned cart.

Not sure why I said you could detect ShopPay in cart transform, I actually can’t find anyway to do it.

Hey @David_Arbias - thanks for raising this, and good follow-up on catching that cart transform can’t see it either.

I did some digging here and it appears that you have the right read on the docs. The short version is that “in Shop Pay” isn’t something the cart carries around. It’s determined per request at checkout based on where the request comes in, so it lives outside the cart state that functions receive as input. That’s why none of the other function APIs (cart transform, discounts, delivery, validation) expose a Shop Pay field today, and why there’s no built-in way for one function to tell another that Shop Pay is in play.

I’m going to submit this as a feature request for a field that exposes this (something like “cart.context.usingShopPay” as an example) and include the context from your use case. Let me know if there’s any other feedback you would like me to include.

I’d also like to understand the specifics of how the ability to recognize whether or not a specific buyer is using a Shop Pay checkout is related to a cart attribute being stripped, specifically when a buyer uses an abandoned checkout link. I’d recommend creating an authenticated ticket with Support so that we can dive into the specifics of your setup and determine whether or not there is platform behaviour or configuration details driving this behaviour. From what I understand, there shouldn’t be functionality differences between a “standard checkout” and a Shop Pay checkout and it would be great to explore the specifics further here so we have an understanding of all the factors present.