Drupal integration - specifically Ubercart

Discussion in 'Developers Forum' started by ecofinn, Jan 20, 2010.

  1. ecofinn New Member

    Hi all.

    I am loving Kashflow - having online access to my company accounts is such a relief - but potentially more revolutionary for us is that it exposes an API.

    So, being a Drupal developer and evangelist, I am going to start work on integrating Drupal (and Ubercart) with the Kashflow API.
    (See http://drupal.org and http://www.ubercart.org/)

    Initially I want all my Ubercat customers (Drupal users) to sync with my Kashflow customers. And when ubercart raises and invoice, it should use Kashflow to do so, and not send duplicate the process. Once that is sorted we can look to use other features of the API.

    I am busy, so this may take a while, but if anyone else out there is developing with Drupal and is interested in joining forces, give me a shout.

    Nice one, and thanks to the Kashflow team.

    Finn.

    Ecobee Ltd. | http://ecobee.org
    Ecohost Ltd. | http://ecohost.coop
  2. PatrickJohnson Administrator

    Glad to hear your being very pro-active.

    Let us know if we can help with anything. When you've got something to test let us have a go. If you make it public we may even add it to our add-ons page.
  3. monaghan Member

    I'm not using ubercart (it wouldn't do what I wanted as I have so much custom code already), but have just got a basic integration between a drupal module and Kashflow for the purposes of raising invoices and other billing functions.

    I just wrote a simple php-soap shim and converted this into a function library in my module. I'm still coding but can generate invoices and allow users to update their account details. Works a treat :)
  4. ecofinn New Member

    good to hear

    Hey monaghan,
    good to hear about your work.
    We're making progress, not as quick as we'd like, but we have a module now that syncs Drupal user accounts with Kashflow and are nearly there with automated invoices. Perhaps we could collaborate, pool resources, create an api module and separate out our Ubercart specific code to a separate module and get them out in the wild for others to use?
    Let me know if you're interested.
    Nice one.
    Finn.
  5. monaghan Member

    How have you coped with Ubercart calculating VAT?

    For example,

    pop a £15 item into KF and it creates a total of £17.63, pop the same item into UC and it creates it at £17.625, stuff that into the KF API and KF records the item as £17.62

    pop 2 £15 items into KF and get a total of £35.26, however, UC gives £35.25

    How have you overcome the issue? Looking at the code, it would appear that UC totals up the whole invoice and then adds tax, whereas KF treats each line as a separate entity as far as VAT is concerned.

    My code creates a customer account and also records the sales types of each item in the UC cart on-the-fly using the hook_submit() function. (I guess I could just create a simple summary invoice in KF, however, this would not allow decent reporting)
  6. monaghan Member

    Finally managed to track down the last place in the uc_taxes and uc_vat modules that deals with the VAT display and force rounding to 2 DP's and to calculate VAT on each item rather than totalling and adding VAT to the total.

    Now on to the payment recording and a bit of my own code to automate the order processing.
  7. crantok New Member

    @monaghan: Glad to know you've beaten the ubercart tax system. Found that really tricky myself: reverse engineering the tax meta-information from the order object in Ubercart's hook_order and applying it line-by-line to the invoice items.

    We've started to release our code on GitHub. Most of it is still too tangled to release yet, but the low level KashFlow interface fell out easily. We're happy to collaborate with other developers on this.

    Developer collaboration | Ecobee - ethical web design and development
  8. lightbeingcreations New Member

    Hi folks, I'm just starting up using Kashflow and working through getting it configured before going live with it. One thing I'd like to to do is integrate it with my Ubercart/Drupal site (Raw Chocolate Making Kits, Raw Cacao Ingredients, Diabetic Vegan Chocolate)

    How have you guys got on with integration to date?

    If there isn't a fully working integration solution, then I presume that I can just use the Paypal integration with Kashflow to get all the invoices/payments in to Kashflow.

    Any advice or suggestion would be welcome
  9. monaghan Member

    Any reason for UC now? Would you not be better using Drupal Commerce?
  10. lightbeingcreations New Member

    Not every module I'm using is currently available for D7/Commerce
  11. shareclock New Member

    how can i add shopping cart module in Drupal ...??
  12. monaghan Member

    Good reason :) Everything I need is either available on D7 or bespoke so it's my fault if it isn't D7 compatible (just working on my last D6->D7 module rewrite)
  13. monaghan Member

    Go to drupal.org and look for commerce (D7) or Ubercart (D6)
  14. lightbeingcreations New Member

    So did you get Ubercart & Kashflow working together before moving to D7? If so, any hints or tips?
  15. monaghan Member

    No sorry, I gave up, I took a look at Drupal Commerce, but that didn't seem far enough through development so I ended up creating my own modules to call KF functions.

    I could look at it for you if required, but my requirements couldn't be squeezed into a shopping cart so I dropped the cart integration, but have working D6 modules that make KF API calls to generate invoices & D7 KF modules that are called by other modules for invoices and customer functions.
  16. martinadam13 New Member

    How can i install Payment method on Drupal ? please help me friends
  17. lightbeingcreations New Member

    @monaghan - I may well give ya a shout when I look to move to D7/Commerce

    @martindam13 - it depends on how much you want to be able to do. The easy way is to just add Paypal buttons to your website. But if you want a full ecommerce website, with account management etc, then you'll need either the Ubercart or Commerce modules.
  18. justinbob7007 New Member

    Hi, thanks for this post. It is exactly what i was looking for. Look forward to reading more .
  19. albertsimon New Member

Share This Page