Where to find a list of payment methods names and ids returned during checkout

There’s currently no way to find out what each payment method name and id will be returned by Shopify functions during checkout, unless you have a store with an activated payment provider in the target country, which is impossible if you work with multiple countries.

For example we have a user that wants to run a function if the payment method “credit card” is activated, we have to guess which one of the 100+ payment providers in Shopify he’s using.

If you try to match “credit card” or the translation “tarjeta de crédito” , it won’t match the name returned by Shopify, which can be anything from “Shopify payments” to “Mercado Pago Checkout Pro” or event “Checkout .com”

I’ve tried using this query in Shopify admin (this query is not even available to apps), but it seems it returns something different for every store based on region or other conditions:

fetch(`/api/shopify/${window.location.pathname.split("/")[2]}`, {
  method: "POST",
  credentials: "include",
  headers: {
    Accept: "application/json",
    "content-type": "application/json",
    "x-csrf-token": "REDACTED",
  },
  body: '{"operationName":"AdditionalPaymentProvidersUplift","variables":{},"query":"query AdditionalPaymentProvidersUplift {\\n  paymentProviders(first: 250, ) {\\n    edges {\\n      node {\\n        id\\n        name\\n        url\\n        applicationUrl\\n        apiClientId\\n        countries\\n        transactionFee\\n        deprecationStatusV2\\n        preferred\\n        paymentMethods {\\n          name\\n          type\\n          __typename\\n        }\\n        configuration {\\n          id\\n          enabled\\n          __typename\\n        }\\n        __typename\\n      }\\n      __typename\\n    }\\n    __typename\\n  }\\n}\\n"}',
});

It’s also not clear if the returned data matches the checkout names, for example if the user wants to match the payment provider “Mercado Pago” for credit cards, there seems to be 3 payment methods that could possible match it from this query in Brazil:

  • Mercado Pago Cartões

  • Mercado Pago Checkout Pro

  • Mercado Pago Pix

However only two of them actually have credit cards, and I’m not even sure if they will be named “Cartão de crédito” or “Mercado Pago” or “Mercado Pago Pro”

We thought also about just logging the input to get the payment names, but you can’t have access to logs unless the merchant shares it, and throwing errors makes the function slower and provides a bad experience.

I’ve just found another example, if the user wishes to apply a function if the payment method name is “seQura” it won’t work, because Shopify changes the payment method name to “Paga a plazos con seQura” if the store is in Spanish, no idea what happens if the name is in other languages.

Here’s another example:

The payment method named “Mercado Pago Cuotas sin Tarjeta”

Gets actually transformed into “Cuotas sin Tarjeta con Mercado Pago”

But you can’t even rely on the name shown in checkout, because payment number 1 is actually “Mercado Pago Tarjetas” instead of “Tarjetas de crédito”