2021-01-03 14:25:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module SubscriptionPortal
|
|
|
|
def self.default_subscriptions_url
|
2021-11-18 22:05:49 +05:30
|
|
|
if ::Gitlab.dev_or_test_env?
|
|
|
|
if Feature.enabled?(:new_customersdot_staging_url, default_enabled: :yaml)
|
|
|
|
'https://customers.staging.gitlab.com'
|
|
|
|
else
|
|
|
|
'https://customers.stg.gitlab.com'
|
|
|
|
end
|
|
|
|
else
|
|
|
|
'https://customers.gitlab.com'
|
|
|
|
end
|
2021-01-03 14:25:43 +05:30
|
|
|
end
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
def self.subscriptions_url
|
|
|
|
ENV.fetch('CUSTOMER_PORTAL_URL', default_subscriptions_url)
|
|
|
|
end
|
2021-06-08 01:23:25 +05:30
|
|
|
|
|
|
|
def self.payment_form_url
|
|
|
|
"#{self.subscriptions_url}/payment_forms/cc_validation"
|
|
|
|
end
|
2021-11-11 11:23:49 +05:30
|
|
|
|
|
|
|
def self.subscriptions_comparison_url
|
|
|
|
'https://about.gitlab.com/pricing/gitlab-com/feature-comparison'
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.subscriptions_graphql_url
|
|
|
|
"#{self.subscriptions_url}/graphql"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.subscriptions_more_minutes_url
|
|
|
|
"#{self.subscriptions_url}/buy_pipeline_minutes"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.subscriptions_more_storage_url
|
|
|
|
"#{self.subscriptions_url}/buy_storage"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.subscriptions_manage_url
|
|
|
|
"#{self.subscriptions_url}/subscriptions"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.subscriptions_plans_url
|
|
|
|
"#{self.subscriptions_url}/plans"
|
|
|
|
end
|
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
def self.subscriptions_gitlab_plans_url
|
|
|
|
"#{self.subscriptions_url}/gitlab_plans"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.subscriptions_instance_review_url
|
|
|
|
"#{self.subscriptions_url}/instance_review"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.add_extra_seats_url(group_id)
|
|
|
|
"#{self.subscriptions_url}/gitlab/namespaces/#{group_id}/extra_seats"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.upgrade_subscription_url(group_id, plan_id)
|
|
|
|
"#{self.subscriptions_url}/gitlab/namespaces/#{group_id}/upgrade/#{plan_id}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.renew_subscription_url(group_id)
|
|
|
|
"#{self.subscriptions_url}/gitlab/namespaces/#{group_id}/renew"
|
|
|
|
end
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
def self.subscription_portal_admin_email
|
|
|
|
ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_EMAIL', 'gl_com_api@gitlab.com')
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.subscription_portal_admin_token
|
|
|
|
ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_TOKEN', 'customer_admin_token')
|
|
|
|
end
|
2021-01-03 14:25:43 +05:30
|
|
|
end
|
|
|
|
end
|
2021-04-29 21:17:54 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Gitlab::SubscriptionPortal.prepend_mod
|
2021-04-29 21:17:54 +05:30
|
|
|
Gitlab::SubscriptionPortal::SUBSCRIPTIONS_URL = Gitlab::SubscriptionPortal.subscriptions_url.freeze
|
2021-06-08 01:23:25 +05:30
|
|
|
Gitlab::SubscriptionPortal::PAYMENT_FORM_URL = Gitlab::SubscriptionPortal.payment_form_url.freeze
|