Skip to content

Commit a207f45

Browse files
fix log
1 parent ad71025 commit a207f45

File tree

9 files changed

+17
-4
lines changed

9 files changed

+17
-4
lines changed

starkbank/merchantcard/log/__log.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from starkcore.utils.resource import Resource
22
from ...utils import rest
3+
from starkcore.utils.api import from_api_json
34
from starkcore.utils.checks import check_date
5+
from ..__merchantcard import _resource as _merchant_card_resource
46

57

68
class Log(Resource):
@@ -14,7 +16,7 @@ def __init__(self, id, created, updated, type, errors, card):
1416
self.updated = check_date(updated)
1517
self.type = type
1618
self.errors = errors
17-
self.card = card
19+
self.card = from_api_json(_merchant_card_resource, card)
1820

1921
_resource = {"class": Log, "name": "MerchantCardLog"}
2022

starkbank/merchantinstallment/log/__log.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from starkcore.utils.resource import Resource
22
from ...utils import rest
3+
from starkcore.utils.api import from_api_json
34
from starkcore.utils.checks import check_date
5+
from ..__merchantinstallment import _resource as _merchant_installment_resource
46

57

68
class Log(Resource):
@@ -14,7 +16,7 @@ def __init__(self, id, created, updated, type, errors, installment):
1416
self.updated = check_date(updated)
1517
self.type = type
1618
self.errors = errors
17-
self.installment = installment
19+
self.installment = from_api_json(_merchant_installment_resource, installment)
1820

1921
_resource = {"class": Log, "name": "MerchantInstallmentLog"}
2022

starkbank/merchantpurchase/log/__log.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from starkcore.utils.resource import Resource
22
from ...utils import rest
3+
from starkcore.utils.api import from_api_json
34
from starkcore.utils.checks import check_date
5+
from ..__merchantpurchase import _resource as _merchant_purchase_resource
46

57

68
class Log(Resource):
@@ -14,7 +16,7 @@ def __init__(self, id, created, type, errors, purchase):
1416
self.created = check_date(created)
1517
self.type = type
1618
self.errors = errors
17-
self.purchase = purchase
19+
self.purchase = from_api_json(_merchant_purchase_resource, purchase)
1820

1921
_resource = {"class": Log, "name": "MerchantPurchaseLog"}
2022

starkbank/merchantsession/log/__log.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from starkcore.utils.resource import Resource
22
from ...utils import rest
3+
from starkcore.utils.api import from_api_json
34
from starkcore.utils.checks import check_date
5+
from ..__merchantsession import _resource as _merchant_session_resource
46

57

68
class Log(Resource):
@@ -13,7 +15,7 @@ def __init__(self, id, created, type, errors, session):
1315
self.created = check_date(created)
1416
self.type = type
1517
self.errors = errors
16-
self.session = session
18+
self.session = from_api_json(_merchant_session_resource, session)
1719

1820
_resource = {"class": Log, "name": "MerchantSessionLog"}
1921

tests/sdk/test_merchant_card_log.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class TestMerchantCardQueryLog(TestCase):
1010
def test_success(self):
1111
merchant_card_logs = starkbank.merchantcard.log.query(limit=3)
1212
for log in merchant_card_logs:
13+
print(log)
1314
self.assertIsInstance(log.id, str)
1415

1516

tests/sdk/test_merchant_installment_log.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class TestMerchantInstallmentQueryLog(TestCase):
1010
def test_success(self):
1111
merchant_installment_logs = starkbank.merchantinstallment.log.query(limit=3)
1212
for log in merchant_installment_logs:
13+
print(log)
1314
self.assertIsInstance(log.id, str)
1415

1516

tests/sdk/test_merchant_purchase_log.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class TestMerchantPurchaseQueryLog(TestCase):
1010
def test_success(self):
1111
merchant_purchase_logs = starkbank.merchantpurchase.log.query(limit=3)
1212
for log in merchant_purchase_logs:
13+
print(log)
1314
self.assertIsInstance(log.id, str)
1415

1516

tests/sdk/test_merchant_session_log.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class TestMerchantSessionQueryLog(TestCase):
1111
def test_success(self):
1212
merchant_session_logs = starkbank.merchantsession.log.query(limit=3)
1313
for log in merchant_session_logs:
14+
print(log)
1415
self.assertIsInstance(log.id, str)
1516

1617

tests/utils/merchantPurchase.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# coding: utf-8
2+
import starkbank
23
from copy import deepcopy
34
from starkbank import MerchantPurchase
45

0 commit comments

Comments
 (0)