medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
24.58k stars 2.42k forks source link

Razorpay order_id ,'An error occurred in updatePayment:\r\n`order_id` is mandatory' and also in client side "usecheckout" from checkout-context file is not available in latest medusa #6511

Open suganyasai1026 opened 6 months ago

suganyasai1026 commented 6 months ago

Bug report

import { useCheckout } from "@lib/context/checkout-context" file not available and data: { code: '', type: 'invalid_data', message: 'An error occurred in updatePayment:\r\norder_id is mandatory' } },

Describe the bug

A clear and concise description of what the bug is.

Code snippets

const plugins = [ { resolve: medusa-payment-razorpay, options: { key_id: process.env.RAZORPAY_ID ?? "", key_secret: process.env.RAZORPAY_SECRET?? "", razorpay_account: process.env.RAZORPAY_ACCOUNT??"", automatic_expiry_period: 30, // /any value between 12minuts and 30 days expressed in minutes/ manual_expiry_period: 20, refund_speed: "normal", webhook_secret: process.env.RAZORPAY_SECRET??"", } },

documentation :https://medusajs.com/plugins/medusa-payment-razorpay/ If applicable, add code samples to help explain your problem

theStonedSage commented 6 months ago

Hey @suganyasai1026 I am also trying to integrate razorpay and facing the exact same issue

were you able to solve this ?

suganyasai1026 commented 6 months ago

no

sumanchy88 commented 4 months ago

There are two issues with respect to plugin -

  1. order_id needs to be added in file medusa-core/packages/medusa/src/interfaces/payment-processor.ts which is consumed by plugin medusa-payment-razorpay
  2. order_id needs to be added in plugin medusa-payment-razorpay under file src/core/razorpay-base.ts in methods -
    async initiatePayment(
    context: PaymentProcessorContext
    ): Promise<PaymentProcessorError | PaymentProcessorSessionResponse> {
    const intentRequestData = this.getPaymentIntentOptions();
    const {
      email,
      currency_code,
      amount,
      resource_id,
      customer,
      paymentSessionData,
      order_id
    } = context;

    and

    async updatePayment(
    context: PaymentProcessorContext
    ): Promise<PaymentProcessorError | PaymentProcessorSessionResponse | void> {
    const { amount, customer, paymentSessionData, currency_code, order_id } = context;
rishabh-zangoh commented 4 months ago

@suganyasai1026 or @sumanchy88 did you people find any solution for this as i am facing the same issue

whiletrueee commented 4 months ago

Hey! Guys I am facing the same issue, any solutions ?

manishkumar212111 commented 4 months ago

Any solution I still looking ?

youreachedrahat commented 2 months ago

@suganyasai1026 @whiletrueee @theStonedSage @sumanchy88 @rishabh-zangoh @manishkumar212111

can you help me with this error. I have completed entire steps but I the payment button is disabled updated 3 files (constants.tsx, payment-button/index.tsx, payment-button/razorpay-payment-button.tsx and env.local with keyidas rzptest... storename and discription image image

manishkumar212111 commented 2 months ago

@youreachedrahat Please use this https://www.npmjs.com/package/medusa-payment-razorpay-poorvika

youreachedrahat commented 2 months ago

I ran this command npm i medusa-payment-razorpay-poorvika to install but still getting this issue no

⠋ Initializing plugin models
error:   Error starting server
Error: Unable to find plugin "medusa-payment-razorpay". Perhaps you need to install its package?
manishkumar212111 commented 2 months ago

Also update plugin name in Medusa-config

On Tue, 9 Jul 2024 at 8:13 PM, Rahat Sayyed @.***> wrote:

I ran this command npm i medusa-payment-razorpay-poorvika to install but still getting this issue no

⠋ Initializing plugin models error: Error starting server Error: Unable to find plugin "medusa-payment-razorpay". Perhaps you need to install its package?

— Reply to this email directly, view it on GitHub https://github.com/medusajs/medusa/issues/6511#issuecomment-2217918168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBP56AVE5PELJG7M35CBFTZLPZHPAVCNFSM6AAAAABD2HJDI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJXHEYTQMJWHA . You are receiving this because you were mentioned.Message ID: @.***>

youreachedrahat commented 2 months ago

Now I have same issue as others

error:   unable to retrieve customer from cart
error:   unable to find razorpay customer
error:   no customer billing found:
no customer billing found null
Error: no customer billing found:
no customer billing found null

{
  type: 'invalid_data',
  code: '',
  date: 2024-07-09T14:47:51.706Z
}

client side

message: 'no customer billing found:\r\nno customer billing found null'
manishkumar212111 commented 2 months ago

Create new customer and then try

On Tue, 9 Jul 2024 at 8:21 PM, Rahat Sayyed @.***> wrote:

Now I have same issue as others

error: unable to retrieve customer from cart error: unable to find razorpay customer error: no customer billing found: no customer billing found null Error: no customer billing found: no customer billing found null

{ type: 'invalid_data', code: '', date: 2024-07-09T14:47:51.706Z }

client side

message: 'no customer billing found:\r\nno customer billing found null'

— Reply to this email directly, view it on GitHub https://github.com/medusajs/medusa/issues/6511#issuecomment-2217935925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBP56FWAGQQAELRNHP2FVTZLP2HDAVCNFSM6AAAAABD2HJDI6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJXHEZTKOJSGU . You are receiving this because you were mentioned.Message ID: @.***>

youreachedrahat commented 2 months ago

already have user

image

youreachedrahat commented 2 months ago
⠋ Initializing defaults
TypeError: Cannot read properties of undefined (reading 'getRepeatableJobs')

is it related

MikhailNarkevich commented 3 weeks ago

@youreachedrahat Do you have any updates? I get the error TypeError: Cannot read properties of undefined (reading 'getRepeatableJobs') Using the plugin from the community medusa-plugin-postmark, maybe if you know a solution to your problem with this error it will help me too Thanks in advance for your answer