Hi everyone.
I’m developing a Checkout UI Extension, and I need to retrieve the credit card brand. I know Shopify identifies the card provider because it displays this information in the checkout, but I haven’t found a way to access it from my extension.
Is there any way to retrieve that field within Shopify’s ecosystem to access this data before the purchase is completed?
Credit card brands can be identified by the sequence of the digits in Credit Card numbers:
from privacy.com:
The card digits and the card number order are strategically chosen and placed. They reveal crucial information about the card, the cardholder, and the card issuer. See the table below:
Number
What It Is
What It Means
The first digit
Major Industry Identifier (MII)
Signifies the credit card network and industry
Digits 1–8
The Issuer Identification Number (IIN) or the Bank Identification Number (BIN)
Indicates the financial institution that issued the card
Digits 7–15
Account Number
Identifies the card and account holder
The last digit
Checksum/Check Digit
Verifies the legitimacy of the other digits using the Luhn algorithm
I’m sure there is a framework or library somewhere for handling this detection reliably.
There’s currently no field exposed in checkout extensions for the credit card type - but I can raise this as a feature request to the checkout team. What would be your specific usecase for being able to know the credit card type from within a checkout extension?
Hi Liam,
Thanks for your response.
The reason I need access to the credit card type within a checkout extension is that my app is a custom credit card payments extension logic using Checkout Extensibility, and displays installment options based on the card brand. Being able to retrieve the credit card type would allow me to show the correct installment plans dynamically.