Skip to content

Commit

Permalink
updated ruby version to 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinHaefele committed Apr 30, 2024
1 parent 7034274 commit 49a9918
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
version:
- 2.7
- 3.1
gemfile:
- gemfiles/Gemfile.rails50
- gemfiles/Gemfile.rails51
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AllCops:
- "lib/active_merchant/billing/gateways/paypal_express.rb"
- "vendor/**/*"
ExtraDetails: false
TargetRubyVersion: 2.7
TargetRubyVersion: 3.1

# Active Merchant gateways are not amenable to length restrictions
Metrics/ClassLength:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,6 @@ Style/ZeroLengthPredicate:
# Offense count: 9321
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Layout/LineLength:
Max: 2602

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem 'rubocop', '~> 1.14.0', require: false
group :test, :remote_test do
# gateway-specific dependencies, keeping these gems out of the gemspec
gem 'braintree', '>= 4.14.0'
gem 'jose', '~> 1.1.3'
gem 'jose', '~> 1.2.0'
gem 'jwe'
gem 'mechanize'
gem 'timecop'
Expand Down
2 changes: 1 addition & 1 deletion activemerchant.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.email = 'tobi@leetsoft.com'
s.homepage = 'http://activemerchant.org/'

s.required_ruby_version = '>= 2.7'
s.required_ruby_version = '>= 3.1'

s.files = Dir['CHANGELOG', 'README.md', 'MIT-LICENSE', 'CONTRIBUTORS', 'lib/**/*', 'vendor/**/*']
s.require_path = 'lib'
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
machine:
ruby:
version: '2.7.0'
version: '3.1.0'

dependencies:
cache_directories:
Expand Down
2 changes: 1 addition & 1 deletion lib/active_merchant/billing/gateways/rapyd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def commit(method, action, parameters)
)
rescue ActiveMerchant::ResponseError => e
response = e.response.body.present? ? parse(e.response.body) : { 'status' => { 'response_code' => e.response.msg } }
message = response['status'].slice('message', 'response_code').values.compact_blank.first || ''
message = response['status'].slice('message', 'response_code').values.select(&:present?).first || ''
Response.new(false, message, response, test: test?, error_code: error_code_from(response))
end

Expand Down
4 changes: 2 additions & 2 deletions lib/active_merchant/billing/gateways/shift4_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ def add_creditcard(post, payment_method, options)
fraudCheckData: {
ipAddress: options[:ip],
email: options[:email]
}.compact_blank,
}.compact,
billing: {
name: payment_method.name,
address: { country: options.dig(:billing_address, :country) }
}.compact_blank,
}.compact,
ach: {
account: {
routingNumber: payment_method.routing_number,
Expand Down
12 changes: 6 additions & 6 deletions test/remote/gateways/remote_blue_snap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ def setup

@amount = 100
@credit_card = credit_card('4263982640269299')
@cabal_card = credit_card('6271701225979642', month: 3, year: 2024)
@naranja_card = credit_card('5895626746595650', month: 11, year: 2024)
@declined_card = credit_card('4917484589897107', month: 1, year: 2023)
@invalid_card = credit_card('4917484589897106', month: 1, year: 2023)
@cabal_card = credit_card('6271701225979642', month: 3, year: Time.now.year + 1)
@naranja_card = credit_card('5895626746595650', month: 11, year: Time.now.year + 1)
@declined_card = credit_card('4917484589897107', month: 1, year: Time.now.year + 1)
@invalid_card = credit_card('4917484589897106', month: 1, year: Time.now.year + 1)
@three_ds_visa_card = credit_card('4000000000001091', month: 1)
@three_ds_master_card = credit_card('5200000000001096', month: 1)
@invalid_cabal_card = credit_card('5896 5700 0000 0000', month: 1, year: 2023)
@invalid_cabal_card = credit_card('5896 5700 0000 0000', month: 1, year: Time.now.year + 1)

# BlueSnap may require support contact to activate fraud checking on sandbox accounts.
# Specific merchant-configurable thresholds can be set as follows:
Expand Down Expand Up @@ -292,7 +292,7 @@ def test_successful_purchase_with_currency
end

def test_successful_purchase_with_level3_data
l_three_visa = credit_card('4111111111111111', month: 2, year: 2023)
l_three_visa = credit_card('4111111111111111', month: 2, year: Time.now.year + 1)
options = @options.merge({
customer_reference_number: '1234A',
sales_tax_amount: 0.6,
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_clearhaus_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_unsuccessful_signing_request
assert gateway.options[:private_key]
assert auth = gateway.authorize(@amount, @credit_card, @options)
assert_failure auth
assert_equal 'Neither PUB key nor PRIV key: not enough data', auth.message
assert_equal 'Neither PUB key nor PRIV key: unsupported', auth.message

credentials = fixtures(:clearhaus_secure)
credentials[:signing_key] = 'foo'
Expand Down
4 changes: 2 additions & 2 deletions test/remote/gateways/remote_creditcall_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ def test_failed_verify
@declined_card.number = ''
response = @gateway.verify(@declined_card, @options)
assert_failure response
assert_match %r{PAN Must be >= 13 Digits}, response.message
assert_match %r{PAN Must be >= 12 Digits}, response.message
end

def test_invalid_login
gateway = CreditcallGateway.new(terminal_id: '', transaction_key: '')

response = gateway.purchase(@amount, @credit_card, @options)
assert_failure response
assert_match %r{Invalid TerminalID - Must be 8 digit number}, response.message
assert_match %r{Invalid terminal details}, response.message
end

def test_transcript_scrubbing
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_d_local_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class RemoteDLocalTest < Test::Unit::TestCase
def setup
@gateway = DLocalGateway.new(fixtures(:d_local))

@amount = 200
@amount = 1000
@credit_card = credit_card('4111111111111111')
@credit_card_naranja = credit_card('5895627823453005')
@cabal_credit_card = credit_card('5896 5700 0000 0004')
Expand Down
4 changes: 2 additions & 2 deletions test/remote/gateways/remote_decidir_plus_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_successful_verify
def test_failed_verify
assert response = @gateway_auth.verify(@declined_card, @options)
assert_failure response
assert_equal 'missing: fraud_detection', response.message
assert_equal '10734: Fraud Detection Data is required', response.message
end

def test_successful_store
Expand Down Expand Up @@ -217,7 +217,7 @@ def test_successful_purchase_with_fraud_detection

response = @gateway_purchase.purchase(@amount, payment_reference, options)
assert_success response
assert_equal({ 'status' => nil }, response.params['fraud_detection'])
assert_equal({ 'send_to_cs' => false, 'status' => nil }, response.params['fraud_detection'])
end

def test_successful_purchase_with_card_brand
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_merchant_warrior_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_successful_purchase

def test_failed_purchase
assert purchase = @gateway.purchase(@success_amount, @expired_card, @options)
assert_match 'Card has expired', purchase.message
assert_match 'Transaction declined', purchase.message
assert_failure purchase
assert_not_nil purchase.params['transaction_id']
assert_equal purchase.params['transaction_id'], purchase.authorization
Expand Down

0 comments on commit 49a9918

Please sign in to comment.