r99606 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99605‎ | r99606 | r99607 >
Date:00:18, 12 October 2011
Author:khorn
Status:ok
Tags:fundraising 
Comment:
Only sends data paypal can process (that isn't null) on a paypal redirect.
r98202
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/gateway_common/DonationData.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)
  • /branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -213,7 +213,7 @@
214214
215215 //TODO: Remember why the heck I decided to leave this here...
216216 //arguably, it's because it's slightly more "view" related, but... still, shouldn't you get stashed
217 - //in the new GatewayForm class so we can override in chlidren if we feel like it? Odd.
 217+ //in the new GatewayForm class so we can override in children if we feel like it? Odd.
218218 function addErrorMessageScript() {
219219 global $wgOut;
220220 $gateway_id = $this->adapter->getIdentifier();
Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -1008,10 +1008,52 @@
10091009 //update contribution tracking
10101010 $this->dataObj->updateContributionTracking( true );
10111011
1012 - $ret = self::getGlobal( "PaypalURL" ) . "/" . $this->postdata['language'] . "?gateway=paypal&" . http_build_query( $this->postdata );
 1012+ $ret = self::getGlobal( "PaypalURL" ) . "/" . $this->postdata['language'] . "?gateway=paypal&" . http_build_query( $this->getPaypalData() );
10131013 self::log( $ret );
10141014 return $ret;
10151015 }
 1016+
 1017+ protected function getPaypalData() {
 1018+ $paypalkeys = array(
 1019+ 'gateway',
 1020+ 'contribution_tracking_id',
 1021+ 'comment',
 1022+ 'referrer',
 1023+ 'comment-option',
 1024+ 'utm_source',
 1025+ 'utm_medium',
 1026+ 'utm_campaign',
 1027+ 'email-opt',
 1028+ 'language',
 1029+ 'owa_session',
 1030+ 'owa_ref',
 1031+ 'tshirt',
 1032+ 'returnto',
 1033+ 'currency_code',
 1034+ 'fname',
 1035+ 'lname',
 1036+ 'email',
 1037+ 'address1',
 1038+ 'city',
 1039+ 'state',
 1040+ 'zip',
 1041+ 'country',
 1042+ 'address_override',
 1043+ 'recurring_paypal',
 1044+ 'amount',
 1045+ 'amountGiven',
 1046+ 'size',
 1047+ 'premium_language',
 1048+ );
 1049+ $ret = array();
 1050+ foreach ( $paypalkeys as $key ){
 1051+ $val = $this->getData( $key );
 1052+ if (!is_null( $val )){
 1053+ $ret[$key] = $this->getData( $key );
 1054+ }
 1055+ }
 1056+ return $ret;
 1057+ }
10161058
10171059 public function getTransactionAllResults() {
10181060 if ( !empty( $this->transaction_results ) && is_array( $this->transaction_results ) ) {
Index: branches/fundraising/extensions/DonationInterface/gateway_common/DonationData.php
@@ -520,7 +520,9 @@
521521 *
522522 * because the form elements for comment anonymization and email opt-out
523523 * are backwards (they are really opt-in) relative to contribution_tracking
524 - * (which is opt-out), we need to reverse the values
 524+ * (which is opt-out), we need to reverse the values.
 525+ * NOTE: If you prune here, and there is a paypal redirect, you will have
 526+ * problems with the email-opt/optout and comment-option/anonymous.
525527 */
526528 function setNormalizedOptOuts( $prune = false ) {
527529 $optout['optout'] = ( $this->isSomething( 'email-opt' ) && $this->getVal( 'email-opt' ) == "1" ) ? '0' : '1';

Follow-up revisions

RevisionCommit summaryAuthorDate
r101669The data used for a paypal redirect needs to be our raw, unstaged data: Not t...khorn20:10, 2 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98202More refactoring work for the gateway adapters, mostly surrounding the specia...khorn00:48, 27 September 2011

Status & tagging log