odoo/odoo#196125

Created by Karan Sharma (shka)
Merged at 908d47eb364ca8196f1b0aab662242440a2f6e75

Statuses:

label
odoo-dev:17.0-sentry-6208134651-razorpay-attributeerror-shka
head
43fd0d63450aebe0d8bb0acd57da15219c9d0ea0
merged
5 months ago by Sales, Antoine Vandevenne (anv)
odoo/odoo
17.0 #196125
saas-17.2 #196984
saas-17.4 #197152 #197136
18.0 #197481
saas-18.1 #197492
saas-18.2
saas-18.3
saas-18.4
master #197504

[FIX] payment_razorpay: prevent error when webhook secret is not provided

This error occurs when a user does not enter a Webhook Secret. As a result, when processing the payment, the missing secret causes the verification to fail, leading to a payment failure.

  • Install the eCommerce module without demo data and with Indian localization.
  • Install Razorpay payment provider and activate developer mode.
  • Add Key ID and Key Secret in Razorpay payment provider.
  • Set up webhook in Razorpay dashboard with a random Webhook Secret.
  • Go to the website, add the product to the cart, and proceed to payment using
    UPI.`

Error: 'bool' object has no attribute 'encode'

This issue occurs because the Webhook Secret is missing, returning False and causing payment verification to fail.

This commit solves the error by handling missing Webhook Secret values by
logging a warning and skipping the signature check instead of returning a False.

Sentry: 6208134651


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr