init: base for stripe V2
This commit is contained in:
@@ -30,4 +30,32 @@ class AccountPolicy < ApplicationPolicy
|
||||
def toggle_deletion?
|
||||
@account_user.administrator?
|
||||
end
|
||||
|
||||
def v2_pricing_plans?
|
||||
@account_user.administrator?
|
||||
end
|
||||
|
||||
def v2_topup_options?
|
||||
@account_user.administrator?
|
||||
end
|
||||
|
||||
def v2_topup?
|
||||
@account_user.administrator?
|
||||
end
|
||||
|
||||
def v2_subscribe?
|
||||
@account_user.administrator?
|
||||
end
|
||||
|
||||
def cancel_subscription?
|
||||
@account_user.administrator?
|
||||
end
|
||||
|
||||
def credit_grants?
|
||||
@account_user.administrator?
|
||||
end
|
||||
|
||||
def change_pricing_plan?
|
||||
@account_user.administrator?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,6 +6,17 @@ if resource.custom_attributes.present?
|
||||
json.subscribed_quantity resource.custom_attributes['subscribed_quantity']
|
||||
json.subscription_status resource.custom_attributes['subscription_status']
|
||||
json.subscription_ends_on resource.custom_attributes['subscription_ends_on']
|
||||
json.stripe_subscription_id resource.custom_attributes['stripe_subscription_id'] if resource.custom_attributes['stripe_subscription_id'].present?
|
||||
json.stripe_billing_version resource.custom_attributes['stripe_billing_version'] if resource.custom_attributes['stripe_billing_version'].present?
|
||||
json.stripe_customer_id resource.custom_attributes['stripe_customer_id'] if resource.custom_attributes['stripe_customer_id'].present?
|
||||
if resource.custom_attributes['pending_stripe_pricing_plan_id'].present?
|
||||
json.pending_stripe_pricing_plan_id resource.custom_attributes['pending_stripe_pricing_plan_id']
|
||||
end
|
||||
if resource.custom_attributes['pending_subscription_quantity'].present?
|
||||
json.pending_subscription_quantity resource.custom_attributes['pending_subscription_quantity']
|
||||
end
|
||||
json.stripe_pricing_plan_id resource.custom_attributes['stripe_pricing_plan_id'] if resource.custom_attributes['stripe_pricing_plan_id'].present?
|
||||
json.next_billing_date resource.custom_attributes['next_billing_date'] if resource.custom_attributes['next_billing_date'].present?
|
||||
json.industry resource.custom_attributes['industry'] if resource.custom_attributes['industry'].present?
|
||||
json.company_size resource.custom_attributes['company_size'] if resource.custom_attributes['company_size'].present?
|
||||
json.timezone resource.custom_attributes['timezone'] if resource.custom_attributes['timezone'].present?
|
||||
|
||||
Reference in New Issue
Block a user