Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Fix response parsing in SagePayGateway for Ruby 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Fauser committed Feb 2, 2010
1 parent daa6695 commit 6b7b57d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions 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]
Expand Down
4 changes: 3 additions & 1 deletion lib/active_merchant/billing/gateways/sage_pay.rb
Expand Up @@ -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

Expand Down

0 comments on commit 6b7b57d

Please sign in to comment.