Page MenuHomePhabricator

ideas for PaymentMethod hierarchy refactor

Authored By
Ejegg
May 30 2015, 12:14 AM
Size
1 KB
Referenced Files
None
Subscribers
None

ideas for PaymentMethod hierarchy refactor

no more 'submethod' - radio buttons will be name="payment_method" value="cc_visa" with fully specified string.
definePaymentMethods will define a single nested array:
$payment_methods['cc'] = array(
'validation' => array ( 'foo' => true ),
'countries' => array( '+' => 'ALL' ),
'children' => array(
'visa' => array(
'validation' => ( array( 'bar' => true, 'foo' => false ) )
),
'mc' => array(
'countries' => '-' => ( 'BR' )
)
)
)
Can override in localSettings with a gateway global
$wgGlobalCollectGatewayPaymentMethodOptions['cc'] = array(
'countries' => ( '-' => 'GB' ),
'children' => array(
'visa' => array(
'currencies' => array( '-' => 'JPY' )
)
),
'selection_weight' => 5
)
new class PaymentMethodFilter will take metadata, gateway global, and set of selections (country, currency, maybe top-level method), and return a list of available payment method codes (with selection weight?).
FormChooser (renamed GatewayChooser) will call PaymentMethodFilter with each gateway in turn and
select from the gateways with non-empty lists, ranked by selection_weight then by number of different fully specified submethods
Somewhere in the form rendering pipeline we also call PaymentMethodFilter to get the list of submethods to show
Bonus: we might be able to get rid of Special:FundraiserLandingPage
when no top-level method is specified, paymentMethodFilter can return a list of top-level methods available in the user's country.

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
166288
Default Alt Text
ideas for PaymentMethod hierarchy refactor (1 KB)

Event Timeline