Skip to content

Commit

Permalink
card_data in cards-validations
Browse files Browse the repository at this point in the history
  • Loading branch information
rogelioLpz committed Apr 13, 2021
1 parent 1210f31 commit 8df8dd6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion cuenca/resources/card_validations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime as dt
from typing import ClassVar, Optional, cast

from cuenca_validations.types import CardStatus, CardType
from cuenca_validations.types.requests import CardValidationRequest
from pydantic.dataclasses import dataclass

Expand All @@ -16,7 +17,9 @@ class CardValidation(Creatable):

created_at: dt.datetime
card_uri: str
is_active: bool
user_id: str
card_status: CardStatus
card_type: CardType
is_valid_cvv: Optional[bool]
is_valid_cvv2: Optional[bool]
is_valid_icvv: Optional[bool]
Expand Down Expand Up @@ -57,3 +60,7 @@ def card(self) -> Card:
@property
def card_id(self) -> str:
return self.card_uri.split('/')[-1]

@property
def is_active(self):
return self.card_status == CardStatus.active
4 changes: 2 additions & 2 deletions tests/resources/test_card_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
def test_card_validations():
card_data = dict(
number='5448750129965637',
cvv='150',
cvv2='685',
cvv='685',
cvv2='150',
icvv='399',
exp_month=2,
exp_year=25,
Expand Down

0 comments on commit 8df8dd6

Please sign in to comment.