Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating refund throws an error #4

Open
AweSomeK101 opened this issue Jan 26, 2024 · 4 comments
Open

Creating refund throws an error #4

AweSomeK101 opened this issue Jan 26, 2024 · 4 comments

Comments

@AweSomeK101
Copy link

`::ffff:127.0.0.1 - - [26/Jan/2024:05:00:36 +0000] "POST /admin/returns/ret_01HN2174DA1T4VQTG40168JAT1/receive HTTP/1.1" 500 86 "http://localhost:9000/app/a/orders/order_01HN209KR3QJG3E896BDGV8A80" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"
error: Cannot read properties of undefined (reading 'id')

TypeError: Cannot read properties of undefined (reading 'id')

at PhonePeProviderService.<anonymous> (D:\codd\biosap\biosap-backend\node_modules\medusa-payment-phonepe\dist\core\phonepe-base.js:403:73)

at step (D:\codd\biosap\biosap-backend\node_modules\medusa-payment-phonepe\dist\core\phonepe-base.js:73:23)

at Object.next (D:\codd\biosap\biosap-backend\node_modules\medusa-payment-phonepe\dist\core\phonepe-base.js:54:53)

at D:\codd\biosap\biosap-backend\node_modules\medusa-payment-phonepe\dist\core\phonepe-base.js:48:71

at new Promise (<anonymous>)

at __awaiter (D:\codd\biosap\biosap-backend\node_modules\medusa-payment-phonepe\dist\core\phonepe-base.js:44:12)

at PhonePeBase.refundPayment (D:\codd\biosap\biosap-backend\node_modules\medusa-payment-phonepe\dist\core\phonepe-base.js:391:16)

at PaymentProviderService.<anonymous> (D:\codd\biosap\biosap-backend\node_modules\@medusajs\medusa\dist\services\payment-provider.js:807:71)

at step (D:\codd\biosap\biosap-backend\node_modules\@medusajs\medusa\dist\services\payment-provider.js:48:23)

at Object.next (D:\codd\biosap\biosap-backend\node_modules\@medusajs\medusa\dist\services\payment-provider.js:29:53)`
@SGFGOV
Copy link
Owner

SGFGOV commented Jan 27, 2024

This is because your client isn't sending the customer information storing the customer information in the payment session data object. The payment sessiondata must have {customer:{id:string}}

BR
PS: you can try this patch 1.1.46-next-v6 it throws a more sensible error

@AweSomeK101
Copy link
Author

AweSomeK101 commented Jan 27, 2024

I'm only using the refund bit from the admin panel for now and that wasn't working.

{ resolve:medusa-payment-phonepe`,

options: {
  redirectUrl: process.env.PHONEPE_REDIRECT_URL,
  callbackUrl: process.env.PHONEPE_CALLBACK_URL,
  salt: process.env.PHONEPE_SALT,
  merchantId: process.env.PHONEPE_MERCHANT_ACCOUNT,
  mode: process.env.PHONEPE_MODE,
  redirectMode: "POST",
},

},
`

and how do i use the patch you mentioned?

@SGFGOV
Copy link
Owner

SGFGOV commented Feb 6, 2024

You need to just install the patch

@suganyasai1026
Copy link

hi , i have followed the documentation but not able to see any update in admin portal to include phonepe for the region

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants