Logo
Explore Help
Sign In
discourse/discourse-subscriptions
1
0
Fork 0
You've already forked discourse-subscriptions
mirror of https://github.com/discourse/discourse-subscriptions.git synced 2025-07-08 07:12:46 +00:00
Code Issues Packages Projects Releases Wiki Activity
discourse-subscriptions/lib/subscriptions_user_constraint.rb

11 lines
254 B
Ruby
Raw Permalink Normal View History

REFACTOR: Use engine to load files, add constraint (#14)
2020-07-06 11:11:04 -05:00
# frozen_string_literal: true
class SubscriptionsUserConstraint
def matches?(request)
provider = Discourse.current_user_provider.new(request.env)
provider.current_user
rescue Discourse::InvalidAccess, Discourse::ReadOnly
false
end
REFACTOR: Use the Prices API in place of Plans (#17) Stripe has a newer API called Prices where you can create a price for any product and it can either be recurring or one-time. The easy part is existing Plans work with the Prices API by passing a Plan ID, but objects are returned in the slightly-different Prices API object format. This commit is a refactor to the new API to handle the data in its new form, and lays the foundation for a one time payment plan to be added to any subscriptions product.
2020-07-15 08:44:40 -05:00
end
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 47ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API