razorpay / razorpay/razorpay-node
Cookie not passed when razorpay submits to `callback_url`
@ankitdas13 is already working on this.
Since Dec 5, 2022.
- Dominant language
- JavaScript
- Stars
- 243
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
Steps to reproduce the behavior
- I am implementing subscriptions and using hosted checkout to pass the necessary parameters to razorpay.
- I am also using cookie based authentication for my app.
All is well till razorpay submits a POST request to my callback_url
Expected behavior
Razorpay should submit the signature to my callback_url with cookies I need to identify the user. The browser doesn't add cookies if the request is a POST request for security reasons.
If I can't identify the user, I can't fetch the subscription_id from the database to validate the signature passed to me.
Actual behavior
Razorpay submits a POST request to my callback_url and so the browser doesn't attach the cookies I need for authentication.
Code snippets
No response
Node version
16.18.1
Library version
2.8.4
Additional Information
Please change the method type to GET and pass the razorpay_payment_id, razorpay_subscription_id and razorpay_signature as query parameters. This would allow the browser to add the cookie and I can validate the signature.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.