Improving recurring order payment method selection

Created on 24 March 2021, over 3 years ago
Updated 9 October 2023, 9 months ago

Problem/Motivation

When a recurring order is closed, one of the steps is to choose a payment method. Currently the subscriptions in the order are collected, then searched for the most recent payment method, and that one is used to process the order.

There is no checking whether the selected payment method is (still) valid, or fallback to another in the event that it's not. There's no check to see if the user has added a newer stored payment method to their account. And if they did that, then no subscription payment methods were updated when they added the method - so if a card expires, and they add a new card, the subscription will still fail to renew. There's also no check to make sure that the selected payment method is re-usable, which it should be usually for a subscription, but that's not guaranteed because recurring does not enforce that the payment method on the initial order is reusable.

All this means that subscription close and renew can fail unnecessarily.

Bonus: I think that if the payment method is available and valid on the order, but an invalid one is present on a subscription, then when the order is refreshed it becomes unpayable. Need to do more checking to confirm this.

Let's improve all of this.

Steps to reproduce

  • Buy a subscription.
  • Delete all your payment methods from your profile
  • Add a new one - either by buying and storing or adding in your profile. Ideally add a non-reusable method, but this may not be possible with your available payment gateways and set up.
  • Wait for your subscription to renew.
  • Receive a dunning notice or find that the subscription was cancelled.

Proposed resolution

Alter RecurringOrderManager->selectPaymentMethod to check the validity of the choices and look for additional fallbacks when a payment method is not available, or will fail.

Remaining tasks

TBD

This may be a job for a resolver. Should the subscription payment method override an order payment method? Or the other way? If there's no valid payment method on either, then what is the right order of fallback? Very much into resolver territory.

User interface changes

None

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Jeff Veit

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024