lib/active_merchant/billing/gateways/cardknox.rb in activemerchant-1.83.0 vs lib/active_merchant/billing/gateways/cardknox.rb in activemerchant-1.84.0
- old
+ new
@@ -277,22 +277,21 @@
masked_card_num: fields['xMaskedCardNumber'],
masked_account_number: fields['MaskedAccountNumber']
}.delete_if{|k, v| v.nil?}
end
-
def commit(action, source_type, parameters)
response = parse(ssl_post(live_url, post_data(COMMANDS[source_type][action], parameters)))
Response.new(
- (response[:status] == 'Approved'),
- message_from(response),
- response,
- authorization: authorization_from(response, source_type),
- avs_result: { code: response[:avs_result_code] },
- cvv_result: response[:cvv_result_code]
- )
+ (response[:status] == 'Approved'),
+ message_from(response),
+ response,
+ authorization: authorization_from(response, source_type),
+ avs_result: { code: response[:avs_result_code] },
+ cvv_result: response[:cvv_result_code]
+ )
end
def message_from(response)
if response[:status] == 'Approved'
'Success'
@@ -310,10 +309,10 @@
def post_data(command, parameters = {})
initial_parameters = {
Key: @options[:api_key],
Version: '4.5.4',
SoftwareName: 'Active Merchant',
- SoftwareVersion: "#{ActiveMerchant::VERSION}",
+ SoftwareVersion: ActiveMerchant::VERSION.to_s,
Command: command,
}
seed = SecureRandom.hex(32).upcase
hash = Digest::SHA1.hexdigest("#{initial_parameters[:command]}:#{@options[:pin]}:#{parameters[:amount]}:#{parameters[:invoice]}:#{seed}")