@@ -103,17 +103,17 @@ class PaymentCard {
103103
104104 PaymentCard (
105105 {@required String number,
106- @required this .cvc,
107- @required this .expiryMonth,
108- @required this .expiryYear,
109- String name,
110- String addressLine1,
111- String addressLine2,
112- String addressLine3,
113- String addressLine4,
114- String addressPostCode,
115- String addressCountry,
116- String country}) {
106+ @required this .cvc,
107+ @required this .expiryMonth,
108+ @required this .expiryYear,
109+ String name,
110+ String addressLine1,
111+ String addressLine2,
112+ String addressLine3,
113+ String addressLine4,
114+ String addressPostCode,
115+ String addressCountry,
116+ String country}) {
117117 this .number = CardUtils .getCleanedNumber (number);
118118 this .name = StringUtils .nullify (name);
119119 this .addressLine1 = StringUtils .nullify (addressLine1);
@@ -149,9 +149,9 @@ class PaymentCard {
149149
150150 var cvcValue = cardCvc.trim ();
151151 bool validLength =
152- ((_type == null && cvcValue.length >= 3 && cvcValue.length <= 4 ) ||
153- (CardType .americanExpress == _type && cvcValue.length == 4 ) ||
154- (CardType .americanExpress != _type && cvcValue.length == 3 ));
152+ ((_type == null && cvcValue.length >= 3 && cvcValue.length <= 4 ) ||
153+ (CardType .americanExpress == _type && cvcValue.length == 4 ) ||
154+ (CardType .americanExpress != _type && cvcValue.length == 3 ));
155155 return ! (! CardUtils .isWholeNumberPositive (cvcValue) || ! validLength);
156156 }
157157
@@ -164,7 +164,8 @@ class PaymentCard {
164164 if (StringUtils .isEmpty (cardNumber)) return false ;
165165
166166 // Remove all non digits
167- var formattedNumber = cardNumber.trim ().replaceAll (new RegExp (r'[^0-9]' ), '' );
167+ var formattedNumber =
168+ cardNumber.trim ().replaceAll (new RegExp (r'[^0-9]' ), '' );
168169
169170 // Verve card needs no other validation except it matched pattern
170171 if (CardType .fullPatternVerve.hasMatch (formattedNumber)) {
@@ -242,13 +243,12 @@ abstract class CardType {
242243 r'^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$' );
243244 static final fullPatternAmericanExpress = RegExp (r'^3[47][0-9]{13}$' );
244245 static final fullPatternDinersClub = RegExp (r'^3(?:0[0-5]|[68][0-9])'
245- r'[0-9]{11}$' );
246+ r'[0-9]{11}$' );
246247 static final fullPatternDiscover = RegExp (r'^6(?:011|5[0-9]{2})[0-9]{12}$' );
247248 static final fullPatternJCB = RegExp (r'^(?:2131|1800|35[0-9]{3})'
248- r'[0-9]{11}$' );
249+ r'[0-9]{11}$' );
249250 static final fullPatternVerve =
250- RegExp (r'^((506(0|1))|(507(8|9))|(6500))[0-9]{12,15}$' );
251-
251+ RegExp (r'^((506(0|1))|(507(8|9))|(6500))[0-9]{12,15}$' );
252252
253253 // Regular expression to match starting characters (aka issuer
254254 // identification number (IIN)) of the card
@@ -257,14 +257,12 @@ abstract class CardType {
257257 static final startingPatternMasterCard = RegExp (
258258 r'((5[1-5])|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720))' );
259259 static final startingPatternAmericanExpress = RegExp (r'((34)|(37))' );
260- static final startingPatternDinersClub = RegExp (
261- r'((30[0-5])|(3[89])|(36)|(3095))' );
260+ static final startingPatternDinersClub =
261+ RegExp ( r'((30[0-5])|(3[89])|(36)|(3095))' );
262262 static final startingPatternJCB = RegExp (r'(352[89]|35[3-8][0-9])' );
263- static final startingPatternVerve = RegExp (
264- r'((506(0|1))|(507(8|9))|(6500))' );
263+ static final startingPatternVerve = RegExp (r'((506(0|1))|(507(8|9))|(6500))' );
265264 static final startingPatternDiscover = RegExp (r'((6[45])|(6011))' );
266265
267-
268266 bool hasFullMatch (String cardNumber);
269267
270268 bool hasStartingMatch (String cardNumber);
0 commit comments