Git Product home page Git Product logo

Comments (13)

radhika-tk avatar radhika-tk commented on September 1, 2024

@Saneesh : In the first step you have created the Order. The result of this is an order_id.
Now, pass this order_id while creating the payment
{
"amount": 5000,
"currency": "INR",
"order_id": "order_7IZKKI4Pnt2kEe", .....> Enter the Order ID obtained from the first step.
"notes": {},
}
This will result in the payment ID

from razorpay-node.

Saneesh avatar Saneesh commented on September 1, 2024

@radhika-tk ,
Thank you for the reply!

When I executed as you said,

let payments = await razorpay.orders.fetchPayments({
        amount: data['amount'],
        currency: data['currency'],
        order_id: String(result.id),
        notes: data['notes'],
      });

it shows the following error.

error : {"statusCode":400,"error":{"code":"BAD_REQUEST_ERROR","description":"The order id must be 20 characters.","field":"order_id"}}

Note: result.id I got as order_CIEbCTYPctRfHq

Regards,
Saneesh.

from razorpay-node.

radhika-tk avatar radhika-tk commented on September 1, 2024

Can you check if the Order ID generated at your end is of the following format:
"order_<14 char id>" , a total of 20 characters

from razorpay-node.

Saneesh avatar Saneesh commented on September 1, 2024

Yes, same format order_CIEbCTYPctRfHq

from razorpay-node.

radhika-tk avatar radhika-tk commented on September 1, 2024

Reiterating the steps that you need to follow:

  1. Create an Order, which will generate an Order ID
  2. Create a Payment using the Order ID, created in step 1
  3. Fetch the Payment

Hope you are following the same

from razorpay-node.

Saneesh avatar Saneesh commented on September 1, 2024

This is the whole code I wrote.

let razorpay = new Razorpay({
  key_id: outConfigs.razorpay.key_id,
  key_secret: outConfigs.razorpay.key_secret,
});

let output: any;

await razorpay.orders.create({
  amount: data['amount'],
  currency: data['currency'],
  receipt: data['receipt'],
  payment_capture: data['payment_capture'],
  notes: data['notes']
}).then(async (result) => {
  output = result;
  let payments = await razorpay.orders.fetchPayments({
    amount: data['amount'],
    currency: data['currency'],
    order_id: String(result.id),
    notes: data['notes'],
  });
  console.log(payments);
 }).catch((error) => {
      output = data;
 });

I think the step 2, is missing from my side.
How to create payment using Order ID? if it is using instance.payments.capture(payment_id, amount, currency) then how can I get the payment_id?

regards,
Saneesh

from razorpay-node.

umanghome avatar umanghome commented on September 1, 2024
  1. Create an Order
  2. Pass the order_id in options while creating the Checkout Form.
  3. Once the user has made a payment using the Checkout Form, you will be able to retrieve the payments associated with the Order. A single order can have multiple payments associated with it if any of them have failed.

from razorpay-node.

radhika-tk avatar radhika-tk commented on September 1, 2024

@Saneesh : What's the update? Any progress made?

from razorpay-node.

Saneesh avatar Saneesh commented on September 1, 2024

@radhika-tk
Yes, it is working I have successfully done the payment. For now, only one issue which is related to https that can be tested after we set up the server.

from razorpay-node.

umanghome avatar umanghome commented on September 1, 2024

Closing this as it seems to be resolved.

from razorpay-node.

zainabf3 avatar zainabf3 commented on September 1, 2024

@radhika-tk
Yes, it is working I have successfully done the payment. For now, only one issue which is related to https that can be tested after we set up the server.

@radhika-tk
Yes, it is working I have successfully done the payment. For now, only one issue which is related to https that can be tested after we set up the server.

hey can you share the code ?

from razorpay-node.

sajeeve9 avatar sajeeve9 commented on September 1, 2024

i am trying to integrate Razorpay Hosted Checkout but i am not able to crack this hosted integration pleease help me tro solve this integration

$order = $client->order->create([
'receipt' => 'order_rcptid_11',
'amount' => 50000, // amount in the smallest currency unit
'currency' => 'INR',// See the list of supported currencies.)
'payment_capture' => '0'
]);

plese help to do this integration
@radhika-tk

from razorpay-node.

goc-gyandeep avatar goc-gyandeep commented on September 1, 2024

Hello @radhika-tk and @Saneesh , I am confused with step-2.
My use case: I am calling APIs and I have no website. I need to send the payment link to the customer then he can pay then I get payment_id in Razorpay dashboard.
Q: How can I get the Payment_id as when I create payment link via API then it gives me few fields with payment link, when payment is done then I can see payment details on Razorpay dashboard. How can I get this payment_id ? as per the below screenshot, I get payment details but I am unable to get the payment_id.

image

  1. I am able to create an order.
  2. I get an order_id but how can I pass this order_id in fetchpayment, I have passed order_id in Fetch Payments by Order API but it returns blank.
  3. @umanghome has mentioned to pass order_id in checkout form but in my case I have no checkout form, I am sending payment link to the customer.

I request for the quick solution for this.

from razorpay-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.