Credit Card Payment
The standard Form pattern for when you'd like to take a user's credit card details.
The credit card component relies on angular-credit-cards
for ccNumber
and ccCvc
. The ccExpiry
directive is a custom directive that formats/validates
the expiration date in a MM / YY format. Also, the credit card type is not explicitly entered but deduced from the credit card number.
ccData
: an object containing the credit card data bound to the directiveccConfig
: an object with the configuration for the credit-card directivecardCode
: boolean value indicating whether cvv is shown (default true)cardCodeRequired
: boolean value indicating whether the card code field is required. This only matters ifcardCode
is true. (default true)fullName
: boolean value indicating whether the full name field is required/shown (default true)
eagerType
: an optional boolean value indicating whether eager type detection (infer and expose the credit card type before the full number is entered) is enabled. (default true)
The credit-card-types display in the example exists as a separate component, but will most likely be used alongside the credit-card component. The component displays the list of supported card types. Once a card type has been selected (or detected by the credit-card component), all the credit card types other than the selected one becomes greyed-out.
selectedType
: string value indicating the card type: 'American Express', 'Diners Club', 'Discover', 'MasterCard', 'Visa'. Note that these values are the same as the ones that are detected by the credit-card directive.supportedTypes
: an array of a selection of supported credit card types. This has the same strings representing the card types: 'American Express', 'Diners Club', 'Discover', 'MasterCard', 'Visa'.