Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Display the correct icon for Mastercard on checkout (#12874)

Gabriel Zortéa Lovison798994cdb309
diff --git a/storefront/app/javascript/spree/storefront/controllers/card_validation_controller.js b/storefront/app/javascript/spree/storefront/controllers/card_validation_controller.js
index 9de62f51f5..0f6a7cb3aa 100644
--- a/storefront/app/javascript/spree/storefront/controllers/card_validation_controller.js
+++ b/storefront/app/javascript/spree/storefront/controllers/card_validation_controller.js
@@ -56,6 +56,8 @@ export default class extends Controller {
}
updateCardIcon(cardType) {
+ cardType = (cardType === "mastercard" ? "master" : cardType)
+
const iconElement = document.getElementById(`credit-card-icon-${cardType}`)
if (iconElement) {
this.typeContainerTarget.innerHTML = iconElement.innerHTML