Skip to content

Commit

Permalink
Merge pull request #11 from BookingSync/support-rails-7
Browse files Browse the repository at this point in the history
support Rails 7
  • Loading branch information
Azdaroth authored Jun 27, 2023
2 parents 9ab092e + 9227164 commit 4dfe595
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI
on: [pull_request]
jobs:
rspec:
strategy:
fail-fast: false
matrix:
include:
- { ruby: '3.0', rails: '6.0' }
- { ruby: '3.0', rails: '6.1' }
- { ruby: '3.0', rails: '7.0' }
- { ruby: '3.1', rails: '7.0' }
- { ruby: '3.2', rails: '7.0' }
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails.${{ matrix.rails }}.gemfile
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake test:units
5 changes: 5 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%w[6.0 6.1 7.0].each do |version|
appraise "rails.#{version}" do
gem "activesupport", "~> #{version}.0"
end
end
11 changes: 11 additions & 0 deletions Gemfile.rails70
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source 'https://rubygems.org'
gemspec

gem 'jruby-openssl', :platforms => :jruby

group :test, :remote_test do
# gateway-specific dependencies, keeping these gems out of the gemspec
gem 'braintree', '~> 2.78.0'
end

gem 'activesupport', '~> 7.0'
2 changes: 1 addition & 1 deletion activemerchant.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|

s.has_rdoc = true if Gem::VERSION < '1.7.0'

s.add_dependency('activesupport', '>= 4.2', '< 7')
s.add_dependency('activesupport', '>= 4.2', '< 8')
s.add_dependency('i18n', '>= 0.6.9')
s.add_dependency('builder', '>= 2.1.2', '< 4.0.0')
s.add_dependency('nokogiri', "~> 1.4")
Expand Down
14 changes: 14 additions & 0 deletions gemfiles/rails.6.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
source "https://rubygems.org"

gem "activesupport", "~> 6.0"
gem "rexml", ">= 3.2.4"

gem 'jruby-openssl', :platforms => :jruby

group :test, :remote_test do
# gateway-specific dependencies, keeping these gems out of the gemspec
gem 'braintree', '~> 2.78.0'
gem "psych", "< 4"
end

gemspec path: "../"
14 changes: 14 additions & 0 deletions gemfiles/rails.6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
source "https://rubygems.org"

gem "activesupport", "~> 6.1"
gem "rexml", ">= 3.2.4"

gem 'jruby-openssl', :platforms => :jruby

group :test, :remote_test do
# gateway-specific dependencies, keeping these gems out of the gemspec
gem 'braintree', '~> 2.78.0'
gem "psych", "< 4"
end

gemspec path: "../"
15 changes: 15 additions & 0 deletions gemfiles/rails.7.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
source "https://rubygems.org"

gem "activesupport", "~> 7.0"
gem "rexml", ">= 3.2.4"

gem 'jruby-openssl', :platforms => :jruby

group :test, :remote_test do
# gateway-specific dependencies, keeping these gems out of the gemspec
gem 'braintree', '~> 2.78.0'
gem "psych", "< 4"
end


gemspec path: "../"
4 changes: 2 additions & 2 deletions lib/active_merchant/billing/gateways/credorax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def credit(amount, payment_method, options={})
add_email(post, options)
add_echo(post, options)
add_transaction_type(post, options)

commit(:credit, post)
end

Expand Down Expand Up @@ -300,7 +300,7 @@ def commit(action, params, reference_action = nil)

def sign_request(params)
params = params.sort
params.each { |param| param[1].gsub!(/[<>()\\]/, ' ') }
params.each { |param| param[1] = param[1].gsub(/[<>()\\]/, ' ') }
values = params.map { |param| param[1].strip }
Digest::MD5.hexdigest(values.join + @options[:cipher_key])
end
Expand Down

0 comments on commit 4dfe595

Please sign in to comment.