Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix response parsing in SagePayGateway for Ruby 1.9

  • Loading branch information...
commit 6b7b57d102daa9a3791327456ee79c59abe9f4c2 1 parent daa6695
Cody Fauser authored
Showing with 4 additions and 1 deletion.
  1. +1 −0  CHANGELOG
  2. +3 −1 lib/active_merchant/billing/gateways/sage_pay.rb
1  CHANGELOG
View
@@ -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]
4 lib/active_merchant/billing/gateways/sage_pay.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.