Index: branches/fundraising/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | |
215 | 215 | //TODO: Remember why the heck I decided to leave this here... |
216 | 216 | //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. |
218 | 218 | function addErrorMessageScript() { |
219 | 219 | global $wgOut; |
220 | 220 | $gateway_id = $this->adapter->getIdentifier(); |
Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -1008,10 +1008,52 @@ |
1009 | 1009 | //update contribution tracking |
1010 | 1010 | $this->dataObj->updateContributionTracking( true ); |
1011 | 1011 | |
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() ); |
1013 | 1013 | self::log( $ret ); |
1014 | 1014 | return $ret; |
1015 | 1015 | } |
| 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 | + } |
1016 | 1058 | |
1017 | 1059 | public function getTransactionAllResults() { |
1018 | 1060 | if ( !empty( $this->transaction_results ) && is_array( $this->transaction_results ) ) { |
Index: branches/fundraising/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -520,7 +520,9 @@ |
521 | 521 | * |
522 | 522 | * because the form elements for comment anonymization and email opt-out |
523 | 523 | * 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. |
525 | 527 | */ |
526 | 528 | function setNormalizedOptOuts( $prune = false ) { |
527 | 529 | $optout['optout'] = ( $this->isSomething( 'email-opt' ) && $this->getVal( 'email-opt' ) == "1" ) ? '0' : '1'; |