【问题标题】:RazorPay is not fetching PaymentId using key and secretRazorPay 未使用密钥和密钥获取 PaymentId
【发布时间】:2018-08-18 01:58:18
【问题描述】:

我正在使用 AngularJS 和 Webapi 实现一个应用程序,在一个解决方案中采用了两个项目,我在客户端使用 checkout.js,然后生成 razorpay_payment_id。但是在我使用的服务器端 WebAPI 应用程序中

string key = System.Configuration.ConfigurationManager.AppSettings["KeyId"];
string secret = System.Configuration.ConfigurationManager.AppSettings["KeySecret"];

// Initialize RazorPay Payment Gateway
RazorpayClient client = new RazorpayClient(key, secret);

//Get Payment Using Id
Payment rPayment = client.Payment.Fetch(reservation.PaymentId);

使用此 RazorpayClient client = new RazorpayClient(key, secret); 不会获取任何 razorpay_payment_id 信息。 所以它显示错误

{"对象引用未设置为对象的实例。"}

..在 razorpay 中。

我在测试模式下生成了keyidkeysecret

为什么razorpayclient 信息不使用密钥和秘密?

【问题讨论】:

  • 你能确认key和secret不为空吗?
  • 我也给出了密钥和秘密,它们不是空的
  • 您找到解决方案了吗?我们也面临同样的问题。

标签: c# asp.net-web-api razorpay


【解决方案1】:

我收到了 Razorpay 集成支持的回复。这是因为 TLS 版本不正确。在顶部添加这一行代码就可以正常工作了。

ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 |
(SecurityProtocolType)768 | (SecurityProtocolType)3072;

参考:Default SecurityProtocol in .NET 4.5

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-17
    • 2017-05-09
    • 1970-01-01
    • 2018-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多