Skip to content

Making First Call

pleykov edited this page Sep 11, 2017 · 6 revisions

Creating request objects

There are two types of requests that can be performed through the SDK -- Inquiry and Update. Those have various modes which will be discussed later on.

C# Example for RIS

Here is a minimal C# example for making the RIS call using our current .NET SDK.

Step-by-step guide

Add the steps involved:

  1. Add the Kount.NET Library to your Project.
  2. Create a Kount.Ris.Inquiry Object and populate the setters.
  3. Add cart data.
  4. Ask for the responger(Inquiry.GetResponse()).
  5. Process the Kount.Ris.Response object returned.
Kount.Ris.Inquiry inq = new Kount.Ris.Inquiry();

// Create masked inquiry with CARD payment
inq.SetCardPaymentMasked("5789372819873789");
// Merchants acknowledgement to ship/process the order
inq.SetMack('Y');
// client e-mail
inq.SetEmail("[email protected]");
// Set default inquiry mode, internet order type
inq.SetMode(InquiryType.ModeQ);
inq.SetSessionId("vdt8796tbhbvhe786hret87645643");
// IP address of the customer
inq.SetIpAddress("165.53.125.33");
inq.SetWebsite("DEFAULT");
// total purchase amount
inq.SetTotal(5000);
ArrayList cart = new ArrayList();
cart.Add(new Kount.Ris.CartItem("Electronics", "TV","Big TV", 1, 24900));
inq.SetCart (cart);
Kount.Ris.Response response = inq.GetResponse();
Console.WriteLine("RESPONSE: " + response.ToString());

Explanation of the request

Here is a short description of what's going on during request creation, following the numbered comments in code

  1. Create masked inquiry with CARD payment, and populate the setters. In this case we don't use Confing Key and hashing method.
  2. Setting the request mode. As mentioned previously, there are several request modes and InquiryType.ModeQ is the most used one. Please check the Advanced page for more information on request modes.
  3. Setting a session identifier. This ID should be unique for a 30-day span and is used to track all changes regarding the purchase described in the request. More information on the Advanced page.
  4. IP address of the customer. The merchant can discover it or it can be obtained through the Data Collector service.
  5. The total purchase amount represented in the lowest possible currency denomination (example: cents for US Dollars)

Next step: Get to know what Kount RIS is returning at the Response description section.
Next step: Check the Advanced wiki page for detailed information on request parameters and SDK usage.