Menu

Code sample information needed

Help
2008-05-08
2013-03-21
  • Nobody/Anonymous

    We have the following requirement related to iBilling.

    1)Locate the existing customer using customer account number.
    2) Fetching customer's last 12 months transaction details (Asset and Revenue ) from iBilling.

    Could you  guide us?

     
    • kipnis

      kipnis - 2008-05-08

      Please specify langauge that your work with when you post next time.

      All lookups should be done via Session class using queryXXX methods (in some languages there are also findXXX method, which function in the same way, but take search parameters as args vs Map/Dictionary). In my personal opinion, queryXXX should be easier for you. Depending on your language you would create a Map/Dictionary and populate with search values. The names of parameters can be found by looking in documentation at findXXX argument names (e.g. http://javadoc.ibillingclient.org/ibilling/client/Session.html\). The names are the same for all languages.

      To find customerAccount by code you can refer to Scenario 3, find line with comment - 'Find customer account'. The value passed as "code" is what i think you call "customer account number".

      To fetch transaction history you would do the same. You would create a map, specify parameters, in this case it would be - "fromCreateDate" and "toCreateDate" (merchantAccountCode is optional, but recommended) and then invoke queryAccountTransaction on the instance of Session passing the map as parameter.

      Hope this helps.

       
      • Nobody/Anonymous

        I need help to integrating ibilling through PHP language.

        Here my requirement is to fetch particular customers transaction. I tried like the previous post. But it didn't work. Here my doubt is how to locate the particular customer ?

        In code samples , they are providing the following code to fetch customer:
                     //Find customer account
                $parameters = new HashMap();
                $parameters->put("merchantAccountCode", $meraccountcode);
                $parameters->put("code", "php.ca-1");
                $customerAccount = $session->queryCustomerAccount($parameters)->get(0);

        But here i got error like
        Undefined index: firstName
        Undefined index: lastName

        we should set all customerAccount parameters here? Is it necessary to locate the existing customer account? Please help me to get it works..

         
    • kipnis

      kipnis - 2008-05-12

      Your code looks correct. You may be getting warnings (we will release version 1.1 shortly, where we will remove that) of underfined index, because search merchanism attempts every possible search parameter (it should not affect your search). Are you sure that you have the CustomerAccount record with this code already created? Unless you created it for your test domain, it will not exist. If you sure you have it, let me know your merchant account code and we will verify. If you are not sure, try to create CustomerAccount using Scenario 1 as your model.

      Hope this helps.

       

Log in to post a comment.