Skip to content

Commit

Permalink
SagePay: Fixed special handling for Japanese Yen currency to not send…
Browse files Browse the repository at this point in the history
… fractional amounts

* This is a followup commit to: b4d852e
  • Loading branch information
Soleone committed Sep 14, 2010
1 parent 1e650c6 commit b7e8c35
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
= ActiveMerchant CHANGELOG

* Fix SagePay special handling for Japanese YEN currency to not send fractional amounts [Soleone]

== Version 1.7.2 (August 27, 2010)

* Update Braintree integration to play nicely with the braintree 2.5.0 gem [Soleone]
* Fix SagePay to not send fractional amounts for Chinese YEN currency [Soleone]
* Fix SagePay to not send fractional amounts for Japanese YEN currency [Soleone]

== Version 1.7.1 (July 28, 2010)

Expand Down
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/sage_pay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SagePayGateway < Gateway
:jcb => "JCB"
}

CURRENCIES_WITHOUT_FRACTIONS = [ 'YEN' ]
CURRENCIES_WITHOUT_FRACTIONS = [ 'JPY' ]

ELECTRON = /^(424519|42496[23]|450875|48440[6-8]|4844[1-5][1-5]|4917[3-5][0-9]|491880)\d{10}(\d{3})?$/

Expand Down
4 changes: 2 additions & 2 deletions test/unit/gateways/sage_pay_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ def test_cvv_result

def test_dont_send_fractional_amount_for_chinese_yen
@amount = 100_00 # 100 YEN
@options[:currency] = 'YEN'
@options[:currency] = 'JPY'

@gateway.expects(:add_pair).with({}, :Amount, '100', :required => true)
@gateway.expects(:add_pair).with({}, :Currency, 'YEN', :required => true)
@gateway.expects(:add_pair).with({}, :Currency, 'JPY', :required => true)

@gateway.send(:add_amount, {}, @amount, @options)
end
Expand Down

0 comments on commit b7e8c35

Please sign in to comment.