Conversation
daveearley
left a comment
There was a problem hiding this comment.
Thanks for the effort here, @on3ss!
Still a lot of work to do before this is resilient enough to be used in a production environment
backend/app/Services/Application/Handlers/Order/Payment/Razorpay/RazorpayWebhookHandler.php
Outdated
Show resolved
Hide resolved
| $expectedSignature = hash_hmac( | ||
| 'sha256', | ||
| $payload, | ||
| $this->config->get('services.razorpay.webhook_secret') |
There was a problem hiding this comment.
I don't see webhook_secret in the config, so this check isn't valid.
| $this->razorpayOrdersRepository->updateByOrderId($orderId, [ | ||
| 'razorpay_payment_id' => $paymentData['id'], | ||
| 'status' => $paymentData['status'], | ||
| 'method' => $paymentData['method'], | ||
| 'amount' => $paymentData['amount'] / 100, // Convert from paise to rupees | ||
| 'currency' => $paymentData['currency'], | ||
| 'fee' => $paymentData['fee'] ?? 0, | ||
| 'tax' => $paymentData['tax'] ?? 0, |
There was a problem hiding this comment.
Several of these columns do not exist in the DB
| try { | ||
| $order = $this->verifyRazorpayPaymentHandler->handle( | ||
| $orderShortId, | ||
| request()->all() |
There was a problem hiding this comment.
There should be request validation here. We should also pass a typed DTO rather than an array.
| <IconWallet size={18}/> | ||
| <span>{t`Online`}</span> | ||
| </button> | ||
| {(isStripeEnabled || isRazorpayEnabled) && ( |
There was a problem hiding this comment.
There should be distinct conditions for both Stripe and Razor pay
…ay/RazorpayWebhookHandler.php Co-authored-by: Dave Earley <dave.m.earley@gmail.com>
|
@daveearley I have made some updates to the codebase relating to your feedbacks. I have also added changes that pertains to webhooks for the following events:
Please do check for additional feedback |
…and added test for CreateRazorpayOrderHandler
…refund webhook handler, also enabled razorpay for refund on cancellation
|
@daveearley please have look. saas remains unimplemented for now, but I would still like to hear feedbacks |
|
Thanks for the changes @on3ss! I wouldn't worry about SAAS support for now. If SAAS mode is enabled we could hide Razorpay as an option in event settings. I'll properly review and test this soon. |
|
Hey, sorry for the delay on this one - it's a large PR touching a pretty sensitive area of the codebase. Unfortunately I haven't been able to fully test it end-to-end as Razorpay doesn't allow sign-up with an Irish-registered company, so I've had to rely on a thorough code review. The overall structure looks solid and follows the existing patterns well, but I've found a few issues that need addressing before I can merge:
Minor stuff:
The main issue is not being able to test this end to end before merging. |
|
How do we proceed with the end-to-end testing then? I can share the test keys if you'd like through other channels. |
Thank you for creating a PR! We appreciate your contribution to Hi.Events.
To make the process as smooth as possible, please ensure you've read the contributing guidelines before proceeding.
Please include a summary of the changes and the issue being fixed or the feature being added. The more detail, the better!
Checklist
Thank you for your contribution! 🎉
Description
This PR adds support for the Razorpay payment gateway as an additional online payment option. In the settings, both STRIPE and RAZORPAY are now treated as ONLINE payment methods, allowing users to choose between them for processing online payments.
Changes Overview
Notes
Request
Looking forward to your feedback on this implementation! Please share any suggestions or concerns about the approach, architecture, or implementation details.