Comments (13)
@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.
@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.
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.
Yes, same format order_CIEbCTYPctRfHq
from razorpay-node.
Reiterating the steps that you need to follow:
- Create an Order, which will generate an Order ID
- Create a Payment using the Order ID, created in step 1
- Fetch the Payment
Hope you are following the same
from razorpay-node.
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.
- Create an Order
- Pass the
order_id
in options while creating the Checkout Form. - 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.
@Saneesh : What's the update? Any progress made?
from razorpay-node.
@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.
Closing this as it seems to be resolved.
from razorpay-node.
@radhika-tk
Yes, it is working I have successfully done the payment. For now, only one issue which is related tohttps
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 tohttps
that can be tested after we set up the server.
hey can you share the code ?
from razorpay-node.
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.
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.
- I am able to create an order.
- 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.
- @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)
- npm install
- `name` field is mandatory in create customer method HOT 3
- Property 'validatePaymentVerification' does not exist on type 'typeof Razorpay' HOT 3
- Razorpay Version 2.9.1 for NodeJS uses Vulnerable Dependencies HOT 4
- Customer Already exists error HOT 13
- cant verify signature HOT 8
- Issue with create customer when customer is already exist and fail_existing value is 0 HOT 1
- [Feature]: Type definition for Webhook Events. HOT 1
- Do we have payment link with qr code HOT 3
- Promise rejection without error in `instance.orders.create()` HOT 1
- Authentication failed in test mode for razorpay connection works in localhost but for same keys fails on server HOT 1
- [Documentation]: Incorrect type in notes type in refund
- [Feature]: Razorpay X support in nodejs SDK HOT 1
- how to update a subscription plan via API
- [Feature]: Create Offers from API HOT 1
- I am unable to make payment through my website in MERN stack HOT 2
- request.body is empty in webhook request
- IP is not required and should not be sent in product configuration node sdk HOT 1
- Invalid Pan field when creating Linked account using razorpay-node
- [Feature]: More responsiveness from maintainers. Maybe take help of contributors? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from razorpay-node.