Skip to content

Commit

Permalink
[PayPal] Add missing model saving after setting extra_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Natureshadow committed Mar 16, 2022
1 parent 4a108a9 commit 2ad0f63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions payments/paypal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def set_response_data(self, payment, response, is_auth=False):
if "links" in response:
extra_data["links"] = {link["rel"]: link for link in response["links"]}
payment.extra_data = json.dumps(extra_data)
payment.save()

def set_response_links(self, payment, response):
transaction = response["transactions"][0]
Expand All @@ -94,11 +95,13 @@ def set_response_links(self, payment, response):
extra_data = json.loads(payment.extra_data or "{}")
extra_data["links"] = {link["rel"]: link for link in links}
payment.extra_data = json.dumps(extra_data)
payment.save()

def set_error_data(self, payment, error):
extra_data = json.loads(payment.extra_data or "{}")
extra_data["error"] = error
payment.extra_data = json.dumps(extra_data)
payment.save()

def _get_links(self, payment):
extra_data = json.loads(payment.extra_data or "{}")
Expand Down

0 comments on commit 2ad0f63

Please sign in to comment.