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

Payment.refund() does not refund #401

Closed
radekholy24 opened this issue Mar 8, 2024 · 2 comments · Fixed by #410
Closed

Payment.refund() does not refund #401

radekholy24 opened this issue Mar 8, 2024 · 2 comments · Fixed by #410
Assignees

Comments

@radekholy24
Copy link
Contributor

radekholy24 commented Mar 8, 2024

Hello,

Expected behavior

If you need to refund a payment, you can do this by calling the refund() method on your Payment instance:

from payments import get_payment_model
Payment = get_payment_model()
payment = Payment.objects.get()
payment.refund()

By default, the total amount would be refunded.

-- https://django-payments.readthedocs.io/en/latest/refund.html

Actual behavior

>>> from payments import get_payment_model
>>> Payment = get_payment_model()
>>> payment = Payment.objects.get()
>>> payment.refund()
>>> payment.captured_amount
Decimal("2.00")
>>> payment.status
'confirmed'

(Neither the captured_amount nor the status changes after a call to refund())

@mariofix
Copy link
Member

Related to #399

radekholy24 added a commit to radekholy24/django-payments that referenced this issue Apr 24, 2024
radekholy24 added a commit to radekholy24/django-payments that referenced this issue Apr 25, 2024
radekholy24 added a commit to radekholy24/django-payments that referenced this issue May 14, 2024
@radekholy24
Copy link
Contributor Author

Here is my PR to fix the issue: #410

radekholy24 added a commit to radekholy24/django-payments that referenced this issue Jun 12, 2024
WhyNotHugo pushed a commit that referenced this issue Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants