lib/active_merchant/billing/gateways/cenpos.rb in activemerchant-1.103.0 vs lib/active_merchant/billing/gateways/cenpos.rb in activemerchant-1.104.0

- old
+ new

@@ -110,11 +110,11 @@ post[:CardLastFourDigits] = payment_method.last_digits post[:MagneticData] = payment_method.track_data if payment_method.track_data end def add_customer_data(post, options) - if(billing_address = (options[:billing_address] || options[:address])) + if (billing_address = (options[:billing_address] || options[:address])) post[:CustomerEmailAddress] = billing_address[:email] post[:CustomerPhone] = billing_address[:phone] post[:CustomerBillingAddress] = billing_address[:address1] post[:CustomerCity] = billing_address[:city] post[:CustomerState] = billing_address[:state] @@ -154,11 +154,11 @@ data = build_request(post) begin xml = ssl_post(self.live_url, data, headers) raw = parse(xml) rescue ActiveMerchant::ResponseError => e - if(e.response.code == '500' && e.response.body.start_with?('<s:Envelope')) + if e.response.code == '500' && e.response.body.start_with?('<s:Envelope') raw = { message: 'See transcript for detailed error description.' } else raise @@ -252,11 +252,11 @@ '1' => STANDARD_ERROR_CODE[:card_declined], '99' => STANDARD_ERROR_CODE[:processing_error], } def authorization_from(request, response) - [ response[:reference_number], request[:CardLastFourDigits], request[:Amount] ].join('|') + [response[:reference_number], request[:CardLastFourDigits], request[:Amount]].join('|') end def split_authorization(authorization) reference_number, last_four_digits, original_amount = authorization.split('|') [reference_number, last_four_digits, original_amount] @@ -275,9 +275,10 @@ end def cvv_result_code(xml) cvv = validation_result_element(xml, 'CVV') return nil unless cvv + validation_result_matches?(*validation_result_element_text(cvv.parent)) ? 'M' : 'N' end def avs_result_code(xml) billing_address_elem = validation_result_element(xml, 'Billing Address')