solidus_braintree 3.2.0 → 3.4.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.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +7 -0
- data/.github/workflows/lint.yml +25 -0
- data/.github/workflows/test.yml +77 -0
- data/.rubocop.yml +5 -84
- data/.standard.yml +6 -0
- data/7.2 +0 -0
- data/Gemfile +12 -20
- data/README.md +7 -5
- data/Rakefile +7 -7
- data/app/helpers/solidus_braintree/braintree_admin_helper.rb +4 -4
- data/app/models/solidus_braintree/avs_result.rb +34 -34
- data/app/models/solidus_braintree/base_record.rb +11 -0
- data/app/models/solidus_braintree/configuration.rb +12 -12
- data/app/models/solidus_braintree/customer.rb +1 -1
- data/app/models/solidus_braintree/gateway.rb +14 -17
- data/app/models/solidus_braintree/response.rb +9 -9
- data/app/models/solidus_braintree/source.rb +9 -7
- data/app/models/solidus_braintree/transaction.rb +2 -2
- data/app/models/solidus_braintree/transaction_address.rb +5 -5
- data/app/models/solidus_braintree/transaction_import.rb +2 -2
- data/app/{decorators/models/solidus_braintree/spree_store_decorator.rb → patches/models/solidus_braintree/spree_store_patch.rb} +1 -1
- data/app/{decorators/models/solidus_braintree/spree_user_decorator.rb → patches/models/solidus_braintree/spree_user_patch.rb} +2 -2
- data/bin/dummy-app +23 -3
- data/bin/rails-sandbox +4 -4
- data/bin/rspec +6 -0
- data/bin/sandbox +55 -31
- data/db/migrate/20161114231422_create_solidus_paypal_braintree_configurations.rb +2 -2
- data/db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb +2 -2
- data/db/migrate/20230109080950_rename_solidus_paypal_braintree_source_type.rb +3 -3
- data/{app/decorators/controllers → lib/controllers/api}/solidus_braintree/client_tokens_controller.rb +2 -2
- data/lib/controllers/backend/solidus_braintree/configurations_controller.rb +4 -4
- data/lib/generators/solidus_braintree/install/install_generator.rb +48 -40
- data/lib/generators/solidus_braintree/install/templates/app/controllers/solidus_braintree/checkouts_controller.rb +7 -7
- data/lib/generators/solidus_braintree/install/templates/app/controllers/solidus_braintree/transactions_controller.rb +7 -7
- data/lib/generators/solidus_braintree/install/templates/app/helpers/solidus_braintree/braintree_checkout_helper.rb +5 -5
- data/{app/decorators/controllers/solidus_braintree/admin_payments_controller_decorator.rb → lib/patches/backend/controllers/solidus_braintree/admin_payments_controller_patch.rb} +1 -1
- data/lib/solidus_braintree/engine.rb +13 -24
- data/lib/solidus_braintree/extension_configuration.rb +1 -1
- data/lib/solidus_braintree/request_protection.rb +2 -2
- data/lib/solidus_braintree/version.rb +1 -1
- data/lib/solidus_braintree.rb +8 -10
- data/lib/solidus_paypal_braintree.rb +2 -2
- data/mise.toml +2 -0
- data/solidus_braintree.gemspec +23 -22
- metadata +62 -152
- data/.circleci/config.yml +0 -80
- data/app/models/application_record.rb +0 -5
- data/lib/views/backend_v1.2/spree/admin/payments/source_forms/_braintree.html.erb +0 -16
- data/lib/views/backend_v2.4/spree/admin/shared/preference_fields/_hash.html.erb +0 -12
- data/spec/controllers/solidus_braintree/checkouts_controller_spec.rb +0 -99
- data/spec/controllers/solidus_braintree/client_tokens_controller_spec.rb +0 -55
- data/spec/controllers/solidus_braintree/configurations_controller_spec.rb +0 -73
- data/spec/controllers/solidus_braintree/transactions_controller_spec.rb +0 -183
- data/spec/fixtures/cassettes/admin/invalid_credit_card.yml +0 -63
- data/spec/fixtures/cassettes/admin/resubmit_credit_card.yml +0 -352
- data/spec/fixtures/cassettes/admin/valid_credit_card.yml +0 -412
- data/spec/fixtures/cassettes/braintree/create_profile.yml +0 -71
- data/spec/fixtures/cassettes/braintree/generate_token.yml +0 -63
- data/spec/fixtures/cassettes/braintree/token.yml +0 -63
- data/spec/fixtures/cassettes/checkout/invalid_credit_card.yml +0 -63
- data/spec/fixtures/cassettes/checkout/resubmit_credit_card.yml +0 -216
- data/spec/fixtures/cassettes/checkout/update.yml +0 -71
- data/spec/fixtures/cassettes/checkout/valid_credit_card.yml +0 -171
- data/spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml +0 -599
- data/spec/fixtures/cassettes/gateway/authorize/credit_card/address.yml +0 -86
- data/spec/fixtures/cassettes/gateway/authorize/merchant_account/EUR.yml +0 -154
- data/spec/fixtures/cassettes/gateway/authorize/paypal/EUR.yml +0 -90
- data/spec/fixtures/cassettes/gateway/authorize/paypal/address.yml +0 -90
- data/spec/fixtures/cassettes/gateway/authorize.yml +0 -86
- data/spec/fixtures/cassettes/gateway/authorized_transaction.yml +0 -73
- data/spec/fixtures/cassettes/gateway/cancel/missing.yml +0 -63
- data/spec/fixtures/cassettes/gateway/cancel/refunds.yml +0 -272
- data/spec/fixtures/cassettes/gateway/cancel/void.yml +0 -201
- data/spec/fixtures/cassettes/gateway/capture.yml +0 -141
- data/spec/fixtures/cassettes/gateway/complete.yml +0 -157
- data/spec/fixtures/cassettes/gateway/credit.yml +0 -208
- data/spec/fixtures/cassettes/gateway/customer.yml +0 -79
- data/spec/fixtures/cassettes/gateway/purchase.yml +0 -87
- data/spec/fixtures/cassettes/gateway/settled_transaction.yml +0 -140
- data/spec/fixtures/cassettes/gateway/void.yml +0 -137
- data/spec/fixtures/cassettes/source/bin.yml +0 -295
- data/spec/fixtures/cassettes/source/card_type.yml +0 -267
- data/spec/fixtures/cassettes/source/last4.yml +0 -267
- data/spec/fixtures/cassettes/transaction/import/valid/capture.yml +0 -224
- data/spec/fixtures/cassettes/transaction/import/valid.yml +0 -71
- data/spec/fixtures/views/carts/_cart_footer.html.erb +0 -18
- data/spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb +0 -17
- data/spec/helpers/solidus_braintree/braintree_checkout_helper_spec.rb +0 -70
- data/spec/models/solidus_braintree/address_spec.rb +0 -71
- data/spec/models/solidus_braintree/avs_result_spec.rb +0 -317
- data/spec/models/solidus_braintree/gateway_spec.rb +0 -774
- data/spec/models/solidus_braintree/response_spec.rb +0 -280
- data/spec/models/solidus_braintree/source_spec.rb +0 -555
- data/spec/models/solidus_braintree/transaction_address_spec.rb +0 -235
- data/spec/models/solidus_braintree/transaction_import_spec.rb +0 -302
- data/spec/models/solidus_braintree/transaction_spec.rb +0 -86
- data/spec/models/spree/store_spec.rb +0 -14
- data/spec/requests/spree/api/orders_controller_spec.rb +0 -36
- data/spec/solidus_braintree_spec_helper.rb +0 -9
- data/spec/support/solidus_braintree/capybara.rb +0 -7
- data/spec/support/solidus_braintree/factories.rb +0 -55
- data/spec/support/solidus_braintree/gateway_helpers.rb +0 -29
- data/spec/support/solidus_braintree/order_ready_for_payment.rb +0 -44
- data/spec/support/solidus_braintree/order_walkthrough.rb +0 -87
- data/spec/support/solidus_braintree/vcr.rb +0 -38
- data/spec/support/solidus_braintree/with_prepended_view_fixtures.rb +0 -19
- data/spec/system/backend/configuration_spec.rb +0 -23
- data/spec/system/backend/new_payment_spec.rb +0 -136
- data/spec/system/frontend/braintree_credit_card_checkout_spec.rb +0 -199
- data/spec/system/frontend/paypal_checkout_spec.rb +0 -168
- data/spec/system/frontend/venmo_checkout_spec.rb +0 -193
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solidus_braintree
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stembolt
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activemerchant
|
|
@@ -44,7 +43,7 @@ dependencies:
|
|
|
44
43
|
requirements:
|
|
45
44
|
- - ">="
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
46
|
+
version: '4.0'
|
|
48
47
|
- - "<"
|
|
49
48
|
- !ruby/object:Gem::Version
|
|
50
49
|
version: '5'
|
|
@@ -54,7 +53,7 @@ dependencies:
|
|
|
54
53
|
requirements:
|
|
55
54
|
- - ">="
|
|
56
55
|
- !ruby/object:Gem::Version
|
|
57
|
-
version:
|
|
56
|
+
version: '4.0'
|
|
58
57
|
- - "<"
|
|
59
58
|
- !ruby/object:Gem::Version
|
|
60
59
|
version: '5'
|
|
@@ -64,7 +63,7 @@ dependencies:
|
|
|
64
63
|
requirements:
|
|
65
64
|
- - ">="
|
|
66
65
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
66
|
+
version: '4.0'
|
|
68
67
|
- - "<"
|
|
69
68
|
- !ruby/object:Gem::Version
|
|
70
69
|
version: '5'
|
|
@@ -74,7 +73,7 @@ dependencies:
|
|
|
74
73
|
requirements:
|
|
75
74
|
- - ">="
|
|
76
75
|
- !ruby/object:Gem::Version
|
|
77
|
-
version:
|
|
76
|
+
version: '4.0'
|
|
78
77
|
- - "<"
|
|
79
78
|
- !ruby/object:Gem::Version
|
|
80
79
|
version: '5'
|
|
@@ -84,7 +83,7 @@ dependencies:
|
|
|
84
83
|
requirements:
|
|
85
84
|
- - ">="
|
|
86
85
|
- !ruby/object:Gem::Version
|
|
87
|
-
version:
|
|
86
|
+
version: '4.0'
|
|
88
87
|
- - "<"
|
|
89
88
|
- !ruby/object:Gem::Version
|
|
90
89
|
version: '5'
|
|
@@ -94,7 +93,7 @@ dependencies:
|
|
|
94
93
|
requirements:
|
|
95
94
|
- - ">="
|
|
96
95
|
- !ruby/object:Gem::Version
|
|
97
|
-
version:
|
|
96
|
+
version: '4.0'
|
|
98
97
|
- - "<"
|
|
99
98
|
- !ruby/object:Gem::Version
|
|
100
99
|
version: '5'
|
|
@@ -104,7 +103,7 @@ dependencies:
|
|
|
104
103
|
requirements:
|
|
105
104
|
- - ">="
|
|
106
105
|
- !ruby/object:Gem::Version
|
|
107
|
-
version: 0.
|
|
106
|
+
version: 0.14.1
|
|
108
107
|
- - "<"
|
|
109
108
|
- !ruby/object:Gem::Version
|
|
110
109
|
version: '1'
|
|
@@ -114,7 +113,7 @@ dependencies:
|
|
|
114
113
|
requirements:
|
|
115
114
|
- - ">="
|
|
116
115
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 0.
|
|
116
|
+
version: 0.14.1
|
|
118
117
|
- - "<"
|
|
119
118
|
- !ruby/object:Gem::Version
|
|
120
119
|
version: '1'
|
|
@@ -136,29 +135,67 @@ dependencies:
|
|
|
136
135
|
name: solidus_dev_support
|
|
137
136
|
requirement: !ruby/object:Gem::Requirement
|
|
138
137
|
requirements:
|
|
139
|
-
- - "
|
|
138
|
+
- - ">="
|
|
140
139
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: '2.
|
|
140
|
+
version: '2.11'
|
|
141
|
+
- - "<"
|
|
142
|
+
- !ruby/object:Gem::Version
|
|
143
|
+
version: '3'
|
|
142
144
|
type: :development
|
|
143
145
|
prerelease: false
|
|
144
146
|
version_requirements: !ruby/object:Gem::Requirement
|
|
145
147
|
requirements:
|
|
146
|
-
- - "
|
|
148
|
+
- - ">="
|
|
149
|
+
- !ruby/object:Gem::Version
|
|
150
|
+
version: '2.11'
|
|
151
|
+
- - "<"
|
|
152
|
+
- !ruby/object:Gem::Version
|
|
153
|
+
version: '3'
|
|
154
|
+
- !ruby/object:Gem::Dependency
|
|
155
|
+
name: vcr
|
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
|
157
|
+
requirements:
|
|
158
|
+
- - ">="
|
|
159
|
+
- !ruby/object:Gem::Version
|
|
160
|
+
version: '0'
|
|
161
|
+
type: :development
|
|
162
|
+
prerelease: false
|
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
164
|
+
requirements:
|
|
165
|
+
- - ">="
|
|
166
|
+
- !ruby/object:Gem::Version
|
|
167
|
+
version: '0'
|
|
168
|
+
- !ruby/object:Gem::Dependency
|
|
169
|
+
name: webmock
|
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
|
171
|
+
requirements:
|
|
172
|
+
- - ">="
|
|
147
173
|
- !ruby/object:Gem::Version
|
|
148
|
-
version: '
|
|
174
|
+
version: '0'
|
|
175
|
+
type: :development
|
|
176
|
+
prerelease: false
|
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
178
|
+
requirements:
|
|
179
|
+
- - ">="
|
|
180
|
+
- !ruby/object:Gem::Version
|
|
181
|
+
version: '0'
|
|
149
182
|
description: Uses the javascript API for seamless braintree payments
|
|
150
183
|
email: braintree+gemfile@stembolt.com
|
|
151
184
|
executables: []
|
|
152
185
|
extensions: []
|
|
153
186
|
extra_rdoc_files: []
|
|
154
187
|
files:
|
|
155
|
-
- ".circleci/config.yml"
|
|
156
188
|
- ".gem_release.yml"
|
|
189
|
+
- ".github/dependabot.yml"
|
|
157
190
|
- ".github/stale.yml"
|
|
191
|
+
- ".github/workflows/lint.yml"
|
|
192
|
+
- ".github/workflows/test.yml"
|
|
158
193
|
- ".github_changelog_generator"
|
|
159
194
|
- ".gitignore"
|
|
160
195
|
- ".rspec"
|
|
161
196
|
- ".rubocop.yml"
|
|
197
|
+
- ".standard.yml"
|
|
198
|
+
- '7.2'
|
|
162
199
|
- CHANGELOG.md
|
|
163
200
|
- Gemfile
|
|
164
201
|
- LICENSE
|
|
@@ -172,14 +209,10 @@ files:
|
|
|
172
209
|
- app/assets/javascripts/spree/backend/solidus_braintree/hosted_form.js
|
|
173
210
|
- app/assets/javascripts/spree/backend/solidus_braintree/promise.js
|
|
174
211
|
- app/assets/stylesheets/spree/backend/solidus_braintree.scss
|
|
175
|
-
- app/decorators/controllers/solidus_braintree/admin_payments_controller_decorator.rb
|
|
176
|
-
- app/decorators/controllers/solidus_braintree/client_tokens_controller.rb
|
|
177
|
-
- app/decorators/models/solidus_braintree/spree_store_decorator.rb
|
|
178
|
-
- app/decorators/models/solidus_braintree/spree_user_decorator.rb
|
|
179
212
|
- app/helpers/solidus_braintree/braintree_admin_helper.rb
|
|
180
|
-
- app/models/application_record.rb
|
|
181
213
|
- app/models/solidus_braintree/address.rb
|
|
182
214
|
- app/models/solidus_braintree/avs_result.rb
|
|
215
|
+
- app/models/solidus_braintree/base_record.rb
|
|
183
216
|
- app/models/solidus_braintree/configuration.rb
|
|
184
217
|
- app/models/solidus_braintree/customer.rb
|
|
185
218
|
- app/models/solidus_braintree/gateway.rb
|
|
@@ -188,6 +221,8 @@ files:
|
|
|
188
221
|
- app/models/solidus_braintree/transaction.rb
|
|
189
222
|
- app/models/solidus_braintree/transaction_address.rb
|
|
190
223
|
- app/models/solidus_braintree/transaction_import.rb
|
|
224
|
+
- app/patches/models/solidus_braintree/spree_store_patch.rb
|
|
225
|
+
- app/patches/models/solidus_braintree/spree_user_patch.rb
|
|
191
226
|
- app/views/spree/api/payments/source_views/_braintree.json.jbuilder
|
|
192
227
|
- bin/console
|
|
193
228
|
- bin/dummy-app
|
|
@@ -215,6 +250,7 @@ files:
|
|
|
215
250
|
- db/migrate/20220104150301_add_venmo_to_braintree_configuration.rb
|
|
216
251
|
- db/migrate/20230109080950_rename_solidus_paypal_braintree_source_type.rb
|
|
217
252
|
- db/migrate/20230210104310_add_device_data_to_braintree_sources.rb
|
|
253
|
+
- lib/controllers/api/solidus_braintree/client_tokens_controller.rb
|
|
218
254
|
- lib/controllers/backend/solidus_braintree/configurations_controller.rb
|
|
219
255
|
- lib/generators/solidus_braintree/install/install_generator.rb
|
|
220
256
|
- lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_active_blue_button_280x48.svg
|
|
@@ -262,6 +298,7 @@ files:
|
|
|
262
298
|
- lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_paypal_messaging.html.erb
|
|
263
299
|
- lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_venmo_button.html.erb
|
|
264
300
|
- lib/generators/solidus_braintree/install/templates/config/initializers/solidus_braintree.rb
|
|
301
|
+
- lib/patches/backend/controllers/solidus_braintree/admin_payments_controller_patch.rb
|
|
265
302
|
- lib/solidus_braintree.rb
|
|
266
303
|
- lib/solidus_braintree/country_mapper.rb
|
|
267
304
|
- lib/solidus_braintree/engine.rb
|
|
@@ -273,71 +310,8 @@ files:
|
|
|
273
310
|
- lib/views/backend/spree/admin/payments/source_forms/_braintree.html.erb
|
|
274
311
|
- lib/views/backend/spree/admin/payments/source_views/_braintree.html.erb
|
|
275
312
|
- lib/views/backend/spree/admin/shared/preference_fields/_preference_select.html.erb
|
|
276
|
-
-
|
|
277
|
-
- lib/views/backend_v2.4/spree/admin/shared/preference_fields/_hash.html.erb
|
|
313
|
+
- mise.toml
|
|
278
314
|
- solidus_braintree.gemspec
|
|
279
|
-
- spec/controllers/solidus_braintree/checkouts_controller_spec.rb
|
|
280
|
-
- spec/controllers/solidus_braintree/client_tokens_controller_spec.rb
|
|
281
|
-
- spec/controllers/solidus_braintree/configurations_controller_spec.rb
|
|
282
|
-
- spec/controllers/solidus_braintree/transactions_controller_spec.rb
|
|
283
|
-
- spec/fixtures/cassettes/admin/invalid_credit_card.yml
|
|
284
|
-
- spec/fixtures/cassettes/admin/resubmit_credit_card.yml
|
|
285
|
-
- spec/fixtures/cassettes/admin/valid_credit_card.yml
|
|
286
|
-
- spec/fixtures/cassettes/braintree/create_profile.yml
|
|
287
|
-
- spec/fixtures/cassettes/braintree/generate_token.yml
|
|
288
|
-
- spec/fixtures/cassettes/braintree/token.yml
|
|
289
|
-
- spec/fixtures/cassettes/checkout/invalid_credit_card.yml
|
|
290
|
-
- spec/fixtures/cassettes/checkout/resubmit_credit_card.yml
|
|
291
|
-
- spec/fixtures/cassettes/checkout/update.yml
|
|
292
|
-
- spec/fixtures/cassettes/checkout/valid_credit_card.yml
|
|
293
|
-
- spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml
|
|
294
|
-
- spec/fixtures/cassettes/gateway/authorize.yml
|
|
295
|
-
- spec/fixtures/cassettes/gateway/authorize/credit_card/address.yml
|
|
296
|
-
- spec/fixtures/cassettes/gateway/authorize/merchant_account/EUR.yml
|
|
297
|
-
- spec/fixtures/cassettes/gateway/authorize/paypal/EUR.yml
|
|
298
|
-
- spec/fixtures/cassettes/gateway/authorize/paypal/address.yml
|
|
299
|
-
- spec/fixtures/cassettes/gateway/authorized_transaction.yml
|
|
300
|
-
- spec/fixtures/cassettes/gateway/cancel/missing.yml
|
|
301
|
-
- spec/fixtures/cassettes/gateway/cancel/refunds.yml
|
|
302
|
-
- spec/fixtures/cassettes/gateway/cancel/void.yml
|
|
303
|
-
- spec/fixtures/cassettes/gateway/capture.yml
|
|
304
|
-
- spec/fixtures/cassettes/gateway/complete.yml
|
|
305
|
-
- spec/fixtures/cassettes/gateway/credit.yml
|
|
306
|
-
- spec/fixtures/cassettes/gateway/customer.yml
|
|
307
|
-
- spec/fixtures/cassettes/gateway/purchase.yml
|
|
308
|
-
- spec/fixtures/cassettes/gateway/settled_transaction.yml
|
|
309
|
-
- spec/fixtures/cassettes/gateway/void.yml
|
|
310
|
-
- spec/fixtures/cassettes/source/bin.yml
|
|
311
|
-
- spec/fixtures/cassettes/source/card_type.yml
|
|
312
|
-
- spec/fixtures/cassettes/source/last4.yml
|
|
313
|
-
- spec/fixtures/cassettes/transaction/import/valid.yml
|
|
314
|
-
- spec/fixtures/cassettes/transaction/import/valid/capture.yml
|
|
315
|
-
- spec/fixtures/views/carts/_cart_footer.html.erb
|
|
316
|
-
- spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb
|
|
317
|
-
- spec/helpers/solidus_braintree/braintree_checkout_helper_spec.rb
|
|
318
|
-
- spec/models/solidus_braintree/address_spec.rb
|
|
319
|
-
- spec/models/solidus_braintree/avs_result_spec.rb
|
|
320
|
-
- spec/models/solidus_braintree/gateway_spec.rb
|
|
321
|
-
- spec/models/solidus_braintree/response_spec.rb
|
|
322
|
-
- spec/models/solidus_braintree/source_spec.rb
|
|
323
|
-
- spec/models/solidus_braintree/transaction_address_spec.rb
|
|
324
|
-
- spec/models/solidus_braintree/transaction_import_spec.rb
|
|
325
|
-
- spec/models/solidus_braintree/transaction_spec.rb
|
|
326
|
-
- spec/models/spree/store_spec.rb
|
|
327
|
-
- spec/requests/spree/api/orders_controller_spec.rb
|
|
328
|
-
- spec/solidus_braintree_spec_helper.rb
|
|
329
|
-
- spec/support/solidus_braintree/capybara.rb
|
|
330
|
-
- spec/support/solidus_braintree/factories.rb
|
|
331
|
-
- spec/support/solidus_braintree/gateway_helpers.rb
|
|
332
|
-
- spec/support/solidus_braintree/order_ready_for_payment.rb
|
|
333
|
-
- spec/support/solidus_braintree/order_walkthrough.rb
|
|
334
|
-
- spec/support/solidus_braintree/vcr.rb
|
|
335
|
-
- spec/support/solidus_braintree/with_prepended_view_fixtures.rb
|
|
336
|
-
- spec/system/backend/configuration_spec.rb
|
|
337
|
-
- spec/system/backend/new_payment_spec.rb
|
|
338
|
-
- spec/system/frontend/braintree_credit_card_checkout_spec.rb
|
|
339
|
-
- spec/system/frontend/paypal_checkout_spec.rb
|
|
340
|
-
- spec/system/frontend/venmo_checkout_spec.rb
|
|
341
315
|
homepage: https://github.com/solidusio/solidus_braintree
|
|
342
316
|
licenses:
|
|
343
317
|
- BSD-3-Clause
|
|
@@ -345,7 +319,6 @@ metadata:
|
|
|
345
319
|
homepage_uri: https://github.com/solidusio/solidus_braintree
|
|
346
320
|
source_code_uri: https://github.com/solidusio/solidus_braintree
|
|
347
321
|
changelog_uri: https://github.com/solidusio/solidus_braintree/releases
|
|
348
|
-
post_install_message:
|
|
349
322
|
rdoc_options: []
|
|
350
323
|
require_paths:
|
|
351
324
|
- lib
|
|
@@ -356,77 +329,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
356
329
|
version: '3.0'
|
|
357
330
|
- - "<"
|
|
358
331
|
- !ruby/object:Gem::Version
|
|
359
|
-
version: '
|
|
332
|
+
version: '5'
|
|
360
333
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
361
334
|
requirements:
|
|
362
335
|
- - ">="
|
|
363
336
|
- !ruby/object:Gem::Version
|
|
364
337
|
version: '0'
|
|
365
338
|
requirements: []
|
|
366
|
-
rubygems_version: 3.
|
|
367
|
-
signing_key:
|
|
339
|
+
rubygems_version: 3.6.9
|
|
368
340
|
specification_version: 4
|
|
369
341
|
summary: Officially supported Braintree extension
|
|
370
|
-
test_files:
|
|
371
|
-
- spec/controllers/solidus_braintree/checkouts_controller_spec.rb
|
|
372
|
-
- spec/controllers/solidus_braintree/client_tokens_controller_spec.rb
|
|
373
|
-
- spec/controllers/solidus_braintree/configurations_controller_spec.rb
|
|
374
|
-
- spec/controllers/solidus_braintree/transactions_controller_spec.rb
|
|
375
|
-
- spec/fixtures/cassettes/admin/invalid_credit_card.yml
|
|
376
|
-
- spec/fixtures/cassettes/admin/resubmit_credit_card.yml
|
|
377
|
-
- spec/fixtures/cassettes/admin/valid_credit_card.yml
|
|
378
|
-
- spec/fixtures/cassettes/braintree/create_profile.yml
|
|
379
|
-
- spec/fixtures/cassettes/braintree/generate_token.yml
|
|
380
|
-
- spec/fixtures/cassettes/braintree/token.yml
|
|
381
|
-
- spec/fixtures/cassettes/checkout/invalid_credit_card.yml
|
|
382
|
-
- spec/fixtures/cassettes/checkout/resubmit_credit_card.yml
|
|
383
|
-
- spec/fixtures/cassettes/checkout/update.yml
|
|
384
|
-
- spec/fixtures/cassettes/checkout/valid_credit_card.yml
|
|
385
|
-
- spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml
|
|
386
|
-
- spec/fixtures/cassettes/gateway/authorize.yml
|
|
387
|
-
- spec/fixtures/cassettes/gateway/authorize/credit_card/address.yml
|
|
388
|
-
- spec/fixtures/cassettes/gateway/authorize/merchant_account/EUR.yml
|
|
389
|
-
- spec/fixtures/cassettes/gateway/authorize/paypal/EUR.yml
|
|
390
|
-
- spec/fixtures/cassettes/gateway/authorize/paypal/address.yml
|
|
391
|
-
- spec/fixtures/cassettes/gateway/authorized_transaction.yml
|
|
392
|
-
- spec/fixtures/cassettes/gateway/cancel/missing.yml
|
|
393
|
-
- spec/fixtures/cassettes/gateway/cancel/refunds.yml
|
|
394
|
-
- spec/fixtures/cassettes/gateway/cancel/void.yml
|
|
395
|
-
- spec/fixtures/cassettes/gateway/capture.yml
|
|
396
|
-
- spec/fixtures/cassettes/gateway/complete.yml
|
|
397
|
-
- spec/fixtures/cassettes/gateway/credit.yml
|
|
398
|
-
- spec/fixtures/cassettes/gateway/customer.yml
|
|
399
|
-
- spec/fixtures/cassettes/gateway/purchase.yml
|
|
400
|
-
- spec/fixtures/cassettes/gateway/settled_transaction.yml
|
|
401
|
-
- spec/fixtures/cassettes/gateway/void.yml
|
|
402
|
-
- spec/fixtures/cassettes/source/bin.yml
|
|
403
|
-
- spec/fixtures/cassettes/source/card_type.yml
|
|
404
|
-
- spec/fixtures/cassettes/source/last4.yml
|
|
405
|
-
- spec/fixtures/cassettes/transaction/import/valid.yml
|
|
406
|
-
- spec/fixtures/cassettes/transaction/import/valid/capture.yml
|
|
407
|
-
- spec/fixtures/views/carts/_cart_footer.html.erb
|
|
408
|
-
- spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb
|
|
409
|
-
- spec/helpers/solidus_braintree/braintree_checkout_helper_spec.rb
|
|
410
|
-
- spec/models/solidus_braintree/address_spec.rb
|
|
411
|
-
- spec/models/solidus_braintree/avs_result_spec.rb
|
|
412
|
-
- spec/models/solidus_braintree/gateway_spec.rb
|
|
413
|
-
- spec/models/solidus_braintree/response_spec.rb
|
|
414
|
-
- spec/models/solidus_braintree/source_spec.rb
|
|
415
|
-
- spec/models/solidus_braintree/transaction_address_spec.rb
|
|
416
|
-
- spec/models/solidus_braintree/transaction_import_spec.rb
|
|
417
|
-
- spec/models/solidus_braintree/transaction_spec.rb
|
|
418
|
-
- spec/models/spree/store_spec.rb
|
|
419
|
-
- spec/requests/spree/api/orders_controller_spec.rb
|
|
420
|
-
- spec/solidus_braintree_spec_helper.rb
|
|
421
|
-
- spec/support/solidus_braintree/capybara.rb
|
|
422
|
-
- spec/support/solidus_braintree/factories.rb
|
|
423
|
-
- spec/support/solidus_braintree/gateway_helpers.rb
|
|
424
|
-
- spec/support/solidus_braintree/order_ready_for_payment.rb
|
|
425
|
-
- spec/support/solidus_braintree/order_walkthrough.rb
|
|
426
|
-
- spec/support/solidus_braintree/vcr.rb
|
|
427
|
-
- spec/support/solidus_braintree/with_prepended_view_fixtures.rb
|
|
428
|
-
- spec/system/backend/configuration_spec.rb
|
|
429
|
-
- spec/system/backend/new_payment_spec.rb
|
|
430
|
-
- spec/system/frontend/braintree_credit_card_checkout_spec.rb
|
|
431
|
-
- spec/system/frontend/paypal_checkout_spec.rb
|
|
432
|
-
- spec/system/frontend/venmo_checkout_spec.rb
|
|
342
|
+
test_files: []
|
data/.circleci/config.yml
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
|
|
3
|
-
orbs:
|
|
4
|
-
browser-tools: circleci/browser-tools@1.1
|
|
5
|
-
|
|
6
|
-
# Always take the latest version of the orb, this allows us to
|
|
7
|
-
# run specs against Solidus supported versions only without the need
|
|
8
|
-
# to change this configuration every time a Solidus version is released
|
|
9
|
-
# or goes EOL.
|
|
10
|
-
solidusio_extensions: solidusio/extensions@volatile
|
|
11
|
-
|
|
12
|
-
commands:
|
|
13
|
-
test-with-starter-frontend:
|
|
14
|
-
steps:
|
|
15
|
-
- checkout
|
|
16
|
-
- browser-tools/install-chrome
|
|
17
|
-
- run:
|
|
18
|
-
name: Install libvips
|
|
19
|
-
command: |
|
|
20
|
-
sudo apt-get update
|
|
21
|
-
sudo apt-get install -yq libvips-dev
|
|
22
|
-
- solidusio_extensions/test-branch:
|
|
23
|
-
branch: main
|
|
24
|
-
command: |
|
|
25
|
-
export FRONTEND=starter
|
|
26
|
-
sudo gem update --system
|
|
27
|
-
gem install bundler rails
|
|
28
|
-
bin/dummy-app
|
|
29
|
-
bin/rspec
|
|
30
|
-
- solidusio_extensions/store-test-results
|
|
31
|
-
|
|
32
|
-
jobs:
|
|
33
|
-
run-specs-with-postgres:
|
|
34
|
-
executor:
|
|
35
|
-
name: solidusio_extensions/postgres
|
|
36
|
-
ruby_version: '3.2'
|
|
37
|
-
steps:
|
|
38
|
-
- test-with-starter-frontend
|
|
39
|
-
|
|
40
|
-
run-specs-with-mysql:
|
|
41
|
-
executor:
|
|
42
|
-
name: solidusio_extensions/mysql
|
|
43
|
-
ruby_version: '3.1'
|
|
44
|
-
steps:
|
|
45
|
-
- test-with-starter-frontend
|
|
46
|
-
|
|
47
|
-
run-specs-with-sqlite:
|
|
48
|
-
executor:
|
|
49
|
-
name: solidusio_extensions/sqlite
|
|
50
|
-
ruby_version: '3.0'
|
|
51
|
-
steps:
|
|
52
|
-
- test-with-starter-frontend
|
|
53
|
-
|
|
54
|
-
lint-code:
|
|
55
|
-
executor:
|
|
56
|
-
name: solidusio_extensions/sqlite-memory
|
|
57
|
-
ruby_version: '3.0'
|
|
58
|
-
steps:
|
|
59
|
-
- solidusio_extensions/lint-code
|
|
60
|
-
|
|
61
|
-
workflows:
|
|
62
|
-
"Run specs on supported Solidus versions":
|
|
63
|
-
jobs:
|
|
64
|
-
- run-specs-with-postgres
|
|
65
|
-
- run-specs-with-mysql
|
|
66
|
-
- run-specs-with-sqlite
|
|
67
|
-
- lint-code
|
|
68
|
-
|
|
69
|
-
"Weekly run specs against main":
|
|
70
|
-
triggers:
|
|
71
|
-
- schedule:
|
|
72
|
-
cron: "0 0 * * 4" # every Thursday
|
|
73
|
-
filters:
|
|
74
|
-
branches:
|
|
75
|
-
only:
|
|
76
|
-
- main
|
|
77
|
-
jobs:
|
|
78
|
-
- run-specs-with-postgres
|
|
79
|
-
- run-specs-with-mysql
|
|
80
|
-
- run-specs-with-sqlite
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<% id = payment_method.id %>
|
|
2
|
-
|
|
3
|
-
<fieldset class="no-border-bottom braintree-hosted-fields" data-braintree-hosted-fields data-id="braintree" data-payment-method-id="<%= id %>">
|
|
4
|
-
<div class="field" data-hook="previous_cards">
|
|
5
|
-
<% if previous_cards.any? %>
|
|
6
|
-
<% previous_cards.each do |card| %>
|
|
7
|
-
<label><%= radio_button_tag :card, card.id, card == previous_cards.first %> <%= card.display_number %><br /></label>
|
|
8
|
-
<% end %>
|
|
9
|
-
<label><%= radio_button_tag :card, "new", false, { id: "card_new#{id}" } %> <%= I18n.t("spree.use_new_cc") %></label>
|
|
10
|
-
<% end %>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<div id="card_form<%= id %>" data-hook style="display: none;">
|
|
14
|
-
<%= render partial: "spree/shared/braintree_hosted_fields", locals: { payment_method: payment_method } %>
|
|
15
|
-
</div>
|
|
16
|
-
</fieldset>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<% label = local_assigns[:label].presence %>
|
|
2
|
-
<% html_options = {class: 'input_hash fullwidth'}.update(local_assigns[:html_options] || {}) %>
|
|
3
|
-
|
|
4
|
-
<div class="field">
|
|
5
|
-
<% if local_assigns[:form] %>
|
|
6
|
-
<%= form.label attribute, label %>
|
|
7
|
-
<%= form.text_area attribute, html_options %>
|
|
8
|
-
<% else %>
|
|
9
|
-
<%= label_tag name, label %>
|
|
10
|
-
<%= text_area_tag name, value, html_options %>
|
|
11
|
-
<% end %>
|
|
12
|
-
</div>
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
require 'solidus_braintree_spec_helper'
|
|
2
|
-
require 'support/solidus_braintree/order_ready_for_payment'
|
|
3
|
-
|
|
4
|
-
RSpec.describe SolidusBraintree::CheckoutsController, type: :controller do
|
|
5
|
-
routes { SolidusBraintree::Engine.routes }
|
|
6
|
-
|
|
7
|
-
include_context 'when order is ready for payment'
|
|
8
|
-
|
|
9
|
-
describe 'PATCH update' do
|
|
10
|
-
subject(:patch_update) { patch :update, params: params }
|
|
11
|
-
|
|
12
|
-
let(:params) do
|
|
13
|
-
{
|
|
14
|
-
"state" => "payment",
|
|
15
|
-
"order" => {
|
|
16
|
-
"payments_attributes" => [
|
|
17
|
-
{
|
|
18
|
-
"payment_method_id" => payment_method.id,
|
|
19
|
-
"source_attributes" => {
|
|
20
|
-
"nonce" => "fake-paypal-billing-agreement-nonce",
|
|
21
|
-
"payment_type" => SolidusBraintree::Source::PAYPAL
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"use_billing" => "1",
|
|
26
|
-
"use_postmates_shipping" => "0"
|
|
27
|
-
},
|
|
28
|
-
"reuse_credit" => "1",
|
|
29
|
-
"order_bill_address" => "",
|
|
30
|
-
"reuse_bill_address" => "1"
|
|
31
|
-
}
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
let!(:payment_method) do
|
|
35
|
-
create_gateway
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
before do
|
|
39
|
-
allow(controller).to receive(:try_spree_current_user) { user }
|
|
40
|
-
allow(controller).to receive(:spree_current_user) { user }
|
|
41
|
-
allow(controller).to receive(:current_order) { order }
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
context "when a payment is created successfully", vcr: {
|
|
45
|
-
cassette_name: 'checkout/update',
|
|
46
|
-
match_requests_on: [:braintree_uri]
|
|
47
|
-
} do
|
|
48
|
-
it 'creates a payment' do
|
|
49
|
-
expect { patch_update }.
|
|
50
|
-
to change { order.payments.count }.
|
|
51
|
-
from(0).
|
|
52
|
-
to(1)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it 'creates a payment source' do
|
|
56
|
-
expect { patch_update }.
|
|
57
|
-
to change(SolidusBraintree::Source, :count).
|
|
58
|
-
from(0).
|
|
59
|
-
to(1)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
it 'assigns @order' do
|
|
63
|
-
patch_update
|
|
64
|
-
expect(assigns(:order)).to eq order
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
it "is successful" do
|
|
68
|
-
expect(patch_update).to be_successful
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
it "renders 'ok'" do
|
|
72
|
-
expect(patch_update.body).to eql("ok")
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
context "when a payment is not created successfully" do
|
|
77
|
-
before do
|
|
78
|
-
allow_any_instance_of(::Spree::Payment).to receive(:save).and_return(false)
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
# No idea why this is the case, but I'm just adding the tests here
|
|
82
|
-
it "is successful" do
|
|
83
|
-
expect(patch_update).to be_successful
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
it "renders 'not-ok'" do
|
|
87
|
-
expect(patch_update.body).to eq('not-ok')
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
it "does not change the number of payments in the system" do
|
|
91
|
-
expect{ patch_update }.not_to(change(::Spree::Payment, :count))
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it "does not change the number of sources in the system" do
|
|
95
|
-
expect{ patch_update }.not_to(change(SolidusBraintree::Source, :count))
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
require 'solidus_braintree_spec_helper'
|
|
2
|
-
|
|
3
|
-
RSpec.describe SolidusBraintree::ClientTokensController do
|
|
4
|
-
routes { SolidusBraintree::Engine.routes }
|
|
5
|
-
|
|
6
|
-
cassette_options = { cassette_name: "braintree/token" }
|
|
7
|
-
describe "POST create", vcr: cassette_options do
|
|
8
|
-
let!(:gateway) { create_gateway }
|
|
9
|
-
let(:user) { create(:user) }
|
|
10
|
-
let(:json) { JSON.parse(response.body) }
|
|
11
|
-
|
|
12
|
-
before { user.generate_spree_api_key! }
|
|
13
|
-
|
|
14
|
-
context 'without a payment method id' do
|
|
15
|
-
subject(:response) do
|
|
16
|
-
post :create, params: { token: user.spree_api_key }
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it "returns a client token", aggregate_failures: true do
|
|
20
|
-
expect(response).to have_http_status(:success)
|
|
21
|
-
expect(response.content_type).to include 'application/json'
|
|
22
|
-
expect(json["client_token"]).to be_present
|
|
23
|
-
expect(json["client_token"]).to be_a String
|
|
24
|
-
expect(json["payment_method_id"]).to eq gateway.id
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
context "when there's two gateway's for different stores" do
|
|
28
|
-
let!(:store1) { create(:store, code: 'store_1') }
|
|
29
|
-
let!(:store2) { create(:store, code: 'store_2') }
|
|
30
|
-
let!(:gateway_for_store1) { create_gateway.tap{ |gw| store1.payment_methods << gw } }
|
|
31
|
-
let!(:gateway_for_store2) { create_gateway.tap{ |gw| store2.payment_methods << gw } }
|
|
32
|
-
|
|
33
|
-
it "returns the correct gateway for store1" do
|
|
34
|
-
allow_any_instance_of(described_class).to receive(:current_store).and_return store1
|
|
35
|
-
expect(json["payment_method_id"]).to eq gateway_for_store1.id
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it "returns the correct gateway for store2" do
|
|
39
|
-
allow_any_instance_of(described_class).to receive(:current_store).and_return store2
|
|
40
|
-
expect(json["payment_method_id"]).to eq gateway_for_store2.id
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
context 'with a payment method id' do
|
|
46
|
-
subject(:response) do
|
|
47
|
-
post :create, params: { token: user.spree_api_key, payment_method_id: gateway.id }
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it 'uses the selected gateway' do
|
|
51
|
-
expect(json["payment_method_id"]).to eq gateway.id
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|