The current implementation of the FDC is not adhering to the DFC
standard. The difference is added in this compatibility layer.
This should be temporary code. The FDC dev team should change their API
in their next development cycle.
And also STRIPE_ENDPOINT_SECRET just in case it's ever used in tests.
Re-records Stripe tests. But some failed... :'(
Failed examples:
rspec ./spec/lib/stripe/credit_card_cloner_spec.rb:71 # Stripe::CreditCardCloner#find_or_clone when called with a valid customer and payment_method clones both the payment method and the customer
rspec ./spec/lib/stripe/payment_intent_validator_spec.rb[1:1:1:1:17:1:2] # Stripe::PaymentIntentValidator#call when payment intent is valid valid non-3D credit cards are correctly handled behaves like payments intents from UnionPay (debit) captures the payment
Inspecting 1483 files
..............................................................................................................................................................C.............................................................................................................................................................................CC.............................................................................................................................................................................C.................................................................................................................................................................................................................................................................................................................................................................C.................................................................................C..............................................................................................................................................................................................C.....................................................................................................................................................................................................................................C......................................................................................................................
Offenses:
app/helpers/discourse_helper.rb:9:5: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch('DISCOURSE_URL') or ENV.fetch('DISCOURSE_URL', nil) instead of ENV['DISCOURSE_URL'].
ENV['DISCOURSE_URL']
^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/configuration.rb:35:10: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch('RAILS_CACHE_ID') or ENV.fetch('RAILS_CACHE_ID', nil) instead of ENV['RAILS_CACHE_ID'].
[ENV['RAILS_CACHE_ID'], self.class.name, name].flatten.join('::').underscore
^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable.rb:84:10: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch("RAILS_CACHE_ID") or ENV.fetch("RAILS_CACHE_ID", nil) instead of ENV["RAILS_CACHE_ID"].
[ENV["RAILS_CACHE_ID"], self.class.name, name, id].join('::').underscore
^^^^^^^^^^^^^^^^^^^^^
app/services/default_country.rb:13:40: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch("DEFAULT_COUNTRY_CODE") or ENV.fetch("DEFAULT_COUNTRY_CODE", nil) instead of ENV["DEFAULT_COUNTRY_CODE"].
Spree::Country.cached_find_by(iso: ENV["DEFAULT_COUNTRY_CODE"]) || Spree::Country.first
^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/default_country.rb:13:73: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
Spree::Country.cached_find_by(iso: ENV.fetch("DEFAULT_COUNTRY_CODE",
^
app/services/default_country.rb:13:101: C: [Corrected] Layout/LineLength: Line is too long. [102/100]
Spree::Country.cached_find_by(iso: ENV.fetch("DEFAULT_COUNTRY_CODE", nil)) || Spree::Country.first
^^
app/services/default_country.rb:14:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
nil)) || Spree::Country.first
^^^
spec/base_spec_helper.rb:51:49: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch("SITE_URL") or ENV.fetch("SITE_URL", nil) instead of ENV["SITE_URL"].
ActionMailer::Base.default_url_options[:host] = ENV["SITE_URL"]
^^^^^^^^^^^^^^^
spec/controllers/spree/credit_cards_controller_spec.rb:8:20: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch('STRIPE_SECRET_TEST_API_KEY') or ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) instead of ENV['STRIPE_SECRET_TEST_API_KEY'].
let(:secret) { ENV['STRIPE_SECRET_TEST_API_KEY'] }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/order_balance_spec.rb:48:70: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
expect(order_balance.display_amount).to eq(Spree::Money.new(20,
^
spec/models/order_balance_spec.rb:48:81: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch('currency') or ENV.fetch('currency', nil) instead of ENV['currency'].
expect(order_balance.display_amount).to eq(Spree::Money.new(20, currency: ENV['currency']))
^^^^^^^^^^^^^^^
spec/models/order_balance_spec.rb:48:101: C: [Corrected] Layout/LineLength: Line is too long. [108/100]
expect(order_balance.display_amount).to eq(Spree::Money.new(20, currency: ENV.fetch('currency', nil)))
^^^^^^^^
spec/models/order_balance_spec.rb:49:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
currency: ENV.fetch('currency', nil)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/order_balance_spec.rb:49:98: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
currency: ENV.fetch('currency',
^
spec/models/order_balance_spec.rb:49:101: C: [Corrected] Layout/LineLength: Line is too long. [104/100]
currency: ENV.fetch('currency', nil)))
^^^^
spec/models/order_balance_spec.rb:50:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
nil)))
^^^
spec/support/vcr_setup.rb:10:50: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch('STRIPE_SECRET_TEST_API_KEY') or ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) instead of ENV['STRIPE_SECRET_TEST_API_KEY'].
config.filter_sensitive_data('<HIDDEN_KEY>') { ENV['STRIPE_SECRET_TEST_API_KEY'] }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/support/vcr_setup.rb:11:55: C: [Corrected] Style/FetchEnvVar: Use ENV.fetch('STRIPE_CUSTOMER') or ENV.fetch('STRIPE_CUSTOMER', nil) instead of ENV['STRIPE_CUSTOMER'].
config.filter_sensitive_data('<HIDDEN_CUSTOMER>') { ENV['STRIPE_CUSTOMER'] }
^^^^^^^^^^^^^^^^^^^^^^
1483 files inspected, 18 offenses detected, 18 offenses corrected