lib/active_merchant/billing/gateways/cashnet.rb in activemerchant-1.119.0 vs lib/active_merchant/billing/gateways/cashnet.rb in activemerchant-1.120.0

- old
+ new

@@ -6,11 +6,11 @@ self.live_url = 'https://commerce.cashnet.com/' self.test_url = 'https://train.cashnet.com/' self.supported_countries = ['US'] self.supported_cardtypes = %i[visa master american_express discover diners_club jcb] - self.homepage_url = 'http://www.higherone.com/' + self.homepage_url = 'https://transactcampus.com' self.display_name = 'Cashnet' self.money_format = :dollars self.max_retries = 0 # Creates a new CashnetGateway @@ -74,20 +74,24 @@ raw_response = ssl_post(url, post_data(action, fields)) parsed_response = parse(raw_response) return unparsable_response(raw_response) unless parsed_response - success = (parsed_response[:result] == '0') + success = success?(parsed_response) Response.new( success, CASHNET_CODES[parsed_response[:result]], parsed_response, test: test?, authorization: (success ? parsed_response[:tx] : '') ) end + def success?(response) + response[:result] == '0' + end + def post_data(action, parameters = {}) post = {} post[:command] = action post[:merchant] = @options[:merchant] post[:operator] = @options[:operator] @@ -189,9 +193,10 @@ '212' => 'Customer/PIN not on file', '213' => 'Customer information not on file', '215' => 'Old PIN does not validate ', '221' => 'Invalid credit card processor type specified in location or payment code', '222' => 'Credit card processor error', + '230' => 'Host Error (USE VOID OR REVERSAL TO REFUND UNSETTLED TRANSACTIONS)', '280' => 'SmartPay transaction not posted', '301' => 'Original transaction not found for this customer', '302' => 'Amount to refund exceeds original payment amount or is missing', '304' => 'Original credit card payment not found or corrupted', '305' => 'Refund amounts should be expressed as positive amounts',