dotnet webapi中的RazorPay自动捕获问题

时间:2019-03-19 08:17:20

标签: .net angularjs asp.net-web-api razorpay

我在dotnet中使用razorpay自动捕获,它在测试模式下可以正常工作,但在实时模式下却不能工作。我在控制器中使用以下代码。

                Dictionary<string, object> input = new Dictionary<string, object>();
                input.Add("amount", amount); // this amount should be same as transaction amount
                input.Add("currency", "INR");
                input.Add("payment_capture", 1);
                var RazorkeyID = db.Parameters.Where(x => x.Name == "RazorPayKeyID").FirstOrDefault().Value;
                var RazorkeySecret = db.Parameters.Where(x => x.Name == "RazorPayKeySecret").FirstOrDefault().Value;

                RazorpayClient client = new RazorpayClient(RazorkeyID.ToString(), RazorkeySecret.ToString());
                //var payment = client.Payment.Fetch(transId);
                //var pymtTransDtl = JsonConvert.DeserializeObject(payment.Attributes.ToString());
                Razorpay.Api.Order order = client.Order.Create(input);
                orderId = order["id"].ToString();`

我为兼容性添加了以下代码。 System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

我认为兼容性代码只会出现问题。请解决此问题。预先感谢

0 个答案:

没有答案