Skip to content

Commit

Permalink
Merge pull request #150 from sanzzzay/master
Browse files Browse the repository at this point in the history
Payment Verification of authorization transaction on subscription.
  • Loading branch information
razorpay-sanjib authored Sep 21, 2021
2 parents 305f731 + 9db769a commit 2061013
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions razorpay/utility/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ def verify_payment_signature(self, parameters):
secret = str(self.client.auth[1])

return self.verify_signature(msg, razorpay_signature, secret)

def verify_subscription_payment_signature(self, parameters):
"""
To consider the payment as successful and subscription as authorized
after the signature has been successfully verified
"""
subscription_id = str(parameters['razorpay_subscription_id'])
payment_id = str(parameters['razorpay_payment_id'])
razorpay_signature = str(parameters['razorpay_signature'])

msg = "{}|{}".format(payment_id, subscription_id)
secret = str(self.client.auth[1])

return self.verify_signature(msg, razorpay_signature, secret)

def verify_webhook_signature(self, body, signature, secret):
return self.verify_signature(body, signature, secret)

Expand Down

0 comments on commit 2061013

Please sign in to comment.