Skip to content

Commit

Permalink
Revert "Fixes basic auth for netbanx by sending the account_number an…
Browse files Browse the repository at this point in the history
…d api_key" (#2644)

This reverts commit a838219. The
previous change needed to be reverted because I had misunderstood that
the account number and username are different values. By reverting the
last PR, the api_key needs to be in the basic auth format already
(<username>:<password).
  • Loading branch information
AnotherJoSmith authored Nov 8, 2017
1 parent 373a5c8 commit ffd7d23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Cyber Source: Correctly passes subscriptionID for store [deedeelavinder] #2633
* Worldbank US: Allow using the backup URL per-request [bpollack] #2645
* Netbanx: Only send currency and billing_details for auths and sales [anotherjosmith] #2643
* Netbanx: Revert "Fixes basic auth for netbanx by sending the account_number and api_key" [anotherjosmith] #2644

== Version 1.74.0 (October 24, 2017)
* Adyen: Update list of supported countries [dtykocki] #2600
Expand Down
6 changes: 1 addition & 5 deletions lib/active_merchant/billing/gateways/netbanx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,11 @@ def headers
{
'Accept' => 'application/json',
'Content-type' => 'application/json',
'Authorization' => "Basic #{basic_auth}",
'Authorization' => "Basic #{Base64.strict_encode64(@options[:api_key].to_s)}",
'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']
Expand Down

0 comments on commit ffd7d23

Please sign in to comment.