1+ import datetime as dt
12from typing import ClassVar , Optional , cast
23
34from cuenca_validations .types import (
@@ -30,9 +31,12 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
3031 status : CardStatus
3132 issuer : CardIssuer
3233 funding_type : CardFundingType
34+ dcvv : Optional [str ] = None
35+ dcvv_expires_at : Optional [dt .datetime ] = None
3336 pin_attempts_failed : Optional [int ] = None
3437 platform_id : Optional [str ] = None
3538 card_holder_user_id : Optional [str ] = None
39+ is_dynamic_cvv : bool = False
3640
3741 @property
3842 def last_4_digits (self ):
@@ -57,6 +61,7 @@ def create(
5761 funding_type : CardFundingType ,
5862 user_id : str = 'me' ,
5963 card_holder_user_id : Optional [str ] = None ,
64+ is_dynamic_cvv : bool = False ,
6065 * ,
6166 session : Session = global_session ,
6267 ) -> 'Card' :
@@ -74,6 +79,7 @@ def create(
7479 issuer = issuer ,
7580 funding_type = funding_type ,
7681 card_holder_user_id = card_holder_user_id ,
82+ is_dynamic_cvv = is_dynamic_cvv ,
7783 )
7884 return cast ('Card' , cls ._create (session = session , ** req .dict ()))
7985
@@ -83,6 +89,7 @@ def update(
8389 card_id : str ,
8490 status : Optional [CardStatus ] = None ,
8591 pin_block : Optional [str ] = None ,
92+ is_dynamic_cvv : bool = False ,
8693 * ,
8794 session : Session = global_session ,
8895 ) -> 'Card' :
@@ -96,7 +103,9 @@ def update(
96103 :param session:
97104 :return: Updated card object
98105 """
99- req = CardUpdateRequest (status = status , pin_block = pin_block )
106+ req = CardUpdateRequest (
107+ status = status , pin_block = pin_block , is_dynamic_cvv = is_dynamic_cvv
108+ )
100109 resp = cls ._update (card_id , session = session , ** req .dict ())
101110 return cast ('Card' , resp )
102111
0 commit comments