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

Fields not set on ReportTransactions create() #372

Open
MatCast opened this issue Sep 8, 2024 · 0 comments
Open

Fields not set on ReportTransactions create() #372

MatCast opened this issue Sep 8, 2024 · 0 comments

Comments

@MatCast
Copy link

MatCast commented Sep 8, 2024

I am trying to create a report following the documentation here.

I however had to change the handler as suggested on 136 as i was getting an invalid_client error.

My resulting code is:

mangopay.client_id = CLIENT_ID
mangopay.apikey = APIKEY 

mangopay.sandbox = False

# Set your other settings.
_handler = mangopay.APIRequest(client_id=CLIENT_ID, apikey=APIKEY)
_handler.sandbox = False

def get_default_handler():
    return _handler

# Monkeypatch `get_default_handler` everywhere.
mangopay.get_default_handler = get_default_handler
mangopay.base.get_default_handler = get_default_handler
mangopay.query.get_default_handler = get_default_handler

filters = ReportTransactionsFilters(
    status=["SUCCEEDED", "CREATED", "FAILED"],
    nature=["REGULAR", "REFUND", "REPUDIATION", "SETTLEMENT"],
    transaction_type=["PAYIN", "PAYOUT", "TRANSFER"],
    wallet_id=123456,
    author_id=None,
    min_debited_funds_currency="EUR",
    max_debited_funds_currency="EUR",
    after_date=1696756976,
    before_date=1699435376,
)
transactions_report = ReportTransactions(
    tag="Created using Mangopay Python SDK",
    download_format="CSV",
    callback_url="https://mangopay.com/docs/please-ignore",
    sort="CreationDate: ASC",
    preview=False,
    filters=filters,
    columns=[
        "Id",
        "Tag",
        "CreationDate",
        "ExecutionDate",
        "AuthorId",
        "CreditedUserId",
        "DebitedFundsAmount",
        "CreditedFundsAmount",
        "Status",
        "ResultCode",
        "ResultMessage",
        "Type",
        "Nature",
        "CreditedWalletId",
        "DebitedWalletId",
    ],
)

create_report = transactions_report.create()

The report is created but all the parametrs passed to the call are ignored and the default parameters are instead set. I get a report with no for example no Tag, and none of the filter i set up.

Am i doing something wrong?
I am using version 3.35.1

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