google4r-checkout 1.1.beta4 → 1.1.beta5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,10 @@
1
1
  =google4r-checkout Changelog
2
2
 
3
+ == 1.1.beta5 (2010-09-21)
4
+
5
+ * Support for chargeback fees and chargeback gateway refund fees, contributed by George Palmer
6
+ * Test::Unit fixes for Ruby 1.9.2
7
+
3
8
  == 1.1.beta4 (2010-07-09)
4
9
 
5
10
  * All changes in this release contributed by George Palmer (thanks very much George!)
@@ -389,6 +389,12 @@ module Google4R #:nodoc:
389
389
 
390
390
  # The total amount charged back for an order (Money)
391
391
  attr_accessor :total_chargeback_amount
392
+
393
+ # The latest fee for the charge back (Money)
394
+ attr_accessor :latest_chargeback_fee_amount
395
+
396
+ # The latest transaction fee refund for an on order (Money)
397
+ attr_accessor :latest_fee_refund_amount
392
398
 
393
399
  # Factory method that creates a new ChargebackAmountNotification from an REXML::Element instance.
394
400
  # Use this to create instances of ChargebackAmountNotification.
@@ -409,6 +415,18 @@ module Google4R #:nodoc:
409
415
  amount = (BigDecimal.new(element.elements['total-chargeback-amount'].text)*100).to_i
410
416
  chargeback.total_chargeback_amount = Money.new(amount, currency)
411
417
 
418
+ if element.elements['latest-chargeback-fee-amount']
419
+ currency = element.elements['latest-chargeback-fee-amount'].attributes['currency']
420
+ amount = (BigDecimal.new(element.elements['latest-chargeback-fee-amount'].text)*100).to_i
421
+ chargeback.latest_chargeback_fee_amount = Money.new(amount, currency)
422
+ end
423
+
424
+ if element.elements['latest-fee-refund-amount']
425
+ currency = element.elements['latest-fee-refund-amount'].attributes['currency']
426
+ amount = (BigDecimal.new(element.elements['latest-fee-refund-amount'].text)*100).to_i
427
+ chargeback.latest_fee_refund_amount = Money.new(amount, currency)
428
+ end
429
+
412
430
  chargeback.timestamp = Time.parse(element.elements['timestamp'].text)
413
431
 
414
432
  return chargeback
@@ -46,6 +46,8 @@ class Google4R::Checkout::ChargebackAmountNotificationTest < Test::Unit::TestCas
46
46
  <google-order-number>841171949013218</google-order-number>
47
47
  <latest-chargeback-amount currency="GBP">226.06</latest-chargeback-amount>
48
48
  <total-chargeback-amount currency="GBP">226.06</total-chargeback-amount>
49
+ <latest-fee-refund-amount currency="GBP">2.21</latest-fee-refund-amount>
50
+ <latest-chargeback-fee-amount currency="GBP">10.00</latest-chargeback-fee-amount>
49
51
  <timestamp>2006-03-18T20:25:31</timestamp>
50
52
  </chargeback-amount-notification>
51
53
  }
@@ -61,5 +63,7 @@ class Google4R::Checkout::ChargebackAmountNotificationTest < Test::Unit::TestCas
61
63
  assert_equal Time.parse('2006-03-18T20:25:31'), notification.timestamp
62
64
  assert_equal(Money.new(22606, 'GBP'), notification.total_chargeback_amount)
63
65
  assert_equal(Money.new(22606, 'GBP'), notification.latest_chargeback_amount)
66
+ assert_equal(Money.new(221, 'GBP'), notification.latest_fee_refund_amount)
67
+ assert_equal(Money.new(1000, 'GBP'), notification.latest_chargeback_fee_amount)
64
68
  end
65
69
  end
@@ -190,7 +190,7 @@ class Google4R::Checkout::CheckoutCommandXmlGeneratorTest < Test::Unit::TestCase
190
190
 
191
191
  # Check that there is no <warnings> tag in the XML.
192
192
  xml_document = REXML::Document.new(res.body)
193
- assert 0, xml_document.root.elements.to_a('//warnings').size
193
+ assert_equal 0, xml_document.root.elements.to_a('//warnings').size
194
194
  end
195
195
  end
196
196
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google4r-checkout
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1848230124
4
+ hash: -1848230123
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - beta4
10
- version: 1.1.beta4
9
+ - beta5
10
+ version: 1.1.beta5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Chan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-09 00:00:00 -04:00
18
+ date: 2010-09-21 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency