Skip to content

Commit b4ceb2e

Browse files
author
Sunny Raj Rathod
authored
Merge pull request #156 from AuthorizeNet/future
Merge from future for 1.9.5 release
2 parents 330dadd + 4d4936c commit b4ceb2e

68 files changed

Lines changed: 3525 additions & 3707 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Gemfile.lock
2-
spec/credentials.yml
32
.ruby-*
43
.idea
54
gemfiles/*.lock

.rubocop.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
AllCops:
2+
TargetRubyVersion: 2.2
3+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4+
# to ignore them, so only the ones explicitly set in this file are enabled.
5+
Exclude:
6+
- 'sample-code-ruby/**/*'
7+
8+
Style/FrozenStringLiteralComment:
9+
Enabled: false
10+
11+
# Check quotes usage according to lint rule below.
12+
Style/StringLiterals:
13+
Enabled: true
14+
EnforcedStyle: single_quotes
15+
AutoCorrect: false
16+
17+
Style/ConditionalAssignment:
18+
Enabled: true
19+
AutoCorrect: false

.scrutinizer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ checks:
22
ruby:
33
code_rating: true
44
duplicate_code: true
5+
tools:
6+
external_code_coverage: true

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ gemfile:
1212
- gemfiles/rails_42.gemfile
1313
- gemfiles/rails_50.gemfile
1414
- gemfiles/rails_51.gemfile
15+
- gemfiles/rails_52.gemfile
1516

1617
before_script:
1718
- git submodule update --remote --recursive
1819

1920
script:
2021
- bundle exec rake spec:ci
22+
- bundle exec rake spec:aim
2123
- bundle exec rake spec:api
24+
- bundle exec rake spec:cim
25+
- bundle exec rake spec:reporting
2226
- bundle exec rake spec:testrunner

Appraisals

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ end
99
appraise "rails-51" do
1010
gem 'rails', '~> 5.1', '>= 5.1.1'
1111
end
12+
13+
appraise "rails-52" do
14+
gem 'rails', '~> 5.2.0.beta2'
15+
end

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Authorize.Net Ruby SDK
22

3-
[![Travis CI Status](https://travis-ci.org/AuthorizeNet/sdk-ruby.svg?branch=master)](https://travis-ci.org/AuthorizeNet/sdk-ruby)
4-
[![Coverage Status](https://coveralls.io/repos/github/AuthorizeNet/sdk-ruby/badge.svg?branch=master)](https://coveralls.io/github/AuthorizeNet/sdk-ruby?branch=master)
5-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master)
6-
[![Gem Version](https://badge.fury.io/rb/authorizenet.svg)](https://badge.fury.io/rb/authorizenet)
3+
[![Version ][rubygems_badge]][rubygems]
4+
[![Travis CI ][travis_badge]][travis]
5+
[![Coverage ][coverage_badge]][coverage]
6+
[![Scrutinizer ][scrutinizer_badge]][scrutinizer]
77

8+
Starting Release 1.8.6 November 2015 the Authorize.Net API has been [reorganized to be more merchant focused](https://developer.authorize.net/api/upgrade_guide/).
9+
AIM, ARB, CIM, Reporting and SIM have all been deprecated in favor of AuthorizeNet::API.
810

911
## Requirements
1012
* Ruby 2.2.2 or higher
@@ -108,4 +110,13 @@ For additional help in testing your own code, Authorize.Net maintains a [compreh
108110

109111

110112
## License
111-
This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/LICENSE.txt) file.
113+
This repository is distributed under a proprietary license. See the provided [`LICENSE.txt`](/LICENSE.txt) file.
114+
115+
[rubygems_badge]: https://badge.fury.io/rb/authorizenet.svg
116+
[rubygems]: https://rubygems.org/gems/authorizenet
117+
[travis_badge]: https://travis-ci.org/AuthorizeNet/sdk-ruby.svg?branch=master
118+
[travis]: https://travis-ci.org/AuthorizeNet/sdk-ruby
119+
[coverage_badge]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/badges/coverage.png?b=master
120+
[coverage]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master
121+
[scrutinizer_badge]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/badges/quality-score.png?b=master
122+
[scrutinizer]: https://scrutinizer-ci.com/g/AuthorizeNet/sdk-ruby/?branch=master

Rakefile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require "rake"
22
require "rspec/core/rake_task"
33

4-
task :default => :spec
4+
task default: :spec
55
desc "Run all specs"
66
RSpec::Core::RakeTask.new(:spec) do |spec|
77
spec.pattern = FileList['spec/**/*_spec.rb']
@@ -11,46 +11,46 @@ end
1111
namespace "spec" do
1212
desc "Run the CIM spec"
1313
RSpec::Core::RakeTask.new('cim') do |spec|
14-
spec.pattern = FileList['spec/cim_spec.rb']
14+
spec.pattern = FileList['spec/cim_spec.rb']
1515
spec.rspec_opts = ['--options', 'spec/spec.opts']
1616
end
17-
17+
1818
desc "Run the ARB spec"
1919
RSpec::Core::RakeTask.new('arb') do |spec|
2020
spec.pattern = FileList['spec/arb_spec.rb']
2121
spec.rspec_opts = ['--options', 'spec/spec.opts']
2222
end
23-
23+
2424
desc "Run the AIM spec"
2525
RSpec::Core::RakeTask.new('aim') do |spec|
2626
spec.pattern = FileList['spec/aim_spec.rb']
2727
spec.rspec_opts = ['--options', 'spec/spec.opts']
2828
end
29-
29+
3030
desc "Run the API spec"
3131
RSpec::Core::RakeTask.new('api') do |spec|
3232
spec.pattern = FileList['spec/api_spec.rb']
3333
spec.rspec_opts = ['--options', 'spec/spec.opts']
3434
end
35-
35+
3636
desc "Run the CI Unit Test spec"
37-
RSpec::Core::RakeTask.new('ci') do |spec|
38-
spec.pattern = FileList['spec/authorize_net_spec.rb']
39-
spec.rspec_opts = ['--options', 'spec/spec.opts']
40-
end
41-
37+
RSpec::Core::RakeTask.new('ci') do |spec|
38+
spec.pattern = FileList['spec/authorize_net_spec.rb']
39+
spec.rspec_opts = ['--options', 'spec/spec.opts']
40+
end
41+
4242
desc "Run the SIM spec"
4343
RSpec::Core::RakeTask.new('sim') do |spec|
4444
spec.pattern = FileList['spec/sim_spec.rb']
4545
spec.rspec_opts = ['--options', 'spec/spec.opts']
4646
end
47-
47+
4848
desc "Run the Reporting spec"
4949
RSpec::Core::RakeTask.new('reporting') do |spec|
5050
spec.pattern = FileList['spec/reporting_spec.rb']
5151
spec.rspec_opts = ['--options', 'spec/spec.opts']
5252
end
53-
53+
5454
desc "Run the Sample code Test Runner"
5555
RSpec::Core::RakeTask.new('testrunner') do |spec|
5656
spec.pattern = FileList['sample-code-ruby/spec/sample_code_spec.rb']
@@ -60,18 +60,18 @@ end
6060

6161
desc "Builds the gem"
6262
task :gem do
63-
%x"gem build authorizenet.gemspec"
63+
`gem build authorizenet.gemspec`
6464
end
6565

6666
desc "Builds the documentation"
6767
task :doc do
68-
%x"rdoc -U -S --main=README.rdoc -A documented_accessor=RW README.rdoc lib/"
68+
`rdoc -U -S --main=README.rdoc -A documented_accessor=RW README.rdoc lib/`
6969
end
7070

7171
namespace "doc" do
7272
desc "Builds the documentation with graphical class hierarchy"
7373
task :graph do
74-
%x"rdoc -U -d -S --main=README.rdoc -A documented_accessor=RW README.rdoc lib/"
74+
`rdoc -U -d -S --main=README.rdoc -A documented_accessor=RW README.rdoc lib/`
7575
end
7676
end
7777

@@ -82,7 +82,7 @@ end
8282

8383
desc "Bundles the sample app."
8484
task :samples do
85-
%x". sample_app_version && zip -r anet_ruby_samples-$VERSION.zip sample_app -x '*/.*' -x '*/Icon' -x '*/__MACOSX'"
85+
`. sample_app_version && zip -r anet_ruby_samples-$VERSION.zip sample_app -x '*/.*' -x '*/Icon' -x '*/__MACOSX'`
8686
end
8787

8888
desc "Bundles the sample app and gem."

authorizenet.gemspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ Gem::Specification.new do |s|
1616

1717
s.add_runtime_dependency 'activesupport', '>= 4.2.6'
1818
s.add_runtime_dependency 'nokogiri', '~> 1.6', '>= 1.6.4'
19-
s.add_runtime_dependency "roxml", "= 3.3.1"
19+
s.add_runtime_dependency 'roxml', '>= 3.3.1'
2020

21+
s.add_development_dependency('appraisal')
2122
s.add_development_dependency 'rake', '~> 0.8', '>= 0.8.7'
2223
s.add_development_dependency 'rspec', '~> 2.1'
23-
s.add_development_dependency('appraisal')
24+
s.add_development_dependency 'simplecov'
25+
s.add_development_dependency 'scrutinizer-ocular'
2426
end

gemfiles/rails_52.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "coveralls", require: false
6+
gem "rails", "~> 5.2.0.beta2"
7+
8+
gemspec path: "../"

lib/app/helpers/authorize_net_helper.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# The Authorize.Net Rails Helper module. Provides methods to assist with integrating the various APIs.
22

33
module AuthorizeNetHelper
4-
54
# Generates a collection of hidden form fields (as a raw HTML string) for a AuthorizeNet::SIM::Transaction
65
# (sim_transaction). You can specify any html_options that hidden_field_tag accepts, and the
76
# hidden fields will be built with those options.
87
def sim_fields(sim_transaction, html_options = {})
98
fields = sim_transaction.form_fields.collect do |k, v|
10-
if v.kind_of? Array
9+
if v.is_a? Array
1110
v.collect { |val| hidden_field_tag(k, val, html_options) }
1211
else
1312
hidden_field_tag(k, v, html_options)
@@ -21,4 +20,4 @@ def sim_fields(sim_transaction, html_options = {})
2120
return field_str
2221
end
2322
end
24-
end
23+
end

0 commit comments

Comments
 (0)