Page MenuHomePhabricator

Set error for Dlocal unsupported card types
Closed, ResolvedPublic

Description

related with T334945 that India do not support amex.
and was originally found from T334769

We have error logs as
Apr 14 14:48:20 payments1007 dlocal_gateway: 175182287:175182287.1 The payment submethod [debmaster] was not found.
Apr 14 18:10:18 payments1005 dlocal_gateway: 175183077:175183077.1 The payment submethod [debvisa] was not found.
Apr 18 13:33:04 payments1006 dlocal_gateway: 175257007:175257007.1 The payment submethod [discover] was not found.
Apr 18 13:43:53 payments1006 dlocal_gateway: 175257420:175257420.1 The payment submethod [maestro] was not found.
Apr 18 13:29:38 payments1006 dlocal_gateway: 175257217:175257217.1 The payment submethod [diner] was not found.

Would love to have a DI level card type not support error from the supported submethods configed in yaml file.

Event Timeline

jgleeson updated the task description. (Show Details)

I noticed that we have submethod warnings in the logs for successful payments also. For 175310978, which was successful, the logs show.
Apr 19 13:24:31 payments1005 dlocal_gateway: 175310978:175310978.1 The payment submethod [discover] was not found.

jgleeson updated the task description. (Show Details)

https://docs.dlocal.com/docs/india#cards seems support Amex, could just need to map the submethod?

On the parent task @EMartin confirms that they don't support it in India right now, so let's treat it as a validation error and not let donors submit. We can use message donate_interface-error-msg-unsupported-card-entered to let the donor know they have to use a different type of card.

It would be nice to get the list of supported cards from the payment_submethods.yaml rather than hardcoding it in JS. I've just checked the list of cards we have seen authorized in India, and they are as follows: Mastercard, Mastercard Debit, Visa, Visa Debit, and Rupay.

useful greps

grep 'Token not found or inactive' payments-dlocal | cut -d" " -f6 | grep -P '\d+'
grep 'Token not found or inactive' payments-dlocal | cut -d" " -f6 | grep -P '^[\d:.]+$' | cut -d: -f1 | sort -u | grep --color=always -f - payments-dlocal

zgrep --color=always 'Token not found or inactive' /srv/archive/frlog1002/logs/payments-dlocal-20230419.gz | cut -d" " -f6 | grep -P '^[\d:.]+$' | cut -d: -f1 | sort -u | zgrep --color=always -f - /srv/archive/frlog1002/logs/payments-dlocal-20230419.gz | zgrep -E --color=always "Token not found or inactive|submethod|" | grep -Po '.+submethod.+'

grep -P 'The payment submethod .+ was not found' payments-dlocal | cut -d" " -f6 | grep -P '\d+' | cut -d: -f1 | sort -u | grep -f - payments-dlocal | grep -Po 'country":"[^"]+"'

grep -P 'The payment submethod .+ was not found' payments-dlocal | cut -d" " -f6 | grep -P '\d+' | cut -d: -f1 | sort -u | grep --color=always -f - payments-dlocal

zgrep -Po 'The payment submethod .+ was not found' /srv/archive/frlog1002/logs/payments-dlocal-20230419.gz
zgrep -i 'amex' /srv/archive/frlog1002/logs/payments-dlocal-20230419.gz

zgrep -P 'The payment submethod .+ was not found' /srv/archive/frlog1002/logs/payments-dlocal-20230419.gz | cut -d" " -f6 | grep -P '\d+' | cut -d: -f1 | sort -u | zgrep --color=always -f - /srv/archive/frlog1002/logs/payments-dlocal-20230419.gz

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

[wikimedia/fundraising/SmashPig@master] add getSimpleSubmethods for DI pair if valid submethod

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

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

[mediawiki/extensions/DonationInterface@master] Add DI error when dlocal smart field has unsupported card type

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

Change 910093 merged by jenkins-bot:

[wikimedia/fundraising/SmashPig@master] add getSimpleSubmethods for DI pair if valid submethod

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

AnnWF renamed this task from Set error for Dlocal unsupported card types in India to Set error for Dlocal unsupported card types.Apr 20 2023, 1:25 AM
AnnWF reopened this task as Open.
AnnWF claimed this task.
AnnWF updated the task description. (Show Details)
AnnWF added a subscriber: jgleeson.

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

[wikimedia/fundraising/SmashPig@master] Add missing submethods pair for dlocal

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

Change 910079 merged by jenkins-bot:

[mediawiki/extensions/DonationInterface@master] Add DI error when dlocal smart field has unsupported card type

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

XenoRyet set Final Story Points to 4.