Closed imprakharshukla closed 6 months ago
Documentation seems to be incorrect here. The callback url should be: callback_url: ${process.env.MEDUSA_BACKEND_URL}/razorpay/hooks
Hello, i have the same issue. In my case i dont use the razorpay plugin. My package version:
"dependencies": { "@medusajs/admin": "7.1.6", "@medusajs/cache-inmemory": "^1.8.9", "@medusajs/cache-redis": "^1.8.9", "@medusajs/event-bus-local": "^1.9.7", "@medusajs/event-bus-redis": "^1.8.10", "@medusajs/file-local": "^1.0.2", "@medusajs/medusa": "1.18", "@tanstack/react-query": "4.22.0", "babel-preset-medusa-package": "^1.1.13", "body-parser": "^1.19.0", "cors": "^2.8.5", "dotenv": "16.0.3", "express": "^4.17.2", "medusa-file-supabase": "^0.0.1", "medusa-fulfillment-manual": "^1.1.38", "medusa-interfaces": "^1.3.7", "medusa-payment-manual": "^1.0.24", "medusa-payment-paypal": "^6.0.2", "medusa-payment-stripe": "^6.0.5", "medusa-plugin-mailjet": "^0.0.6", "prism-react-renderer": "^2.0.4", "typeorm": "^0.3.16" }
Getting the same exact issue, on PayPal (and probably also Stripe) plugin. In both cases isn't happening all the time, but about once every 6 transactions. On PayPal it causes the payment to go through but remain on hold state (on stripe seems to cause the payment to fail directly and thus not even trying to create the order, but I am not sure. I didn't receive reports about this, so I'm speculating), falling in this scenario. I think it always has to do with the 404 errors I get on the webhooks, even though I pointed them as written in manual (I set up the webhook as https://mybackenddomain.url/paypal/hooks ) . I am using basically same versions of @Mehmo21 , except for medusa that is 1.17.3.
Uh, somehow I fixed the issue (no failed order since Jan 23), with an edit that I did, which in theory shouldn't have effect on this, but well, maybe it did. I wanted to get an email when the order did fail, with all the data accessible to the storefront in that situation. I did two things, actually:
const onPaymentCompleted = () => {
complete(undefined, {
onSuccess: ({ data }) => {
resetCart()
if (data && data.id && data.id.includes("cart_")) {
fetch(`/api/error/report`, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(data)
});
}
push(`/order/confirmed/${data.id}`)
},
})
}
@imprakharshukla is the issue is resolved , i am too facing the same issue
I too get 404 Error from PayPal Webhooks
Bug report
Describe the bug
Medusa store redirects to 'http://localhost:8000/order/confirmed/cart_xxxx....' after the completion of the order. Hence, the cart doesn't convert into an order despite running the completeCheckout mutation.
I am using the razorpay plugin for medusa (https://github.com/SGFGOV/medusa-payment-razorpay)
System information
Medusa version (including plugins):
Node.js version: v20.2.0 Database: Postgres (supabase) Operating system: MacOS 13.2.1 Browser (if relevant): Arc
Steps to reproduce the behavior
Expected behavior
Order should have been created in the database and the redirect URL should contain the order ID starting with order_xxx.., instead of a cart id cart_xxx...
Screenshots
If applicable, add screenshots to help explain your problem
Code snippets
Checkout-Context- https://gist.github.com/imprakharshukla/3b3b819aa32da89051dae410b6a0137f payment-button: - https://gist.github.com/imprakharshukla/4150620a3a32b5a62bffd0477a0925b2
Additional context
Server Logs- https://gist.github.com/imprakharshukla/96d03fde9ddbb535b52c87147148948c Frontend Logs- https://gist.github.com/imprakharshukla/3cea82e6929bfe746823133c5b7ecb5f Frontend Console output- https://gist.github.com/imprakharshukla/d63e4d54d7c0ab0646ba11236875552e
I am using the razorpay plugin for medusa (https://github.com/SGFGOV/medusa-payment-razorpay)