1

我已使用 razorpay-cordova 插件为 Rozar 付款执行付款,但我收到错误请求“提供的 id 不存在”。但我正在使用我的测试密钥 ID,这是非常正确的。

payWithRozarPay(invoice: any) {
    const options = {
      description:
        'Buy ' + invoice.coin_amount + ' amount credit for quicklegalsolutions',
      currency: 'INR',
      key: 'rzp_test_Qtzsbri8xV2oIa',
      order_id: invoice.inv_code,
      amount: invoice.amount * 100,
      name: 'Quick Legal Solutions',
      prefill: {
        email: invoice.user.email,
        contact: invoice.user.mobile,
        name: invoice.user.name
      },
      theme: {
        color: '#F37254'
      }
    };
    console.log(options);
    // tslint:disable-next-line: only-arrow-functions
    const successCallback = function(success: any) {
      alert('payment_id: ' + success.razorpay_payment_id);
      console.log('payment_id: ' + success.razorpay_payment_id);
    };

    // tslint:disable-next-line: only-arrow-functions
    const cancelCallback = function(error: any) {
      alert(error.description + ' (Error ' + error.code + ')');
      console.log(error);
    };

    RazorpayCheckout.on('payment.success', successCallback);
    RazorpayCheckout.on('payment.cancel', cancelCallback);
    RazorpayCheckout.open(options);
  }
4

2 回答 2

2

从描述中删除“order_id:invoice.inv_code”

于 2019-07-12T05:55:48.333 回答
0

你是对的@sayak

实际上,order_id在您使用 razorpay api 生成新订单的订单流时使用的 id字段/order

很可能您没有使用他们的订单流程,这就是id您发送的订单不存在于他们的记录中的原因。

如果您使用他们的流程来管理订单,您应该order_id在生成订单时发送您收到的

于 2020-02-06T07:45:15.233 回答