solidus_paypal_braintree 0.2.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +40 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +18 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +76 -0
  8. data/CHANGELOG.md +258 -0
  9. data/Gemfile +41 -0
  10. data/LICENSE +2 -2
  11. data/README.md +208 -48
  12. data/Rakefile +4 -28
  13. data/app/assets/config/solidus_paypal_braintree_manifest.js +1 -0
  14. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_280x48.svg +19 -0
  15. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_320x48.svg +19 -0
  16. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_375x48.svg +19 -0
  17. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_280x48.svg +19 -0
  18. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_320x48.svg +19 -0
  19. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_375x48.svg +19 -0
  20. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_acceptance_mark.svg +15 -0
  21. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_280x48.svg +19 -0
  22. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_320x48.svg +19 -0
  23. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_375x48.svg +19 -0
  24. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_logo.svg +18 -0
  25. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_acceptance_mark.svg +20 -0
  26. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_280x48.svg +19 -0
  27. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_320x48.svg +19 -0
  28. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_375x48.svg +19 -0
  29. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_logo.svg +18 -0
  30. data/app/assets/javascripts/solidus_paypal_braintree/checkout.js +32 -3
  31. data/app/assets/javascripts/solidus_paypal_braintree/client.js +58 -5
  32. data/app/assets/javascripts/solidus_paypal_braintree/constants.js +36 -5
  33. data/app/assets/javascripts/solidus_paypal_braintree/frontend.js +2 -0
  34. data/app/assets/javascripts/solidus_paypal_braintree/hosted_form.js +15 -5
  35. data/app/assets/javascripts/solidus_paypal_braintree/paypal_button.js +90 -26
  36. data/app/assets/javascripts/solidus_paypal_braintree/paypal_messaging.js +22 -0
  37. data/app/assets/javascripts/solidus_paypal_braintree/venmo_button.js +86 -0
  38. data/app/assets/javascripts/spree/backend/solidus_paypal_braintree.js +2 -2
  39. data/app/assets/javascripts/spree/frontend/paypal_button.js +15 -13
  40. data/app/assets/stylesheets/spree/frontend/solidus_paypal_braintree.css +12 -0
  41. data/app/decorators/controllers/solidus_paypal_braintree/admin_payments_controller_decorator.rb +11 -0
  42. data/app/decorators/controllers/solidus_paypal_braintree/checkout_controller_decorator.rb +11 -0
  43. data/app/decorators/controllers/solidus_paypal_braintree/client_tokens_controller.rb +41 -0
  44. data/app/decorators/controllers/solidus_paypal_braintree/orders_controller_decorator.rb +11 -0
  45. data/app/decorators/models/solidus_paypal_braintree/spree/store_decorator.rb +20 -0
  46. data/app/decorators/models/solidus_paypal_braintree/spree/user_decorator.rb +13 -0
  47. data/app/helpers/solidus_paypal_braintree/braintree_admin_helper.rb +23 -0
  48. data/app/helpers/solidus_paypal_braintree/braintree_checkout_helper.rb +60 -0
  49. data/app/models/application_record.rb +2 -0
  50. data/app/models/solidus_paypal_braintree/address.rb +64 -0
  51. data/app/models/solidus_paypal_braintree/avs_result.rb +69 -0
  52. data/app/models/solidus_paypal_braintree/configuration.rb +39 -3
  53. data/app/models/solidus_paypal_braintree/customer.rb +7 -3
  54. data/app/models/solidus_paypal_braintree/gateway.rb +150 -43
  55. data/app/models/solidus_paypal_braintree/response.rb +49 -21
  56. data/app/models/solidus_paypal_braintree/source.rb +70 -10
  57. data/app/models/solidus_paypal_braintree/transaction.rb +3 -2
  58. data/app/models/solidus_paypal_braintree/transaction_address.rb +36 -15
  59. data/app/models/solidus_paypal_braintree/transaction_import.rb +18 -12
  60. data/app/overrides/spree/payments/payment/add_paypal_funding_source_to_payment.rb +9 -0
  61. data/app/views/spree/api/payments/source_views/_paypal_braintree.json.jbuilder +3 -0
  62. data/app/views/spree/checkout/existing_payment/_paypal_braintree.html.erb +10 -0
  63. data/app/views/spree/shared/_apple_pay_button.html.erb +27 -0
  64. data/app/views/spree/shared/_braintree_errors.html.erb +16 -0
  65. data/app/views/spree/shared/_braintree_hosted_fields.html.erb +25 -8
  66. data/app/views/spree/shared/_paypal_braintree_head_scripts.html.erb +26 -0
  67. data/app/views/spree/shared/_paypal_cart_button.html.erb +38 -0
  68. data/app/views/spree/shared/_paypal_messaging.html.erb +13 -0
  69. data/app/views/spree/shared/_venmo_button.html.erb +33 -0
  70. data/bin/console +17 -0
  71. data/bin/rails +15 -0
  72. data/bin/setup +8 -0
  73. data/config/locales/en.yml +66 -0
  74. data/config/locales/it.yml +56 -0
  75. data/config/routes.rb +2 -0
  76. data/db/migrate/20160906201711_create_solidus_paypal_braintree_customers.rb +3 -1
  77. data/db/migrate/20161125172005_add_braintree_configuration_to_stores.rb +5 -7
  78. data/db/migrate/20170505193712_add_null_constraint_to_sources.rb +3 -1
  79. data/db/migrate/20190705115327_add_paypal_button_preferences_to_braintree_configurations.rb +5 -0
  80. data/db/migrate/20190911141712_add_3d_secure_to_braintree_configuration.rb +5 -0
  81. data/db/migrate/20211222170950_add_paypal_funding_source_to_solidus_paypal_braintree_sources.rb +5 -0
  82. data/db/migrate/20220104150301_add_venmo_to_braintree_configuration.rb +5 -0
  83. data/lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb +23 -5
  84. data/lib/controllers/frontend/solidus_paypal_braintree/checkouts_controller.rb +25 -21
  85. data/lib/controllers/frontend/solidus_paypal_braintree/transactions_controller.rb +56 -50
  86. data/lib/generators/solidus_paypal_braintree/install/install_generator.rb +7 -6
  87. data/lib/solidus_paypal_braintree/country_mapper.rb +4 -2
  88. data/lib/solidus_paypal_braintree/engine.rb +34 -22
  89. data/lib/solidus_paypal_braintree/factories.rb +41 -6
  90. data/lib/solidus_paypal_braintree/request_protection.rb +21 -0
  91. data/lib/solidus_paypal_braintree/version.rb +3 -1
  92. data/lib/solidus_paypal_braintree.rb +5 -1
  93. data/lib/views/backend/solidus_paypal_braintree/configurations/list.html.erb +38 -5
  94. data/lib/views/backend/spree/admin/payments/source_forms/_paypal_braintree.html.erb +2 -2
  95. data/lib/views/backend/spree/admin/payments/source_views/_paypal_braintree.html.erb +7 -2
  96. data/lib/views/backend/spree/admin/shared/preference_fields/_preference_select.html.erb +13 -0
  97. data/lib/views/backend_v1.2/spree/admin/payments/source_forms/_paypal_braintree.html.erb +2 -2
  98. data/lib/views/backend_v2.4/spree/admin/shared/preference_fields/_hash.html.erb +12 -0
  99. data/lib/views/frontend/solidus_paypal_braintree/payments/_payment.html.erb +12 -0
  100. data/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb +10 -77
  101. data/lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb +32 -0
  102. data/solidus_paypal_braintree.gemspec +43 -0
  103. data/spec/controllers/solidus_paypal_braintree/checkouts_controller_spec.rb +99 -0
  104. data/spec/controllers/solidus_paypal_braintree/client_tokens_controller_spec.rb +55 -0
  105. data/spec/controllers/solidus_paypal_braintree/configurations_controller_spec.rb +73 -0
  106. data/spec/controllers/solidus_paypal_braintree/transactions_controller_spec.rb +183 -0
  107. data/spec/features/backend/configuration_spec.rb +23 -0
  108. data/spec/features/backend/new_payment_spec.rb +137 -0
  109. data/spec/features/frontend/braintree_credit_card_checkout_spec.rb +191 -0
  110. data/spec/features/frontend/paypal_checkout_spec.rb +166 -0
  111. data/spec/features/frontend/venmo_checkout_spec.rb +189 -0
  112. data/spec/fixtures/cassettes/admin/invalid_credit_card.yml +63 -0
  113. data/spec/fixtures/cassettes/admin/resubmit_credit_card.yml +352 -0
  114. data/spec/fixtures/cassettes/admin/valid_credit_card.yml +412 -0
  115. data/spec/fixtures/cassettes/braintree/create_profile.yml +71 -0
  116. data/spec/fixtures/cassettes/braintree/generate_token.yml +63 -0
  117. data/spec/fixtures/cassettes/braintree/token.yml +63 -0
  118. data/spec/fixtures/cassettes/checkout/invalid_credit_card.yml +63 -0
  119. data/spec/fixtures/cassettes/checkout/resubmit_credit_card.yml +216 -0
  120. data/spec/fixtures/cassettes/checkout/update.yml +71 -0
  121. data/spec/fixtures/cassettes/checkout/valid_credit_card.yml +156 -0
  122. data/spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml +599 -0
  123. data/spec/fixtures/cassettes/gateway/authorize/credit_card/address.yml +86 -0
  124. data/spec/fixtures/cassettes/gateway/authorize/merchant_account/EUR.yml +154 -0
  125. data/spec/fixtures/cassettes/gateway/authorize/paypal/EUR.yml +90 -0
  126. data/spec/fixtures/cassettes/gateway/authorize/paypal/address.yml +90 -0
  127. data/spec/fixtures/cassettes/gateway/authorize.yml +86 -0
  128. data/spec/fixtures/cassettes/gateway/authorized_transaction.yml +73 -0
  129. data/spec/fixtures/cassettes/gateway/cancel/missing.yml +63 -0
  130. data/spec/fixtures/cassettes/gateway/cancel/refunds.yml +272 -0
  131. data/spec/fixtures/cassettes/gateway/cancel/void.yml +201 -0
  132. data/spec/fixtures/cassettes/gateway/capture.yml +141 -0
  133. data/spec/fixtures/cassettes/gateway/complete.yml +157 -0
  134. data/spec/fixtures/cassettes/gateway/credit.yml +208 -0
  135. data/spec/fixtures/cassettes/gateway/purchase.yml +87 -0
  136. data/spec/fixtures/cassettes/gateway/settled_transaction.yml +140 -0
  137. data/spec/fixtures/cassettes/gateway/void.yml +137 -0
  138. data/spec/fixtures/cassettes/source/card_type.yml +267 -0
  139. data/spec/fixtures/cassettes/source/last4.yml +267 -0
  140. data/spec/fixtures/cassettes/transaction/import/valid/capture.yml +224 -0
  141. data/spec/fixtures/cassettes/transaction/import/valid.yml +71 -0
  142. data/spec/fixtures/views/spree/orders/edit.html.erb +50 -0
  143. data/spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb +17 -0
  144. data/spec/helpers/solidus_paypal_braintree/braintree_checkout_helper_spec.rb +70 -0
  145. data/spec/models/solidus_paypal_braintree/address_spec.rb +71 -0
  146. data/spec/models/solidus_paypal_braintree/avs_result_spec.rb +317 -0
  147. data/spec/models/solidus_paypal_braintree/gateway_spec.rb +692 -0
  148. data/spec/models/solidus_paypal_braintree/response_spec.rb +280 -0
  149. data/spec/models/solidus_paypal_braintree/source_spec.rb +499 -0
  150. data/spec/models/solidus_paypal_braintree/transaction_address_spec.rb +235 -0
  151. data/spec/models/solidus_paypal_braintree/transaction_import_spec.rb +300 -0
  152. data/spec/models/solidus_paypal_braintree/transaction_spec.rb +85 -0
  153. data/spec/models/spree/store_spec.rb +14 -0
  154. data/spec/requests/spree/api/orders_controller_spec.rb +36 -0
  155. data/spec/spec_helper.rb +29 -0
  156. data/spec/support/capybara.rb +7 -0
  157. data/spec/support/factories.rb +2 -0
  158. data/spec/support/gateway_helpers.rb +29 -0
  159. data/spec/support/order_ready_for_payment.rb +37 -0
  160. data/spec/support/vcr.rb +42 -0
  161. data/spec/support/views.rb +1 -0
  162. metadata +226 -166
  163. data/app/controllers/solidus_paypal_braintree/client_tokens_controller.rb +0 -21
  164. data/app/helpers/braintree_admin_helper.rb +0 -18
  165. data/app/models/spree/store_decorator.rb +0 -11
  166. data/app/overrides/admin_navigation_menu.rb +0 -6
  167. data/config/initializers/braintree.rb +0 -1
  168. data/lib/views/backend/solidus_paypal_braintree/configurations/_admin_tab.html.erb +0 -3
@@ -0,0 +1,2 @@
1
+ # Requires factories defined in lib/solidus_paypal_braintree/factories.rb
2
+ require 'solidus_paypal_braintree/factories'
@@ -0,0 +1,29 @@
1
+ module SolidusPaypalBraintree
2
+ module GatewayHelpers
3
+ def new_gateway(opts = {})
4
+ SolidusPaypalBraintree::Gateway.new({
5
+ name: "Braintree",
6
+ preferences: {
7
+ environment: 'sandbox',
8
+ public_key: ENV.fetch('BRAINTREE_PUBLIC_KEY', 'dummy_public_key'),
9
+ private_key: ENV.fetch('BRAINTREE_PRIVATE_KEY', 'dummy_private_key'),
10
+ merchant_id: ENV.fetch('BRAINTREE_MERCHANT_ID', 'dummy_merchant_id'),
11
+ merchant_currency_map: {
12
+ 'EUR' => 'stembolt_EUR'
13
+ },
14
+ paypal_payee_email_map: {
15
+ 'EUR' => ENV.fetch('BRAINTREE_PAYPAL_PAYEE_EMAIL', 'paypal+europe@example.com')
16
+ }
17
+ }
18
+ }.merge(opts))
19
+ end
20
+
21
+ def create_gateway(opts = {})
22
+ new_gateway(opts).tap(&:save!)
23
+ end
24
+ end
25
+ end
26
+
27
+ RSpec.configure do |config|
28
+ config.include SolidusPaypalBraintree::GatewayHelpers
29
+ end
@@ -0,0 +1,37 @@
1
+ shared_context 'when order is ready for payment' do
2
+ let!(:country) { create :country }
3
+
4
+ let(:user) { create :user }
5
+ let(:address) { create :address, zipcode: "90210", lastname: "Doe", country: country }
6
+
7
+ before do
8
+ create :shipping_method, cost: 5
9
+ end
10
+
11
+ let(:gateway) do
12
+ new_gateway(auto_capture: true)
13
+ end
14
+
15
+ let(:order) do
16
+ order = Spree::Order.create!(
17
+ line_items: [create(:line_item, price: 50)],
18
+ email: 'test@example.com',
19
+ bill_address: address,
20
+ ship_address: address,
21
+ user: user
22
+ )
23
+ order.recalculate
24
+
25
+ expect(order.state).to eq "cart"
26
+
27
+ # push through cart, address and delivery
28
+ # its sadly unsafe to use any reasonable factory here accross
29
+ # supported solidus versions
30
+ order.next!
31
+ order.next!
32
+ order.next!
33
+
34
+ expect(order.state).to eq "payment"
35
+ order
36
+ end
37
+ end
@@ -0,0 +1,42 @@
1
+ require 'vcr'
2
+ require 'webmock'
3
+
4
+ VCR.configure do |c|
5
+ c.cassette_library_dir = "spec/fixtures/cassettes"
6
+ c.hook_into :webmock
7
+ c.configure_rspec_metadata!
8
+ c.default_cassette_options = {
9
+ match_requests_on: [:method, :uri, :body]
10
+ }
11
+ c.allow_http_connections_when_no_cassette = false
12
+ c.ignore_localhost = true
13
+ c.ignore_hosts 'chromedriver.storage.googleapis.com'
14
+
15
+ # client token used for the fronted JS lib cannot be mocked:
16
+ # it contains a cryptographically signed string containing the merchant id
17
+ # that's sent back to braintree's server by the JS lib
18
+ c.ignore_request do |request|
19
+ !(request.uri =~ %r{/merchants/\w+/client_token\z}).nil?
20
+ end
21
+
22
+ # match a request to Braintree sandbox APIs by ignoring the merchant ID
23
+ # in the request URI
24
+ c.register_request_matcher :braintree_uri do |request1, request2|
25
+ extract_url_resource = lambda do |uri|
26
+ uri_match_pattern =
27
+ %r{\Ahttps://api\.sandbox\.braintreegateway\.com/merchants/\w+(/.*)\z}
28
+
29
+ if match = uri.match(uri_match_pattern)
30
+ match.captures.first
31
+ end
32
+ end
33
+ r1_resource = extract_url_resource.call(request1.uri)
34
+ r2_resource = extract_url_resource.call(request2.uri)
35
+
36
+ !r1_resource.nil? && r1_resource == r2_resource
37
+ end
38
+
39
+ # https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock
40
+ driver_hosts = Webdrivers::Common.subclasses.map { |driver| URI(driver.base_url).host }
41
+ c.ignore_hosts(*driver_hosts)
42
+ end
@@ -0,0 +1 @@
1
+ ApplicationController.prepend_view_path "spec/fixtures/views"
metadata CHANGED
@@ -1,205 +1,105 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_paypal_braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stembolt
8
- autorequire:
9
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2022-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: solidus
14
+ name: activemerchant
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '3'
19
+ version: '1.48'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '1.0'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '3'
33
- - !ruby/object:Gem::Dependency
34
- name: solidus_support
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '0'
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - ">="
24
+ - - "~>"
45
25
  - !ruby/object:Gem::Version
46
- version: '0'
26
+ version: '1.48'
47
27
  - !ruby/object:Gem::Dependency
48
28
  name: braintree
49
29
  requirement: !ruby/object:Gem::Requirement
50
30
  requirements:
51
31
  - - "~>"
52
32
  - !ruby/object:Gem::Version
53
- version: '2.65'
33
+ version: '3.4'
54
34
  type: :runtime
55
35
  prerelease: false
56
36
  version_requirements: !ruby/object:Gem::Requirement
57
37
  requirements:
58
38
  - - "~>"
59
39
  - !ruby/object:Gem::Version
60
- version: '2.65'
61
- - !ruby/object:Gem::Dependency
62
- name: capybara
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '0'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- version: '0'
40
+ version: '3.4'
75
41
  - !ruby/object:Gem::Dependency
76
- name: capybara-screenshot
42
+ name: solidus_api
77
43
  requirement: !ruby/object:Gem::Requirement
78
44
  requirements:
79
45
  - - ">="
80
46
  - !ruby/object:Gem::Version
81
- version: '0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
- - !ruby/object:Gem::Dependency
90
- name: launchy
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
47
+ version: 2.0.0
48
+ - - "<"
94
49
  - !ruby/object:Gem::Version
95
- version: '0'
96
- type: :development
50
+ version: '4'
51
+ type: :runtime
97
52
  prerelease: false
98
53
  version_requirements: !ruby/object:Gem::Requirement
99
54
  requirements:
100
55
  - - ">="
101
56
  - !ruby/object:Gem::Version
102
- version: '0'
103
- - !ruby/object:Gem::Dependency
104
- name: poltergeist
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
57
+ version: 2.0.0
58
+ - - "<"
115
59
  - !ruby/object:Gem::Version
116
- version: '0'
60
+ version: '4'
117
61
  - !ruby/object:Gem::Dependency
118
- name: coffee-rails
62
+ name: solidus_core
119
63
  requirement: !ruby/object:Gem::Requirement
120
64
  requirements:
121
65
  - - ">="
122
66
  - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
- - !ruby/object:Gem::Dependency
132
- name: sass-rails
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - ">="
67
+ version: 2.0.0
68
+ - - "<"
136
69
  - !ruby/object:Gem::Version
137
- version: '0'
138
- type: :development
70
+ version: '4'
71
+ type: :runtime
139
72
  prerelease: false
140
73
  version_requirements: !ruby/object:Gem::Requirement
141
74
  requirements:
142
75
  - - ">="
143
76
  - !ruby/object:Gem::Version
144
- version: '0'
145
- - !ruby/object:Gem::Dependency
146
- name: database_cleaner
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - ">="
150
- - !ruby/object:Gem::Version
151
- version: '0'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - ">="
77
+ version: 2.0.0
78
+ - - "<"
157
79
  - !ruby/object:Gem::Version
158
- version: '0'
80
+ version: '4'
159
81
  - !ruby/object:Gem::Dependency
160
- name: factory_girl
82
+ name: solidus_support
161
83
  requirement: !ruby/object:Gem::Requirement
162
84
  requirements:
163
85
  - - ">="
164
86
  - !ruby/object:Gem::Version
165
- version: '0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: '0'
173
- - !ruby/object:Gem::Dependency
174
- name: rspec-rails
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - ">="
87
+ version: 0.8.1
88
+ - - "<"
178
89
  - !ruby/object:Gem::Version
179
- version: '0'
180
- type: :development
90
+ version: '1'
91
+ type: :runtime
181
92
  prerelease: false
182
93
  version_requirements: !ruby/object:Gem::Requirement
183
94
  requirements:
184
95
  - - ">="
185
96
  - !ruby/object:Gem::Version
186
- version: '0'
187
- - !ruby/object:Gem::Dependency
188
- name: rubocop
189
- requirement: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: '0.47'
194
- type: :development
195
- prerelease: false
196
- version_requirements: !ruby/object:Gem::Requirement
197
- requirements:
198
- - - ">="
97
+ version: 0.8.1
98
+ - - "<"
199
99
  - !ruby/object:Gem::Version
200
- version: '0.47'
100
+ version: '1'
201
101
  - !ruby/object:Gem::Dependency
202
- name: rubocop-rspec
102
+ name: selenium-webdriver
203
103
  requirement: !ruby/object:Gem::Requirement
204
104
  requirements:
205
105
  - - ">="
@@ -213,7 +113,7 @@ dependencies:
213
113
  - !ruby/object:Gem::Version
214
114
  version: '0'
215
115
  - !ruby/object:Gem::Dependency
216
- name: simplecov
116
+ name: solidus_dev_support
217
117
  requirement: !ruby/object:Gem::Requirement
218
118
  requirements:
219
119
  - - ">="
@@ -227,7 +127,7 @@ dependencies:
227
127
  - !ruby/object:Gem::Version
228
128
  version: '0'
229
129
  - !ruby/object:Gem::Dependency
230
- name: sqlite3
130
+ name: vcr
231
131
  requirement: !ruby/object:Gem::Requirement
232
132
  requirements:
233
133
  - - ">="
@@ -254,29 +154,40 @@ dependencies:
254
154
  - - ">="
255
155
  - !ruby/object:Gem::Version
256
156
  version: '0'
257
- - !ruby/object:Gem::Dependency
258
- name: vcr
259
- requirement: !ruby/object:Gem::Requirement
260
- requirements:
261
- - - ">="
262
- - !ruby/object:Gem::Version
263
- version: '0'
264
- type: :development
265
- prerelease: false
266
- version_requirements: !ruby/object:Gem::Requirement
267
- requirements:
268
- - - ">="
269
- - !ruby/object:Gem::Version
270
- version: '0'
271
157
  description: Uses the javascript API for seamless braintree payments
272
158
  email: braintree+gemfile@stembolt.com
273
159
  executables: []
274
160
  extensions: []
275
161
  extra_rdoc_files: []
276
162
  files:
163
+ - ".circleci/config.yml"
164
+ - ".gem_release.yml"
165
+ - ".github/stale.yml"
166
+ - ".gitignore"
167
+ - ".rspec"
168
+ - ".rubocop.yml"
169
+ - CHANGELOG.md
170
+ - Gemfile
277
171
  - LICENSE
278
172
  - README.md
279
173
  - Rakefile
174
+ - app/assets/config/solidus_paypal_braintree_manifest.js
175
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_280x48.svg
176
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_320x48.svg
177
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_375x48.svg
178
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_280x48.svg
179
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_320x48.svg
180
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_375x48.svg
181
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_acceptance_mark.svg
182
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_280x48.svg
183
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_320x48.svg
184
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_375x48.svg
185
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_logo.svg
186
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_white_acceptance_mark.svg
187
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_280x48.svg
188
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_320x48.svg
189
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_375x48.svg
190
+ - app/assets/images/solidus_paypal_braintree/venmo/venmo_white_logo.svg
280
191
  - app/assets/javascripts/solidus_paypal_braintree/apple_pay_button.js
281
192
  - app/assets/javascripts/solidus_paypal_braintree/checkout.js
282
193
  - app/assets/javascripts/solidus_paypal_braintree/client.js
@@ -284,15 +195,25 @@ files:
284
195
  - app/assets/javascripts/solidus_paypal_braintree/frontend.js
285
196
  - app/assets/javascripts/solidus_paypal_braintree/hosted_form.js
286
197
  - app/assets/javascripts/solidus_paypal_braintree/paypal_button.js
198
+ - app/assets/javascripts/solidus_paypal_braintree/paypal_messaging.js
287
199
  - app/assets/javascripts/solidus_paypal_braintree/promise.js
200
+ - app/assets/javascripts/solidus_paypal_braintree/venmo_button.js
288
201
  - app/assets/javascripts/spree/backend/solidus_paypal_braintree.js
289
202
  - app/assets/javascripts/spree/frontend/paypal_button.js
290
203
  - app/assets/javascripts/spree/frontend/solidus_paypal_braintree.js
291
204
  - app/assets/stylesheets/spree/backend/solidus_paypal_braintree.scss
292
205
  - app/assets/stylesheets/spree/frontend/solidus_paypal_braintree.css
293
- - app/controllers/solidus_paypal_braintree/client_tokens_controller.rb
294
- - app/helpers/braintree_admin_helper.rb
206
+ - app/decorators/controllers/solidus_paypal_braintree/admin_payments_controller_decorator.rb
207
+ - app/decorators/controllers/solidus_paypal_braintree/checkout_controller_decorator.rb
208
+ - app/decorators/controllers/solidus_paypal_braintree/client_tokens_controller.rb
209
+ - app/decorators/controllers/solidus_paypal_braintree/orders_controller_decorator.rb
210
+ - app/decorators/models/solidus_paypal_braintree/spree/store_decorator.rb
211
+ - app/decorators/models/solidus_paypal_braintree/spree/user_decorator.rb
212
+ - app/helpers/solidus_paypal_braintree/braintree_admin_helper.rb
213
+ - app/helpers/solidus_paypal_braintree/braintree_checkout_helper.rb
295
214
  - app/models/application_record.rb
215
+ - app/models/solidus_paypal_braintree/address.rb
216
+ - app/models/solidus_paypal_braintree/avs_result.rb
296
217
  - app/models/solidus_paypal_braintree/configuration.rb
297
218
  - app/models/solidus_paypal_braintree/customer.rb
298
219
  - app/models/solidus_paypal_braintree/gateway.rb
@@ -301,11 +222,21 @@ files:
301
222
  - app/models/solidus_paypal_braintree/transaction.rb
302
223
  - app/models/solidus_paypal_braintree/transaction_address.rb
303
224
  - app/models/solidus_paypal_braintree/transaction_import.rb
304
- - app/models/spree/store_decorator.rb
305
- - app/overrides/admin_navigation_menu.rb
225
+ - app/overrides/spree/payments/payment/add_paypal_funding_source_to_payment.rb
226
+ - app/views/spree/api/payments/source_views/_paypal_braintree.json.jbuilder
227
+ - app/views/spree/checkout/existing_payment/_paypal_braintree.html.erb
228
+ - app/views/spree/shared/_apple_pay_button.html.erb
229
+ - app/views/spree/shared/_braintree_errors.html.erb
306
230
  - app/views/spree/shared/_braintree_hosted_fields.html.erb
307
- - config/initializers/braintree.rb
231
+ - app/views/spree/shared/_paypal_braintree_head_scripts.html.erb
232
+ - app/views/spree/shared/_paypal_cart_button.html.erb
233
+ - app/views/spree/shared/_paypal_messaging.html.erb
234
+ - app/views/spree/shared/_venmo_button.html.erb
235
+ - bin/console
236
+ - bin/rails
237
+ - bin/setup
308
238
  - config/locales/en.yml
239
+ - config/locales/it.yml
309
240
  - config/routes.rb
310
241
  - db/migrate/20160830061749_create_solidus_paypal_braintree_sources.rb
311
242
  - db/migrate/20160906201711_create_solidus_paypal_braintree_customers.rb
@@ -314,6 +245,10 @@ files:
314
245
  - db/migrate/20170203191030_add_credit_card_to_braintree_configuration.rb
315
246
  - db/migrate/20170505193712_add_null_constraint_to_sources.rb
316
247
  - db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb
248
+ - db/migrate/20190705115327_add_paypal_button_preferences_to_braintree_configurations.rb
249
+ - db/migrate/20190911141712_add_3d_secure_to_braintree_configuration.rb
250
+ - db/migrate/20211222170950_add_paypal_funding_source_to_solidus_paypal_braintree_sources.rb
251
+ - db/migrate/20220104150301_add_venmo_to_braintree_configuration.rb
317
252
  - lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb
318
253
  - lib/controllers/frontend/solidus_paypal_braintree/checkouts_controller.rb
319
254
  - lib/controllers/frontend/solidus_paypal_braintree/transactions_controller.rb
@@ -322,18 +257,85 @@ files:
322
257
  - lib/solidus_paypal_braintree/country_mapper.rb
323
258
  - lib/solidus_paypal_braintree/engine.rb
324
259
  - lib/solidus_paypal_braintree/factories.rb
260
+ - lib/solidus_paypal_braintree/request_protection.rb
325
261
  - lib/solidus_paypal_braintree/version.rb
326
- - lib/views/backend/solidus_paypal_braintree/configurations/_admin_tab.html.erb
327
262
  - lib/views/backend/solidus_paypal_braintree/configurations/list.html.erb
328
263
  - lib/views/backend/spree/admin/payments/source_forms/_paypal_braintree.html.erb
329
264
  - lib/views/backend/spree/admin/payments/source_views/_paypal_braintree.html.erb
265
+ - lib/views/backend/spree/admin/shared/preference_fields/_preference_select.html.erb
330
266
  - lib/views/backend_v1.2/spree/admin/payments/source_forms/_paypal_braintree.html.erb
267
+ - lib/views/backend_v2.4/spree/admin/shared/preference_fields/_hash.html.erb
268
+ - lib/views/frontend/solidus_paypal_braintree/payments/_payment.html.erb
331
269
  - lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb
332
- homepage: https://stembolt.com
270
+ - lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb
271
+ - solidus_paypal_braintree.gemspec
272
+ - spec/controllers/solidus_paypal_braintree/checkouts_controller_spec.rb
273
+ - spec/controllers/solidus_paypal_braintree/client_tokens_controller_spec.rb
274
+ - spec/controllers/solidus_paypal_braintree/configurations_controller_spec.rb
275
+ - spec/controllers/solidus_paypal_braintree/transactions_controller_spec.rb
276
+ - spec/features/backend/configuration_spec.rb
277
+ - spec/features/backend/new_payment_spec.rb
278
+ - spec/features/frontend/braintree_credit_card_checkout_spec.rb
279
+ - spec/features/frontend/paypal_checkout_spec.rb
280
+ - spec/features/frontend/venmo_checkout_spec.rb
281
+ - spec/fixtures/cassettes/admin/invalid_credit_card.yml
282
+ - spec/fixtures/cassettes/admin/resubmit_credit_card.yml
283
+ - spec/fixtures/cassettes/admin/valid_credit_card.yml
284
+ - spec/fixtures/cassettes/braintree/create_profile.yml
285
+ - spec/fixtures/cassettes/braintree/generate_token.yml
286
+ - spec/fixtures/cassettes/braintree/token.yml
287
+ - spec/fixtures/cassettes/checkout/invalid_credit_card.yml
288
+ - spec/fixtures/cassettes/checkout/resubmit_credit_card.yml
289
+ - spec/fixtures/cassettes/checkout/update.yml
290
+ - spec/fixtures/cassettes/checkout/valid_credit_card.yml
291
+ - spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml
292
+ - spec/fixtures/cassettes/gateway/authorize.yml
293
+ - spec/fixtures/cassettes/gateway/authorize/credit_card/address.yml
294
+ - spec/fixtures/cassettes/gateway/authorize/merchant_account/EUR.yml
295
+ - spec/fixtures/cassettes/gateway/authorize/paypal/EUR.yml
296
+ - spec/fixtures/cassettes/gateway/authorize/paypal/address.yml
297
+ - spec/fixtures/cassettes/gateway/authorized_transaction.yml
298
+ - spec/fixtures/cassettes/gateway/cancel/missing.yml
299
+ - spec/fixtures/cassettes/gateway/cancel/refunds.yml
300
+ - spec/fixtures/cassettes/gateway/cancel/void.yml
301
+ - spec/fixtures/cassettes/gateway/capture.yml
302
+ - spec/fixtures/cassettes/gateway/complete.yml
303
+ - spec/fixtures/cassettes/gateway/credit.yml
304
+ - spec/fixtures/cassettes/gateway/purchase.yml
305
+ - spec/fixtures/cassettes/gateway/settled_transaction.yml
306
+ - spec/fixtures/cassettes/gateway/void.yml
307
+ - spec/fixtures/cassettes/source/card_type.yml
308
+ - spec/fixtures/cassettes/source/last4.yml
309
+ - spec/fixtures/cassettes/transaction/import/valid.yml
310
+ - spec/fixtures/cassettes/transaction/import/valid/capture.yml
311
+ - spec/fixtures/views/spree/orders/edit.html.erb
312
+ - spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb
313
+ - spec/helpers/solidus_paypal_braintree/braintree_checkout_helper_spec.rb
314
+ - spec/models/solidus_paypal_braintree/address_spec.rb
315
+ - spec/models/solidus_paypal_braintree/avs_result_spec.rb
316
+ - spec/models/solidus_paypal_braintree/gateway_spec.rb
317
+ - spec/models/solidus_paypal_braintree/response_spec.rb
318
+ - spec/models/solidus_paypal_braintree/source_spec.rb
319
+ - spec/models/solidus_paypal_braintree/transaction_address_spec.rb
320
+ - spec/models/solidus_paypal_braintree/transaction_import_spec.rb
321
+ - spec/models/solidus_paypal_braintree/transaction_spec.rb
322
+ - spec/models/spree/store_spec.rb
323
+ - spec/requests/spree/api/orders_controller_spec.rb
324
+ - spec/spec_helper.rb
325
+ - spec/support/capybara.rb
326
+ - spec/support/factories.rb
327
+ - spec/support/gateway_helpers.rb
328
+ - spec/support/order_ready_for_payment.rb
329
+ - spec/support/vcr.rb
330
+ - spec/support/views.rb
331
+ homepage: https://github.com/solidusio/solidus_paypal_braintree
333
332
  licenses:
334
333
  - BSD-3-Clause
335
- metadata: {}
336
- post_install_message:
334
+ metadata:
335
+ homepage_uri: https://github.com/solidusio/solidus_paypal_braintree
336
+ source_code_uri: https://github.com/solidusio/solidus_paypal_braintree
337
+ rubygems_mfa_required: 'true'
338
+ post_install_message:
337
339
  rdoc_options: []
338
340
  require_paths:
339
341
  - lib
@@ -341,16 +343,74 @@ required_ruby_version: !ruby/object:Gem::Requirement
341
343
  requirements:
342
344
  - - ">="
343
345
  - !ruby/object:Gem::Version
344
- version: '0'
346
+ version: '2.5'
345
347
  required_rubygems_version: !ruby/object:Gem::Requirement
346
348
  requirements:
347
349
  - - ">="
348
350
  - !ruby/object:Gem::Version
349
351
  version: '0'
350
352
  requirements: []
351
- rubyforge_project:
352
- rubygems_version: 2.6.11
353
- signing_key:
353
+ rubygems_version: 3.2.20
354
+ signing_key:
354
355
  specification_version: 4
355
356
  summary: Officially supported Paypal/Braintree extension
356
- test_files: []
357
+ test_files:
358
+ - spec/spec_helper.rb
359
+ - spec/features/frontend/venmo_checkout_spec.rb
360
+ - spec/features/frontend/braintree_credit_card_checkout_spec.rb
361
+ - spec/features/frontend/paypal_checkout_spec.rb
362
+ - spec/features/backend/configuration_spec.rb
363
+ - spec/features/backend/new_payment_spec.rb
364
+ - spec/models/solidus_paypal_braintree/transaction_import_spec.rb
365
+ - spec/models/solidus_paypal_braintree/gateway_spec.rb
366
+ - spec/models/solidus_paypal_braintree/transaction_address_spec.rb
367
+ - spec/models/solidus_paypal_braintree/transaction_spec.rb
368
+ - spec/models/solidus_paypal_braintree/source_spec.rb
369
+ - spec/models/solidus_paypal_braintree/avs_result_spec.rb
370
+ - spec/models/solidus_paypal_braintree/response_spec.rb
371
+ - spec/models/solidus_paypal_braintree/address_spec.rb
372
+ - spec/models/spree/store_spec.rb
373
+ - spec/requests/spree/api/orders_controller_spec.rb
374
+ - spec/support/capybara.rb
375
+ - spec/support/views.rb
376
+ - spec/support/vcr.rb
377
+ - spec/support/gateway_helpers.rb
378
+ - spec/support/factories.rb
379
+ - spec/support/order_ready_for_payment.rb
380
+ - spec/fixtures/cassettes/transaction/import/valid.yml
381
+ - spec/fixtures/cassettes/transaction/import/valid/capture.yml
382
+ - spec/fixtures/cassettes/braintree/create_profile.yml
383
+ - spec/fixtures/cassettes/braintree/generate_token.yml
384
+ - spec/fixtures/cassettes/braintree/token.yml
385
+ - spec/fixtures/cassettes/source/last4.yml
386
+ - spec/fixtures/cassettes/source/card_type.yml
387
+ - spec/fixtures/cassettes/admin/valid_credit_card.yml
388
+ - spec/fixtures/cassettes/admin/invalid_credit_card.yml
389
+ - spec/fixtures/cassettes/admin/resubmit_credit_card.yml
390
+ - spec/fixtures/cassettes/checkout/valid_credit_card.yml
391
+ - spec/fixtures/cassettes/checkout/invalid_credit_card.yml
392
+ - spec/fixtures/cassettes/checkout/update.yml
393
+ - spec/fixtures/cassettes/checkout/resubmit_credit_card.yml
394
+ - spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml
395
+ - spec/fixtures/cassettes/gateway/cancel/missing.yml
396
+ - spec/fixtures/cassettes/gateway/cancel/refunds.yml
397
+ - spec/fixtures/cassettes/gateway/cancel/void.yml
398
+ - spec/fixtures/cassettes/gateway/capture.yml
399
+ - spec/fixtures/cassettes/gateway/settled_transaction.yml
400
+ - spec/fixtures/cassettes/gateway/authorized_transaction.yml
401
+ - spec/fixtures/cassettes/gateway/void.yml
402
+ - spec/fixtures/cassettes/gateway/credit.yml
403
+ - spec/fixtures/cassettes/gateway/authorize.yml
404
+ - spec/fixtures/cassettes/gateway/authorize/credit_card/address.yml
405
+ - spec/fixtures/cassettes/gateway/authorize/paypal/EUR.yml
406
+ - spec/fixtures/cassettes/gateway/authorize/paypal/address.yml
407
+ - spec/fixtures/cassettes/gateway/authorize/merchant_account/EUR.yml
408
+ - spec/fixtures/cassettes/gateway/complete.yml
409
+ - spec/fixtures/cassettes/gateway/purchase.yml
410
+ - spec/fixtures/views/spree/orders/edit.html.erb
411
+ - spec/controllers/solidus_paypal_braintree/configurations_controller_spec.rb
412
+ - spec/controllers/solidus_paypal_braintree/transactions_controller_spec.rb
413
+ - spec/controllers/solidus_paypal_braintree/client_tokens_controller_spec.rb
414
+ - spec/controllers/solidus_paypal_braintree/checkouts_controller_spec.rb
415
+ - spec/helpers/solidus_paypal_braintree/braintree_admin_helper_spec.rb
416
+ - spec/helpers/solidus_paypal_braintree/braintree_checkout_helper_spec.rb