SGFGOV / medusa-payment-razorpay

A basic implementation for medusajs payment with razorpay
https://github.com/SGFGOV/medusa-payment-razorpay
13 stars 17 forks source link

`context` in `updatePayment` method never has `customer` in the `context.paymentSessionData` #12

Closed thakkaryash21 closed 4 months ago

thakkaryash21 commented 7 months ago

This is leading to new orders getting created everytime updatePayment is called. This is also leading to failure in authorizePayment. In what circumstances would context.paymentSessionData.customer exist?

SGFGOV commented 6 months ago

The reason this happens is that medusa updates the payment context with each step, which in turn expects the order to be updated. However, razorpay doesn't support order updates. Thus it creates a new order with every update, only the last order Id should be passed to the client. This may not be the ideal solution, but am happy to accept a PR for the same. The customer context needs to be set by the client and sent. Sorry this bit isn't in the readme file. Happy to accept a PR where you are doing this.

SGFGOV commented 4 months ago

Plz check if this is is fixed in 7.0.6

SGFGOV commented 4 months ago

please use the latest version. this has been fixed