KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: Ketan B on May 23, 2012, 03:06:54 pm

Title: How to call registerCustomer method using JSON API
Post by: Ketan B on May 23, 2012, 03:06:54 pm
Hello All,

               I am using Konakart JSON API. I want to register customer using JSON call.
 
I have read from API that in KKEng i have method

                int registerCustomer(CustomerRegistrationIf custReg)

  Which can work for me.
             
              I want an Idea How can i call this method.

Thank you
Title: Re: How to call registerCustomer method using JSON API
Post by: ryan on May 23, 2012, 03:24:56 pm
What programming language are you using to make the call?
Title: Re: How to call registerCustomer method using JSON API
Post by: Ketan B on June 01, 2012, 05:21:57 am
Firstly Sorry for late reply .

I'm using JSP and In my Javascript part I have written jquery code

<script type="text/javascript">
         

$("#submitButton").click(function(){

                    var registerCustomerCallback = function(result, textStatus, jqXHR) {

                            var registeredCustomer = decodeJson(result);
               };

                    var customerRegistration = new CustomerRegistrationIf();
                    kkEng.registerCustomer(customerRegistration,registerCustomerCallback, null,eng);
             });
});
</script>

I just want to register a customer. I cannot use Controller I chose an JQuery approach to register a customer.

Please guide me. How can I achieve this.

Thank you
Title: Re: How to call registerCustomer method using JSON API
Post by: julie on June 01, 2012, 06:12:41 pm
You have to set the attributes of the CustomerRegistration object in the JavaScript. It is called CustomerRegistration and not CustomerRegistrationIf.

In order to see an example for what you need to set, take a look at  RegisterCustomer.java under \KonaKart\java_api_examples\src\com\konakart\apiexamples.