public
Description: Simple wrapper for the Braintree APIs that uses Camping
Homepage: http://developer.getbraintree.com
Clone URL: git://github.com/braintree/braintree-utili-tool.git
Search Repo:
fixing error with get vs. query
ch0wda (author)
Thu Apr 10 10:30:18 -0700 2008
commit  a75b79794622317b44f66233c9722797e2a87bec
tree    d242c92c5d0f525f35b24fc3f612028276c6ebee
parent  d5195cebef0b250691de2755f806af2def15a4a8
...
97
98
99
100
 
101
102
103
...
112
113
114
115
116
117
118
 
 
 
 
 
 
119
120
121
...
221
222
223
224
 
225
226
227
...
97
98
99
 
100
101
102
103
...
112
113
114
 
 
 
 
115
116
117
118
119
120
121
122
123
...
223
224
225
 
226
227
228
229
0
@@ -97,7 +97,7 @@
0
     end
0
 
0
     def to_hash
0
- unless self.format.nil?
0
+ if self.format.nil?
0
         response_hash = { }
0
         self.response_body.split("&").each do |pair|
0
         pair_array = pair.split("=")
0
@@ -112,10 +112,12 @@
0
   
0
     private
0
     def format_response_body
0
- xml_oo = XmlSimple.xml_in(self.response_body, { 'SuppressEmpty' => true })
0
- xml_oo_out = XmlSimple.xml_out(xml_oo, { 'NoEscape' => true })
0
- formatted = xml_oo_out.gsub("<", "&lt;").gsub(">", "&gt;")
0
- return formatted
0
+ unless self.format.nil?
0
+ xml_oo = XmlSimple.xml_in(self.response_body, { 'SuppressEmpty' => true })
0
+ xml_oo_out = XmlSimple.xml_out(xml_oo, { 'NoEscape' => true })
0
+ formatted = xml_oo_out.gsub("<", "&lt;").gsub(">", "&gt;")
0
+ return formatted
0
+ end
0
     end
0
   end
0
 end
0
@@ -221,7 +223,7 @@
0
 
0
     def post
0
       @gateway_request = GatewayRequest.new( { :api, "query"}, input )
0
- @gateway_response = GatewayResponse.new(@gateway_request.response)
0
+ @gateway_response = GatewayResponse.new(@gateway_request.response, "xml")
0
       respond_to do |format|
0
         format.html { render :quick_query }
0
       end

Comments

    No one has commented yet.