English 中文(简体)
提供的补贴在 no子里不存在raz子支付。
原标题:The id provided does not exist razorpay in nodejs

i m 在我React.js与背后 no的 no子里安装了支薪门。

www.un.org/Depts/DGACM/index_french.htm

razorpayHandler = () =>{
        const payment_amount  = this.props.TotalPrice;
        const backend_url =  https://25234399bb.ngrok.io ;
        const self = this;
        const options = {
        key: config.RAZOR_PAY_KEY,
        amount: payment_amount * 100,
        name:  StanPlus ,
        description:  pay your ambulance fare ,
        handler(response) {
            const paymentId = response.razorpay_payment_id;
            const url =  backend_url+ /razorpay/ +paymentId+ / +payment_amount+ / +self.id;
            console.log(paymentId)
            // Using my server endpoints to capture the payment
            fetch(url, {
            method:  get ,
            headers: {
                "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
            }
            })
            .then(resp =>  resp.json())
            .then(function (data) {
                    console.log(data)
            })
            .catch(function (error) {
                console.log( Request failed , error);
            });
        },
        theme: {
            color:  #40A9FF ,
        },
        };
        const rzp1 = new window.Razorpay(options);

        rzp1.open();
    }

backend.js(nodejs)

var express = require( express );
var router = express.Router();
var config = require( ../config );

const Razorpay = require( razorpay );
const instance = new Razorpay({
  key_id: config.razorpay_live_key,
  key_secret: config.razorpay_live_secret,
});

router.get( /:payment_id/:amount/:BID ,function(req,res,next){
    const {payment_id } = req.params;
    const {BID} = req.params;
    const amount = Number(req.params.amount*100);
    instance.payments.capture(payment_id, amount).then((data) => {
        data.Bid = BID;
        res.json(data);
    }).catch((error) => {
        res.json(error);
    });
})
module.exports = router;

这表明我有错误。

“statusCode”:400,“error”:{“code”:“BAD_REquestST_ERROR”,“description”:“所提供的援助不存在”

but if the same code if do process using test key its getting successfully completed but it is not working with live api.
here i m passing an extra parameter to the backend which required for us but if removed that parameter then also it is not working.but with parameter it is working with test api.
when we send request to backend it is generating id and sending to backend also but still it showing The id provided does not exist.

问题回答

如果你使用测试模式,那么就从json物体中删除了order_id参数。

我也一周前面临这一错误。 这一错误是在我们改变生产钥匙的测试钥匙以最终支付工作时产生的。

So I faced this issue The id provided does not exist because of the mismatch of Razorpay Keys on the frontend and backend side(node.js side.)

因此,确保你在后端和前线拥有生产环境的同样客户关键和秘密。

请允许我在评论中知道,如果它仍未解决的话。

  1. For Test Remove the OrderId from your options json data.
  2. For Live mode Pass the autogenerated Orderid From the user Control.

Removing order_id is not good practice we should follow documentation. To get order_id in React you have to first create a order in your backend eg(node.js). follow this steps to get order_id from Razorpay.

Step - 1

var instance = new Razorpay({  key_id:  YOUR_KEY_ID ,  key_secret:  YOUR_KEY_SECRET })

这将启动新的<代码>Razor Pai。

Step - 2

MyOrder = instance.orders.create({amount, currency, receipt, notes})

this will create an order for you and then you have access to order_id. You can log MyOrder to see more available attributes or just console.log(MyOrder.id) to get order_id and finally you have to pass your order_id in your case you have to pass order_id in options.

http://www.hchr.org。 您可以查阅与本<代码>类似的命令。 MyOrder.id

https://razor Pay.com/docs/ Remuneration-gateway/server-integration/nodejs/“rel=“nofollow noreferer”>doc。

页: 1 Razor Pay SDKs for all Platform here

如果你使用付款方式,则不把订单从个人价值选择中删除。

 var options = {
        "key": "xxxxxxxxxxxxxxx", // Enter the Key ID generated from the Dashboard
        "amount": "50000", // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise
        "currency": "INR",
        "name": "Acme Corp",
        "description": "Test Transaction",
        "image": "https://example.com/your_logo",
        // "order_id": "order_9A33XWu170gUtm", //This is a sample Order ID. Pass the `id` obtained in the response of Step 1
        "handler": function (response){
            alert(response.razorpay_payment_id);
            alert(response.razorpay_order_id);
            alert(response.razorpay_signature)
        },
        "prefill": {
            "name": "Gaurav Kumar",
            "email": "[email protected]",
            "contact": "9999999999"
        },
        "notes": {
            "address": "Razorpay Corporate Office"
        },
        "theme": {
            "color": "#3399cc"
        }
    };

当你发出不正确的命令,以启动付款方式时,就会出现这一错误。 基本上,命令不属于你的raz子付款账户,或属于无效账户。

例子:如果你发出命令——附有一套全权证书,然后使用另一套全权证书,这一问题就会发生。

I too faced the same problem while integrating Razorpay for subscription payments Initially, I passed order_id in the options param, which yielded the error -

{
  "code": "BAD_REQUEST_ERROR",
  "description": "The id provided does not exist",
  "source": "business",
  "step": "payment_initiation",
  "reason": "input_validation_failed",
  "metadata": {}
}

Hence replaced order_id with subscription_id.
Works now!

Check for the rp_type, for subscription pass options["subscription_id"], for orders pass options["order_id"]

I got a very fantastic solution of this error. there was a mismatch of key and key_id I resolved my error by replacing key_id with key in options object in Frontend Side.





相关问题
API HTTPOK 200 Postback handler from Ruby App

I m building a sinatra Ruby app that interacts with Jambool Social Gold API (a virtual currency platform). After a transaction is complete (the user purchases points) Jambool sends a "postback" to "...

Safely getting card number for payment gateway

I have a payment gateway api for BluePay. My application is in PHP. I am able to process a transaction with code similar to this: bp->process(1111111111111111,.....) with 111111111111111 being the ...

ecommerce stock management with external payment gateway

this question is similar to this one but with a twist (so the answer accepted for the older question is not valid in the following scenario) i have a site for selling tickets (PHP/MYSQL). Suppose i ...

Online credit card payment processing on behalf of others

Does anyone know a way to facilitate payment between two parties via our website similar to how eBay facilitates payments between sellers and buyers, with buyers using their credit cards to make the ...

Getting started with a project using Zend Framework

Ok, I ve got Zend all set up and my hello world pages working. Personally, I d rather code this from scratch, but I m trying to find out how to use Zend to save time when making similar projects over ...

热门标签