Stripe customer data not updated when contacts are merged
While investigating why a recurring donation that was successful in Stripe was not updating the status of the donation in CiviCRM, I discovered that the contact ID did not match between the customer metadata in Stripe and the contact data in CiviCRM. This helped me figure out that the contact had been merged with a duplicate at some point, and the contact that ended up deleted was the one that originally had the recurring donation.
Would it be possible to hook into the deduplication merge process to:
- Update Stripe's customer metadata (contact ID)
- Update the customer data in the database (
civicrm_stripe_customerstable) with the new contact ID
Anything else needed to keep this linked correctly?