Page MenuHomePhabricator

Refactor: Sort out transaction_option vs getData* vs getTransactionSpecificValue vs account* constellation
Open, Needs TriagePublic

Description

Come up with a more intuitive interface to our different forms of data. With only a few obvious exceptions, almost all code should be using getNormalized to access data.

  • getNormalized: Get data using a normalized key, in its normalized form.
  • Staged data should be built just in time, I don't believe we ever need to store it. This might require some adjustment to legacy staging functions (Adyen).
  • (T130154) Looking at it more, I really don't like how accountInfo works. Get rid of the defineAccountInfo functions, use account_config everywhere. Don't use magic to stuff account config into transaction values.

Details

Related Gerrit Patches:
mediawiki/extensions/DonationInterface : masterAstroPay signature as staging helper
mediawiki/extensions/DonationInterface : masterEncodingMangler implements StagingHelper

Event Timeline

awight created this task.Jun 6 2016, 10:56 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 6 2016, 10:56 PM
awight renamed this task from Refactor: Sort out transaction_option vs getData* vs getTransactionSpecificValue vs accountInfo vs account_config to Refactor: Sort out transaction_option vs getData* vs getTransactionSpecificValue vs account* constellation.Jun 7 2016, 9:11 PM
awight updated the task description. (Show Details)

Change 293465 had a related patch set uploaded (by Ejegg):
AstroPay signature as staging helper

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

Ejegg added a comment.Jun 9 2016, 4:13 AM

Also, how about the staged data keys are the processor names, not ours. We could have one generic staging/unstaging helper 'KeyMapper' that just copies over values, altering keys as defined in var_map (see TODO on $theirKey => $ourKey thing in GlobalCollect). Its stage function could be transaction-aware and only copy over what's needed for the current txn.

Another generic staging helper could copy over the 'values' section of the current transaction, and a third could copy the appropriate account config.

Then $staged_data would just need to be encoded in the right format to send to the processor, and we could dispense with getTransactionSpecificValue entirely.

Change 293466 had a related patch set uploaded (by Ejegg):
EncodingMangler implements StagingHelper

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

Change 293466 merged by jenkins-bot:
EncodingMangler implements StagingHelper

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

Change 293465 merged by jenkins-bot:
AstroPay signature as staging helper

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

mmodell removed a subscriber: awight.Jun 22 2017, 9:38 PM