We've moved discussions to Discord

Subscribing an account to a free plan

Reference points: 

  • https://jumpstartrails.com/discussions/322
  • https://jumpstartrails.com/discussions/444

I am looking to provide "free" accounts but when I try to "Subscribe" new users to this free plan, the Pay gem does not provide support for a "jumpstart" processor. I am sure there is something i'm missing but here is the flow I currently have:

1. Add a "free plan" in the jumpstart admin



2. Enable the person to use the id in the new account subscription UI flow (remove scope to `without_free` in subscriptions_controller.rb#L91, and also show the free acount on the pricing page)

def set_plan
    @plan = Plan.find_by(id: params[:plan])
    redirect_to pricing_path if @plan.nil?
end

3. Build a subscription as normal (subscriptions_controller.rb#L18-L30)

def create
    current_account.assign_attributes(subscription_params)
    @plan = Plan.find(current_account.plan) # Get the Stripe or Braintree specific ID
    processor_id = @plan.processor_id(current_account.processor)
    coupon = current_account.coupon
    current_account.subscribe(plan: processor_id, trial_period_days: @plan.trial_period_days, coupon: coupon)
    redirect_to subscription_success_path, notice: t(".created")
rescue Pay::ActionRequired => e
    redirect_to pay.payment_path(e.payment.id)
rescue Pay::Error => e
    flash[:alert] = e.message
    render :new
end

However, when the user clicks the button to subscribe, I end up with:



I am assuming this error now comes from the Pay gem. In Jumpstart admin area (payments), I have only enabled the 'stripe' payment processor, and there is no option for "jumpstart" as a processor for the free plan.

How can I ensure that I can 'subscribe' free users to the free plan?
Reference points: 

  • https://jumpstartrails.com/discussions/322
  • https://jumpstartrails.com/discussions/444

I am looking to provide "free" accounts but when I try to "Subscribe" new users to this free plan, the Pay gem does not provide support for a "jumpstart" processor. I am sure there is something i'm missing but here is the flow I currently have:

1. Add a "free plan" in the jumpstart admin



2. Enable the person to use the id in the new account subscription UI flow (remove scope to `without_free` in subscriptions_controller.rb#L91, and also show the free acount on the pricing page)

def set_plan
    @plan = Plan.find_by(id: params[:plan])
    redirect_to pricing_path if @plan.nil?
end

3. Build a subscription as normal (subscriptions_controller.rb#L18-L30)

def create
    current_account.assign_attributes(subscription_params)
    @plan = Plan.find(current_account.plan) # Get the Stripe or Braintree specific ID
    processor_id = @plan.processor_id(current_account.processor)
    coupon = current_account.coupon
    current_account.subscribe(plan: processor_id, trial_period_days: @plan.trial_period_days, coupon: coupon)
    redirect_to subscription_success_path, notice: t(".created")
rescue Pay::ActionRequired => e
    redirect_to pay.payment_path(e.payment.id)
rescue Pay::Error => e
    flash[:alert] = e.message
    render :new
end

However, when the user clicks the button to subscribe, I end up with:



I am assuming this error now comes from the Pay gem. In Jumpstart admin area (payments), I have only enabled the 'stripe' payment processor, and there is no option for "jumpstart" as a processor for the free plan.

How can I ensure that I can 'subscribe' free users to the free plan?
Notifications
You’re not receiving notifications from this thread.
© 2022 Jumpstart Pro by GoRails, LLC