Page MenuHomePhabricator

Validation error during recurring charge, in field: last_name
Closed, ResolvedPublic

Description

A bunch of gpay apple pay are failing due to no last name

We just merged a patch to handle similar if we have both add to one field, as xx xx as first name, no last name
https://gerrit.wikimedia.org/r/c/wikimedia/fundraising/SmashPig/+/1291963

but here are many single first name no last name needs to take care of too.

apple:
Validation error during recurring charge, in field: last_name. Message: required. Payment Method: apple. Payment Submethod: . Request: {"recurring_payment_token":"7785208a-6ee3-4c8a-b178-a6b01b52408b","amount":3.1,"currency":"AUD","first_name":"xxx","last_name":null,"email":"xxxxx@gmail.com","country":"AU","order_id":"235411822.12","installment":"recurring","description":"Wikimedia 877 600 9454","recurring":true,"user_ip":"xxxxx","processor_contact_id":null,"payment_service_id":null,"fiscal_number":null}

gpay:

Validation error during recurring charge, in field: last_name. Message: required. Payment Method: google. Payment Submethod: . Request: {"recurring_payment_token":"52caa609-7312-441d-9b1f-e764f32cb572","amount":30,"currency":"NOK","first_name":"xxxx.","last_name":null,"email":"xxxxx@gmail.com","country":"NO","order_id":"239575769.11","installment":"recurring","description":"Wikimedia 877 600 9454","recurring":true,"user_ip":"xxxxx","processor_contact_id":null,"payment_service_id":null,"fiscal_number":null}

Event Timeline

The patch was to split firstname and last name if any, but the case we see recently were all single first name from google, so nothing can split I will create another patch to handle this, if detect as 3rd party use name provided for the null part too, since we are not actually update the name if new contribution from non-trust source like those from google, still honor the initial name which must have valid name pass, also will check if google pay update the response format for recurring thus no last name get past back

AnnWF triaged this task as Medium priority.
AnnWF moved this task from Backlog to In Progress on the Fundraising Tech - Chaos Crew board.

Take this as example:

Validation error during recurring charge, in field: last_name. Message: required. Payment Method: apple. Payment Submethod: . Request: {"recurring_payment_token":"7785208a-6ee3-4c8a-b178-a6b01b52408b","amount":3.1,"currency":"AUD","first_name":"xx","last_name":null,"email":"xx@gmail.com","country":"AU","order_id":"235411822.12","installment":"recurring","description":"Wikimedia 877 600 9454","recurring":true,"user_ip":"124.182.68.225","processor_contact_id":null,"payment_service_id":null,"fiscal_number":null}

civi: (also no last name)
https://civicrm.wikimedia.org/civicrm/contact/view?reset=1&cid=66209615

gravy dashboard: (recurring token from adyen)
https://wikimedia.gr4vy.app/merchants/default/transactions/9f11c23e-a9cc-48d9-b458-31c8b6376665/overview

gravy dashboard: (initial donation was only first name no last name, which not required strictly from adyen)
https://ca-live.adyen.com/ca/ui/transactions/payments/G6NH5X5KVGL9R8B9/ where do not force to have a last name

so the best way to skip this is by asking Gravy to update their api to accept name null
also see some full name can split with ., added as we done for space inbetween

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

[wikimedia/fundraising/SmashPig@master] Do not force first name and last name for gravy recurring

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

Based on the reply from Gravy:
"first_name": "" → 400 string_too_short
"first_name": null (or omitted) and  → authorizes fine
I also specifically tested sending "last_name": null on a recurring charge and it succeeds 
so a null last name is accepted.

So as long as we are not sending "" for either first name or last name, should works

Change #1309314 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] Do not force first name and last name for gravy recurring

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

XenoRyet set Final Story Points to 4.