Permalink
Browse files

remove stripe featureflag

  • Loading branch information...
valdis committed Oct 12, 2017
1 parent 78cb4dd commit 73774c36f7110200a50b5cd5675cb1e8fa9220aa
Showing with 110 additions and 768 deletions.
  1. +0 −1 app/controllers/admin/getting_started_guide_controller.rb
  2. +3 −4 app/controllers/admin/payment_preferences_controller.rb
  3. +2 −2 app/controllers/int_api/marketplaces_controller.rb
  4. +1 −1 app/helpers/application_helper.rb
  5. +1 −6 app/jobs/create_member_email_batch_job.rb
  6. +1 −1 app/view_utils/paypal_helper.rb
  7. +2 −13 app/view_utils/stripe_helper.rb
  8. +1 −5 app/views/accept_preauthorized_conversations/accept.haml
  9. +0 −114 app/views/admin/payment_preferences/_old_paypal_index.haml
  10. 0 app/views/admin/payment_preferences/{_stripe_available.haml → _payment_settings.haml}
  11. +6 −17 app/views/admin/payment_preferences/index.haml
  12. +0 −23 app/views/listing_conversations/_paypal_payment_methods.haml
  13. +5 −13 app/views/listing_conversations/initiate.haml
  14. +1 −4 app/views/listings/_listing_actions.haml
  15. +4 −16 app/views/listings/form/_price.haml
  16. +4 −11 app/views/payment_settings/_paypal_wizard.haml
  17. +25 −35 client/app/components/sections/OnboardingGuide/GuidePaypalPage.js
  18. +0 −2 client/app/components/sections/OnboardingGuide/OnboardingGuide.js
  19. +0 −7 config/locales/ab.yml
  20. +2 −9 config/locales/ar.yml
  21. +0 −7 config/locales/bg.yml
  22. +0 −7 config/locales/bn-BD.yml
  23. +0 −7 config/locales/ca.yml
  24. +1 −10 config/locales/cs.yml
  25. +1 −8 config/locales/da-DK.yml
  26. +1 −10 config/locales/de.yml
  27. +0 −7 config/locales/el.yml
  28. +0 −7 config/locales/en-AU.yml
  29. +0 −7 config/locales/en-GB.yml
  30. +0 −7 config/locales/en-NZ.yml
  31. +2 −14 config/locales/en.yml
  32. +1 −10 config/locales/es-ES.yml
  33. +0 −7 config/locales/es.yml
  34. +0 −7 config/locales/et.yml
  35. +0 −7 config/locales/eu-ES.yml
  36. +1 −12 config/locales/fi.yml
  37. +1 −10 config/locales/fr-CA.yml
  38. +0 −11 config/locales/fr.yml
  39. +0 −7 config/locales/he-IL.yml
  40. +0 −7 config/locales/hi-IN.yml
  41. +0 −7 config/locales/hr.yml
  42. +5 −12 config/locales/hu.yml
  43. +0 −7 config/locales/hy-AM.yml
  44. +0 −7 config/locales/id.yml
  45. +0 −7 config/locales/is.yml
  46. +1 −10 config/locales/it.yml
  47. +1 −10 config/locales/ja.yml
  48. +1 −8 config/locales/ka.yml
  49. +0 −7 config/locales/km-KH.yml
  50. +0 −7 config/locales/lv.yml
  51. +0 −7 config/locales/mn.yml
  52. +0 −7 config/locales/ms-MY.yml
  53. +1 −8 config/locales/nb.yml
  54. +4 −13 config/locales/nl.yml
  55. +2 −3 config/locales/onboarding/de.yml
  56. +2 −3 config/locales/onboarding/en.yml
  57. +2 −3 config/locales/onboarding/es-ES.yml
  58. +2 −3 config/locales/onboarding/fi.yml
  59. +2 −3 config/locales/onboarding/fr.yml
  60. +2 −3 config/locales/onboarding/nl.yml
  61. +1 −10 config/locales/pl.yml
  62. +1 −10 config/locales/pt-BR.yml
  63. +0 −7 config/locales/pt-PT.yml
  64. +0 −7 config/locales/ro.yml
  65. +1 −8 config/locales/ru.yml
  66. +3 −12 config/locales/sk-SK.yml
  67. +0 −7 config/locales/sl.yml
  68. +0 −7 config/locales/sq-AL.yml
  69. +0 −7 config/locales/sr.yml
  70. +4 −15 config/locales/sv.yml
  71. +0 −7 config/locales/sw.yml
  72. +0 −7 config/locales/ta-IN.yml
  73. +1 −10 config/locales/th-TH.yml
  74. +0 −7 config/locales/ti.yml
  75. +2 −12 config/locales/tr-TR.yml
  76. +0 −7 config/locales/uk.yml
  77. +1 −10 config/locales/vi.yml
  78. +0 −7 config/locales/zh-HK.yml
  79. +1 −10 config/locales/zh-TW.yml
  80. +3 −12 config/locales/zh.yml
  81. +1 −1 features/support/feature_tests/page/admin_paypal_preferences.rb
@@ -63,7 +63,6 @@ def data(page:)
onboarding_data: sorted_steps,
name: PersonViewUtils.person_display_name(@current_user, @current_community),
info_icon: icon_tag("information"),
stripe_enabled: FeatureFlagHelper.feature_enabled?(:stripe),
}
}
end
@@ -8,7 +8,7 @@ def index
more_locals.merge!(paypal_index)
end
if @stripe_available || @stripe_enabled
if @stripe_enabled
more_locals.merge!(stripe_index)
end
@@ -35,7 +35,7 @@ def index
def update
if params[:payment_preferences_form].present?
update_payment_preferences
elsif params[:stripe_api_keys_form].present? && @stripe_available
elsif params[:stripe_api_keys_form].present?
update_stripe_keys
end
@@ -49,7 +49,6 @@ def update
def ensure_payments_enabled
@paypal_enabled = PaypalHelper.paypal_active?(@current_community.id)
@stripe_available = StripeHelper.stripe_feature_enabled?(@current_community.id)
@stripe_enabled = StripeHelper.stripe_provisioned?(@current_community.id)
unless @paypal_enabled || @stripe_enabled
flash[:error] = t("admin.communities.settings.payments_not_enabled")
@@ -135,7 +134,7 @@ def build_view_locals
display_knowledge_base_articles: APP_CONFIG.display_knowledge_base_articles,
knowledge_base_url: APP_CONFIG.knowledge_base_url,
support_email: APP_CONFIG.support_email,
stripe_enabled: @stripe_enabled || @stripe_available,
stripe_enabled: @stripe_enabled,
paypal_enabled: @paypal_enabled,
stripe_account: nil,
paypal_account: nil,
@@ -59,8 +59,8 @@ def create
url = URLUtils.append_query_param(url, "auth", auth_token[:token])
# Enable specific features for all new trials
FeatureFlagService::API::Api.features.enable(community_id: marketplace[:id], person_id: user[:id], features: [:topbar_v1, :stripe])
FeatureFlagService::API::Api.features.enable(community_id: marketplace[:id], features: [:topbar_v1, :stripe])
FeatureFlagService::API::Api.features.enable(community_id: marketplace[:id], person_id: user[:id], features: [:topbar_v1])
FeatureFlagService::API::Api.features.enable(community_id: marketplace[:id], features: [:topbar_v1])
# TODO handle error cases with proper response
@@ -444,7 +444,7 @@ def admin_links_for(community)
:name => "listing_shapes"
}
if PaypalHelper.paypal_active?(@current_community.id) || StripeHelper.stripe_feature_enabled?(@current_community.id)
if PaypalHelper.paypal_active?(@current_community.id) || StripeHelper.stripe_provisioned?(@current_community.id)
links << {
:topic => :configure,
:text => t("admin.communities.settings.payment_preferences"),
@@ -35,12 +35,7 @@ def matches_mode?(mode, community, recipient)
paypal_ready = PaypalHelper.user_and_community_ready_for_payments?(recipient.id, community.id)
# TODO: remove rescue after merge with stripe-integration
begin
stripe_ready = StripeHelper.user_and_community_ready_for_payments?(recipient.id, community.id)
rescue
stripe_mode = nil
end
stripe_ready = StripeHelper.user_and_community_ready_for_payments?(recipient.id, community.id)
case mode
when 'with_listing'
@@ -60,7 +60,7 @@ def paypal_active?(community_id)
.map { |result| result[:data] }
.or_else(nil)
return settings && settings[:active] && settings[:payment_gateway] == :paypal
return settings && settings[:active]
end
@@ -5,7 +5,6 @@ module StripeHelper
module_function
def community_ready_for_payments?(community_id)
return false unless stripe_feature_enabled?(community_id)
stripe_active?(community_id) &&
Maybe(TxApi.settings.get(community_id: community_id, payment_gateway: :stripe, payment_process: :preauthorize))
.map {|res| res[:success] ? res[:data] : nil}
@@ -15,17 +14,15 @@ def community_ready_for_payments?(community_id)
end
def stripe_active?(community_id)
return false unless stripe_feature_enabled?(community_id)
active_settings = Maybe(TxApi.settings.get(community_id: community_id, payment_gateway: :stripe, payment_process: :preauthorize))
settings = Maybe(TxApi.settings.get(community_id: community_id, payment_gateway: :stripe, payment_process: :preauthorize))
.select { |result| result[:success] }
.map { |result| result[:data] }
.or_else(nil)
return active_settings && active_settings[:active] && active_settings[:api_verified]
return settings && settings[:active] && settings[:api_verified]
end
def stripe_provisioned?(community_id)
return false unless stripe_feature_enabled?(community_id)
settings = Maybe(TxApi.settings.get(
community_id: community_id,
payment_gateway: :stripe,
@@ -59,12 +56,4 @@ def open_listings_with_missing_payment_info?(user_id, community_id)
!user_and_community_ready_for_payments?(user_id, community_id) &&
PaymentHelper.open_listings_with_payment_process?(community_id, user_id)
end
# We are not using FeatureFlagHelper.feature_enabled?(:stripe) here,
# the reason is that method Community#payments_in_use? uses MarketplaceService::Community::Query.payment_type which calls StripeHelper.stripe_active?
# and it can be invoked in context where FeatureFlagHelper is not initialized, like from PersonMailer
def stripe_feature_enabled?(community_id)
features = FeatureFlagService::API::Api.features.get_for_community(community_id: community_id).maybe[:features].or_else(Set.new)
features.include?(:stripe)
end
end
@@ -86,7 +86,6 @@
%span.conversation-stripe-fee-value
= "-#{MoneyViewUtils.to_humanized(gateway_fee)}"
.conversation-total-wrapper
%span.conversation-total-label
= t("conversations.accept.total_label")
@@ -108,10 +107,7 @@
%h2= t("common.paypal_fee_info.title")
- text_with_line_breaks_html_safe do
- link_to_paypal = link_to(t("common.paypal_fee_info.link_to_paypal_text"), paypal_fees_url, target: "_blank")
- if FeatureFlagHelper.feature_enabled?(:stripe)
= t("common.paypal_fee_info_new.body_text_accept", link_to_paypal: link_to_paypal, paypal_commission: paypal_commission).html_safe
- else
= t("common.paypal_fee_info.body_text", link_to_paypal: link_to_paypal, paypal_commission: paypal_commission).html_safe
= t("common.paypal_fee_info.body_text_accept", link_to_paypal: link_to_paypal, paypal_commission: paypal_commission).html_safe
- content_for :extra_javascript do
:javascript

This file was deleted.

Oops, something went wrong.
@@ -1,20 +1,9 @@
- if @stripe_available
- content_for :title_header do
%h1
= t("layouts.admin.admin")
= "-"
= t("admin.communities.settings.payment_preferences")
- else
- content_for :title_header do
%h1
= t("layouts.admin.admin")
= "-"
= t("admin.communities.paypal_account.paypal_admin_account")
- content_for :title_header do
%h1
= t("layouts.admin.admin")
= "-"
= t("admin.communities.settings.payment_preferences")
= render partial: 'layouts/onboarding_popup_wrapper'
= render :partial => "admin/left_hand_navigation", :locals => { :links => admin_links_for(@current_community) }
- if FeatureFlagHelper.feature_enabled?(:stripe)
= render partial: 'stripe_available', locals: local_assigns
- else
= render partial: 'old_paypal_index', locals: local_assigns
= render partial: 'payment_settings', locals: local_assigns

This file was deleted.

Oops, something went wrong.
@@ -48,7 +48,7 @@
- if delivery_method
= hidden_field_tag :delivery, delivery_method
= hidden_field_tag :payment_type
- if stripe_in_use
@@ -57,19 +57,11 @@
%h2
= t("listing_conversations.stripe_payment.payment")
= render :partial => "listing_conversations/stripe_payment", locals: { publishable_key: stripe_publishable_key, stripe_shipping_required: stripe_shipping_required, paypal_in_use: paypal_in_use}
- if paypal_in_use && !stripe_in_use
.row
.col-12.payment-button-wrapper.paypal-payment
- if FeatureFlagHelper.feature_enabled?(:stripe)
= button_tag t("paypal.pay_with_paypal"), class: "checkout-with-paypal-button"
- else
= button_tag t("paypal.pay_with_paypal"), class: "checkout-with-paypal-button blue"
.row
.col-12
- unless FeatureFlagHelper.feature_enabled?(:stripe)
= render :partial => "listing_conversations/paypal_payment_methods", locals: { country_code: country_code }
= button_tag t("paypal.pay_with_paypal"), class: "checkout-with-paypal-button"
- if paypal_in_use && stripe_in_use
.row
@@ -93,10 +85,10 @@
- content_for :extra_javascript do
:javascript
$(function(){
$(".checkout-with-paypal-button").click(function(){
$(".checkout-with-paypal-button").click(function(){
$("#payment_type").val("paypal");
});
$(".checkout-with-stripe-button").click(function(){
$(".checkout-with-stripe-button").click(function(){
$("#payment_type").val("stripe");
});
});
@@ -155,10 +155,7 @@
.row
.col-12
- if FeatureFlagHelper.feature_enabled?(:stripe)
= render :partial => "listing_conversations/payment_methods", locals: { stripe_in_use: @listing_presenter.stripe_in_use, paypal_in_use: @listing_presenter.paypal_in_use }
- elsif @listing_presenter.paypal_in_use
= render :partial => "listing_conversations/paypal_payment_methods", locals: { country_code: @listing_presenter.community_country_code }
= render :partial => "listing_conversations/payment_methods", locals: { stripe_in_use: @listing_presenter.stripe_in_use, paypal_in_use: @listing_presenter.paypal_in_use }
- if @listing_presenter.is_authorized
.listing-view-admin-links
Oops, something went wrong.

0 comments on commit 73774c3

Please sign in to comment.