Skip to content

Commit

Permalink
improvement(BankNameFromCard):added example and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
payam-zahedi committed Apr 19, 2021
1 parent 378baa0 commit a2f1ef4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
- [x] [Checking IBAN of the bank account (_SHEBA_)](#checking-iban-of-the-bank-account-sheba---source)
- [x] [Validating ATM card number](#validating-atm-card-number---source)
- [x] [Validating Iranians phone number](#validating-iranians-phone-number---source)
- [ ] Finding name of banks by ATM card number
- [x] [Finding banks name by ATM card number](#finding-banks-name-by-card-number---source)
- [ ] Getting information from vehicle plate
- [x] [Fixing and decoding URLs with whitespace](https://github.com/persian-tools/dart-persian-tools#fixing-and-decoding-urls---source)
- [x] [Fixing and decoding URLs with whitespace](#fixing-and-decoding-urls---source)
## Usage

now let's look at examples and how work with apis in package
Expand Down Expand Up @@ -160,6 +160,21 @@ phoneNumber.phoneNumberPrefix; // 902
phoneNumber.phoneNumberDetail?.name; // ایرانسل
```

- #### Finding banks name by card number - [source](https://github.com/persian-tools/dart-persian-tools/blob/master/lib/src/core/url_fix/url_fix.dart)

```dart
final cardNumber = '6037701689095443';
final bankInfo = getBankNameFromCardNumber(cardNumber);
bankInfo?.name; // بانک کشاورزی
bankInfo?.initCode; // 603770
/// you can also use this methods as String extension method
// get bank info from String
cardNumber.bankNameFromCard?.name; // بانک کشاورزی
```

- #### Fixing and decoding URLs - [source](https://github.com/persian-tools/dart-persian-tools/blob/master/lib/src/core/url_fix/url_fix.dart)

```dart
Expand Down
14 changes: 14 additions & 0 deletions example/example_get_bank_from_card_number.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:dart_persian_tools/dart_persian_tools.dart';

void main() {
final cardNumber = '6037701689095443';

final bankInfo = getBankNameFromCardNumber(cardNumber);
print(bankInfo?.name); // بانک کشاورزی
print(bankInfo?.initCode); // 603770

/// you can also use this methods as String extension method
// get bank info from String
print(cardNumber.bankNameFromCard?.name); // بانک کشاورزی
}

0 comments on commit a2f1ef4

Please sign in to comment.