Page MenuHomePhabricator

DonationInterface forms should accept full_name
Closed, ResolvedPublic

Description

We currently only accept first and last name fields separately. Since Amazon Pay and Google Pay give us a full name, we should send that complete name to Civi. At Civi we can store the full name as well as apply more sophisticated logic to parse out likely first/last/middle initials.

This task will include adding a full_name field to the DonationData object and ensuring it is persisted to session, adding a full_name parameter to any APIs that currently accept first and last name, and adding the full_name to the queue message when data exists.

Event Timeline

Note that on the Civi Side we currently handle in ChecksFile - we should move that to WMFContact::save()

if (!empty($msg['full_name']) && (empty($msg['first_name']) || empty($msg['last_name']))) {
  // Parse name parts into fields if we have the full name and the name parts are
  // not otherwise specified.
  $msg = array_merge(array_filter((array) Name::parse(FALSE)
    ->setNames([$msg['full_name']])
    ->execute()->first()), $msg);
  $msg['addressee_custom'] = $msg['full_name'];
}

Change 770521 had a related patch set uploaded (by Wfan; author: Wfan):

[mediawiki/extensions/DonationInterface@master] Add full_name to queue

https://gerrit.wikimedia.org/r/770521

DStrine raised the priority of this task from Low to Medium.Mar 16 2022, 4:19 PM

Change 770521 merged by jenkins-bot:

[mediawiki/extensions/DonationInterface@master] Add full_name to queue

https://gerrit.wikimedia.org/r/770521

DStrine raised the priority of this task from Medium to High.Mar 29 2022, 8:44 PM
DStrine set Final Story Points to 2.