2019-09-24 20:44:51 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 11:23:45 +11:00
|
|
|
module DiscourseSubscriptions
|
2019-09-24 20:44:51 +10:00
|
|
|
module Stripe
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2024-01-04 15:52:24 +08:00
|
|
|
AUTH_PROBLEM_IDENTIFIER = "#{DiscourseSubscriptions::PLUGIN_NAME}.stripe_auth_error"
|
|
|
|
|
2019-09-24 20:44:51 +10:00
|
|
|
def set_api_key
|
2019-12-04 11:53:05 +11:00
|
|
|
::Stripe.api_key = SiteSetting.discourse_subscriptions_secret_key
|
2019-09-24 20:44:51 +10:00
|
|
|
end
|
2020-05-28 10:32:57 -05:00
|
|
|
|
|
|
|
def is_stripe_configured?
|
2022-12-29 12:35:06 +00:00
|
|
|
SiteSetting.discourse_subscriptions_public_key.present? &&
|
|
|
|
SiteSetting.discourse_subscriptions_secret_key.present?
|
2020-05-28 10:32:57 -05:00
|
|
|
end
|
2019-09-24 20:44:51 +10:00
|
|
|
end
|
|
|
|
end
|