0
votes

I am trying to use the QuickBooks API using oAuth 2.0. My app currently runs perfectly using oAuth 1.0

I am using the quickbooks-ruby gem

gem "quickbooks-ruby", '1.0.1'

I have successfully migrated a client form oAuth 1.0 to oAuth 2.0 and received the access_token and refresh_token.

Now i'm trying to get the company preferences using oAuth 2.0, and getting an error. undefined method 'connection=' for #IntuitOAuth::Client:

Please see my code below:

access_token = OAuth2::AccessToken.new($oauth2_client, access_token, :refresh_token => refresh_token)

service = Quickbooks::Service::Preferences.new
service.company_id = realm_id
service.access_token = access_token
preferences = service.query("Select * from Preferences")

Thanks for your help!

1
Is your code calling connection = ... anywhere? the code you show doesn't look like the code the error must by pointing.arieljuod

1 Answers

0
votes

Figured it out!

The ruby gem i'm using to access the QBO API is incompatible with the intuit-oauth gem that QBO released for the QBO oAuth 2.0 migration.

You have to use one or the other gem. I have figured out how to get all the oAuth 2.0 operations working without the intuit-oauth gem.