1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

$30 to the first PHP coder who can show me this...

Discussion in 'General Programming Chat' started by nameace, Jul 19, 2011.

  1. nameace

    nameace Newbie

    Joined:
    Nov 21, 2009
    Messages:
    31
    Likes Received:
    10
    Occupation:
    Internet Opportunist
    Location:
    UK
    Hey guys,

    I have a PHP script that raises an invoice in my Kashflow account, which is a web based accounting application. So I have the API all set up and it works. The problem is my script will only raise invoices for existing customers. I need it to be able to add a new customer record if they don't already exist and then raise an invoice accordingly.

    I know which functions to use (there is good documentation) but I'm not sure how to craft the code to allow for this extra functionality.

    The way I understand it is that I need a wrapper function to query the customer records and create a new one if necessary and then go on to create the invoice.

    I need someone to tell me how to do it. Just a good explanation really.

    If interested either post here or pm. I will forward to you what I have.

    Cheers guys and gals,

    Vin
     
    Last edited: Jul 19, 2011
  2. nameace

    nameace Newbie

    Joined:
    Nov 21, 2009
    Messages:
    31
    Likes Received:
    10
    Occupation:
    Internet Opportunist
    Location:
    UK
    any takers?

    Just need it explained to me that's all

    :bump:
     
  3. daymond

    daymond Junior Member Premium Member

    Joined:
    May 24, 2011
    Messages:
    185
    Likes Received:
    40
    just check before making new invoice if your customer is in db, if not query db with new user data and make new invoice. If they have api for sure must have some examples
     
    • Thanks Thanks x 1
  4. Bots_Do_it_Faster

    Bots_Do_it_Faster Registered Member

    Joined:
    Jun 28, 2010
    Messages:
    64
    Likes Received:
    77
    Occupation:
    Web Developer php and c#
    Location:
    South Florida
    You basic logic is sound.
    When the form posts to create an invoice it needs to check if user exists and it needs to create account if it doesn't exist. The the normal flow could continue. You would also need to decide when you create accounts automatically how you want to set default passwords and email the user. If not, it could be confusing for returning customers that were created automatically.

    If you have any specific questions hit me on skype and I'll be glad to do what I can to help.

    skype: bots_do_it_faster
     
    • Thanks Thanks x 1
    Last edited: Jul 19, 2011
  5. nameace

    nameace Newbie

    Joined:
    Nov 21, 2009
    Messages:
    31
    Likes Received:
    10
    Occupation:
    Internet Opportunist
    Location:
    UK
    thanks daymond, there are a couple of php examples but they don't contain this particular feature.

    thanks man, have just pmed you