solidus_paypal_braintree 1.2.0 → 2.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.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +0 -18
  3. data/CHANGELOG.md +9 -0
  4. data/README.md +9 -0
  5. data/lib/generators/solidus_paypal_braintree/install/install_generator.rb +2 -36
  6. data/lib/solidus_paypal_braintree/engine.rb +0 -56
  7. data/lib/solidus_paypal_braintree/version.rb +1 -1
  8. data/lib/solidus_paypal_braintree.rb +1 -6
  9. data/solidus_paypal_braintree.gemspec +7 -5
  10. data/spec/controllers/solidus_paypal_braintree/checkouts_controller_spec.rb +5 -5
  11. data/spec/controllers/solidus_paypal_braintree/client_tokens_controller_spec.rb +2 -2
  12. data/spec/controllers/solidus_paypal_braintree/configurations_controller_spec.rb +2 -2
  13. data/spec/controllers/solidus_paypal_braintree/transactions_controller_spec.rb +5 -5
  14. data/spec/features/backend/configuration_spec.rb +3 -3
  15. data/spec/features/backend/new_payment_spec.rb +1 -1
  16. data/spec/features/frontend/braintree_credit_card_checkout_spec.rb +3 -3
  17. data/spec/fixtures/views/spree/orders/edit.html.erb +1 -1
  18. data/spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb +1 -1
  19. data/spec/helpers/solidus_paypal_braintree/braintree_checkout_helper_spec.rb +5 -5
  20. data/spec/models/solidus_paypal_braintree/address_spec.rb +1 -1
  21. data/spec/models/solidus_paypal_braintree/avs_result_spec.rb +1 -1
  22. data/spec/models/solidus_paypal_braintree/gateway_spec.rb +11 -11
  23. data/spec/models/solidus_paypal_braintree/response_spec.rb +1 -1
  24. data/spec/models/solidus_paypal_braintree/source_spec.rb +2 -2
  25. data/spec/models/solidus_paypal_braintree/transaction_address_spec.rb +1 -1
  26. data/spec/models/solidus_paypal_braintree/transaction_import_spec.rb +12 -12
  27. data/spec/models/solidus_paypal_braintree/transaction_spec.rb +2 -2
  28. data/spec/requests/spree/api/orders_controller_spec.rb +2 -2
  29. data/spec/spec_helper.rb +2 -2
  30. data/spec/support/gateway_helpers.rb +3 -3
  31. metadata +9 -174
  32. data/app/assets/config/solidus_paypal_braintree_manifest.js +0 -1
  33. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_280x48.svg +0 -19
  34. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_320x48.svg +0 -19
  35. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_375x48.svg +0 -19
  36. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_280x48.svg +0 -19
  37. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_320x48.svg +0 -19
  38. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_375x48.svg +0 -19
  39. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_acceptance_mark.svg +0 -15
  40. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_280x48.svg +0 -19
  41. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_320x48.svg +0 -19
  42. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_375x48.svg +0 -19
  43. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_logo.svg +0 -18
  44. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_acceptance_mark.svg +0 -20
  45. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_280x48.svg +0 -19
  46. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_320x48.svg +0 -19
  47. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_375x48.svg +0 -19
  48. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_logo.svg +0 -18
  49. data/app/assets/javascripts/solidus_paypal_braintree/apple_pay_button.js +0 -179
  50. data/app/assets/javascripts/solidus_paypal_braintree/checkout.js +0 -108
  51. data/app/assets/javascripts/solidus_paypal_braintree/client.js +0 -239
  52. data/app/assets/javascripts/solidus_paypal_braintree/constants.js +0 -89
  53. data/app/assets/javascripts/solidus_paypal_braintree/frontend.js +0 -14
  54. data/app/assets/javascripts/solidus_paypal_braintree/hosted_form.js +0 -46
  55. data/app/assets/javascripts/solidus_paypal_braintree/paypal_button.js +0 -178
  56. data/app/assets/javascripts/solidus_paypal_braintree/paypal_messaging.js +0 -22
  57. data/app/assets/javascripts/solidus_paypal_braintree/promise.js +0 -20
  58. data/app/assets/javascripts/solidus_paypal_braintree/venmo_button.js +0 -86
  59. data/app/assets/javascripts/spree/backend/solidus_paypal_braintree.js +0 -96
  60. data/app/assets/javascripts/spree/frontend/paypal_button.js +0 -34
  61. data/app/assets/javascripts/spree/frontend/solidus_paypal_braintree.js +0 -1
  62. data/app/assets/stylesheets/spree/backend/solidus_paypal_braintree.css +0 -4
  63. data/app/assets/stylesheets/spree/backend/solidus_paypal_braintree.scss +0 -28
  64. data/app/assets/stylesheets/spree/frontend/solidus_paypal_braintree.css +0 -51
  65. data/app/decorators/controllers/solidus_paypal_braintree/admin_payments_controller_decorator.rb +0 -11
  66. data/app/decorators/controllers/solidus_paypal_braintree/checkout_controller_decorator.rb +0 -11
  67. data/app/decorators/controllers/solidus_paypal_braintree/client_tokens_controller.rb +0 -41
  68. data/app/decorators/controllers/solidus_paypal_braintree/orders_controller_decorator.rb +0 -11
  69. data/app/decorators/models/solidus_paypal_braintree/spree/store_decorator.rb +0 -20
  70. data/app/decorators/models/solidus_paypal_braintree/spree/user_decorator.rb +0 -13
  71. data/app/helpers/solidus_paypal_braintree/braintree_admin_helper.rb +0 -23
  72. data/app/helpers/solidus_paypal_braintree/braintree_checkout_helper.rb +0 -60
  73. data/app/models/application_record.rb +0 -5
  74. data/app/models/solidus_paypal_braintree/address.rb +0 -64
  75. data/app/models/solidus_paypal_braintree/avs_result.rb +0 -69
  76. data/app/models/solidus_paypal_braintree/configuration.rb +0 -39
  77. data/app/models/solidus_paypal_braintree/customer.rb +0 -8
  78. data/app/models/solidus_paypal_braintree/gateway.rb +0 -433
  79. data/app/models/solidus_paypal_braintree/response.rb +0 -80
  80. data/app/models/solidus_paypal_braintree/source.rb +0 -135
  81. data/app/models/solidus_paypal_braintree/transaction.rb +0 -31
  82. data/app/models/solidus_paypal_braintree/transaction_address.rb +0 -88
  83. data/app/models/solidus_paypal_braintree/transaction_import.rb +0 -98
  84. data/app/overrides/spree/payments/payment/add_paypal_funding_source_to_payment.rb +0 -9
  85. data/app/views/spree/api/payments/source_views/_paypal_braintree.json.jbuilder +0 -3
  86. data/app/views/spree/checkout/existing_payment/_paypal_braintree.html.erb +0 -10
  87. data/app/views/spree/shared/_apple_pay_button.html.erb +0 -27
  88. data/app/views/spree/shared/_braintree_errors.html.erb +0 -16
  89. data/app/views/spree/shared/_braintree_hosted_fields.html.erb +0 -43
  90. data/app/views/spree/shared/_paypal_braintree_head_scripts.html.erb +0 -26
  91. data/app/views/spree/shared/_paypal_cart_button.html.erb +0 -38
  92. data/app/views/spree/shared/_paypal_messaging.html.erb +0 -13
  93. data/app/views/spree/shared/_venmo_button.html.erb +0 -33
  94. data/config/locales/en.yml +0 -96
  95. data/config/locales/it.yml +0 -56
  96. data/config/routes.rb +0 -14
  97. data/db/migrate/20160830061749_create_solidus_paypal_braintree_sources.rb +0 -16
  98. data/db/migrate/20160906201711_create_solidus_paypal_braintree_customers.rb +0 -13
  99. data/db/migrate/20161114231422_create_solidus_paypal_braintree_configurations.rb +0 -11
  100. data/db/migrate/20161125172005_add_braintree_configuration_to_stores.rb +0 -7
  101. data/db/migrate/20170203191030_add_credit_card_to_braintree_configuration.rb +0 -6
  102. data/db/migrate/20170505193712_add_null_constraint_to_sources.rb +0 -32
  103. data/db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb +0 -11
  104. data/db/migrate/20190705115327_add_paypal_button_preferences_to_braintree_configurations.rb +0 -5
  105. data/db/migrate/20190911141712_add_3d_secure_to_braintree_configuration.rb +0 -5
  106. data/db/migrate/20211222170950_add_paypal_funding_source_to_solidus_paypal_braintree_sources.rb +0 -5
  107. data/db/migrate/20220104150301_add_venmo_to_braintree_configuration.rb +0 -5
  108. data/lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb +0 -48
  109. data/lib/controllers/frontend/solidus_paypal_braintree/checkouts_controller.rb +0 -31
  110. data/lib/controllers/frontend/solidus_paypal_braintree/transactions_controller.rb +0 -67
  111. data/lib/generators/solidus_paypal_braintree/install/templates/initializer.rb +0 -6
  112. data/lib/solidus_paypal_braintree/country_mapper.rb +0 -37
  113. data/lib/solidus_paypal_braintree/extension_configuration.rb +0 -23
  114. data/lib/solidus_paypal_braintree/request_protection.rb +0 -21
  115. data/lib/solidus_paypal_braintree/testing_support/factories.rb +0 -53
  116. data/lib/views/backend/solidus_paypal_braintree/configurations/list.html.erb +0 -63
  117. data/lib/views/backend/spree/admin/payments/source_forms/_paypal_braintree.html.erb +0 -16
  118. data/lib/views/backend/spree/admin/payments/source_views/_paypal_braintree.html.erb +0 -39
  119. data/lib/views/backend/spree/admin/shared/preference_fields/_preference_select.html.erb +0 -13
  120. data/lib/views/backend_v1.2/spree/admin/payments/source_forms/_paypal_braintree.html.erb +0 -16
  121. data/lib/views/backend_v2.4/spree/admin/shared/preference_fields/_hash.html.erb +0 -12
  122. data/lib/views/frontend/solidus_paypal_braintree/payments/_payment.html.erb +0 -12
  123. data/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb +0 -23
  124. data/lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5a99cf586082f26611d58fc0ab61e282c4cbcc00ccf1bb26702fc1051a41ff0
4
- data.tar.gz: fddad0e0df126342b1ae1b4d5267d6cce177b66a41c051ad4cfda28127bbd86a
3
+ metadata.gz: 1c6085bc8f7520e1cc3af5df786810b9ff6b4f45403dff9072f51086d9afe0b6
4
+ data.tar.gz: e652de0bf5d7b517323f02c68b361d8ebf4d51c15f987dc188f6169e3ddfbecb
5
5
  SHA512:
6
- metadata.gz: ad6a2ad7d62c46d6a801252db48ff2cadb08d29581601898a207ce5d46338373ec455999e6a46f1be9a62d0eb2785aa1e42373ff380c66bf9bdff029b9b5143a
7
- data.tar.gz: 74c45a0105ffe812e456896c96455db6be96f500a400e9f2285e1cb5e650d16a77af68737f57df13d69eb0de6c80aade23ad3fc48f142024494c8271d90604ff
6
+ metadata.gz: 4323694d9f2478bd8839a6833591879a414e35639fbdd96a54a96bc5e8916e0ac39df525bc1f7aed7ac87039242651712429019c638dcffe8affc7a95215433a
7
+ data.tar.gz: e079058905f73cd30e4c8cc8dd846e1106160ccc36a1704adf7f081eb15612cd9c834bf67bcf16a351ac7f02b0cf6606e5d70e9ae1fb2bb360b1c4ea8c318701
data/.circleci/config.yml CHANGED
@@ -21,27 +21,9 @@ jobs:
21
21
  steps:
22
22
  - browser-tools/install-browser-tools
23
23
  - solidusio_extensions/run-tests
24
- lint-code:
25
- executor: solidusio_extensions/sqlite-memory
26
- steps:
27
- - browser-tools/install-browser-tools
28
- - solidusio_extensions/lint-code
29
24
 
30
25
  workflows:
31
26
  "Run specs on supported Solidus versions":
32
27
  jobs:
33
28
  - run-specs-with-postgres
34
29
  - run-specs-with-mysql
35
- - lint-code
36
-
37
- "Weekly run specs against master":
38
- triggers:
39
- - schedule:
40
- cron: "0 0 * * 4" # every Thursday
41
- filters:
42
- branches:
43
- only:
44
- - master
45
- jobs:
46
- - run-specs-with-postgres
47
- - run-specs-with-mysql
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [v2.0.0](https://github.com/solidusio/solidus_paypal_braintree/tree/v1.2.0) (2023-03-20)
4
+
5
+ This extension is deprecated. This last version contains only a dependency to the new
6
+ recommended extension.
7
+
8
+ To upgrade, follow the instructions here:
9
+
10
+ https://github.com/solidusio/solidus_braintree/wiki/Upgrading-from-SolidusPaypalBraintree-To-SolidusBraintree
11
+
3
12
  ## [v1.2.0](https://github.com/solidusio/solidus_paypal_braintree/tree/v1.2.0) (2022-12-12)
4
13
 
5
14
  [Full Changelog](https://github.com/solidusio/solidus_paypal_braintree/compare/v1.1.2...v1.2.0)
data/README.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # SolidusPaypalBraintree
2
2
 
3
+ ⛔️ This extension is archived. ⛔️
4
+
5
+ It has been renamed and moved to [solidus_braintree](https://github.com/solidusio/solidus_braintree).
6
+
7
+ If you were using this project, you can follow the [instructions to upgrade to the new extension](https://github.com/solidusio/solidus_braintree/wiki/Upgrading-from-SolidusPaypalBraintree-To-SolidusBraintree).
8
+
9
+ <hr>
10
+ <br>
11
+
3
12
  [![CircleCI](https://circleci.com/gh/solidusio/solidus_paypal_braintree.svg?style=shield)](https://circleci.com/gh/solidusio/solidus_paypal_braintree)
4
13
  [![codecov](https://codecov.io/gh/solidusio/solidus_paypal_braintree/branch/master/graph/badge.svg)](https://codecov.io/gh/solidusio/solidus_paypal_braintree)
5
14
 
@@ -1,42 +1,8 @@
1
- # frozen_string_literal: true
2
-
3
1
  module SolidusPaypalBraintree
4
2
  module Generators
5
3
  class InstallGenerator < Rails::Generators::Base
6
- class_option :auto_run_migrations, type: :boolean, default: false
7
- source_root File.expand_path('templates', __dir__)
8
-
9
- def copy_initializer
10
- template 'initializer.rb', 'config/initializers/solidus_paypal_braintree.rb'
11
- end
12
-
13
- def add_javascripts
14
- append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/solidus_paypal_braintree\n" # rubocop:disable Layout/LineLength
15
- append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/solidus_paypal_braintree\n" # rubocop:disable Layout/LineLength
16
- end
17
-
18
- def add_stylesheets
19
- inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/solidus_paypal_braintree\n", before: %r{\*/}, verbose: true # rubocop:disable Layout/LineLength
20
- inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/solidus_paypal_braintree\n", before: %r{\*/}, verbose: true # rubocop:disable Layout/LineLength
21
- end
22
-
23
- def add_migrations
24
- run 'bin/rails railties:install:migrations FROM=solidus_paypal_braintree'
25
- end
26
-
27
- def mount_engine
28
- insert_into_file File.join('config', 'routes.rb'), after: "Rails.application.routes.draw do\n" do
29
- "mount SolidusPaypalBraintree::Engine, at: '/solidus_paypal_braintree'\n"
30
- end
31
- end
32
-
33
- def run_migrations
34
- run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]')) # rubocop:disable Layout/LineLength
35
- if run_migrations
36
- run 'bin/rails db:migrate'
37
- else
38
- puts 'Skipping bin/rails db:migrate, don\'t forget to run it!' # rubocop:disable Rails/Output
39
- end
4
+ def install_braintree
5
+ run 'bin/rails g solidus_braintree:install --auto_run_migrations=true'
40
6
  end
41
7
  end
42
8
  end
@@ -9,61 +9,5 @@ module SolidusPaypalBraintree
9
9
 
10
10
  isolate_namespace SolidusPaypalBraintree
11
11
  engine_name 'solidus_paypal_braintree'
12
-
13
- ActiveSupport::Inflector.inflections do |inflect|
14
- inflect.acronym 'AVS'
15
- end
16
-
17
- initializer "register_solidus_paypal_braintree_gateway", after: "spree.register.payment_methods" do |app|
18
- config.to_prepare do
19
- app.config.spree.payment_methods << SolidusPaypalBraintree::Gateway
20
- SolidusPaypalBraintree::Gateway.allowed_admin_form_preference_types.push(:preference_select).uniq!
21
- ::Spree::PermittedAttributes.source_attributes.concat([:nonce, :payment_type, :paypal_funding_source]).uniq!
22
- end
23
- end
24
-
25
- if SolidusSupport.frontend_available?
26
- config.assets.precompile += [
27
- 'solidus_paypal_braintree/checkout.js',
28
- 'solidus_paypal_braintree/frontend.js',
29
- 'spree/frontend/apple_pay_button.js',
30
- 'solidus_paypal_braintree_manifest.js'
31
- ]
32
- paths["app/controllers"] << "lib/controllers/frontend"
33
- paths["app/views"] << "lib/views/frontend"
34
- end
35
-
36
- if SolidusSupport.backend_available?
37
- config.assets.precompile += ["spree/backend/solidus_paypal_braintree.js"]
38
- paths["app/controllers"] << "lib/controllers/backend"
39
-
40
- # We support Solidus v1.2, which requires some different markup in the
41
- # source form partial. This will take precedence over lib/views/backend.
42
- paths["app/views"] << "lib/views/backend_v1.2" if Spree.solidus_gem_version < Gem::Version.new('1.3')
43
-
44
- # Solidus v2.4 introduced preference field partials but does not ship a hash field type.
45
- # This is solved in Solidus v2.5.
46
- if Spree.solidus_gem_version <= Gem::Version.new('2.5.0')
47
- paths["app/views"] << "lib/views/backend_v2.4"
48
- end
49
-
50
- paths["app/views"] << "lib/views/backend"
51
-
52
- initializer "solidus_paypal_braintree_admin_menu_item", after: "register_solidus_paypal_braintree_gateway" do
53
- Spree::Backend::Config.configure do |config|
54
- config.menu_items << config.class::MenuItem.new(
55
- [:braintree],
56
- 'cc-paypal',
57
- url: '/solidus_paypal_braintree/configurations/list',
58
- condition: -> { can?(:list, SolidusPaypalBraintree::Configuration) }
59
- )
60
- end
61
- end
62
- end
63
-
64
- # use rspec for tests
65
- config.generators do |g|
66
- g.test_framework :rspec
67
- end
68
12
  end
69
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusPaypalBraintree
4
- VERSION = '1.2.0'
4
+ VERSION = '2.0.0'
5
5
  end
@@ -1,11 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'solidus_core'
4
- require 'solidus_support'
5
-
6
- require 'solidus_paypal_braintree/country_mapper'
7
- require 'solidus_paypal_braintree/request_protection'
8
- require 'solidus_paypal_braintree/extension_configuration'
3
+ require 'solidus_braintree'
9
4
  require 'solidus_paypal_braintree/version'
10
5
  require 'solidus_paypal_braintree/engine'
11
6
 
@@ -29,11 +29,13 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_dependency 'activemerchant', '~> 1.48'
33
- spec.add_dependency 'braintree', '~> 3.4'
34
- spec.add_dependency 'solidus_api', ['>= 2.4.0', '< 4']
35
- spec.add_dependency 'solidus_core', ['>= 2.4.0', '< 4']
36
- spec.add_dependency 'solidus_support', ['>= 0.8.1', '< 1']
32
+ spec.add_dependency 'solidus_braintree', '~> 2.0'
33
+ spec.post_install_message = %q{
34
+ ACTION REQUIRED: This extension has been renamed to solidus_braintree.
35
+
36
+ To upgrade to the new name, follow the instructions here:
37
+ https://github.com/solidusio/solidus_braintree/wiki/Upgrading-from-SolidusPaypalBraintree-To-SolidusBraintree
38
+ }
37
39
 
38
40
  spec.add_development_dependency 'rails-controller-testing'
39
41
  spec.add_development_dependency 'solidus_dev_support', '~> 2.5'
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
  require 'support/order_ready_for_payment'
3
3
 
4
- RSpec.describe SolidusPaypalBraintree::CheckoutsController, type: :controller do
5
- routes { SolidusPaypalBraintree::Engine.routes }
4
+ RSpec.describe SolidusBraintree::CheckoutsController, type: :controller do
5
+ routes { SolidusBraintree::Engine.routes }
6
6
 
7
7
  include_context 'when order is ready for payment'
8
8
 
@@ -18,7 +18,7 @@ RSpec.describe SolidusPaypalBraintree::CheckoutsController, type: :controller do
18
18
  "payment_method_id" => payment_method.id,
19
19
  "source_attributes" => {
20
20
  "nonce" => "fake-paypal-billing-agreement-nonce",
21
- "payment_type" => SolidusPaypalBraintree::Source::PAYPAL
21
+ "payment_type" => SolidusBraintree::Source::PAYPAL
22
22
  }
23
23
  }
24
24
  ],
@@ -54,7 +54,7 @@ RSpec.describe SolidusPaypalBraintree::CheckoutsController, type: :controller do
54
54
 
55
55
  it 'creates a payment source' do
56
56
  expect { patch_update }.
57
- to change(SolidusPaypalBraintree::Source, :count).
57
+ to change(SolidusBraintree::Source, :count).
58
58
  from(0).
59
59
  to(1)
60
60
  end
@@ -92,7 +92,7 @@ RSpec.describe SolidusPaypalBraintree::CheckoutsController, type: :controller do
92
92
  end
93
93
 
94
94
  it "does not change the number of sources in the system" do
95
- expect{ patch_update }.not_to(change(SolidusPaypalBraintree::Source, :count))
95
+ expect{ patch_update }.not_to(change(SolidusBraintree::Source, :count))
96
96
  end
97
97
  end
98
98
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe SolidusPaypalBraintree::ClientTokensController do
4
- routes { SolidusPaypalBraintree::Engine.routes }
3
+ describe SolidusBraintree::ClientTokensController do
4
+ routes { SolidusBraintree::Engine.routes }
5
5
 
6
6
  cassette_options = { cassette_name: "braintree/token" }
7
7
  describe "POST create", vcr: cassette_options do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe SolidusPaypalBraintree::ConfigurationsController, type: :controller do
4
- routes { SolidusPaypalBraintree::Engine.routes }
3
+ describe SolidusBraintree::ConfigurationsController, type: :controller do
4
+ routes { SolidusBraintree::Engine.routes }
5
5
 
6
6
  let!(:store_1) { create :store }
7
7
  let!(:store_2) { create :store }
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe SolidusPaypalBraintree::TransactionsController, type: :controller do
4
- routes { SolidusPaypalBraintree::Engine.routes }
3
+ RSpec.describe SolidusBraintree::TransactionsController, type: :controller do
4
+ routes { SolidusBraintree::Engine.routes }
5
5
 
6
6
  let!(:country) { create :country }
7
7
  let(:line_item) { create :line_item, price: 50 }
@@ -37,7 +37,7 @@ RSpec.describe SolidusPaypalBraintree::TransactionsController, type: :controller
37
37
  {
38
38
  transaction: {
39
39
  nonce: "fake-valid-nonce",
40
- payment_type: SolidusPaypalBraintree::Source::PAYPAL,
40
+ payment_type: SolidusBraintree::Source::PAYPAL,
41
41
  phone: "1112223333",
42
42
  email: "batman@example.com",
43
43
  address_attributes: {
@@ -62,7 +62,7 @@ RSpec.describe SolidusPaypalBraintree::TransactionsController, type: :controller
62
62
 
63
63
  it "raises a validation error" do
64
64
  expect { post_create }.to raise_error(
65
- SolidusPaypalBraintree::TransactionsController::InvalidImportError,
65
+ SolidusBraintree::TransactionsController::InvalidImportError,
66
66
  "Import invalid: " \
67
67
  "Address is invalid, " \
68
68
  "Address City can't be blank"
@@ -159,7 +159,7 @@ RSpec.describe SolidusPaypalBraintree::TransactionsController, type: :controller
159
159
  context "when format is HTML" do
160
160
  it "raises an error including the validation messages" do
161
161
  expect { post_create }.to raise_error(
162
- SolidusPaypalBraintree::TransactionsController::InvalidImportError,
162
+ SolidusBraintree::TransactionsController::InvalidImportError,
163
163
  "Import invalid: Email can't be blank"
164
164
  )
165
165
  end
@@ -5,15 +5,15 @@ RSpec.describe "viewing the configuration interface" do
5
5
 
6
6
  # Regression to ensure this page still renders on old versions of solidus
7
7
  it "doesn't raise any errors due to unavailable route helpers" do
8
- visit "/solidus_paypal_braintree/configurations/list"
8
+ visit "/solidus_braintree/configurations/list"
9
9
  expect(page).to have_content("Braintree Configurations")
10
10
  end
11
11
 
12
12
  # Regression to ensure this page renders on Solidus 2.4
13
13
  it "doesn't raise any errors due to unavailable preference field partial" do
14
- Rails.application.config.spree.payment_methods << SolidusPaypalBraintree::Gateway
14
+ Rails.application.config.spree.payment_methods << SolidusBraintree::Gateway
15
15
  Spree::PaymentMethod.create!(
16
- type: 'SolidusPaypalBraintree::Gateway',
16
+ type: 'SolidusBraintree::Gateway',
17
17
  name: 'Braintree Payments'
18
18
  )
19
19
  visit '/admin/payment_methods'
@@ -14,7 +14,7 @@ shared_context "with backend checkout setup" do
14
14
  store.braintree_configuration.update!(credit_card: true)
15
15
  end
16
16
 
17
- allow_any_instance_of(SolidusPaypalBraintree::Source).to receive(:nonce).and_return("fake-valid-nonce")
17
+ allow_any_instance_of(SolidusBraintree::Source).to receive(:nonce).and_return("fake-valid-nonce")
18
18
 
19
19
  # Order and payment numbers must be identical between runs to re-use the VCR
20
20
  # cassette
@@ -40,7 +40,7 @@ shared_context "with frontend checkout setup" do
40
40
  allow_any_instance_of(Spree::CheckoutController).to receive_messages(try_spree_current_user: user)
41
41
  allow_any_instance_of(Spree::CheckoutController).to receive_messages(spree_current_user: user)
42
42
  allow_any_instance_of(Spree::Payment).to receive(:number).and_return("123ABC")
43
- allow_any_instance_of(SolidusPaypalBraintree::Source).to receive(:nonce).and_return("fake-valid-nonce")
43
+ allow_any_instance_of(SolidusBraintree::Source).to receive(:nonce).and_return("fake-valid-nonce")
44
44
 
45
45
  visit spree.checkout_state_path(:delivery)
46
46
  click_button "Save and Continue"
@@ -141,7 +141,7 @@ describe 'entering credit card details', type: :feature, js: true do
141
141
  end
142
142
 
143
143
  it "displays an alert with a meaningful error message" do
144
- expect(page).to have_text I18n.t("solidus_paypal_braintree.errors.empty_fields")
144
+ expect(page).to have_text I18n.t("solidus_braintree.errors.empty_fields")
145
145
  expect(page).to have_selector("input[type='submit']:enabled")
146
146
  end
147
147
 
@@ -151,7 +151,7 @@ describe 'entering credit card details', type: :feature, js: true do
151
151
  expect(page).to have_selector("input[type='submit']:enabled")
152
152
 
153
153
  click_button "Save and Continue"
154
- expect(page).to have_text I18n.t("solidus_paypal_braintree.errors.empty_fields")
154
+ expect(page).to have_text I18n.t("solidus_braintree.errors.empty_fields")
155
155
  end
156
156
  end
157
157
 
@@ -1,4 +1,4 @@
1
- <!-- Modified cart view with PayPal button, from solidus_paypal_braintree -->
1
+ <!-- Modified cart view with PayPal button, from solidus_braintree -->
2
2
 
3
3
  <% @body_id = 'cart' %>
4
4
  <div data-hook="cart_container">
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe SolidusPaypalBraintree::BraintreeAdminHelper do
3
+ RSpec.describe SolidusBraintree::BraintreeAdminHelper do
4
4
  describe '#braintree_transaction_link' do
5
5
  subject { helper.braintree_transaction_link(payment) }
6
6
 
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe SolidusPaypalBraintree::BraintreeCheckoutHelper do
3
+ RSpec.describe SolidusBraintree::BraintreeCheckoutHelper do
4
4
  let!(:store) { create :store }
5
5
  let(:braintree_configuration) { {} }
6
6
 
@@ -36,7 +36,7 @@ RSpec.describe SolidusPaypalBraintree::BraintreeCheckoutHelper do
36
36
  let(:active) { false }
37
37
 
38
38
  it 'returns the correct url' do
39
- expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_white_button_280x48-.+\.svg])
39
+ expect(subject).to match(%r[\A/assets/solidus_braintree/venmo/venmo_white_button_280x48-.+\.svg])
40
40
  end
41
41
  end
42
42
 
@@ -45,7 +45,7 @@ RSpec.describe SolidusPaypalBraintree::BraintreeCheckoutHelper do
45
45
  let(:active) { true }
46
46
 
47
47
  it 'returns the correct url' do
48
- expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_active_white_button_280x48-.+\.svg])
48
+ expect(subject).to match(%r[\A/assets/solidus_braintree/venmo/venmo_active_white_button_280x48-.+\.svg])
49
49
  end
50
50
  end
51
51
 
@@ -54,7 +54,7 @@ RSpec.describe SolidusPaypalBraintree::BraintreeCheckoutHelper do
54
54
  let(:active) { false }
55
55
 
56
56
  it 'returns the correct url' do
57
- expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_blue_button_320x48-.+\.svg])
57
+ expect(subject).to match(%r[\A/assets/solidus_braintree/venmo/venmo_blue_button_320x48-.+\.svg])
58
58
  end
59
59
  end
60
60
 
@@ -63,7 +63,7 @@ RSpec.describe SolidusPaypalBraintree::BraintreeCheckoutHelper do
63
63
  let(:active) { true }
64
64
 
65
65
  it 'returns the correct url' do
66
- expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_active_blue_button_320x48-.+\.svg])
66
+ expect(subject).to match(%r[\A/assets/solidus_braintree/venmo/venmo_active_blue_button_320x48-.+\.svg])
67
67
  end
68
68
  end
69
69
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe SolidusPaypalBraintree::Address do
3
+ RSpec.describe SolidusBraintree::Address do
4
4
  describe "::split_name" do
5
5
  subject { described_class.split_name(name) }
6
6
 
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe SolidusPaypalBraintree::AVSResult do
3
+ RSpec.describe SolidusBraintree::AVSResult do
4
4
  describe 'AVS response message' do
5
5
  subject { described_class.build(transaction).to_hash['message'] }
6
6
 
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'webmock'
3
3
  require 'support/order_ready_for_payment'
4
4
 
5
- RSpec.describe SolidusPaypalBraintree::Gateway do
5
+ RSpec.describe SolidusBraintree::Gateway do
6
6
  let(:gateway) do
7
7
  new_gateway.tap(&:save)
8
8
  end
@@ -12,7 +12,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
12
12
  let(:user) { create :user }
13
13
 
14
14
  let(:source) do
15
- SolidusPaypalBraintree::Source.create!(
15
+ SolidusBraintree::Source.create!(
16
16
  nonce: 'fake-valid-nonce',
17
17
  user: user,
18
18
  payment_type: payment_type,
@@ -20,7 +20,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
20
20
  )
21
21
  end
22
22
 
23
- let(:payment_type) { SolidusPaypalBraintree::Source::PAYPAL }
23
+ let(:payment_type) { SolidusBraintree::Source::PAYPAL }
24
24
 
25
25
  describe "saving preference hashes as strings" do
26
26
  subject { gateway.update(update_params) }
@@ -159,7 +159,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
159
159
  describe "#method_type" do
160
160
  subject { gateway.method_type }
161
161
 
162
- it { is_expected.to eq "paypal_braintree" }
162
+ it { is_expected.to eq "braintree" }
163
163
  end
164
164
 
165
165
  describe '#gateway_options' do
@@ -281,7 +281,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
281
281
  cassette_name: 'gateway/authorize/credit_card/address',
282
282
  match_requests_on: [:braintree_uri]
283
283
  } do
284
- let(:payment_type) { SolidusPaypalBraintree::Source::CREDIT_CARD }
284
+ let(:payment_type) { SolidusBraintree::Source::CREDIT_CARD }
285
285
 
286
286
  it 'includes the billing address in the request' do
287
287
  expect_any_instance_of(Braintree::TransactionGateway).to receive(:sale).
@@ -509,7 +509,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
509
509
  }
510
510
  context "with no existing customer profile", vcr: cassette_options do
511
511
  it 'creates and returns a new customer profile', aggregate_failures: true do
512
- expect(profile).to be_a SolidusPaypalBraintree::Customer
512
+ expect(profile).to be_a SolidusBraintree::Customer
513
513
  expect(profile.sources).to eq [source]
514
514
  expect(profile.braintree_customer_id).to be_present
515
515
  end
@@ -601,7 +601,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
601
601
  let(:other_payment_method) { FactoryBot.create(:payment_method) }
602
602
 
603
603
  let(:source_without_profile) do
604
- SolidusPaypalBraintree::Source.create!(
604
+ SolidusBraintree::Source.create!(
605
605
  payment_method_id: gateway.id,
606
606
  payment_type: payment_type,
607
607
  user_id: user.id
@@ -609,7 +609,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
609
609
  end
610
610
 
611
611
  let(:source_with_profile) do
612
- SolidusPaypalBraintree::Source.create!(
612
+ SolidusBraintree::Source.create!(
613
613
  payment_method_id: gateway.id,
614
614
  payment_type: payment_type,
615
615
  user_id: user.id
@@ -677,7 +677,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
677
677
  let(:user) { FactoryBot.create(:user) }
678
678
 
679
679
  let!(:source_without_profile) do
680
- SolidusPaypalBraintree::Source.create!(
680
+ SolidusBraintree::Source.create!(
681
681
  payment_method_id: gateway.id,
682
682
  payment_type: payment_type,
683
683
  user_id: user.id
@@ -685,7 +685,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
685
685
  end
686
686
 
687
687
  let!(:source_with_profile) do
688
- SolidusPaypalBraintree::Source.create!(
688
+ SolidusBraintree::Source.create!(
689
689
  payment_method_id: gateway.id,
690
690
  payment_type: payment_type,
691
691
  user_id: user.id
@@ -736,7 +736,7 @@ RSpec.describe SolidusPaypalBraintree::Gateway do
736
736
  gateway
737
737
  end
738
738
 
739
- it { expect { subject }.to raise_error SolidusPaypalBraintree::Gateway::TokenGenerationDisabledError }
739
+ it { expect { subject }.to raise_error SolidusBraintree::Gateway::TokenGenerationDisabledError }
740
740
  end
741
741
  end
742
742
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe SolidusPaypalBraintree::Response do
3
+ RSpec.describe SolidusBraintree::Response do
4
4
  let(:failed_transaction) { nil }
5
5
  let(:error) do
6
6
  instance_double(
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe SolidusPaypalBraintree::Source, type: :model do
3
+ RSpec.describe SolidusBraintree::Source, type: :model do
4
4
  include_context 'when order is ready for payment'
5
5
 
6
6
  it 'is invalid without a payment_type set' do
@@ -13,7 +13,7 @@ RSpec.describe SolidusPaypalBraintree::Source, type: :model do
13
13
 
14
14
  describe 'attributes' do
15
15
  context 'with paypal_funding_source' do
16
- subject { build(:solidus_paypal_braintree_source, :paypal) }
16
+ subject { build(:solidus_braintree_source, :paypal) }
17
17
 
18
18
  it 'can be nil' do
19
19
  subject.paypal_funding_source = nil
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe SolidusPaypalBraintree::TransactionAddress do
3
+ describe SolidusBraintree::TransactionAddress do
4
4
  describe "#valid?" do
5
5
  subject { address.valid? }
6
6