Skip to content

Commit

Permalink
Added one more UZ_CARD format and HUMO
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyryan committed Jan 11, 2024
1 parent c6d1718 commit 3dd9b5a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## [2.12.4]
- Added one more UZ_CARD format and HUMO according to this thread https://github.com/caseyryan/flutter_multi_formatter/issues/150
## [2.12.3]
- Added toStringAsSmartRound() to double extension
- Re-Fixed a problem with incorrect rounding if mantissa == 0
Expand Down
22 changes: 14 additions & 8 deletions lib/formatters/credit_card_number_input_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CardSystem {
static const String AMERICAN_EXPRESS = 'Amex';
static const String DINERS_CLUB = 'DinersClub';
static const String UZ_CARD = 'UzCard';
static const String HUMO = 'HUMO';
}

class CreditCardNumberInputFormatter extends TextInputFormatter {
Expand Down Expand Up @@ -155,8 +156,7 @@ bool isCardNumberValid({
}
var formatted = _formatByMask(cardNumber, countryData.numberMask!);
var reprocessed = toNumericString(formatted);
return reprocessed == cardNumber &&
(checkLength == false || reprocessed.length == countryData.numDigits);
return reprocessed == cardNumber && (checkLength == false || reprocessed.length == countryData.numDigits);
}

/// checks not only for a length and characters but also
Expand Down Expand Up @@ -365,12 +365,18 @@ class _CardSystemDatas {
'numberMask': '0000 0000 0000 0000',
'numDigits': 16,
},
// {
// 'system': CardSystem.JCB,
// 'systemCode': '35',
// 'numberMask': '0000 0000 0000 0000 000',
// 'numDigits': 19,
// },
{
'system': CardSystem.UZ_CARD,
'systemCode': '5614',
'numberMask': '0000 0000 0000 0000',
'numDigits': 16,
},
{
'system': CardSystem.HUMO,
'systemCode': '9860',
'numberMask': '0000 0000 0000 0000',
'numDigits': 16,
},
{
'system': CardSystem.DISCOVER,
'systemCode': '60',
Expand Down
2 changes: 0 additions & 2 deletions lib/formatters/currency_input_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_multi_formatter/extensions/int_extensions.dart';
import 'package:flutter_multi_formatter/extensions/string_extensions.dart';
import 'package:flutter_multi_formatter/flutter_multi_formatter.dart';

final RegExp _mantissaSeparatorRegexp = RegExp(r'[,.]');
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_multi_formatter
description: A package of formatters for international phone numbers, credit / debit cards and a masked formatter
version: 2.12.3
version: 2.12.4
homepage: https://github.com/caseyryan/flutter_multi_formatter

environment:
Expand Down

0 comments on commit 3dd9b5a

Please sign in to comment.