
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@vtex/payment-flags
Advanced tools
A React component which renders payment flag SVGs. They are easier to handle and look really crisp on any size, and also use the most recent branding from each carrier.
Through NPM:
$ npm install @vtex/payment-flags
import PaymentFlagPicker from '@vtex/country-codes/modules/PaymentFlagPicker'
Through vtex.io:
Add vtex.payment-flags
to your manifest.json
dependencies
import { PaymentFlagPicker } from 'vtex.payment-flags'
This component takes in a code representing one of VTEX's paymentSystem
codes, fetches the SVG component related to that payment, and provides it as argument to a children function. You should render the component inside a container with the desired height, as they will fit 100% of such height. If a component associated with that paymentSystem is not found, such argument will be null
.
paymentSystem
from the Payments APInull
)PaymentFlagPicker.propTypes = {
paymentSystem: PropTypes.string.isRequired,
children: PropTypes.func.isRequired,
}
// Shall render an Amex card with height 'h2'
<PaymentFlagPicker paymentSystem={'1'}>
{FlagComponent =>
FlagComponent && (
<div className="h2">
<FlagComponent />
</div>
)
}
</PaymentFlagPicker>
There are still a few credit cards missing (Aura, Banricompras and some Colombian ones). Would be nice to have SVGs for Boleto, Apple Pay, Cash, and other stuff, and also a default SVG to render when nothing is found.
There are more flags available from where I took the first ones (here). Designers willing to help develop more flags should use that list as a style reference.
Author: Gustavo Silva (@akaFTS), with initial SVGs obtained from muffinresearch/payment-icons
This project is licensed under the MIT License.
FAQs
A React component which renders payment icons
We found that @vtex/payment-flags demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 33 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.