|
|
@@ -65,8 +65,8 @@ import frappe |
|
|
|
from frappe import _ |
|
|
|
import json |
|
|
|
import hmac |
|
|
|
import sys |
|
|
|
import hashlib |
|
|
|
import six |
|
|
|
from six.moves.urllib.parse import urlencode |
|
|
|
from frappe.model.document import Document |
|
|
|
from frappe.utils import get_url, call_hook_method, cint, get_timestamp |
|
|
@@ -321,7 +321,7 @@ class RazorpaySettings(Document): |
|
|
|
frappe.log_error(frappe.get_traceback()) |
|
|
|
|
|
|
|
def verify_signature(self, body, signature, key): |
|
|
|
if sys.version_info[0] == 3: |
|
|
|
if six.PY3: |
|
|
|
key = bytes(key, 'utf-8') |
|
|
|
body = bytes(body, 'utf-8') |
|
|
|
|
|
|
@@ -331,7 +331,7 @@ class RazorpaySettings(Document): |
|
|
|
|
|
|
|
generated_signature = dig.hexdigest() |
|
|
|
|
|
|
|
if sys.version_info[0:3] < (2, 7, 7): |
|
|
|
if six.PY2: |
|
|
|
result = self.compare_string(generated_signature, signature) |
|
|
|
else: |
|
|
|
result = hmac.compare_digest(generated_signature, signature) |
|
|
|