ruckus / quickbooks-ruby

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

Attaching `BillPaymentCheck `, `BillPaymentCreditCard` to `BillPayment` produces invalid XML #582

Closed brodyhoskins closed 1 year ago

brodyhoskins commented 1 year ago

While creating a BillPayment, we can attach a BillPaymentCheck or BillPaymentCreditCard like:

bill_payment = Quickbooks::Model::BillPayment.new

bill_payment.pay_type = 'Check'
bill_payment.check_payment = Quickbooks::Model::BillPaymentCheck.new(
  bank_account_ref: Quickbooks::Model::Account # some existing account
)

# or

bill_payment.pay_type = 'CreditCard'
bill_payment.credit_card_payment = Quickbooks::Model::BillPaymentCreditCard.new(
  cc_account_ref: Quickbooks::Model::Account # some existing account
)

The problem is that in the request XML under the <CheckPayment>/<CreditCardPayment>'s <BankAccountRef>/<CCAccountRef> has an <Id> where the API expects <Value>.

Intuit support wrote:

Based on the provided request payload, we could see that under BankAccountRef, the VALUE attribute defines the id and there is no attribute named ID under BankAccountRef or CCAccountRef. Please refer the billPayment API : https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/billpayment. In case of any issue, please do revert back.

Am I missing something or is this an issue? I've poured through the models and documentation but cannot seem to find a solution.

brodyhoskins commented 1 year ago

Closing this as I've learned I can just use Quickbooks::Model::BaseReference directly