#need help in integrating razorpay in medusa v2
14 messages · Page 1 of 1 (latest)
i am firstime integrating payment gateway , i am following this https://github.com/sgftech/payment-razorpay
i am getting this error after clicking on continue payment
http: GET /admin/regions/ ← http://localhost:9000/app/analytics (304) - 20.778 ms
http: POST /store/payment-collections ← - (200) - 29.515 ms
error: Invalid request: Unrecognized fields: 'context'
MedusaError: Invalid request: Unrecognized fields: 'context'
at zodValidator (D:\web development\medusa2\my-medusa-store\node_modules@medusajs\framework\src\zod\zod-helpers.ts:126:13)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at async validateBody (D:\web development\medusa2\my-medusa-store\node_modules@medusajs\framework\src\http\utils\validate-body.ts:30:27) {
__isMedusaError: true,
type: 'invalid_data',
code: undefined,
date: 2025-02-24T05:22:11.311Z
}
http: POST /store/payment-collections/pay_col_01JMV5A397GYVXE01MFY941PCQ/payment-sessions ← - (400) - 25.587 ms
and if i remove context then from
const handleSubmit = async () => {
setIsLoading(true)
try {
const shouldInputCard =
isStripeFunc(selectedPaymentMethod) && !activeSession
console.log(activeSession)
if (!activeSession) {
await initiatePaymentSession(cart, {
provider_id: selectedPaymentMethod,
// context:{
// extra:cart
// }
})
}
const checkActiveSession =
activeSession?.provider_id === selectedPaymentMethod
console.log(checkActiveSession)
if (!checkActiveSession) {
await initiatePaymentSession(cart, {
provider_id: selectedPaymentMethod,
})
}
if (!shouldInputCard) {
return router.push(
pathname + "?" + createQueryString("step", "review"),
{
scroll: false,
}
)
}
} catch (err: any) {
setError(err.message)
} finally {
setIsLoading(false)
}
}
i got error as cart not ready
we cannot add localhost url as webhook url it should be deployed url
exactly what do you mean by deployed url
i have used ngrok to create webhook url
deployed url hosted backend url (https) instead of localhost
so if a deploy this project then the issue will get resolve
the first error will be resolved
ok thank you
can you tell me where can i deploy this easiy just to test payment gateway is working properly or not
I am not sure about that
Can use ngrok to get https link