mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-07-10 08:03:27 +00:00
FIX: Stripe returned limited number of plans
This commit is contained in:
parent
892c889c31
commit
029232e881
@ -10,14 +10,16 @@ module DiscourseSubscriptions
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
begin
|
begin
|
||||||
customer = Customer.find_by(user_id: current_user.id)
|
customer = Customer.where(user_id: current_user.id)
|
||||||
subscription_ids = Subscription.where(customer_id: customer.id).pluck(:external_id) if customer
|
customer_ids = customer.map { |c| c.id } if customer
|
||||||
|
subscription_ids = Subscription.where("customer_id in (?)", customer_ids).pluck(:external_id) if customer_ids
|
||||||
|
|
||||||
subscriptions = []
|
subscriptions = []
|
||||||
|
|
||||||
if subscription_ids
|
if subscription_ids
|
||||||
plans = ::Stripe::Plan.list(
|
plans = ::Stripe::Plan.list(
|
||||||
expand: ['data.product']
|
expand: ['data.product'],
|
||||||
|
limit: 100
|
||||||
)
|
)
|
||||||
|
|
||||||
customers = ::Stripe::Customer.list(
|
customers = ::Stripe::Customer.list(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user