xero_gateway-float 2.1.4 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/xero_gateway/payment.rb +9 -8
- data/xero_gateway.gemspec +1 -1
- metadata +1 -1
data/lib/xero_gateway/payment.rb
CHANGED
@@ -10,7 +10,7 @@ module XeroGateway
|
|
10
10
|
attr_reader :errors
|
11
11
|
|
12
12
|
# All accessible fields
|
13
|
-
attr_accessor :invoice_id, :invoice, :invoice_number, :account, :code, :payment_id, :date, :amount, :reference, :currency_rate, :account_id
|
13
|
+
attr_accessor :invoice_id, :invoice, :invoice_number, :account, :code, :payment_id, :date, :amount, :reference, :currency_rate, :account_id, :updated_date_utc
|
14
14
|
|
15
15
|
def initialize(params = {})
|
16
16
|
@errors ||= []
|
@@ -24,13 +24,14 @@ module XeroGateway
|
|
24
24
|
payment = Payment.new(:gateway => gateway)
|
25
25
|
payment_element.children.each do | element |
|
26
26
|
case element.name
|
27
|
-
when 'PaymentID'
|
28
|
-
when 'Date'
|
29
|
-
when 'Amount'
|
30
|
-
when 'Reference'
|
31
|
-
when 'CurrencyRate'
|
32
|
-
when 'Invoice'
|
33
|
-
when 'Account'
|
27
|
+
when 'PaymentID' then payment.payment_id = element.text
|
28
|
+
when 'Date' then payment.date = parse_date_time(element.text)
|
29
|
+
when 'Amount' then payment.amount = BigDecimal.new(element.text)
|
30
|
+
when 'Reference' then payment.reference = element.text
|
31
|
+
when 'CurrencyRate' then payment.currency_rate = BigDecimal.new(element.text)
|
32
|
+
when 'Invoice' then payment.invoice = Invoice.from_xml(element)
|
33
|
+
when 'Account' then payment.account = Account.from_xml(element)
|
34
|
+
when "UpdatedDateUTC" then payment.updated_date_utc = parse_utc_date_time(element.text)
|
34
35
|
end
|
35
36
|
end
|
36
37
|
payment
|
data/xero_gateway.gemspec
CHANGED