Page MenuHomePhabricator

Add India-specific payment methods across our pipeline
Closed, ResolvedPublic4 Estimated Story Points

Description

DonationInterface

  • add them to dlocal (astropay) payment_submethod config
  • add a new form definition to DonationInterfaceFormSettings.php
  • download logos where needed

SmashPig

  • add them to PaymentProviders/AstroPay/ReferenceData.php

CRM

  • add them to update_payment_instruments.php
  • add another function just like wmf_civicrm_update_7595 to wmf_civicrm.install file
  • add them to the big ol' switch block that normalizes payment instrument (wmf_civicrm.module lines 612-824)

Methods and bank codes

We're waiting for confirmation on bank transfer method PayTM Wallet (bank code PW, logo https://pay.dlocal.com/views/2.0/images/payments/PW.png).

The methods above with URLs for logos need those logos downloaded and resized to be copied into the gateway_forms/includes directory. Our standard logo height is 53 pixels tall. If the original logo is high enough resolution, it's nice to have a 2x and 3x version as well for high DPI screens (see Mastercard section of config for 2x and 3x syntax).

We can add all of them (including PayTM Wallet), just leaving PayTM Wallet commented out in DonationInterface's astropay_gateway/config/payment_submethod.yaml till we get confirmation that it's working.

Related Objects

Event Timeline

(moved to task description)

Ejegg triaged this task as Medium priority.Jun 13 2019, 7:53 PM
Ejegg updated the task description. (Show Details)
Ejegg set the point value for this task to 4.

Change 518746 had a related patch set uploaded (by Cstone; owner: Cstone):
[mediawiki/extensions/DonationInterface@master] Adding India support with dlocal.

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

Change 518762 had a related patch set uploaded (by Cstone; owner: Cstone):
[wikimedia/fundraising/SmashPig@master] Adding India support with dlocal.

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

Change 518776 had a related patch set uploaded (by Ejegg; owner: Ejegg):
[mediawiki/extensions/DonationInterface@master] Add logos for India cards & bank methods

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

Change 518776 merged by jenkins-bot:
[mediawiki/extensions/DonationInterface@master] Add logos for India cards & bank methods

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

Change 518790 had a related patch set uploaded (by Cstone; owner: Cstone):
[wikimedia/fundraising/crm@master] Add India support with dlocal.

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

Change 518790 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Add India support with dlocal.

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

Change 518762 merged by jenkins-bot:
[wikimedia/fundraising/SmashPig@master] Adding India support with dlocal.

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

Change 518746 merged by jenkins-bot:
[mediawiki/extensions/DonationInterface@master] Adding India support with dlocal.

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

@Cstone I deployed the DonationInterface part of this tonight. There's one more tiny thing to do - bump the version number of the SmashPig composer package and update the SmashPig library in crm. That will let the Dlocal audit code use the updated decoder ring. We should be able to put a test donation through as early as tomorrow, as long as we get that library update out before any audit file comes through with the new methods.

@Cstone oops, shortly after deploying this I started seeing "Empty param x_cpf" in the error logs. That's the tax ID number we have to send along with most dlocal requests. We'll have to add that (our normalized name for the parameter is fiscal_number) to the country_fields.yaml, and add a country-specific label in the i18n files (search for fiscal_number in *.json for examples). The India-specific label for this field should be 'PAN'.

The dlocal Streamline documentation also says we need street address and city for India, so those will go in country_fields as well. And finally, we need to add an 'x_version' parameter to the newinvoice transaction definition, with fixed value 1.1

For now, I pushed out a followup patch to DonationInterfaceFormSettings dialing the form's selection_weight down to zero. I think that should make sure people don't land there just because they're trying to donate from India, in INR.

Change 519510 had a related patch set uploaded (by Cstone; owner: Cstone):
[mediawiki/extensions/DonationInterface@master] Add India specfic fields for dlocal. PAN for fiscal_number and x_version.

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

@Ejegg when adding x_version . In AstroPayTest for testNewInvoiceRequest it is using BR. Should a separate test be made for IN using the x_version parameter?

@Cstone let's update the existing test to add the version code. Maybe add another test for India to check that address and city come through?

Change 519510 merged by jenkins-bot:
[mediawiki/extensions/DonationInterface@master] Add India specific fields for dlocal.

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

Change 521952 had a related patch set uploaded (by Cstone; owner: Cstone):
[wikimedia/fundraising/crm@master] Update SmashPig version to 0.5.10

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

Change 521952 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Update SmashPig version to 0.5.10

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

  NODES
Note 5
Project 11