Delete stale shoppers from BlueSnap

Created on 7 January 2022, over 2 years ago
Updated 10 April 2024, 3 months ago

Problem/Motivation

See parent issue. Fix the issue for existing users that are blocked from adding payment methods.

Steps to reproduce

See parent issue.

Proposed resolution

Users that already have a Shopper with the association not registered in Drupal will still face the error when they try adding new payment methods. Assuming that the merchant shopper ID sent to BlueSnap is unique (we currently use the UUID β†’ ), we can write a Drush command that does the following:

  • Collect all Shoppers that fulfill the following criteria. Criteria #3 and #4 are to limit as much as possible the probability of unintentionally deleting shoppers that fall outside of this case.
    1. Have a merchant shopper ID that correspond to a Drupal user's UUID
    2. The association missing in Drupal.
    3. There are no payment methods associated with the shopper.
    4. There are no orders associated with the shopper.
  • Provide the option to display the Shopper IDs/User IDs/UUIDs without deleting them for confirmation.
  • Provide the option to choose which Shoppers to delete.
  • Add the option to either delete the selected Shoppers or associate them with the Drupal User.

Deleting the Shoppers or adding the missing association will fix the issue. When broken users add a new payment method, they will either have the association and add the payment method to the existing Shopper, or the Shopper will have been deleted and a new Shopper will be created.

Since this can get a bit complicated and the considerations, the risks and the appropriate solution may be different for different sites, we should provide the option to choose. It should be reviewed by a developer therefore a Drush command instead of a UI-based solution.

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡΅πŸ‡ͺPeru krystalcode

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