Repository: cuenca-mx/cuenca-python

Issue:
Add card_uri into CardTransactions resource
In the future we need to be able to access the card from the uri according to another resources

Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129?src=pr&el=h1) Report
> Merging [#129](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129?src=pr&el=desc) (40cdf3f) into [main](https://codecov.io/gh/cuenca-mx/cuenca-python/commit/eb5047bc7a990890316413abf04499facef3c8e7?el=desc) (eb5047b) will **not change** coverage.
> The diff coverage is `100.00%`.


```diff
@@            Coverage Diff            @@
##              main      #129   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          559       562    +3     
=========================================
+ Hits           559       562    +3     
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `100.00% <100.00%> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cuenca/resources/cards.py](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129/diff?src=pr&el=tree#diff-Y3VlbmNhL3Jlc291cmNlcy9jYXJkcy5weQ==) | `100.00% <ø> (ø)` | |
| [cuenca/resources/card\_transactions.py](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129/diff?src=pr&el=tree#diff-Y3VlbmNhL3Jlc291cmNlcy9jYXJkX3RyYW5zYWN0aW9ucy5weQ==) | `100.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129?src=pr&el=footer). Last update [eb5047b...df3fa72](https://codecov.io/gh/cuenca-mx/cuenca-python/pull/129?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

cuencandres: Hay cambios sobre `Card`, y es que hoy en día `Card` no maneja `ledger_account_id`.
Lo quité para que pasaran mis tests, pero los cambios completos sobre `Card`, vienen en este PR:

https://github.com/cuenca-mx/cuenca-python/pull/120

Patch:
diff --git a/cuenca/resources/card_transactions.py b/cuenca/resources/card_transactions.py
index 4e4043a..6921a4d 100644
--- a/cuenca/resources/card_transactions.py
+++ b/cuenca/resources/card_transactions.py
@@ -9,7 +9,8 @@ from cuenca_validations.types import (
 from pydantic.dataclasses import dataclass
 
 from .base import Transaction
-from .resources import retrieve_uris
+from .cards import Card
+from .resources import retrieve_uri, retrieve_uris
 
 
 @dataclass
@@ -19,7 +20,7 @@ class CardTransaction(Transaction):
     type: CardTransactionType
     network: CardNetwork
     related_card_transaction_uris: List[str]
-    card_id: str
+    card_uri: str
     card_last4: str
     card_type: CardType
     metadata: dict
@@ -33,3 +34,7 @@ class CardTransaction(Transaction):
             List['CardTransaction'],
             retrieve_uris(self.related_card_transaction_uris),
         )
+
+    @property  # type: ignore
+    def card(self) -> Card:
+        return cast(Card, retrieve_uri(self.card_uri))
diff --git a/cuenca/resources/cards.py b/cuenca/resources/cards.py
index f43a8c2..8c8ff10 100644
--- a/cuenca/resources/cards.py
+++ b/cuenca/resources/cards.py
@@ -16,7 +16,6 @@ class Card(Retrievable, Queryable, Creatable, Updateable):
     _query_params: ClassVar = CardQuery
 
     user_id: str
-    ledger_account_id: str
     number: str
     exp_month: int
     exp_year: int
diff --git a/cuenca/version.py b/cuenca/version.py
index 93a22fb..3c1039e 100644
--- a/cuenca/version.py
+++ b/cuenca/version.py
@@ -1,3 +1,3 @@
-__version__ = '0.6.3'
+__version__ = '0.6.4'
 CLIENT_VERSION = __version__
 API_VERSION = '2020-03-19'
diff --git a/requirements.txt b/requirements.txt
index 03557f8..71864ff 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
 requests==2.25.1
-cuenca-validations==0.7.8
+cuenca-validations==0.7.9
 dataclasses>=0.7;python_version<"3.7"


Test patch:
diff --git a/tests/resources/cassettes/test_card_transaction_child_retrieve.yaml b/tests/resources/cassettes/test_card_transaction_child_retrieve.yaml
index ff1d9f9..e5e91b5 100644
--- a/tests/resources/cassettes/test_card_transaction_child_retrieve.yaml
+++ b/tests/resources/cassettes/test_card_transaction_child_retrieve.yaml
@@ -11,42 +11,44 @@ interactions:
       Connection:
       - keep-alive
       User-Agent:
-      - cuenca-python/0.3.6
+      - cuenca-python/0.6.3
       X-Cuenca-Api-Version:
       - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211344Z
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
     method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CT002
+    uri: https://sandbox.cuenca.com/card_transactions/CT4jC3Dh65FNmb0lGBTnvr4I
   response:
     body:
-      string: '{"id":"CT002","created_at":"2020-10-29T18:04:37.414000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
-        Michoacan","type":"refund","network":"visa","related_card_transaction_uris":["/card_transactions/CT001"],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"38007","retrieval_reference":"444838149","track_data_method":null,"transaction_reference":null},"error_type":null}'
+      string: '{"id":"CT4jC3Dh65FNmb0lGBTnvr4I","created_at":"2020-10-29T16:52:39.044000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
+        Michoacan","type":"refund","network":"visa","related_card_transaction_uris":["/card_transactions/CT17YWLDHWI59r6F0oG1ihvK"],"card_last4":"0359","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"40352","retrieval_reference":"765187539","track_data_method":null,"transaction_reference":null},"error_type":null}'
     headers:
       Connection:
       - keep-alive
       Content-Length:
-      - '659'
+      - '649'
       Content-Type:
       - application/json
       Date:
-      - Thu, 29 Oct 2020 21:13:44 GMT
-      Via:
-      - 1.1 fef232a36f2d64e8401caff3be58f4fc.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - 4WuDXoq-_GWtMLx6kiNBPWtX2BpR211K3UJSdnbP24GiScNcXF2HlQ==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
+      - Fri, 05 Mar 2021 01:06:41 GMT
       X-Amzn-Trace-Id:
-      - Root=1-5f9b3088-54cfc3235bfff8a00655b709;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
+      - Root=1-60418421-2f2c09e2459746347fa2db67;Sampled=0
+      X-Request-Time:
+      - 'value: 0.230'
       x-amz-apigw-id:
-      - VMSFZGONoAMF7zA=
+      - bsGVNEfKiYcFXlQ=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '649'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 01:06:41 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - de384365-d5c1-49eb-b615-05e3258eb5da
       x-amzn-RequestId:
-      - 0d065a8f-9a36-47ec-88b1-1b3bfcb1e215
+      - 51a7afd5-97bb-4e49-a18d-a83d97c67860
     status:
       code: 200
       message: OK
@@ -62,42 +64,44 @@ interactions:
       Connection:
       - keep-alive
       User-Agent:
-      - cuenca-python/0.3.6
+      - cuenca-python/0.6.3
       X-Cuenca-Api-Version:
       - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211344Z
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
     method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CT001
+    uri: https://sandbox.cuenca.com/card_transactions/CT17YWLDHWI59r6F0oG1ihvK
   response:
     body:
-      string: '{"id":"CT001","created_at":"2020-10-29T18:04:37.396000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
-        Michoacan","type":"auth","network":"visa","related_card_transaction_uris":["/card_transactions/CT002","/card_transactions/CT2pnV82umR0FnxWsDwHBFq","/card_transactions/CTXoLAkUBeZY7arY4XyuaYp"],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"36776","retrieval_reference":"691159329","track_data_method":null,"transaction_reference":null},"error_type":null}'
+      string: '{"id":"CT17YWLDHWI59r6F0oG1ihvK","created_at":"2020-10-29T16:39:51.279000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
+        Michoacan","type":"auth","network":"visa","related_card_transaction_uris":["/card_transactions/CT4jC3Dh65FNmb0lGBTnvr4I","/card_transactions/CT3749UxhLljsima27fLTCCk"],"card_last4":"0359","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"86562","retrieval_reference":"82903776","track_data_method":null,"transaction_reference":null},"error_type":null}'
     headers:
       Connection:
       - keep-alive
       Content-Length:
-      - '747'
+      - '692'
       Content-Type:
       - application/json
       Date:
-      - Thu, 29 Oct 2020 21:13:45 GMT
-      Via:
-      - 1.1 fef232a36f2d64e8401caff3be58f4fc.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - LIS9DTnDXufnad7kEAG_UcUfcFs7laqNSgFpJx5vwbGGeAXMACHszA==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
+      - Fri, 05 Mar 2021 01:06:41 GMT
       X-Amzn-Trace-Id:
-      - Root=1-5f9b3089-4586ce643d7ee31e3c819823;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
+      - Root=1-60418421-5d2045ec35c21cea0694f704;Sampled=0
+      X-Request-Time:
+      - 'value: 0.214'
       x-amz-apigw-id:
-      - VMSFbFGyIAMFcMQ=
+      - bsGVRFmniYcFSiA=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '692'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 01:06:41 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - 9ed376a2-9197-413f-a4a0-d0ee40cc27f1
       x-amzn-RequestId:
-      - 99f43c26-2aea-4de7-b03d-9113ff28a3ed
+      - 8863f0a7-7a38-4125-b280-29050d3415cc
     status:
       code: 200
       message: OK
diff --git a/tests/resources/cassettes/test_card_transaction_expiration_retrieve.yaml b/tests/resources/cassettes/test_card_transaction_expiration_retrieve.yaml
index 7bd4cad..c738a01 100644
--- a/tests/resources/cassettes/test_card_transaction_expiration_retrieve.yaml
+++ b/tests/resources/cassettes/test_card_transaction_expiration_retrieve.yaml
@@ -11,42 +11,44 @@ interactions:
       Connection:
       - keep-alive
       User-Agent:
-      - cuenca-python/0.3.6
+      - cuenca-python/0.6.3
       X-Cuenca-Api-Version:
       - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211345Z
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
     method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CT004
+    uri: https://sandbox.cuenca.com/card_transactions/CT4kMz2YNoWxVSQOCPCh2nQD
   response:
     body:
-      string: '{"id":"CT004","created_at":"2020-10-29T18:04:36.318000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"failed","descriptor":"Superama
-        Michoacan","type":"expiration","network":"visa","related_card_transaction_uris":[],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"68697","retrieval_reference":"899493694","track_data_method":null,"transaction_reference":null},"error_type":null}'
+      string: '{"id":"CT4kMz2YNoWxVSQOCPCh2nQD","created_at":"2020-10-28T21:00:24.033000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"failed","descriptor":"Superama
+        Michoacan","type":"expiration","network":"visa","related_card_transaction_uris":[],"card_last4":"0359","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"68942","retrieval_reference":"741113898","track_data_method":null,"transaction_reference":null},"error_type":null}'
     headers:
       Connection:
       - keep-alive
       Content-Length:
-      - '641'
+      - '607'
       Content-Type:
       - application/json
       Date:
-      - Thu, 29 Oct 2020 21:13:45 GMT
-      Via:
-      - 1.1 a75dce573e80f2f2d03981a80f910c42.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - c5u29_nf3YTSb7F-8JyhufTnieVVTDY59jXwr2jdJ3qcuEcSVEPO3A==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
+      - Fri, 05 Mar 2021 01:06:43 GMT
       X-Amzn-Trace-Id:
-      - Root=1-5f9b3089-501105c97ed0766d4d07559f;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
+      - Root=1-60418422-7c5e37d23713820a25da2092;Sampled=0
+      X-Request-Time:
+      - 'value: 0.230'
       x-amz-apigw-id:
-      - VMSFiGpHIAMFlbw=
+      - bsGVdEkHCYcFVfw=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '607'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 01:06:43 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - de803222-e1bc-492c-a97a-624c47ba82d3
       x-amzn-RequestId:
-      - 18ec27c1-e875-47ea-84aa-3b12bb4cb0b1
+      - e4aa0d18-e8ee-4ed9-af9e-8b8df10b9b36
     status:
       code: 200
       message: OK
diff --git a/tests/resources/cassettes/test_card_transaction_parent_retrieve.yaml b/tests/resources/cassettes/test_card_transaction_parent_retrieve.yaml
index 3042174..8e18bcd 100644
--- a/tests/resources/cassettes/test_card_transaction_parent_retrieve.yaml
+++ b/tests/resources/cassettes/test_card_transaction_parent_retrieve.yaml
@@ -11,93 +11,44 @@ interactions:
       Connection:
       - keep-alive
       User-Agent:
-      - cuenca-python/0.3.6
+      - cuenca-python/0.6.3
       X-Cuenca-Api-Version:
       - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211341Z
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
     method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CT001
+    uri: https://sandbox.cuenca.com/card_transactions/CT17YWLDHWI59r6F0oG1ihvK
   response:
     body:
-      string: '{"id":"CT001","created_at":"2020-10-29T18:04:37.396000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
-        Michoacan","type":"auth","network":"visa","related_card_transaction_uris":["/card_transactions/CT002","/card_transactions/CT2pnV82umR0FnxWsDwHBFq","/card_transactions/CTXoLAkUBeZY7arY4XyuaYp"],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"36776","retrieval_reference":"691159329","track_data_method":null,"transaction_reference":null},"error_type":null}'
+      string: '{"id":"CT17YWLDHWI59r6F0oG1ihvK","created_at":"2020-10-29T16:39:51.279000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
+        Michoacan","type":"auth","network":"visa","related_card_transaction_uris":["/card_transactions/CT4jC3Dh65FNmb0lGBTnvr4I","/card_transactions/CT3749UxhLljsima27fLTCCk"],"card_last4":"0359","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"86562","retrieval_reference":"82903776","track_data_method":null,"transaction_reference":null},"error_type":null}'
     headers:
       Connection:
       - keep-alive
       Content-Length:
-      - '747'
+      - '692'
       Content-Type:
       - application/json
       Date:
-      - Thu, 29 Oct 2020 21:13:43 GMT
-      Via:
-      - 1.1 7dfbfeea200bdd11da4db1cf0ddcb718.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - 5I-sg1Vcgf9YmqcaZ6DDuy03rDJMstVODeHHtwNiSqG3PmMTbHMpfA==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
+      - Fri, 05 Mar 2021 01:06:40 GMT
       X-Amzn-Trace-Id:
-      - Root=1-5f9b3085-4a1eeef5535fb9de2ced3c81;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
+      - Root=1-6041841d-3439d27c68bedeca7a3a4729;Sampled=0
+      X-Request-Time:
+      - 'value: 2.956'
       x-amz-apigw-id:
-      - VMSE5HReoAMFwOw=
-      x-amzn-RequestId:
-      - e7c89dfc-280c-42d6-91bc-a3dca2b08911
-    status:
-      code: 200
-      message: OK
-- request:
-    body: null
-    headers:
-      Accept:
-      - '*/*'
-      Accept-Encoding:
-      - gzip, deflate
-      Authorization:
-      - DUMMY
-      Connection:
+      - bsGUmGdNiYcFTtg=
+      x-amzn-Remapped-Connection:
       - keep-alive
-      User-Agent:
-      - cuenca-python/0.3.6
-      X-Cuenca-Api-Version:
-      - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211343Z
-    method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CT002
-  response:
-    body:
-      string: '{"id":"CT002","created_at":"2020-10-29T18:04:37.414000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
-        Michoacan","type":"refund","network":"visa","related_card_transaction_uris":["/card_transactions/CT001"],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"38007","retrieval_reference":"444838149","track_data_method":null,"transaction_reference":null},"error_type":null}'
-    headers:
-      Connection:
-      - keep-alive
-      Content-Length:
-      - '659'
-      Content-Type:
-      - application/json
-      Date:
-      - Thu, 29 Oct 2020 21:13:44 GMT
-      Via:
-      - 1.1 7dfbfeea200bdd11da4db1cf0ddcb718.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - LNgP1cn9L-xtKu17DIF6y85l5pdgB89p-lmkUinEJlNelw9JoHUDuA==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
-      X-Amzn-Trace-Id:
-      - Root=1-5f9b3088-7863eb8f6465863634dec890;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
-      x-amz-apigw-id:
-      - VMSFRGP1oAMFuzg=
+      x-amzn-Remapped-Content-Length:
+      - '692'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 01:06:40 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - 7ddb6b7c-e708-40f4-a9c4-515b9d38206b
       x-amzn-RequestId:
-      - f36a338b-51e0-449c-a0e1-b7e55fcba272
+      - cdd40899-31d7-4514-b907-72f6b61fc897
     status:
       code: 200
       message: OK
@@ -113,42 +64,44 @@ interactions:
       Connection:
       - keep-alive
       User-Agent:
-      - cuenca-python/0.3.6
+      - cuenca-python/0.6.3
       X-Cuenca-Api-Version:
       - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211344Z
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
     method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CT2pnV82umR0FnxWsDwHBFq
+    uri: https://sandbox.cuenca.com/card_transactions/CT3749UxhLljsima27fLTCCk
   response:
     body:
-      string: '{"id":"CT2pnV82umR0FnxWsDwHBFq","created_at":"2020-10-29T18:47:31.439000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":500,"status":"succeeded","descriptor":"Superama
-        Michoacan","type":"refund","network":"visa","related_card_transaction_uris":["/card_transactions/CT001"],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":"6582387564","card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"9999","retrieval_reference":"9089089","track_data_method":null,"transaction_reference":null},"error_type":null}'
+      string: '{"id":"CT3749UxhLljsima27fLTCCk","created_at":"2020-10-29T16:39:52.789000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
+        Michoacan","type":"refund","network":"visa","related_card_transaction_uris":["/card_transactions/CT17YWLDHWI59r6F0oG1ihvK"],"card_last4":"0359","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"55107","retrieval_reference":"990131889","track_data_method":null,"transaction_reference":null},"error_type":null}'
     headers:
       Connection:
       - keep-alive
       Content-Length:
-      - '665'
+      - '649'
       Content-Type:
       - application/json
       Date:
-      - Thu, 29 Oct 2020 21:13:44 GMT
-      Via:
-      - 1.1 7dfbfeea200bdd11da4db1cf0ddcb718.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - ZpzVI6pBSWm5cPMocG4-SZMn3bqqIfDTjLUGlRxbBPnswGLzhN1Sfw==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
+      - Fri, 05 Mar 2021 01:06:40 GMT
       X-Amzn-Trace-Id:
-      - Root=1-5f9b3088-61aa7b7b45b5105a125d497a;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
+      - Root=1-60418420-236d374a694504436b368da8;Sampled=0
+      X-Request-Time:
+      - 'value: 0.316'
       x-amz-apigw-id:
-      - VMSFTE9joAMFdiQ=
+      - bsGVEF1kiYcFo2g=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '649'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 01:06:40 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - e7c8e012-8c4b-40b0-8a57-878fd5f54580
       x-amzn-RequestId:
-      - 0a465b88-3453-42d3-b583-ae8be3c28d73
+      - afa56a43-1c91-41df-bf4a-3949a07ff123
     status:
       code: 200
       message: OK
@@ -164,42 +117,44 @@ interactions:
       Connection:
       - keep-alive
       User-Agent:
-      - cuenca-python/0.3.6
+      - cuenca-python/0.6.3
       X-Cuenca-Api-Version:
       - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211344Z
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
     method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CTXoLAkUBeZY7arY4XyuaYp
+    uri: https://sandbox.cuenca.com/card_transactions/CT4jC3Dh65FNmb0lGBTnvr4I
   response:
     body:
-      string: '{"id":"CTXoLAkUBeZY7arY4XyuaYp","created_at":"2020-10-29T19:31:23.460000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"succeeded","descriptor":"Superama
-        Michoacan","type":"capture","network":"visa","related_card_transaction_uris":["/card_transactions/CT001"],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":"6582387564","card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"9999","retrieval_reference":"9089089","track_data_method":null,"transaction_reference":null},"error_type":null}'
+      string: '{"id":"CT4jC3Dh65FNmb0lGBTnvr4I","created_at":"2020-10-29T16:52:39.044000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"created","descriptor":"Superama
+        Michoacan","type":"refund","network":"visa","related_card_transaction_uris":["/card_transactions/CT17YWLDHWI59r6F0oG1ihvK"],"card_last4":"0359","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"40352","retrieval_reference":"765187539","track_data_method":null,"transaction_reference":null},"error_type":null}'
     headers:
       Connection:
       - keep-alive
       Content-Length:
-      - '666'
+      - '649'
       Content-Type:
       - application/json
       Date:
-      - Thu, 29 Oct 2020 21:13:44 GMT
-      Via:
-      - 1.1 7dfbfeea200bdd11da4db1cf0ddcb718.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - nj5dJaNqp7aWlt8gcbAC2tTngxU0mguESgy0y4WztTcdUTa2kVNEdA==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
+      - Fri, 05 Mar 2021 01:06:40 GMT
       X-Amzn-Trace-Id:
-      - Root=1-5f9b3088-282b49bc64fa04c30b00b8f2;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
+      - Root=1-60418420-7c701ffa4d4214376a5ddc47;Sampled=0
+      X-Request-Time:
+      - 'value: 0.315'
       x-amz-apigw-id:
-      - VMSFVGvhoAMF4LQ=
+      - bsGVHFknCYcFSiA=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '649'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 01:06:40 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - 0ec5ff1a-ac69-4eaf-b2d8-e0209d23815e
       x-amzn-RequestId:
-      - 243762c7-ce13-4f64-8fc6-fe476a589a32
+      - 225e369c-8617-4d6b-8cb2-5a5c624d5398
     status:
       code: 200
       message: OK
diff --git a/tests/resources/cassettes/test_card_transaction_refund_without_parent_id_retrieve.yaml b/tests/resources/cassettes/test_card_transaction_refund_without_parent_id_retrieve.yaml
index 01691b8..9520843 100644
--- a/tests/resources/cassettes/test_card_transaction_refund_without_parent_id_retrieve.yaml
+++ b/tests/resources/cassettes/test_card_transaction_refund_without_parent_id_retrieve.yaml
@@ -11,42 +11,44 @@ interactions:
       Connection:
       - keep-alive
       User-Agent:
-      - cuenca-python/0.3.6
+      - cuenca-python/0.6.3
       X-Cuenca-Api-Version:
       - '2020-03-19'
-      x-amz-content-sha256:
-      - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
-      x-amz-date:
-      - 20201029T211345Z
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
     method: GET
-    uri: https://sandbox.cuenca.com/card_transactions/CT003
+    uri: https://sandbox.cuenca.com/card_transactions/CTKLh6VNCRTybvfpVSMLu8m
   response:
     body:
-      string: '{"id":"CT003","created_at":"2020-10-29T18:03:59.878000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"succeeded","descriptor":"Superama
-        Michoacan","type":"auth","network":"visa","related_card_transaction_uris":[],"card_id":"CA001","card_last4":"0359","card_type":"virtual","metadata":{"authorizer_number":null,"card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"84454","retrieval_reference":"518709560","track_data_method":null,"transaction_reference":null},"error_type":null}'
+      string: '{"id":"CTKLh6VNCRTybvfpVSMLu8m","created_at":"2020-10-29T18:04:52.705000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":300,"status":"succeeded","descriptor":"Superama
+        Michoacan","type":"refund","network":"visa","related_card_transaction_uris":[],"card_last4":"0359","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":"6582387564","card_acceptor":null,"commission":null,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"9999","retrieval_reference":"9089089","track_data_method":null,"transaction_reference":null},"error_type":null}'
     headers:
       Connection:
       - keep-alive
       Content-Length:
-      - '613'
+      - '610'
       Content-Type:
       - application/json
       Date:
-      - Thu, 29 Oct 2020 21:13:45 GMT
-      Via:
-      - 1.1 3844a554993ef7edabea082622b10c45.cloudfront.net (CloudFront)
-      X-Amz-Cf-Id:
-      - avlXhzkeeautRc3OPR-xE070uOSuDlP6D6_Xu3QOy3L79L3mnC4nwQ==
-      X-Amz-Cf-Pop:
-      - IAH50-C1
+      - Fri, 05 Mar 2021 01:06:42 GMT
       X-Amzn-Trace-Id:
-      - Root=1-5f9b3089-260d13036df86bac521e0477;Sampled=0
-      X-Cache:
-      - Miss from cloudfront
+      - Root=1-60418422-7eeb82247950b4184514b804;Sampled=0
+      X-Request-Time:
+      - 'value: 0.205'
       x-amz-apigw-id:
-      - VMSFeH75oAMFUXg=
+      - bsGVYFalCYcF7Qg=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '610'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 01:06:42 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - d0db32d1-ed2b-4351-8965-bb7cc9ef7098
       x-amzn-RequestId:
-      - 4292b6ac-6571-4c50-b6ff-56c628937948
+      - d5dc5780-a6ab-4bbe-b3c8-ccb290750ef9
     status:
       code: 200
       message: OK
diff --git a/tests/resources/cassettes/test_card_transaction_retrieve_card.yaml b/tests/resources/cassettes/test_card_transaction_retrieve_card.yaml
new file mode 100644
index 0000000..3a88bc8
--- /dev/null
+++ b/tests/resources/cassettes/test_card_transaction_retrieve_card.yaml
@@ -0,0 +1,107 @@
+interactions:
+- request:
+    body: null
+    headers:
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Authorization:
+      - DUMMY
+      Connection:
+      - keep-alive
+      User-Agent:
+      - cuenca-python/0.6.3
+      X-Cuenca-Api-Version:
+      - '2020-03-19'
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
+    method: GET
+    uri: https://sandbox.cuenca.com/card_transactions/CT00PARENT01
+  response:
+    body:
+      string: '{"id":"CT00PARENT01","created_at":"2020-11-11T21:25:26.230000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","amount":609,"status":"succeeded","descriptor":"Uso
+        de tarjeta","type":"auth","network":"visa","related_card_transaction_uris":[],"card_last4":"1234","card_type":"virtual","card_uri":"/cards/CAYNfqsQTFSnKz56n6Vw6rTw","metadata":{"authorizer_number":"1234","card_acceptor":null,"commission":0,"currency_code":"484","is_cvv":null,"pos_capabilty":null,"prosa_transaction_id":"98765","retrieval_reference":"123456789","track_data_method":null,"transaction_reference":null},"error_type":null}'
+    headers:
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '587'
+      Content-Type:
+      - application/json
+      Date:
+      - Fri, 05 Mar 2021 00:09:47 GMT
+      X-Amzn-Trace-Id:
+      - Root=1-604176c8-217231536ffd059b3ce801f1;Sampled=0
+      X-Request-Time:
+      - 'value: 2.670'
+      x-amz-apigw-id:
+      - br9_YFqUCYcFZAg=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '587'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 00:09:47 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - 26cb0789-04c3-4527-9f82-461e008f2723
+      x-amzn-RequestId:
+      - b304f475-2238-415a-990d-53f8b7d1ca55
+    status:
+      code: 200
+      message: OK
+- request:
+    body: null
+    headers:
+      Accept:
+      - '*/*'
+      Accept-Encoding:
+      - gzip, deflate
+      Authorization:
+      - DUMMY
+      Connection:
+      - keep-alive
+      User-Agent:
+      - cuenca-python/0.6.3
+      X-Cuenca-Api-Version:
+      - '2020-03-19'
+      X-Cuenca-LoginToken:
+      - LTSb8853JJRGiPBvY4lZCMzQ
+    method: GET
+    uri: https://sandbox.cuenca.com/cards/CAYNfqsQTFSnKz56n6Vw6rTw
+  response:
+    body:
+      string: '{"id":"CAYNfqsQTFSnKz56n6Vw6rTw","created_at":"2021-02-25T20:00:41.131000","updated_at":"2021-02-25T20:00:41.131000","user_id":"US4PCNV8rLB2wqBfORzIAXUl","number":"5113910084308447","exp_month":2,"exp_year":2026,"cvv2":"896","type":"virtual","status":"active","pin":null,"issuer":"cuenca","funding_type":"debit","pin_block":null,"_cls":"BaseCard.CuencaCard","batch":null,"manufacturer":null,"cvv":null,"icvv":null}'
+    headers:
+      Connection:
+      - keep-alive
+      Content-Length:
+      - '414'
+      Content-Type:
+      - application/json
+      Date:
+      - Fri, 05 Mar 2021 00:09:53 GMT
+      X-Amzn-Trace-Id:
+      - Root=1-604176cb-6d716f89449758b74dd53c3d;Sampled=0
+      X-Request-Time:
+      - 'value: 5.647'
+      x-amz-apigw-id:
+      - br9_0FC8CYcFdFA=
+      x-amzn-Remapped-Connection:
+      - keep-alive
+      x-amzn-Remapped-Content-Length:
+      - '414'
+      x-amzn-Remapped-Date:
+      - Fri, 05 Mar 2021 00:09:53 GMT
+      x-amzn-Remapped-Server:
+      - nginx/1.18.0
+      x-amzn-Remapped-x-amzn-RequestId:
+      - 3c0af4eb-5d9c-4f3d-96cb-653df509051a
+      x-amzn-RequestId:
+      - 2d14e70d-00a5-4208-9911-5f6e84b6f1b9
+    status:
+      code: 200
+      message: OK
+version: 1
diff --git a/tests/resources/test_card_transactions.py b/tests/resources/test_card_transactions.py
index c0cfb6d..af2dbaa 100644
--- a/tests/resources/test_card_transactions.py
+++ b/tests/resources/test_card_transactions.py
@@ -5,16 +5,16 @@ from cuenca import CardTransaction
 
 @pytest.mark.vcr
 def test_card_transaction_parent_retrieve():
-    ct = CardTransaction.retrieve('CT001')
+    ct = CardTransaction.retrieve('CT17YWLDHWI59r6F0oG1ihvK')
     related_cts = ct.related_card_transactions
-    assert len(related_cts) == 3
+    assert len(related_cts) == 2
     for card_transaction in related_cts:
         assert card_transaction.type != 'auth'
 
 
 @pytest.mark.vcr
 def test_card_transaction_child_retrieve():
-    ct = CardTransaction.retrieve('CT002')
+    ct = CardTransaction.retrieve('CT4jC3Dh65FNmb0lGBTnvr4I')
     related_cts = ct.related_card_transactions
     assert len(related_cts) == 1
     assert related_cts[0].type == 'auth'
@@ -22,11 +22,20 @@ def test_card_transaction_child_retrieve():
 
 @pytest.mark.vcr
 def test_card_transaction_refund_without_parent_id_retrieve():
-    ct = CardTransaction.retrieve('CT003')
+    ct = CardTransaction.retrieve('CTKLh6VNCRTybvfpVSMLu8m')
     assert not ct.related_card_transactions
 
 
 @pytest.mark.vcr
 def test_card_transaction_expiration_retrieve():
-    ct = CardTransaction.retrieve('CT004')
+    ct = CardTransaction.retrieve('CT4kMz2YNoWxVSQOCPCh2nQD')
     assert ct.type == 'expiration'
+
+
+@pytest.mark.vcr
+def test_card_transaction_retrieve_card():
+    ct = CardTransaction.retrieve('CT00PARENT01')
+    card = ct.card
+    assert card
+    assert card.user_id == ct.user_id
+    assert len(card.number) == 16
diff --git a/tests/resources/test_cards.py b/tests/resources/test_cards.py
index d240096..9eb3628 100644
--- a/tests/resources/test_cards.py
+++ b/tests/resources/test_cards.py
@@ -16,7 +16,6 @@ def test_card_create():
     assert len(card.number) == 16
     assert card.type == CardType.virtual
     assert card.user_id == user_id
-    assert card.ledger_account_id == ledger_account_id
 
 
 @pytest.mark.vcr