Plans with a "Ramp" pricing model causes fatal error on plan settings page

Created on 23 October 2023, over 1 year ago
Updated 31 October 2023, over 1 year ago

Problem/Motivation

If my recurly account has a plan that uses the Ramp pricing model (I believe this is a new Recurly feature) on the enabled plans page /admin/config/services/recurly/subscription-plans I get the following fatal error.

The website encountered an unexpected error. Please try again later.
TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given in class_implements() (line 94 of modules/contrib/recurly/src/Form/RecurlySubscriptionPlansForm.php).

class_implements(NULL) (Line: 94)
Drupal\recurly\Form\RecurlySubscriptionPlansForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('recurly_subscription_plans_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 193)
Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object, 1, 1) (Line: 49)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Add a plan with a Ramp pricing model to your Recurly account, go to /admin/config/services/recurly/subscription-plans on your Drupal site.

If I remove the plan from recurly, the settings page loads correctly. This only happens with Ramp plans.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @loze
  • πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles
  • πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

    It looks like the Ramp pricing model has been a Recurly feature since last Oct.

    https://docs.recurly.com/docs/ramp-pricing

    After looking further into this there are several places in this mod that need to be updated to support this, or at least not break like it is now.

    the main thing is $plan->unit_amount_in_cents doesn't exist with Ramp plans, instead there is an array $plan->ramp_intervals with a unit_amount_in_cents key for each ramp interval.

  • πŸ‡ΊπŸ‡ΈUnited States eojthebrave Minneapolis, MN

    I'm in favor of supporting Ramp plans. Though it's not a feature I'm using so don't have a lot of time to work on it myself right now. If this is something you want to take on though I'm happy to help answer questions, and review code. Feel free to ping me in Slack as well.

Production build 0.71.5 2024