-
Notifications
You must be signed in to change notification settings - Fork 6
Making First Call
pleykov edited this page Sep 11, 2017
·
6 revisions
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.
Here is a minimal C#
example for making the RIS call using our current .NET SDK
.
-
Add the
Kount.NET
Library to your Project. -
Create a
Kount.Ris.Inquiry
Object and populate the setters. -
Add
cart
data. -
Ask for the responger(
Inquiry.GetResponse()
). - 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());
Here is a short description of what's going on during request creation, following the numbered comments in code
- Create masked inquiry with
CARD
payment, and populate the setters. In this case we don't useConfing Key
and hashing method. - 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. - 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.
- IP address of the customer. The merchant can discover it or it can be obtained through the Data Collector service.
- 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.
- Home
- Installation
- Adding Configuration
-
Making Your First Call
- [[
C#
Example for RIS | Making-First-Call#c-example-for-ris ]] - Explanation
- [[
- Response description
- SDK Integration Tests
- Connection Troubleshooting