Repository navigation
feat: extend validatePaymentVerification to support invoice payments - #451
Open
AxatSachani wants to merge 5 commits into
Open
AxatSachani wants to merge 5 commits into
AxatSachani wants to merge 5 commits into
Conversation
AxatSachani
marked this pull request as ready for review
July 3, 2025 13:47
Author
|
@ankitdas13 Could you please add the |
AxatSachani
marked this pull request as draft
November 15, 2025 06:03
AxatSachani
marked this pull request as ready for review
November 15, 2025 06:04
AxatSachani
force-pushed
the
feature/invoice-signature-verification
branch
3 times, most recently
from
September 30, 2026 04:42
de7ef0d to
865f053
Compare
- Extended the `validatePaymentVerification` method to support invoice-based payment verification.
- Added logic to handle the following payload structure:
- ```razorpay_invoice_id|razorpay_invoice_receipt|razorpay_invoice_status|payment_id```
- This is useful when using Razorpay’s Invoice API to create invoices and collect payments.
- The change is backward compatible and preserves existing flows for order_id, subscription_id, and payment_link_id.
…ayment verification - Introduced a new interface **```RazorpayVerifyInvoicePayment```** extending RazorpayWebhook. - This interface defines the required fields for verifying invoice-based payments: - invoice_id - invoice_receipt_id - invoice_status - Helps improve type safety and developer experience when working with invoice payment signature verification. - Complements the logic added in ```validatePaymentVerification``` to support invoice-based flows.
…ntVerification - Added a test case to verify the new invoice payment verification logic in ```validatePaymentVerification```. - Test uses a sample payload with: - invoice_id - invoice_receipt_id - invoice_status - payment_id - Validates both a correct and incorrect signature to ensure robustness of the verification logic. - Complements the recent enhancement for invoice-based signature support.
- Error message referenced razorpay_invoice_id; the expected key is invoice_id - Accept RazorpayVerifyInvoicePayment in validatePaymentVerification typings - Document invoice payment verification in paymentVerfication.md
AxatSachani
force-pushed
the
feature/invoice-signature-verification
branch
from
September 30, 2026 04:48
7a741a6 to
4d750f3
Compare
Author
|
@rzpamidi @ankitdas13 The branch is up to date with Fixes #450 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ What this PR does
This PR adds support for verifying invoice-based payments in the
validatePaymentVerificationutility method in the Razorpay Node.js SDK.✨ New payload format supported for invoice payments:
razorpay_invoice_id|razorpay_invoice_receipt|razorpay_invoice_status|payment_id📌 Why this is needed
The existing implementation of
validatePaymentVerificationonly supported:order_idsubscription_idpayment_link_idHowever, many developers (including myself) use the Invoice API to create invoices and collect payments — especially for business compliance and downloadable PDF invoices. Until now, there was no official support for verifying invoice-based payments in the SDK.
🔧 What was added
razorpay_invoice_idrazorpay_invoice_receiptrazorpay_invoice_statuspayment_id✅ Test Case
View the test case here:
📄 Invoice Payment Verification Test Case
Testing
Test evidence: https://docs.google.com/document/d/1N7lUzFDZRspV833D94V7Pr_JEYza9JTfd7T8p0ozJeE/edit?usp=sharing
npm test: 380 passing, 0 failing (includes the new "Invoice Payment Verfication" test)master(b9e8527)Testing
Test evidence: https://docs.google.com/document/d/1N7lUzFDZRspV833D94V7Pr_JEYza9JTfd7T8p0ozJeE/edit?usp=sharing
npm test: 380 passing, 0 failing (includes the new "Invoice Payment Verfication" test)master(b9e8527)🔗 References