From 62480a93c07d340bef1e8e967cb7b4bcff08b0b0 Mon Sep 17 00:00:00 2001 From: Benny Degezelle Date: Mon, 23 Dec 2019 19:15:17 +0100 Subject: [PATCH] Further patch get_payments; see https://github.com/xero-gateway/xero_gateway/pull/151#issuecomment-568541038 --- lib/xero_gateway/payment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xero_gateway/payment.rb b/lib/xero_gateway/payment.rb index b03968fb..a5620c65 100644 --- a/lib/xero_gateway/payment.rb +++ b/lib/xero_gateway/payment.rb @@ -31,7 +31,7 @@ def self.from_xml(payment_element) when 'CurrencyRate' then payment.currency_rate = BigDecimal(element.text) when 'Invoice' payment.invoice_id = element.elements["InvoiceID"].text - payment.invoice_number = element.elements["InvoiceNumber"].text + payment.invoice_number = element.elements["InvoiceNumber"].try(:text) when 'IsReconciled' then payment.reconciled = (element.text == "true") when 'Account' then payment.account_id = element.elements["AccountID"].text end