我正在使用rails 3.2 和 quickeebook gem来在线连接 quickbooks。现在我的 rails 应用程序和 quickbook 之间的连接已经完成,但是我面临着新的问题。
当我尝试将 customer.name 保存在 quickbook 中时,它会通过我的控制器成功保存,但如果我尝试传递 customer.id、customer.email、customer.zipcode、customer.phone 等字段,则会产生错误。如何使用 quickeebook gem 保存这些数据
哦,对不起,我忘记解释错误和代码
oauth_client = OAuth::AccessToken.new($qb_oauth_consumer, current_login.access_token, current_login.access_secret)
#creating customer in quickbooks
customer_service = Quickeebooks::Online::Service::Customer.new
customer_service.access_token = oauth_client
customer_service.realm_id = current_login.realm_id
customer_service.list
customer = Quickeebooks::Online::Model::Customer.new
customer.name = "New Customer2"
customer.email_address = "new_customer1@gmail.org"
customer.given_name = "New"
customer.middle_name = "H."
customer.family_name = "Customer"
customer.phone = "9845845854"
customer.web_site = "www.google.com"
customer.billing_address = "this is billing address"
customer.city = "Bangalore"
customer_service.create(customer)
假设,我想将这些字段插入在线快速手册中。但这会产生如下错误:
undefined method `to_xml' for "9845845854":String
直到family_name 的其他字段都运行良好,但是对于电话、地址、网站、城市等字段,每当我想将这些值推送到快速簿错误时,例如:
undefined method `to_xml' for "9845845854":String
undefined method `to_xml' for "www.google.com":string
undefined method `city=' for #<Quickeebooks::Online::Model::Customer:0xb5150e68>
来了。如何修复此错误?