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

non final capture + return amount + more documentation #148

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fix inverted calculation
devkral committed Oct 6, 2017

Verified

This commit was signed with the committer’s verified signature.
inkydragon Chengyu Han
commit dfe71b676bdaf2f6ae5204aca0bdc3a59c1bc242
2 changes: 1 addition & 1 deletion payments/models.py
Original file line number Diff line number Diff line change
@@ -141,7 +141,7 @@ def capture(self, amount=None, final=True):
provider = provider_factory(self.variant)
amount = provider.capture(self, amount, final)
if amount:
self.captured_amount -= amount
self.captured_amount += amount
if final:
self.change_status(PaymentStatus.CONFIRMED)
return amount