App reviews, troubleshooting, and recommendations
Shopify functions to hide payment gateway on country code based.
I have installed the app and added the example code to hide payment method on cart total bases but now I want to hide them country code
Hi @boski1 ,
I think that in the past you could only do this by being a Shopify Plus merchant and using scripts, but now you can achieve this with apps like the Kip: Customize Payment Methods app, which lets you hide payment gateways based on conditions like country, language, location, etc.
I hope you find this helpful!
Hi @boski1 , you can try KlinKode PayRules app to hide any payment methods based on country.
It's the most easiest one out there. You can check the below video to know how to use the app.
I came across this while trying to solve the same problem. If you are following the Shopify tutorial, then you need to add localization to you input and filter it accordingly.
query Input {
localization {
country {
isoCode
}
}
paymentMethods {
id
name
}
paymentCustomization {
metafield(
namespace: "$app:payment-customization"
key: "function-configuration"
) {
value
}
}
}
Then within run.rs, perform a similar check to the tutorial
let country = input.localization.country.iso_code.to_string();
// If the country is not US, we don't need to hide the payment method
if country != "US" {
// You can use STDERR for debug logs in your function
eprintln!("Country is not US, no need to hide the payment method.");
return Ok(no_changes);
}
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024