Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe: Fix header for test account deletion call #4612

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/active_merchant/billing/gateways/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ def supports_scrubbing?
def scrub(transcript)
transcript.
gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
gsub(%r((Authorization: Bearer )\w+), '\1[FILTERED]').
gsub(%r((&?three_d_secure\[cryptogram\]=)[\w=]*(&?)), '\1[FILTERED]\2').
gsub(%r(((\[card\]|card)\[cryptogram\]=)[^&]+(&?)), '\1[FILTERED]\3').
gsub(%r(((\[card\]|card)\[cvc\]=)\d+), '\1[FILTERED]').
Expand All @@ -301,7 +302,7 @@ def supports_network_tokenization?
def delete_latest_test_external_account(account)
return unless test?

auth_header = { 'Authorization': "Bearer #{options[:login]}" }
auth_header = { 'Authorization' => 'Basic ' + Base64.strict_encode64(options[:login].to_s + ':').strip }
url = "#{live_url}accounts/#{CGI.escape(account)}/external_accounts"
accounts_response = JSON.parse(ssl_get("#{url}?limit=100", auth_header))
to_delete = accounts_response['data'].reject { |ac| ac['default_for_currency'] }
Expand Down