Permalink
Browse files

Fix response parsing in SagePayGateway for Ruby 1.9

  • Loading branch information...
1 parent daa6695 commit 6b7b57d102daa9a3791327456ee79c59abe9f4c2 Cody Fauser committed Feb 2, 2010
Showing with 4 additions and 1 deletion.
  1. +1 −0 CHANGELOG
  2. +3 −1 lib/active_merchant/billing/gateways/sage_pay.rb
View
1 CHANGELOG
@@ -1,5 +1,6 @@
= ActiveMerchant CHANGELOG
+* Use String#each_line instead of to_a in SagePayGateway for Ruby 1.9 compat [cody]
* Don't return an array when finding the country code. Fixes issue with Ruby 1.9 [cody]
* Fix custom assertions for Ruby 1.9 [cody]
* Deprecate Money objects [cody]
View
4 lib/active_merchant/billing/gateways/sage_pay.rb
@@ -286,7 +286,9 @@ def post_data(action, parameters = {})
# Key2=value2
def parse(body)
result = {}
- body.to_a.each { |pair| result[$1] = $2 if pair.strip =~ /\A([^=]+)=(.+)\Z/im }
+ body.to_s.each_line do |pair|
+ result[$1] = $2 if pair.strip =~ /\A([^=]+)=(.+)\Z/im
+ end
result
end

0 comments on commit 6b7b57d

Please sign in to comment.