ruckus / quickbooks-ruby

Quickbooks Online REST API V3 - Ruby
MIT License
374 stars 302 forks source link

Quickbooks::IntuitRequestException Validation filter broken? #555

Closed Kvothe-28 closed 3 years ago

Kvothe-28 commented 3 years ago

Hi there, I'm trying to update a quickbooks customer (to be more specific I'm tryig to create a new customer by defining customer as customer = Quickbooks::Model::Customer.new and then updating the Nill vallues with my own values) via values from my app's ActiveRecord model. But for some reason it raises exception errors. At first it was raising exception error for attributes without an e-mail address;

Screenshot_11

Which was understandable at some point. But then I tried to update it with an object that had an e-mail attribute, it raised this exception;

Screenshot_10 (addresses don't contain invalid characters they are just regular letters)

When I try with different companies I still get the same error, even though e-mail address length was different error kept saying supplied length was "37 characters" which it was not. I can probably try to bypass this by "Query Building" but it would be my first time using it and I'd like to use it as a last resort. I'm very new in Ruby on Rails. So can anybody help me out with this? Thank you for your time.

This is how my code looks btw (running under a service). I'm trying for one object for now, after I bypass these exceptions, I'm thinking about an each do loop to iterate all companies and save them as quickbooks customers. If you think there's a better, more reliable, optimal way to do this task, please feel free to share. Screenshot_12

ruckus commented 3 years ago

Interesting. Try enabling logging and/or debugging to see the actual request XML being generated. It could also be helpful to point your client towards an HTTP Proxy.

See: https://github.com/ruckus/quickbooks-ruby#logging

But also, the multiple assignments to customer.billing_address wont have much affect, the last assignment will win.

See here on how to generate a whole address with its child properties and then assign that singular address:

https://github.com/ruckus/quickbooks-ruby#physical-addresses

Kvothe-28 commented 3 years ago

UPDATE ON THE ISSUE @ruckus Logging didn't worked, I got "Malformed Website Address Format" error. I tried something myself but it seems it didn't worked either. I tried to validate the url by parsing then adding "http://" to the beginning.

Screenshot_13

But it raised this error;

Screenshot_15

Logging in didn't do much difference.