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

Remove last validation for Stripe API Key #4804

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion lib/active_merchant/billing/gateways/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,6 @@ def commit(method, url, parameters = nil, options = {})
add_expand_parameters(parameters, options) if parameters

return Response.new(false, 'Invalid API Key provided') if test? && !key(options).start_with?('sk_test')
return Response.new(false, 'Invalid API Key provided') if !test? && !key(options).start_with?('sk_live')

response = api_request(method, url, parameters, options)
response['webhook_id'] = options[:webhook_id] if options[:webhook_id]
Expand Down
7 changes: 0 additions & 7 deletions test/unit/gateways/stripe_payment_intents_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,6 @@ def test_invalid_login_test_transaction
assert_match 'Invalid API Key provided', response.message
end

def test_invalid_login_live_transaction
gateway = StripePaymentIntentsGateway.new(login: 'sk_test_3422', test: false)
assert response = gateway.purchase(@amount, @credit_card, @options)
assert_failure response
assert_match 'Invalid API Key provided', response.message
end

def test_failed_error_on_requires_action
@gateway.expects(:ssl_request).returns(failed_with_set_error_on_requires_action_response)

Expand Down
7 changes: 0 additions & 7 deletions test/unit/gateways/stripe_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -883,13 +883,6 @@ def test_invalid_login_test_transaction
assert_match 'Invalid API Key provided', response.message
end

def test_invalid_login_live_transaction
gateway = StripePaymentIntentsGateway.new(login: 'sk_test_3422', test: false)
assert response = gateway.purchase(@amount, @credit_card, @options)
assert_failure response
assert_match 'Invalid API Key provided', response.message
end

def test_add_creditcard_with_credit_card
post = {}
@gateway.send(:add_creditcard, post, @credit_card, {})
Expand Down