It looks like we currently don't have a workflow for users who currently have an expired or canceled subscription, and wish to re-subscribe (i.e., start a new subscription):

  • If such a user goes to /signup, they'll be redirected to /user/{user}/subscription, since they have a Braintree customer ID linked to their Drupal user account.
  • Once on /user/{user}/subscription, the 'Update subscription' form won't work, since an expired or canceled Braintree subscription can't be updated (https://developers.braintreepayments.com/guides/recurring-billing/manage...).

I think we can add support for those cases by:

  1. Changing \Drupal\braintree_cashier\EventSubscriber\KernelRequestSubscriber::kernelRequest so it doesn't redirect users when they have a Braintree customer ID but no active subscription.
  2. Then on /signup, changing \Drupal\braintree_cashier\Form\SignupForm::submitForm as needed. I think the form itself would work, maybe we can add a title callback to make sure the page title makes sense for users that already have a customer ID (and we can assume already had a subscription in the past).

Happy to work on this, but I wanted to make sure I'm not missing/overlooking anything. Thoughts?

Comments

brunodbo created an issue. See original summary.

brunodbo’s picture

Issue summary: View changes
shaundychko’s picture

Thanks for the feedback, and it's good to start with discussion.

The "Update subscription" form actually does work since a new subscription will be created in this use case. This user will presumably already have a payment method on file since they've already had a subscription in a past. Improvement is definitely needed for this version of the checkout flow since if it isn't clear to developers then it definitely won't be clear to users.

Perhaps the button text should be changed to "Sign up" instead of "Update Subscription" if the user does not have an active subscription?

Just to document, another use case similar to the one in this issue is:
1) User creates an account but doesn't sign up for a subscription
2) User visits their account page later and adds a payment method
3) User signs up on the "My Subscription" tab.

What are you thoughts? Will a button text change suffice?

brunodbo’s picture

Oh, I missed that in \Drupal\braintree_cashier\Form\UpdateSubscriptionFormConfirm::submitForm, sorry about that!

Yep, I think changing the button text would definitely help; 'Sign up' would work. I was also thinking of adding a bit of text at the top of the form to clarify what the user's (non-)subscription status is. Then again, a lot of those UI bits will end up being overridden. But it still might make sense to provide something clear by default.

Just to document, another use case similar to the one in this issue is: (...)

That is sort of my use case. I'm going to be starting my users on a 30-day non-Braintree trial when they register, so initially they will be logged in without a Braintree subscription. I'll be redirecting logged in users without a subscription to /sign-up when they hit the 'My subscription' page, and am probably going to override \Drupal\braintree_cashier\Form\PaymentMethodForm::accessRoute so it checks whether the user has a Braintree customer ID.

shaundychko’s picture

Thanks for describing your use case. I've committed a change to the header introducing the plan select form, as well as the button text (and functional tests).

  • ShaunDychko committed 2a2a43e on 8.x-2.x
    Issue #3018032 by brunodbo, ShaunDychko: Add workflow for expired/...
shaundychko’s picture

Status: Active » Fixed
shaundychko’s picture

Title: Add workflow for expired/canceled subscription » Document checkout flow for expired/canceled subscription
shaundychko’s picture

Title: Document checkout flow for expired/canceled subscription » Improve UI for checkout flow for expired/canceled subscription
brunodbo’s picture

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.