lib/active_merchant/billing/gateways/smart_ps.rb in activemerchant-1.133.0 vs lib/active_merchant/billing/gateways/smart_ps.rb in activemerchant-1.137.0

- old
+ new

@@ -224,15 +224,19 @@ end def commit(action, money, parameters) parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money response = parse(ssl_post(self.live_url, post_data(action, parameters))) - Response.new(response['response'] == '1', message_from(response), response, + Response.new( + response['response'] == '1', + message_from(response), + response, authorization: (response['transactionid'] || response['customer_vault_id']), test: test?, cvv_result: response['cvvresponse'], - avs_result: { code: response['avsresponse'] }) + avs_result: { code: response['avsresponse'] } + ) end def expdate(creditcard) year = sprintf('%.04i', creditcard.year) month = sprintf('%.02i', creditcard.month) @@ -255,11 +259,10 @@ post = {} post[:username] = @options[:login] post[:password] = @options[:password] post[:type] = action if action - request = post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&') - request + post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&') end def determine_funding_source(source) case when source.is_a?(String) then :vault