File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,6 +109,9 @@ export interface Options {
109109 } ;
110110 ariaLabel ?: string ;
111111 placeholder ?: string ;
112+ validCardBrands ?: {
113+ type : string ;
114+ } [ ] | null ;
112115 } ;
113116 "transaction.ccvv" ?: {
114117 showCardIcon ?: boolean | object ;
Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ export class VGS {
141141 // Autocomplete is not customizable
142142 autoComplete : "cc-number" ,
143143 validations : [ "required" , "validCardNumber" ] ,
144+ validCardBrands : null
144145 } ,
145146 "transaction.ccvv" : {
146147 showCardIcon : false ,
@@ -158,6 +159,12 @@ export class VGS {
158159 css : styles ,
159160 } ,
160161 } ;
162+ // Override the validCardBrands if set in the theme options, as this should not be deep merged.
163+ if ( options &&
164+ options [ "transaction.ccnumber" ] &&
165+ options [ "transaction.ccnumber" ] . validCardBrands ) {
166+ defaultOptions [ "transaction.ccnumber" ] . validCardBrands = options [ "transaction.ccnumber" ] . validCardBrands ;
167+ }
161168 // Deep merge the default options with the options set in the theme
162169 this . options = ENGrid . deepMerge ( defaultOptions , options ) ;
163170 this . logger . log ( "Options" , this . options ) ;
You can’t perform that action at this time.
0 commit comments