Skip to content

Commit

Permalink
PayPal: Fix AttributeError: Manager isn't accessible via Payment inst…
Browse files Browse the repository at this point in the history
…ances
  • Loading branch information
radekholy24 committed May 14, 2024
1 parent 8b40e5d commit c3d54ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions payments/paypal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def process_data(self, payment, request):
payment.attrs.payer_info = executed_payment["payer"]["payer_info"]
if self._capture:
payment.captured_amount = payment.total
payment.objects.filter(pk=payment.pk).update(captured_amount=payment.captured_amount)
type(payment).objects.filter(pk=payment.pk).update(captured_amount=payment.captured_amount)
payment.change_status(PaymentStatus.CONFIRMED)
else:
payment.change_status(PaymentStatus.PREAUTH)
Expand All @@ -303,7 +303,7 @@ def process_subscription_data(self, payment, request):
return redirect(failure_url)
if subscription_data["status"] == "ACTIVE":
payment.captured_amount = payment.total
payment.objects.filter(pk=payment.pk).update(captured_amount=payment.captured_amount)
type(payment).objects.filter(pk=payment.pk).update(captured_amount=payment.captured_amount)
payment.change_status(PaymentStatus.CONFIRMED)
return redirect(success_url)
payment.change_status(PaymentStatus.REJECTED)
Expand Down

0 comments on commit c3d54ba

Please sign in to comment.