minimul / qbo_api

Ruby JSON-only client for QuickBooks Online API v3. Built on top of the Faraday gem.
MIT License
85 stars 46 forks source link

Issue with Vendor Credits and Bill Payments? #90

Closed hdrsh closed 6 years ago

hdrsh commented 6 years ago

Hello,

While creating a bill payment, with the following body:

{"VendorRef"=>{"value"=>"238", "name"=>"Vendor"}, "DocNumber"=>"11761", "TxnDate"=>"2018-01-21", "TotalAmt"=>10.95, "PrivateNote"=>"For Purchase Order: XYZABC", "Line"=>[{"Amount"=>10.95, "LinkedTxn"=>[{"TxnId"=>3385, "TxnType"=>"Bill"}]}], "CurrencyRef"=>{"value"=>"USD"}, "ExchangeRate"=>5.66, "PayType"=>"CreditCard", "CreditCardPayment"=>{"CCAccountRef"=>{"value"=>"771", "name"=>"American Express - 5555"}}}

The payment gets created succesfully, but I get the following Debug Warning:

DEBUG -- : [QuickBooks] entity name not in response body: entity=:billpayment entity_name="Billpayment" body={..

When I then try to update the bill payment, instead of updating the payment, for some reason, a new payment gets created:

@qbo_api.update(:billpayment, id: qbo_payment_id, payload: purchase_transaction_payload)

Both the issues also happen with vendor credits (ie. Debug and duplication on update)

minimul commented 6 years ago

Should be :bill_payment. You snake case the resources' title case. e.g. AnExampleResource = :an_example_resource.