r100630 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100629‎ | r100630 | r100631 >
Date:17:57, 24 October 2011
Author:jpostlethwaite
Status:ok (Comments)
Tags:fundraising 
Comment:
Adding payment fields to form.
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_forms/TwoStepAmount.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepAmount.php
@@ -24,9 +24,10 @@
2525 class Gateway_Form_TwoStepAmount extends Gateway_Form {
2626
2727 public function __construct( &$form_data, &$form_errors, &$gateway ) {
28 - $form_data['payment_method'] = 'bt';
29 - $form_data['payment_submethod'] = 'bt';
3028
 29+ $form_data['payment_method'] = empty($form_data['payment_method']) ? 'bt' : $form_data['payment_method'];
 30+ $form_data['payment_submethod'] = empty($form_data['payment_submethod']) ? 'bt' : $form_data['payment_submethod'];
 31+
3132 //$form_data['payment_method'] = 'rtbt';
3233 //$form_data['payment_submethod'] = 'rtbt_nordea_sweeden';
3334

Comments

#Comment by Khorn (WMF) (talk | contribs)   18:54, 27 October 2011

This is fine, but just as a note for the future, $form_data does get populated from the gateway's data. So, if you set these things in the gateway, they will already be available in $form_data by the time you get here.

Status & tagging log