workarea-usaepay 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/Gemfile +17 -0
  4. data/LICENSE +52 -0
  5. data/README.md +43 -0
  6. data/Rakefile +56 -0
  7. data/app/assets/images/workarea/admin/usaepay/.keep +0 -0
  8. data/app/assets/images/workarea/storefront/usaepay/.keep +0 -0
  9. data/app/assets/javascripts/workarea/admin/usaepay/.keep +0 -0
  10. data/app/assets/javascripts/workarea/storefront/usaepay/.keep +0 -0
  11. data/app/assets/stylesheets/workarea/admin/usaepay/.keep +0 -0
  12. data/app/assets/stylesheets/workarea/storefront/usaepay/.keep +0 -0
  13. data/app/controllers/.keep +0 -0
  14. data/app/helpers/.keep +0 -0
  15. data/app/mailers/.keep +0 -0
  16. data/app/models/.keep +0 -0
  17. data/app/models/workarea/payment/authorize/credit_card.decorator +34 -0
  18. data/app/models/workarea/payment/credit_card_data.rb +29 -0
  19. data/app/models/workarea/payment/store_credit_card.decorator +13 -0
  20. data/app/views/.keep +0 -0
  21. data/bin/rails +25 -0
  22. data/config/initializers/workarea.rb +5 -0
  23. data/config/routes.rb +2 -0
  24. data/lib/usaepay/gateway.rb +94 -0
  25. data/lib/workarea/storefront/system_test.rb +156 -0
  26. data/lib/workarea/usaepay.rb +44 -0
  27. data/lib/workarea/usaepay/engine.rb +10 -0
  28. data/lib/workarea/usaepay/version.rb +5 -0
  29. data/test/dummy/.ruby-version +1 -0
  30. data/test/dummy/Rakefile +6 -0
  31. data/test/dummy/app/assets/config/manifest.js +2 -0
  32. data/test/dummy/app/assets/images/.keep +0 -0
  33. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  34. data/test/dummy/app/controllers/application_controller.rb +2 -0
  35. data/test/dummy/app/controllers/concerns/.keep +0 -0
  36. data/test/dummy/app/helpers/application_helper.rb +2 -0
  37. data/test/dummy/app/javascript/packs/application.js +14 -0
  38. data/test/dummy/app/jobs/application_job.rb +7 -0
  39. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  40. data/test/dummy/app/models/concerns/.keep +0 -0
  41. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  42. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  43. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  44. data/test/dummy/bin/rails +4 -0
  45. data/test/dummy/bin/rake +4 -0
  46. data/test/dummy/bin/setup +25 -0
  47. data/test/dummy/config.ru +5 -0
  48. data/test/dummy/config/application.rb +33 -0
  49. data/test/dummy/config/boot.rb +5 -0
  50. data/test/dummy/config/environment.rb +5 -0
  51. data/test/dummy/config/environments/development.rb +53 -0
  52. data/test/dummy/config/environments/production.rb +101 -0
  53. data/test/dummy/config/environments/test.rb +47 -0
  54. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  55. data/test/dummy/config/initializers/assets.rb +12 -0
  56. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  57. data/test/dummy/config/initializers/content_security_policy.rb +28 -0
  58. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  59. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  60. data/test/dummy/config/initializers/inflections.rb +16 -0
  61. data/test/dummy/config/initializers/mime_types.rb +4 -0
  62. data/test/dummy/config/initializers/workarea.rb +5 -0
  63. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  64. data/test/dummy/config/locales/en.yml +33 -0
  65. data/test/dummy/config/puma.rb +38 -0
  66. data/test/dummy/config/routes.rb +5 -0
  67. data/test/dummy/config/spring.rb +6 -0
  68. data/test/dummy/db/seeds.rb +2 -0
  69. data/test/dummy/lib/assets/.keep +0 -0
  70. data/test/dummy/log/.keep +0 -0
  71. data/test/models/workarea/payment/authorize/credit_card_test.decorator +15 -0
  72. data/test/models/workarea/payment/credit_card_integration_test.decorator +5 -0
  73. data/test/support/workarea/usaepay_transaction_vcr_gateway.rb +22 -0
  74. data/test/teaspoon_env.rb +6 -0
  75. data/test/test_helper.rb +10 -0
  76. data/workarea-usaepay.gemspec +21 -0
  77. metadata +132 -0
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in the app/assets
11
+ # folder are already added.
12
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,28 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.config.content_security_policy do |policy|
8
+ # policy.default_src :self, :https
9
+ # policy.font_src :self, :https, :data
10
+ # policy.img_src :self, :https, :data
11
+ # policy.object_src :none
12
+ # policy.script_src :self, :https
13
+ # policy.style_src :self, :https
14
+
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+
19
+ # If you are using UJS then enable automatic nonce generation
20
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21
+
22
+ # Set the nonce only to specific directives
23
+ # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
24
+
25
+ # Report CSP violations to a specified URI
26
+ # For further information see the following documentation:
27
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
28
+ # Rails.application.config.content_security_policy_report_only = true
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,5 @@
1
+ Workarea.configure do |config|
2
+ # Basic site info
3
+ config.site_name = 'Workarea Usaepay'
4
+ config.host = 'www.example.com'
5
+ end
@@ -0,0 +1,9 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at https://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,38 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9
+ threads min_threads_count, max_threads_count
10
+
11
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
12
+ #
13
+ port ENV.fetch("PORT") { 3000 }
14
+
15
+ # Specifies the `environment` that Puma will run in.
16
+ #
17
+ environment ENV.fetch("RAILS_ENV") { "development" }
18
+
19
+ # Specifies the `pidfile` that Puma will use.
20
+ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
21
+
22
+ # Specifies the number of `workers` to boot in clustered mode.
23
+ # Workers are forked web server processes. If using threads and workers together
24
+ # the concurrency of the application would be max `threads` * `workers`.
25
+ # Workers do not work on JRuby or Windows (both of which do not support
26
+ # processes).
27
+ #
28
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
29
+
30
+ # Use the `preload_app!` method when specifying a `workers` number.
31
+ # This directive tells Puma to first boot the application and load code
32
+ # before forking the application. This takes advantage of Copy On Write
33
+ # process behavior so workers use less memory.
34
+ #
35
+ # preload_app!
36
+
37
+ # Allow puma to be restarted by `rails restart` command.
38
+ plugin :tmp_restart
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ mount Workarea::Core::Engine => '/'
3
+ mount Workarea::Admin::Engine => '/admin', as: 'admin'
4
+ mount Workarea::Storefront::Engine => '/', as: 'storefront'
5
+ end
@@ -0,0 +1,6 @@
1
+ Spring.watch(
2
+ ".ruby-version",
3
+ ".rbenv-vars",
4
+ "tmp/restart.txt",
5
+ "tmp/caching-dev.txt"
6
+ )
@@ -0,0 +1,2 @@
1
+ require 'workarea/seeds'
2
+ Workarea::Seeds.run
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ module Workarea
2
+ decorate Payment::Authorize::CreditCardTest, with: :usaepay_transaction do #[8]
3
+ decorated { include UsaepayTransactionVcrGateway } #[9]
4
+
5
+ # [10]
6
+ #
7
+ # def test_foo
8
+ # VCR.use_cassette 'credit_card_gateway/foo' do
9
+ # super
10
+ # end
11
+ # end
12
+ #
13
+ # ...
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module Workarea
2
+ decorate Payment::CreditCardIntegrationTest, with: :usaepay_transaction do #[8]
3
+ decorated { include UsaepayTransactionVcrGateway } #[9]
4
+ end
5
+ end
@@ -0,0 +1,22 @@
1
+ module Workarea
2
+ module UsaepayTransactionVcrGateway #[3]
3
+ def self.included(test)
4
+ test.setup :set_up_gateway
5
+ test.teardown :reset_gateway
6
+ end
7
+
8
+ def set_up_gateway
9
+ @_old_gateway = Workarea.config.gateways.credit_card
10
+ Workarea.config.gateways.credit_card = ActiveMerchant::Billing::UsaEpayCustom.new( #[5]
11
+ user: 'xxxx',
12
+ login: 'xxxx',
13
+ password: 'xxxx',
14
+ test: true
15
+ )
16
+ end
17
+
18
+ def reset_gateway
19
+ Workarea.config.gateways.credit_card = @_old_gateway #[7]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ require 'workarea/testing/teaspoon'
2
+
3
+ Teaspoon.configure do |config|
4
+ config.root = Workarea::Usaepay::Engine.root
5
+ Workarea::Teaspoon.apply(config)
6
+ end
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV['RAILS_ENV'] = 'test'
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ require 'rails/test_help'
6
+ require 'workarea/test_help'
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -0,0 +1,21 @@
1
+ $:.push File.expand_path("lib", __dir__)
2
+
3
+ # Maintain your gem's version:
4
+ require "workarea/usaepay/version"
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "workarea-usaepay"
9
+ spec.version = Workarea::Usaepay::VERSION
10
+ spec.authors = ["Gunasekaran.Raja"]
11
+ spec.email = ["guna.r@trikatechnologies.com"]
12
+ spec.homepage = "https://github.com/trikatechnologies/workarea-usaepay-transaction"
13
+ spec.summary = "USA ePay transaction gateway"
14
+ spec.description = "Payment gateway for USA ePay transaction"
15
+ spec.license = "AGPL-3.0-or-later"
16
+
17
+
18
+ spec.files = `git ls-files`.split("\n")
19
+
20
+ spec.add_dependency 'workarea', '~> 3.x'
21
+ end
metadata ADDED
@@ -0,0 +1,132 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-usaepay
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Gunasekaran.Raja
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-06-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: workarea
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.x
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.x
27
+ description: Payment gateway for USA ePay transaction
28
+ email:
29
+ - guna.r@trikatechnologies.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - app/assets/images/workarea/admin/usaepay/.keep
40
+ - app/assets/images/workarea/storefront/usaepay/.keep
41
+ - app/assets/javascripts/workarea/admin/usaepay/.keep
42
+ - app/assets/javascripts/workarea/storefront/usaepay/.keep
43
+ - app/assets/stylesheets/workarea/admin/usaepay/.keep
44
+ - app/assets/stylesheets/workarea/storefront/usaepay/.keep
45
+ - app/controllers/.keep
46
+ - app/helpers/.keep
47
+ - app/mailers/.keep
48
+ - app/models/.keep
49
+ - app/models/workarea/payment/authorize/credit_card.decorator
50
+ - app/models/workarea/payment/credit_card_data.rb
51
+ - app/models/workarea/payment/store_credit_card.decorator
52
+ - app/views/.keep
53
+ - bin/rails
54
+ - config/initializers/workarea.rb
55
+ - config/routes.rb
56
+ - lib/usaepay/gateway.rb
57
+ - lib/workarea/storefront/system_test.rb
58
+ - lib/workarea/usaepay.rb
59
+ - lib/workarea/usaepay/engine.rb
60
+ - lib/workarea/usaepay/version.rb
61
+ - test/dummy/.ruby-version
62
+ - test/dummy/Rakefile
63
+ - test/dummy/app/assets/config/manifest.js
64
+ - test/dummy/app/assets/images/.keep
65
+ - test/dummy/app/assets/stylesheets/application.css
66
+ - test/dummy/app/controllers/application_controller.rb
67
+ - test/dummy/app/controllers/concerns/.keep
68
+ - test/dummy/app/helpers/application_helper.rb
69
+ - test/dummy/app/javascript/packs/application.js
70
+ - test/dummy/app/jobs/application_job.rb
71
+ - test/dummy/app/mailers/application_mailer.rb
72
+ - test/dummy/app/models/concerns/.keep
73
+ - test/dummy/app/views/layouts/application.html.erb
74
+ - test/dummy/app/views/layouts/mailer.html.erb
75
+ - test/dummy/app/views/layouts/mailer.text.erb
76
+ - test/dummy/bin/rails
77
+ - test/dummy/bin/rake
78
+ - test/dummy/bin/setup
79
+ - test/dummy/config.ru
80
+ - test/dummy/config/application.rb
81
+ - test/dummy/config/boot.rb
82
+ - test/dummy/config/environment.rb
83
+ - test/dummy/config/environments/development.rb
84
+ - test/dummy/config/environments/production.rb
85
+ - test/dummy/config/environments/test.rb
86
+ - test/dummy/config/initializers/application_controller_renderer.rb
87
+ - test/dummy/config/initializers/assets.rb
88
+ - test/dummy/config/initializers/backtrace_silencers.rb
89
+ - test/dummy/config/initializers/content_security_policy.rb
90
+ - test/dummy/config/initializers/cookies_serializer.rb
91
+ - test/dummy/config/initializers/filter_parameter_logging.rb
92
+ - test/dummy/config/initializers/inflections.rb
93
+ - test/dummy/config/initializers/mime_types.rb
94
+ - test/dummy/config/initializers/workarea.rb
95
+ - test/dummy/config/initializers/wrap_parameters.rb
96
+ - test/dummy/config/locales/en.yml
97
+ - test/dummy/config/puma.rb
98
+ - test/dummy/config/routes.rb
99
+ - test/dummy/config/spring.rb
100
+ - test/dummy/db/seeds.rb
101
+ - test/dummy/lib/assets/.keep
102
+ - test/dummy/log/.keep
103
+ - test/models/workarea/payment/authorize/credit_card_test.decorator
104
+ - test/models/workarea/payment/credit_card_integration_test.decorator
105
+ - test/support/workarea/usaepay_transaction_vcr_gateway.rb
106
+ - test/teaspoon_env.rb
107
+ - test/test_helper.rb
108
+ - workarea-usaepay.gemspec
109
+ homepage: https://github.com/trikatechnologies/workarea-usaepay-transaction
110
+ licenses:
111
+ - AGPL-3.0-or-later
112
+ metadata: {}
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubygems_version: 3.0.8
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: USA ePay transaction gateway
132
+ test_files: []