Skip to content

[Bug]: Error in refund method #340

Description

@pabloriquelmecas

What happened?

When I use the method transactions.refund, the sdk trows an error but processes the refund without a problem, the SDK sends an API error making it unsafe for process and check refunds issued by code.

from sumup import Sumup
client = Sumup(api_key="API")
merchant = "MERCHANT"
result = client.transactions.refund(merchant_code=merchant,transaction_id="TRANSACTION_ID")
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    result = client.transactions.refund(merchant_code=merchant,transaction_id="TRANSACTION_ID")
  File "C:\Users\Pablo\AppData\Local\Programs\Python\Python313\Lib\site-packages\sumup\transactions\resource.py", line 156, in refund
    raise APIError(f"Unexpected response", status=resp.status_code, body=resp.text)
sumup._exceptions.APIError: Unexpected response

After that execution, I checked on the Sumup dashboard and the transaction was refunded without a problem.

Relevant code or error output

SDK version

0.3.0

Python version

3.13

Operating system

Windows

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions