lib/active_merchant/billing/gateways/netbanx.rb in activemerchant-1.73.0 vs lib/active_merchant/billing/gateways/netbanx.rb in activemerchant-1.74.0

- old
+ new

@@ -239,12 +239,16 @@ # Builds the auth and U-A headers for the request def headers { 'Accept' => 'application/json', 'Content-type' => 'application/json', - 'Authorization' => "Basic #{Base64.strict_encode64(@options[:api_key].to_s).strip}", + 'Authorization' => "Basic #{basic_auth}", 'User-Agent' => "Netbanx-Paysafe v1.0/ActiveMerchant #{ActiveMerchant::VERSION}" } + end + + def basic_auth + Base64.strict_encode64("#{@options[:account_number]}:#{@options[:api_key]}") end def error_code_from(response) unless success_from(response) case response['errorCode']