Skip to content

Commit

Permalink
Merge pull request #304 from Natureshadow/fix-paypal
Browse files Browse the repository at this point in the history
[PayPal] Add missing model saving after setting extra_data
  • Loading branch information
Hugo authored Mar 16, 2022
2 parents 4a108a9 + 2ad0f63 commit ddb4e7d
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 ddb4e7d

Please sign in to comment.