Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make a subscription report #4

Open
dmytromk opened this issue Feb 4, 2025 · 0 comments
Open

Can't make a subscription report #4

dmytromk opened this issue Feb 4, 2025 · 0 comments

Comments

@dmytromk
Copy link

dmytromk commented Feb 4, 2025

Can't make a subscription report, because only orders (either card or APM) can be parsed in __send_reconciliation_request

from datetime import datetime
from solidgate import ApiClient


client = ApiClient("merchant_id", "merchant_private_key")
client.RECONCILIATION_CHARGEBACKS_PATH = 'api/v1/subscriptions'
orders = client.chargeback_reconciliation(datetime.strptime("2025-01-01", "%Y-%m-%d"),
                                                                        datetime.strptime("2025-01-02", "%Y-%m-%d"))

for order in orders:
    print(order)
Traceback (most recent call last):
  File "/user/test/test.py", line 10, in <module>
    for order in orders:
  File "/user/test/.venv/lib/python3.9/site-packages/solidgate/api_client.py", line 101, in __send_reconciliation_request
    for order in response_content['orders']:
KeyError: 'orders'

This code fails, because in __send_reconciliation_request only key orders is parsed

if 200 <= response.status_code < 300:
    response_content = json.loads(response.content)
    for order in response_content['orders']:
        yield order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant