Skip to content

Commit

Permalink
Migrated to null-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
berehovyi committed Dec 28, 2021
1 parent 62764aa commit 2629f3c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 701 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ coverage/
.dart_tool/
.metadata
.packages
pubspec.lock
pubspec.lock
example/pubspec.lock
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.2.0
* Migrated to null-safety

## 0.0.1

* TODO: Describe initial release.
* First release of mobile cloudipsp functionality
217 changes: 0 additions & 217 deletions example/pubspec.lock

This file was deleted.

7 changes: 3 additions & 4 deletions lib/src/cloudipsp_error.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class CloudipspError extends Error {
String message;

Expand All @@ -8,12 +7,12 @@ class CloudipspError extends Error {
class CloudipspUserError extends CloudipspError {
String code;

CloudipspUserError(this.code, String message): super(message);
CloudipspUserError(this.code, String message) : super(message);
}

class CloudipspApiError extends CloudipspError {
int code;
String requestId;

CloudipspApiError(this.code, this.requestId, String message): super(message);
}
CloudipspApiError(this.code, this.requestId, String message) : super(message);
}
13 changes: 3 additions & 10 deletions lib/src/credit_card.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import './cvv_utils.dart';

enum CardType {
VISA,
MASTERCARD,
MAESTRO,
UNKNOWN
}
enum CardType { VISA, MASTERCARD, MAESTRO, UNKNOWN }

abstract class CreditCard {
bool isValidCardNumber();
Expand All @@ -27,8 +22,7 @@ class PrivateCreditCard implements CreditCard {
final int yy;
final String cvv;

PrivateCreditCard(this.cardNumber, this.mm, this.yy, this.cvv): super();

PrivateCreditCard(this.cardNumber, this.mm, this.yy, this.cvv) : super();

@override
bool isValidCardNumber() {
Expand Down Expand Up @@ -72,7 +66,6 @@ class PrivateCreditCard implements CreditCard {
return (yy > year) || (yy == year && mm >= now.month);
}


@override
bool isValidCvv() {
if (CvvUtils.isCvv4Length(cardNumber)) {
Expand Down Expand Up @@ -108,4 +101,4 @@ class PrivateCreditCard implements CreditCard {

return sum % 10 == 0;
}
}
}
Loading

0 comments on commit 2629f3c

Please sign in to comment.