razorpay / razorpay-python

Razorpay Python SDK
https://pypi.python.org/pypi/razorpay
MIT License
153 stars 81 forks source link

Not able to verify the invoice signature #254

Open ravipiplani opened 1 year ago

ravipiplani commented 1 year ago
  1. Created an invoice via the api.
  2. Used the invoice order id to initiate razorpay checkout.
  3. Once the payment is successful, sent the verification data to backend for verification.
  4. Verification failed - This is where I am stuck. Razorpay docs/python library doesn't cover the signature verification for invoice.

I tried writing my own logic to verify the signature but I don't know the message structure to generate the signature.

Below is the sample data:

{razorpay_payment_id: 'pay_M8pBohrkOsZ2WC', razorpay_invoice_id: 'inv_M8pBLnILtoj6z6', razorpay_invoice_status: 'paid', razorpay_invoice_receipt: null, razorpay_signature: '8ff858ab7c03e18b37f227414fd8af4e602f2690a89220c49f3fddce25d15a36'}

I am using invoice to create orders (and not creating the order directly) to get invoice PDF once the invoice is paid.