2

I am implementing an application using AngularJS and Webapi taken two projects in one solution, I used checkout.js in client side then razorpay_payment_id is generating. But in the server side WebAPI application I used

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);

Using this RazorpayClient client = new RazorpayClient(key, secret); not fetching any razorpay_payment_id information. So that it is showing the error

{"Object reference not set to an instance of an object."}

..in razorpay.

I had generated the keyid and keysecret in test mode.

Why is the razorpayclient information not coming using key and secret?

Nkosi
  • 235,767
  • 35
  • 427
  • 472
chaitanya k
  • 199
  • 1
  • 3
  • 14

1 Answers1

5

I got reply from Razorpay integration support. It's because of incorrect TLS version. Add this line at the top and code would work fine.

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

Reference: Default SecurityProtocol in .NET 4.5

user3587767
  • 152
  • 8