Skip to content

Fix: Add pickup_code generation to Razorpay webhook for offline reliability - #32

Merged
AkibDa merged 1 commit into
GreenPlateByCodeNewbies:mainfrom
AkibDa:main
Jan 17, 2026
Merged

AkibDa merged 1 commit into
GreenPlateByCodeNewbies:mainfrom
AkibDa:main

Conversation

@AkibDa

@AkibDa AkibDa commented Jan 17, 2026

Copy link
Copy Markdown
Member

app/webhook.py: Saved and secure.

Comment thread app/webhook.py
"payment_id": payment_id,
"razorpay_payment_data": payment,
"pickup_code": pickup_code,
"updated_at": firestore.SERVER_TIMESTAMP

Check notice

Code scanning / Bandit (reported by Codacy)

Standard pseudo-random generators are not suitable for security/cryptographic purposes. Note

Standard pseudo-random generators are not suitable for security/cryptographic purposes.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pylintpython3 (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pylint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread app/webhook.py
snapshot = order_ref.get(transaction=transaction)
if not snapshot.exists:
print(f"❌ Order {internal_order_id} not found!")
return

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 6 spaces, expected 12 (bad-indentation) Warning

Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
Comment thread app/webhook.py
print(f"❌ Order {internal_order_id} not found!")
return

current_data = snapshot.to_dict()

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 6 spaces, expected 12 (bad-indentation) Warning

Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
Comment thread app/webhook.py
return

current_data = snapshot.to_dict()

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 6 spaces, expected 12 (bad-indentation) Warning

Bad indentation. Found 6 spaces, expected 12 (bad-indentation)
Comment thread app/webhook.py

current_data = snapshot.to_dict()

if current_data.get("status") == "PAID":

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 8 spaces, expected 16 (bad-indentation) Warning

Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
Comment thread app/webhook.py
current_data = snapshot.to_dict()

if current_data.get("status") == "PAID":
print(f"ℹ️ Order {internal_order_id} was already PAID. Skipping update.")

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 8 spaces, expected 16 (bad-indentation) Warning

Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
Comment thread app/webhook.py
"payment_id": payment_id,
"razorpay_payment_data": payment,
"pickup_code": pickup_code,
"updated_at": firestore.SERVER_TIMESTAMP

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 8 spaces, expected 16 (bad-indentation) Warning

Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
Comment thread app/webhook.py
"pickup_code": pickup_code,
"updated_at": firestore.SERVER_TIMESTAMP
})
print(f"✅ SUCCESS: Generated Pickup Code {pickup_code} for Order {internal_order_id}")

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 8 spaces, expected 16 (bad-indentation) Warning

Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
Comment thread app/webhook.py
except Exception as e:
print(f"❌ Transaction failed: {e}")

else:

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 8 spaces, expected 16 (bad-indentation) Warning

Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
Comment thread app/webhook.py
else:
print(f"⚠️ Payment received without internal_order_id: {payment['id']}")

return {"status": "ok"}

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 8 spaces, expected 16 (bad-indentation) Warning

Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
Comment thread app/webhook.py Outdated

Check warning

Code scanning / Prospector (reported by Codacy)

Bad indentation. Found 8 spaces, expected 16 (bad-indentation) Warning

Bad indentation. Found 8 spaces, expected 16 (bad-indentation)
@AkibDa
AkibDa merged commit 4569bdb into GreenPlateByCodeNewbies:main Jan 17, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants