solidus_braintree 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +39 -8
- data/.gitignore +1 -0
- data/.rubocop.yml +8 -1
- data/CHANGELOG.md +37 -29
- data/Rakefile +6 -1
- data/app/assets/config/solidus_braintree_manifest.js +0 -1
- data/app/assets/javascripts/spree/backend/solidus_braintree.js +4 -4
- data/app/models/solidus_braintree/gateway.rb +4 -0
- data/app/models/solidus_braintree/response.rb +1 -1
- data/app/models/solidus_braintree/source.rb +5 -0
- data/bin/dummy-app +37 -0
- data/bin/rails-dummy-app +17 -0
- data/bin/rspec +11 -0
- data/bin/sandbox +20 -62
- data/db/migrate/20230210104310_add_device_data_to_braintree_sources.rb +5 -0
- data/lib/generators/solidus_braintree/install/install_generator.rb +134 -34
- data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/javascripts/spree/frontend/paypal_button.js +1 -1
- data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/ajax.js +13 -0
- data/{app/assets/javascripts → lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend}/solidus_braintree/apple_pay_button.js +2 -2
- data/{app/assets/javascripts → lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend}/solidus_braintree/checkout.js +10 -5
- data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/client.js +239 -0
- data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/constants.js +89 -0
- data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/frontend.js +15 -0
- data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/hosted_form.js +48 -0
- data/{app/assets/javascripts → lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend}/solidus_braintree/paypal_button.js +2 -2
- data/{app/assets/javascripts → lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend}/solidus_braintree/paypal_messaging.js +1 -1
- data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/promise.js +20 -0
- data/{app/assets/javascripts → lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend}/solidus_braintree/venmo_button.js +1 -1
- data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree.js +1 -0
- data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/stylesheets/spree/frontend/solidus_braintree.scss +11 -0
- data/lib/{controllers/frontend → generators/solidus_braintree/install/templates/app/controllers}/solidus_braintree/checkouts_controller.rb +1 -1
- data/lib/{controllers/frontend → generators/solidus_braintree/install/templates/app/controllers}/solidus_braintree/transactions_controller.rb +3 -3
- data/lib/generators/solidus_braintree/install/templates/app/views/checkouts/existing_payment/_braintree.html.erb +2 -0
- data/lib/{views/frontend/spree/checkout → generators/solidus_braintree/install/templates/app/views/checkouts}/payment/_braintree.html.erb +1 -1
- data/lib/{views/frontend/solidus_braintree/payments/_payment.html.erb → generators/solidus_braintree/install/templates/app/views/payments/_braintree_payment_details.html.erb} +0 -3
- data/{app → lib/generators/solidus_braintree/install/templates/app}/views/spree/shared/_apple_pay_button.html.erb +1 -1
- data/{app → lib/generators/solidus_braintree/install/templates/app}/views/spree/shared/_braintree_head_scripts.html.erb +1 -1
- data/{app → lib/generators/solidus_braintree/install/templates/app}/views/spree/shared/_braintree_hosted_fields.html.erb +1 -4
- data/lib/solidus_braintree/engine.rb +15 -10
- data/lib/solidus_braintree/version.rb +1 -1
- data/solidus_braintree.gemspec +3 -5
- data/spec/controllers/solidus_braintree/checkouts_controller_spec.rb +2 -2
- data/spec/controllers/solidus_braintree/client_tokens_controller_spec.rb +2 -2
- data/spec/controllers/solidus_braintree/configurations_controller_spec.rb +2 -2
- data/spec/controllers/solidus_braintree/transactions_controller_spec.rb +3 -3
- data/spec/fixtures/views/carts/_cart_footer.html.erb +18 -0
- data/spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb +1 -1
- data/spec/helpers/solidus_braintree/braintree_checkout_helper_spec.rb +1 -1
- data/spec/models/solidus_braintree/address_spec.rb +1 -1
- data/spec/models/solidus_braintree/avs_result_spec.rb +1 -1
- data/spec/models/solidus_braintree/gateway_spec.rb +35 -3
- data/spec/models/solidus_braintree/response_spec.rb +1 -1
- data/spec/models/solidus_braintree/source_spec.rb +17 -1
- data/spec/models/solidus_braintree/transaction_address_spec.rb +2 -2
- data/spec/models/solidus_braintree/transaction_import_spec.rb +2 -2
- data/spec/models/solidus_braintree/transaction_spec.rb +2 -2
- data/spec/models/spree/store_spec.rb +2 -2
- data/spec/requests/spree/api/orders_controller_spec.rb +2 -2
- data/spec/solidus_braintree_helper.rb +7 -0
- data/{lib/solidus_braintree/testing_support → spec/support/solidus_braintree}/factories.rb +17 -15
- data/spec/support/{order_ready_for_payment.rb → solidus_braintree/order_ready_for_payment.rb} +9 -2
- data/spec/support/solidus_braintree/order_walkthrough.rb +87 -0
- data/spec/support/solidus_braintree/with_prepended_view_fixtures.rb +19 -0
- data/spec/{features → system}/backend/configuration_spec.rb +2 -2
- data/spec/{features → system}/backend/new_payment_spec.rb +3 -4
- data/spec/{features → system}/frontend/braintree_credit_card_checkout_spec.rb +23 -15
- data/spec/{features → system}/frontend/paypal_checkout_spec.rb +6 -3
- data/spec/{features → system}/frontend/venmo_checkout_spec.rb +8 -9
- metadata +88 -107
- data/app/assets/javascripts/solidus_braintree/frontend.js +0 -14
- data/app/assets/javascripts/spree/frontend/solidus_braintree.js +0 -1
- data/app/decorators/controllers/solidus_braintree/checkout_controller_decorator.rb +0 -11
- data/app/decorators/controllers/solidus_braintree/orders_controller_decorator.rb +0 -11
- data/app/overrides/spree/payments/payment/add_paypal_funding_source_to_payment.rb +0 -9
- data/app/views/spree/checkout/existing_payment/_braintree.html.erb +0 -10
- data/spec/fixtures/views/spree/orders/edit.html.erb +0 -50
- data/spec/spec_helper.rb +0 -32
- data/spec/support/views.rb +0 -1
- /data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/client.js +0 -0
- /data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/constants.js +0 -0
- /data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/hosted_form.js +0 -0
- /data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/promise.js +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_active_blue_button_280x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_active_blue_button_320x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_active_blue_button_375x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_active_white_button_280x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_active_white_button_320x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_active_white_button_375x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_blue_acceptance_mark.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_blue_button_280x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_blue_button_320x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_blue_button_375x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_blue_logo.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_white_acceptance_mark.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_white_button_280x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_white_button_320x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_white_button_375x48.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/assets/images/solidus_braintree/venmo/venmo_white_logo.svg +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/helpers/solidus_braintree/braintree_checkout_helper.rb +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/views/spree/shared/_braintree_errors.html.erb +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/views/spree/shared/_paypal_cart_button.html.erb +0 -0
- /data/lib/{views/frontend → generators/solidus_braintree/install/templates/app/views}/spree/shared/_paypal_checkout_button.html.erb +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/views/spree/shared/_paypal_messaging.html.erb +0 -0
- /data/{app → lib/generators/solidus_braintree/install/templates/app}/views/spree/shared/_venmo_button.html.erb +0 -0
- /data/lib/generators/solidus_braintree/install/templates/{initializer.rb → config/initializers/solidus_braintree.rb} +0 -0
- /data/spec/support/{capybara.rb → solidus_braintree/capybara.rb} +0 -0
- /data/spec/support/{gateway_helpers.rb → solidus_braintree/gateway_helpers.rb} +0 -0
- /data/spec/support/{vcr.rb → solidus_braintree/vcr.rb} +0 -0
@@ -1,50 +0,0 @@
|
|
1
|
-
<!-- Modified cart view with PayPal button, from solidus_braintree -->
|
2
|
-
|
3
|
-
<% @body_id = 'cart' %>
|
4
|
-
<div data-hook="cart_container">
|
5
|
-
<h1><%= t('spree.shopping_cart') %></h1>
|
6
|
-
|
7
|
-
<% if @order.line_items.empty? %>
|
8
|
-
|
9
|
-
<div data-hook="empty_cart">
|
10
|
-
<p><%= t('spree.your_cart_is_empty') %></p>
|
11
|
-
<p><%= link_to t('spree.continue_shopping'), products_path, class: 'button continue' %></p>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<% else %>
|
15
|
-
|
16
|
-
<div data-hook="outside_cart_form">
|
17
|
-
<%= form_for @order, url: update_cart_path, html: {id: 'update-cart'} do |order_form| %>
|
18
|
-
<div data-hook="inside_cart_form">
|
19
|
-
|
20
|
-
<div data-hook="cart_items">
|
21
|
-
<%= render 'form', order_form: order_form %>
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<div class="links columns sixteen alpha omega" data-hook="cart_buttons">
|
25
|
-
<%= order_form.text_field :coupon_code, size: 10, placeholder: t('spree.coupon_code') %>
|
26
|
-
<%= button_tag class: 'primary', id: 'update-button' do %>
|
27
|
-
<%= t('spree.update') %>
|
28
|
-
<% end %>
|
29
|
-
<%= button_tag class: 'button checkout primary', id: 'checkout-link', name: 'checkout' do %>
|
30
|
-
<%= t('spree.checkout') %>
|
31
|
-
<% end %>
|
32
|
-
</div>
|
33
|
-
|
34
|
-
</div>
|
35
|
-
<% end %>
|
36
|
-
</div>
|
37
|
-
|
38
|
-
<div id="empty-cart" data-hook>
|
39
|
-
<%= form_tag empty_cart_path, method: :put do %>
|
40
|
-
<p id="clear_cart_link" data-hook>
|
41
|
-
<%= submit_tag t('spree.empty_cart'), class: 'button gray' %>
|
42
|
-
<%= t('spree.or') %>
|
43
|
-
<%= link_to t('spree.continue_shopping'), products_path, class: 'continue button gray' %>
|
44
|
-
</p>
|
45
|
-
<% end %>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<%= render "spree/shared/paypal_cart_button" %>
|
49
|
-
<% end %>
|
50
|
-
</div>
|
data/spec/spec_helper.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Configure Rails Environment
|
4
|
-
ENV['RAILS_ENV'] = 'test'
|
5
|
-
|
6
|
-
# Run Coverage report
|
7
|
-
require 'solidus_dev_support/rspec/coverage'
|
8
|
-
require 'rails-controller-testing'
|
9
|
-
|
10
|
-
# Create the dummy app if it's still missing.
|
11
|
-
dummy_env = "#{__dir__}/dummy/config/environment.rb"
|
12
|
-
system 'bin/rake extension:test_app' unless File.exist? dummy_env
|
13
|
-
require dummy_env
|
14
|
-
|
15
|
-
# Requires factories and other useful helpers defined in spree_core.
|
16
|
-
require 'solidus_dev_support/rspec/feature_helper'
|
17
|
-
|
18
|
-
# Requires supporting ruby files with custom matchers and macros, etc,
|
19
|
-
# in spec/support/ and its subdirectories.
|
20
|
-
Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }
|
21
|
-
|
22
|
-
# Requires factories defined in lib/solidus_braintree/testing_support/factories.rb
|
23
|
-
SolidusDevSupport::TestingSupport::Factories.load_for(SolidusBraintree::Engine)
|
24
|
-
|
25
|
-
RSpec.configure do |config|
|
26
|
-
config.infer_spec_type_from_file_location!
|
27
|
-
config.use_transactional_fixtures = false
|
28
|
-
|
29
|
-
if Spree.solidus_gem_version < Gem::Version.new('2.11')
|
30
|
-
config.extend Spree::TestingSupport::AuthorizationHelpers::Request, type: :system
|
31
|
-
end
|
32
|
-
end
|
data/spec/support/views.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ApplicationController.prepend_view_path "spec/fixtures/views"
|
/data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/client.js
RENAMED
File without changes
|
/data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/constants.js
RENAMED
File without changes
|
/data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/hosted_form.js
RENAMED
File without changes
|
/data/app/assets/javascripts/{solidus_braintree → spree/backend/solidus_braintree}/promise.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|