Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Update Invoice in Windows edition #84

Closed
theinventor opened this issue Jul 30, 2013 · 3 comments
Closed

Update Invoice in Windows edition #84

theinventor opened this issue Jul 30, 2013 · 3 comments

Comments

@theinventor
Copy link
Contributor

It looks like the update functionality is just missing - is that right?

Would it be a lot of effort to add it?

@ruckus
Copy link
Owner

ruckus commented Jul 31, 2013

You're right - it does not exist.

In theory it should be decently straight-forward to implement. Intuit requires that some fields are not set / provided for an Update. If you look at Windows::Customer#update you'll see this in action - some fields have to be niled out.

What I would do is:

  • Take the skeleton from Windows::Customer#update and implement it in Invoice
  • Attempt to perform the update in a Console - you'll get some errors. Probably along the lines of needing to nil out certain fields. Fix the errors and repeat until it works.

Not pretty, but its the iterative process I had to do for the Customer#update.

During development its very helpful to be running an HTTP proxy so you can capture all of the traffic - helpful to grab the XML to implement in the spec as well. I use Charles Proxy:

http://www.charlesproxy.com/

But there are free / open source applications as well.

@ruckus
Copy link
Owner

ruckus commented Jul 31, 2013

Forgot to include: to have the library actually use your HTTP proxy you configure it like so:

options = {
  :site                 => "https://oauth.intuit.com",
  :request_token_path   => "/oauth/v1/get_request_token",
  :authorize_path       => "/oauth/v1/get_access_token",
  :access_token_path    => "/oauth/v1/get_access_token",
}

if Rails.env.development?
  options[:proxy] = "http://127.0.0.1:8080"
end

$qb_oauth_consumer = OAuth::Consumer.new(consumer_key, consumer_secret, options)

@theinventor
Copy link
Contributor Author

Awesome - I'm going to take a stab at this next week, I'll close this issue and update you if I get somewhere

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants