spree_unified_payment 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +9 -0
- data/.travis.yml +6 -0
- data/Gemfile +20 -0
- data/LICENSE +26 -0
- data/README.md +61 -0
- data/Versionfile +12 -0
- data/app/assets/javascripts/admin/spree_unified_payment.js +39 -0
- data/app/assets/stylesheets/store/spree_unified_payment.css +7 -0
- data/app/controllers/application_controller.rb +2 -0
- data/app/controllers/spree/admin/unified_payments_controller.rb +34 -0
- data/app/controllers/spree/checkout_controller_decorator.rb +19 -0
- data/app/controllers/spree/unified_payments_controller.rb +151 -0
- data/app/helpers/transaction_notification_mail_helper.rb +12 -0
- data/app/helpers/unified_transaction_helper.rb +18 -0
- data/app/mailers/spree/transaction_notification_mailer.rb +16 -0
- data/app/models/spree/order_decorator.rb +67 -0
- data/app/models/spree/payment_method/unified_payment_method.rb +34 -0
- data/app/models/spree/store_credit_decorator.rb +4 -0
- data/app/models/spree/user_decorator.rb +7 -0
- data/app/models/unified_payment/transaction_decorator.rb +102 -0
- data/app/overrides/add_unified_tabs_to_admin_menu.rb +6 -0
- data/app/views/spree/admin/unified_payments/index.html.erb +98 -0
- data/app/views/spree/admin/unified_payments/query_gateway.js.erb +10 -0
- data/app/views/spree/admin/unified_payments/receipt.html.erb +20 -0
- data/app/views/spree/checkout/payment/_unifiedpaymentmethod.html.erb +24 -0
- data/app/views/spree/transaction_notification_mailer/send_mail.html.erb +20 -0
- data/app/views/spree/unified_payments/approved.html.erb +25 -0
- data/app/views/spree/unified_payments/canceled.html.erb +1 -0
- data/app/views/spree/unified_payments/create.html.erb +8 -0
- data/app/views/spree/unified_payments/create.js.erb +3 -0
- data/app/views/spree/unified_payments/declined.html.erb +4 -0
- data/app/views/spree/unified_payments/index.html.erb +28 -0
- data/app/views/spree/unified_payments/new.html.erb +35 -0
- data/app/views/spree/unified_payments/new.js.erb +3 -0
- data/config/initializers/constants.rb +8 -0
- data/config/routes.rb +15 -0
- data/db/migrate/20140120075553_add_transaction_fields_to_unified_payment_transactions.rb +14 -0
- data/db/migrate/20140120081453_add_unified_transaction_id_to_spree_store_credits.rb +6 -0
- data/lib/generators/spree_unified_payment/install/install_generator.rb +27 -0
- data/lib/spree_unified_payment/engine.rb +26 -0
- data/lib/spree_unified_payment.rb +2 -0
- data/lib/transaction_expiration.rb +9 -0
- data/spec/constants_spec.rb +11 -0
- data/spec/controllers/spree/admin/unified_payments_controller_spec.rb +155 -0
- data/spec/controllers/spree/checkout_controller_decorator_spec.rb +114 -0
- data/spec/controllers/spree/unified_payments_controller_spec.rb +509 -0
- data/spec/mailers/transaction_notification_mailer_spec.rb +48 -0
- data/spec/models/spree/order_decorator_spec.rb +206 -0
- data/spec/models/spree/payment_method/unified_payment_spec.rb +25 -0
- data/spec/models/spree/store_credit_decorator_spec.rb +11 -0
- data/spec/models/spree/user_decorator_spec.rb +12 -0
- data/spec/models/unified_payment/transaction_decorator_spec.rb +483 -0
- data/spec/spec_helper.rb +66 -0
- data/spree_unified_payment.gemspec +23 -0
- metadata +184 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
# require 'rspec/autorun'
|
6
|
+
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler/setup'
|
9
|
+
require 'spree_unified_payment'
|
10
|
+
require 'database_cleaner'
|
11
|
+
|
12
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
13
|
+
# in spec/support/ and its subdirectories.
|
14
|
+
# Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
15
|
+
|
16
|
+
# Checks for pending migrations before tests are run.
|
17
|
+
# If you are not using ActiveRecord, you can remove this line.
|
18
|
+
# ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
19
|
+
|
20
|
+
RSpec.configure do |config|
|
21
|
+
# ## Mock Framework
|
22
|
+
#
|
23
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
24
|
+
#
|
25
|
+
# config.mock_with :mocha
|
26
|
+
# config.mock_with :flexmock
|
27
|
+
# config.mock_with :rr
|
28
|
+
|
29
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
30
|
+
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
31
|
+
|
32
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
33
|
+
# examples within a transaction, remove the following line or assign false
|
34
|
+
# instead of true.
|
35
|
+
# config.use_transactional_fixtures = true
|
36
|
+
config.include Spree::Core::Engine.routes.url_helpers
|
37
|
+
config.before :suite do
|
38
|
+
DatabaseCleaner.strategy = :transaction
|
39
|
+
DatabaseCleaner.clean_with(:truncation)
|
40
|
+
end
|
41
|
+
|
42
|
+
config.before type: :request do
|
43
|
+
DatabaseCleaner.strategy = :truncation
|
44
|
+
end
|
45
|
+
|
46
|
+
config.before :each do
|
47
|
+
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
|
48
|
+
DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
|
49
|
+
DatabaseCleaner.start
|
50
|
+
end
|
51
|
+
|
52
|
+
# After each spec clean the database.
|
53
|
+
config.after :each do
|
54
|
+
DatabaseCleaner.clean
|
55
|
+
end
|
56
|
+
# If true, the base class of anonymous controllers will be inferred
|
57
|
+
# automatically. This will be the default behavior in future versions of
|
58
|
+
# rspec-rails.
|
59
|
+
# config.infer_base_class_for_anonymous_controllers = false
|
60
|
+
|
61
|
+
# Run specs in random order to surface order dependencies. If you find an
|
62
|
+
# order dependency and want to debug it, you can fix the order by providing
|
63
|
+
# the seed, which is printed after each run.
|
64
|
+
# --seed 1234
|
65
|
+
config.order = "random"
|
66
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.platform = Gem::Platform::RUBY
|
3
|
+
s.name = "spree_unified_payment"
|
4
|
+
s.version = "1.0.0"
|
5
|
+
s.author = ["Manish Kangia", "Sushant Mittal"]
|
6
|
+
s.email = 'info@vinsol.com'
|
7
|
+
s.homepage = 'http://vinsol.com'
|
8
|
+
s.license = 'MIT'
|
9
|
+
|
10
|
+
s.summary = "Integrate payment using UnifiedPayment service"
|
11
|
+
s.description = "Enable spree store to allow payment via UnifiedPayment"
|
12
|
+
|
13
|
+
s.required_rubygems_version = ">=2.0.0"
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.require_path = 'lib'
|
17
|
+
s.requirements << 'none'
|
18
|
+
|
19
|
+
s.add_dependency('spree_core', '~> 2.0.0')
|
20
|
+
s.add_dependency 'unified_payment', '1.0.0'
|
21
|
+
s.add_dependency 'spree_wallet', '~> 2.0.3'
|
22
|
+
s.add_dependency 'delayed_job_active_record', '~> 4.0.0'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,184 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spree_unified_payment
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Manish Kangia
|
14
|
+
- Sushant Mittal
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2014-02-27 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: spree_core
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 2.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: unified_payment
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - "="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 23
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
version: 1.0.0
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: spree_wallet
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 9
|
62
|
+
segments:
|
63
|
+
- 2
|
64
|
+
- 0
|
65
|
+
- 3
|
66
|
+
version: 2.0.3
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: delayed_job_active_record
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 63
|
78
|
+
segments:
|
79
|
+
- 4
|
80
|
+
- 0
|
81
|
+
- 0
|
82
|
+
version: 4.0.0
|
83
|
+
type: :runtime
|
84
|
+
version_requirements: *id004
|
85
|
+
description: Enable spree store to allow payment via UnifiedPayment
|
86
|
+
email: info@vinsol.com
|
87
|
+
executables: []
|
88
|
+
|
89
|
+
extensions: []
|
90
|
+
|
91
|
+
extra_rdoc_files: []
|
92
|
+
|
93
|
+
files:
|
94
|
+
- .gitignore
|
95
|
+
- .travis.yml
|
96
|
+
- Gemfile
|
97
|
+
- LICENSE
|
98
|
+
- README.md
|
99
|
+
- Versionfile
|
100
|
+
- app/assets/javascripts/admin/spree_unified_payment.js
|
101
|
+
- app/assets/stylesheets/store/spree_unified_payment.css
|
102
|
+
- app/controllers/application_controller.rb
|
103
|
+
- app/controllers/spree/admin/unified_payments_controller.rb
|
104
|
+
- app/controllers/spree/checkout_controller_decorator.rb
|
105
|
+
- app/controllers/spree/unified_payments_controller.rb
|
106
|
+
- app/helpers/transaction_notification_mail_helper.rb
|
107
|
+
- app/helpers/unified_transaction_helper.rb
|
108
|
+
- app/mailers/spree/transaction_notification_mailer.rb
|
109
|
+
- app/models/spree/order_decorator.rb
|
110
|
+
- app/models/spree/payment_method/unified_payment_method.rb
|
111
|
+
- app/models/spree/store_credit_decorator.rb
|
112
|
+
- app/models/spree/user_decorator.rb
|
113
|
+
- app/models/unified_payment/transaction_decorator.rb
|
114
|
+
- app/overrides/add_unified_tabs_to_admin_menu.rb
|
115
|
+
- app/views/spree/admin/unified_payments/index.html.erb
|
116
|
+
- app/views/spree/admin/unified_payments/query_gateway.js.erb
|
117
|
+
- app/views/spree/admin/unified_payments/receipt.html.erb
|
118
|
+
- app/views/spree/checkout/payment/_unifiedpaymentmethod.html.erb
|
119
|
+
- app/views/spree/transaction_notification_mailer/send_mail.html.erb
|
120
|
+
- app/views/spree/unified_payments/approved.html.erb
|
121
|
+
- app/views/spree/unified_payments/canceled.html.erb
|
122
|
+
- app/views/spree/unified_payments/create.html.erb
|
123
|
+
- app/views/spree/unified_payments/create.js.erb
|
124
|
+
- app/views/spree/unified_payments/declined.html.erb
|
125
|
+
- app/views/spree/unified_payments/index.html.erb
|
126
|
+
- app/views/spree/unified_payments/new.html.erb
|
127
|
+
- app/views/spree/unified_payments/new.js.erb
|
128
|
+
- config/initializers/constants.rb
|
129
|
+
- config/routes.rb
|
130
|
+
- db/migrate/20140120075553_add_transaction_fields_to_unified_payment_transactions.rb
|
131
|
+
- db/migrate/20140120081453_add_unified_transaction_id_to_spree_store_credits.rb
|
132
|
+
- lib/generators/spree_unified_payment/install/install_generator.rb
|
133
|
+
- lib/spree_unified_payment.rb
|
134
|
+
- lib/spree_unified_payment/engine.rb
|
135
|
+
- lib/transaction_expiration.rb
|
136
|
+
- spec/constants_spec.rb
|
137
|
+
- spec/controllers/spree/admin/unified_payments_controller_spec.rb
|
138
|
+
- spec/controllers/spree/checkout_controller_decorator_spec.rb
|
139
|
+
- spec/controllers/spree/unified_payments_controller_spec.rb
|
140
|
+
- spec/mailers/transaction_notification_mailer_spec.rb
|
141
|
+
- spec/models/spree/order_decorator_spec.rb
|
142
|
+
- spec/models/spree/payment_method/unified_payment_spec.rb
|
143
|
+
- spec/models/spree/store_credit_decorator_spec.rb
|
144
|
+
- spec/models/spree/user_decorator_spec.rb
|
145
|
+
- spec/models/unified_payment/transaction_decorator_spec.rb
|
146
|
+
- spec/spec_helper.rb
|
147
|
+
- spree_unified_payment.gemspec
|
148
|
+
homepage: http://vinsol.com
|
149
|
+
licenses:
|
150
|
+
- MIT
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
|
154
|
+
require_paths:
|
155
|
+
- lib
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
hash: 3
|
162
|
+
segments:
|
163
|
+
- 0
|
164
|
+
version: "0"
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
none: false
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
hash: 15
|
171
|
+
segments:
|
172
|
+
- 2
|
173
|
+
- 0
|
174
|
+
- 0
|
175
|
+
version: 2.0.0
|
176
|
+
requirements:
|
177
|
+
- none
|
178
|
+
rubyforge_project:
|
179
|
+
rubygems_version: 1.8.24
|
180
|
+
signing_key:
|
181
|
+
specification_version: 3
|
182
|
+
summary: Integrate payment using UnifiedPayment service
|
183
|
+
test_files: []
|
184
|
+
|