Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.alias.php |
— | — | @@ -6,8 +6,3 @@ |
7 | 7 | $specialPageAliases['en'] = array( |
8 | 8 | 'PayflowProGateway' => array( 'PayflowProGateway' ), |
9 | 9 | ); |
10 | | - |
11 | | -/** |
12 | | - * For backwards compatibility with MediaWiki 1.15 and earlier. |
13 | | - */ |
14 | | -$aliases =& $specialPageAliases; |
\ No newline at end of file |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.alias.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
15 | 10 | Merged /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.alias.php:r107322 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php |
— | — | @@ -156,7 +156,7 @@ |
157 | 157 | //instantiate a new DonationData that behaves like it's owned by the correct gateway. |
158 | 158 | $donationDataObj = new DonationData( $gateway_class, false, $tracking_data ); |
159 | 159 | // fetch the order_id |
160 | | - $order_id = $donationDataObj->getVal( 'order_id' ); |
| 160 | + $order_id = $donationDataObj->getVal_Escaped( 'order_id' ); |
161 | 161 | |
162 | 162 | // fetch the CSRF prevention token and set it if it's not already set |
163 | 163 | $token = $donationDataObj->token_getSaltedSessionToken(); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
164 | 164 | Merged /trunk/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,96127-97926,97945-99042,99045-99408,99503,99555,99568,99570-101026,101060,101063-101064,101073,101076,101109,101180,101207,101335,101441,101502,101553,101557,101561,101576,101676,101679,101757,101785-101786,101823,101826,101837,101852,101870-101872,101882,101890,101910,101929,101947,101949-101951,101955-101960,101962,101964-101966,101996,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102123-102127,102130,102134,102140,102147,102151-102152,102155-102156,102186,102188-102242,102258-102259,102267,102269,102307,102313,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,103024,103032,103036-103038,103040,103044,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103261-103262,103264,103275,103278,103284,103289-103291,103325,103371,103397,103399,103401,103411,103413,103421,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,104587,104611,105938,107106,107182,107261,107287,107342,107412,107536 |
165 | 165 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -39,10 +39,10 @@ |
40 | 40 | if ( $this->adapter->posted ) { |
41 | 41 | // The form was submitted and the payment method has been set |
42 | 42 | // Check form for errors |
43 | | - $form_errors = $this->validateForm( $this->errors ); |
| 43 | + $form_errors = $this->validateForm(); |
44 | 44 | // If there were errors, redisplay form, otherwise proceed to next step |
45 | 45 | if ( $form_errors ) { |
46 | | - $this->displayForm( $this->errors ); |
| 46 | + $this->displayForm(); |
47 | 47 | } else { // The submitted form data is valid, so process it |
48 | 48 | $result = $this->adapter->do_transaction( 'Card' ); |
49 | 49 | |
— | — | @@ -58,11 +58,12 @@ |
59 | 59 | } |
60 | 60 | } else { |
61 | 61 | // Display form for the first time |
62 | | - $this->displayForm( $this->errors ); |
| 62 | + $this->displayForm(); |
63 | 63 | } |
64 | 64 | } else {//token mismatch |
65 | | - $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
66 | | - $this->displayForm( $this->errors ); |
| 65 | + $error['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
| 66 | + $this->adapter->addManualError( $error ); |
| 67 | + $this->displayForm(); |
67 | 68 | } |
68 | 69 | } |
69 | 70 | |
— | — | @@ -83,7 +84,7 @@ |
84 | 85 | } |
85 | 86 | } |
86 | 87 | |
87 | | - $data = $this->adapter->getData_Raw(); |
| 88 | + $data = $this->adapter->getData_Unstaged_Escaped(); |
88 | 89 | $msgPrefix = $data['order_id'] . ' ' . $data['i_order_id'] . ' '; |
89 | 90 | |
90 | 91 | // if approved, display results and send transaction to the queue |
— | — | @@ -94,8 +95,9 @@ |
95 | 96 | } elseif ( ( $errorCode == '3' ) && ( $data['numAttempt'] < '5' ) ) { |
96 | 97 | $this->log( $msgPrefix . "Transaction unsuccessful (invalid info).", LOG_DEBUG ); |
97 | 98 | // pass responseMsg as an array key as required by displayForm |
98 | | - $this->errors['retryMsg'] = $responseMsg; |
99 | | - $this->displayForm( $this->errors ); |
| 99 | + $error['retryMsg'] = $responseMsg; |
| 100 | + $this->adapter->addManualError( $error ); |
| 101 | + $this->displayForm(); |
100 | 102 | // if declined or if user has already made two attempts, decline |
101 | 103 | } elseif ( ( $errorCode == '2' ) || ( $data['numAttempt'] >= '3' ) ) { |
102 | 104 | $this->log( $msgPrefix . "Transaction declined.", LOG_DEBUG ); |
— | — | @@ -108,14 +110,16 @@ |
109 | 111 | $this->fnPayflowDisplayPending( $data, $responseMsg ); |
110 | 112 | } elseif ( strpos( $errorCode, 'internal' ) === 0 ) { |
111 | 113 | $this->log( $msgPrefix . "Transaction unsuccessful (communication failure).", LOG_DEBUG ); |
112 | | - $this->errors['retryMsg'] = $responseMsg; |
113 | | - $this->displayForm( $this->errors ); |
| 114 | + $error['retryMsg'] = $responseMsg; |
| 115 | + $this->adapter->addManualError( $error ); |
| 116 | + $this->displayForm(); |
114 | 117 | } elseif ( !empty( $errorCode ) ) { |
115 | 118 | // This should not be hit. |
116 | 119 | $this->log( $msgPrefix . "Transaction unsuccessful (unknown failure).", LOG_DEBUG ); |
117 | 120 | $this->fnPayflowDisplayOtherResults( $responseMsg ); |
118 | | - $this->errors['retryMsg'] = $errorCode; |
119 | | - $this->displayForm( $this->errors ); |
| 121 | + $error['retryMsg'] = $errorCode; |
| 122 | + $this->adapter->addManualError( $error ); |
| 123 | + $this->displayForm(); |
120 | 124 | } |
121 | 125 | } |
122 | 126 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
123 | 127 | Merged /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php:r105938,107609 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/donationinterface_langonly.php |
— | — | @@ -38,8 +38,8 @@ |
39 | 39 | |
40 | 40 | // PayflowPro-specific messaging |
41 | 41 | $wgExtensionMessagesFiles['PayflowProGateway'] = $donationinterface_dir . 'payflowpro_gateway/payflowpro_gateway.i18n.php'; |
42 | | -$wgExtensionAliasesFiles['PayflowProGateway'] = $donationinterface_dir . 'payflowpro_gateway/payflowpro_gateway.alias.php'; |
| 42 | +$wgExtensionMessagesFiles['PayflowProGatewayAlias'] = $donationinterface_dir . 'payflowpro_gateway/payflowpro_gateway.alias.php'; |
43 | 43 | |
44 | 44 | // GlobalCollect-specific messaging |
45 | 45 | $wgExtensionMessagesFiles['GlobalCollectGateway'] = $donationinterface_dir . 'globalcollect_gateway/globalcollect_gateway.i18n.php'; |
46 | | -$wgExtensionAliasesFiles['GlobalCollectGateway'] = $donationinterface_dir . 'globalcollect_gateway/globalcollect_gateway.alias.php'; |
\ No newline at end of file |
| 46 | +$wgExtensionMessagesFiles['GlobalCollectGatewayAlias'] = $donationinterface_dir . 'globalcollect_gateway/globalcollect_gateway.alias.php'; |
\ No newline at end of file |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/donationinterface_langonly.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
47 | 47 | Merged /trunk/extensions/DonationInterface/donationinterface_langonly.php:r107299 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/custom_filters.body.php |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | $this->gateway_adapter->setValidationAction( $localAction ); |
61 | 61 | |
62 | 62 | $log_msg = '"' . $localAction . "\"\t\"" . $this->risk_score . "\""; |
63 | | - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Filtered', $log_msg ); |
| 63 | + $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Filtered', $log_msg ); |
64 | 64 | return TRUE; |
65 | 65 | } |
66 | 66 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/custom_filters.body.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
67 | 67 | Merged /trunk/extensions/DonationInterface/extras/custom_filters/custom_filters.body.php:r105938 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | |
23 | 23 | public function filter() { |
24 | 24 | // pull out the source from the filter object |
25 | | - $source = $this->gateway_adapter->getData_Raw( 'utm_source' ); |
| 25 | + $source = $this->gateway_adapter->getData_Unstaged_Escaped( 'utm_source' ); |
26 | 26 | |
27 | 27 | // a very complex filtering algorithm for sources |
28 | 28 | $srcRules = $this->gateway_adapter->getGlobal( 'CustomFiltersSrcRules' ); |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | $log_msg .= "\t\"" . addslashes( $regex ) . "\""; |
40 | 40 | $log_msg .= "\t\"" . $this->cfo->risk_score . "\""; |
41 | 41 | $this->log( |
42 | | - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Filter: Source', $log_msg |
| 42 | + $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Filter: Source', $log_msg |
43 | 43 | ); |
44 | 44 | } |
45 | 45 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
46 | 46 | Merged /trunk/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938 |
47 | 47 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php:r99568 |
48 | 48 | Merged /branches/fundraising/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php:r98263-100243 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | return TRUE; |
19 | 19 | } |
20 | 20 | |
21 | | - $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Raw() ); |
| 21 | + $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Unstaged_Escaped() ); |
22 | 22 | $this->query_minfraud( $minfraud_query ); |
23 | 23 | |
24 | 24 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
25 | 25 | Merged /branches/fundraising/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php:r98263-100243 |
26 | 26 | Merged /trunk/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938 |
27 | 27 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | |
23 | 23 | public function filter() { |
24 | 24 | // pull out the referrer from the gateway_adapter |
25 | | - $referrer = $this->gateway_adapter->getData_Raw( 'referrer' ); |
| 25 | + $referrer = $this->gateway_adapter->getData_Unstaged_Escaped( 'referrer' ); |
26 | 26 | |
27 | 27 | // a very complex filtering algorithm for referrers |
28 | 28 | $refRules = $this->gateway_adapter->getGlobal( 'CustomFiltersRefRules' ); |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | $log_msg .= "\t\"" . addslashes( $regex ) . "\""; |
40 | 40 | $log_msg .= "\t\"" . $this->cfo->risk_score . "\""; |
41 | 41 | $this->log( |
42 | | - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Filter: Referrer', $log_msg |
| 42 | + $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Filter: Referrer', $log_msg |
43 | 43 | ); |
44 | 44 | } |
45 | 45 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
46 | 46 | Merged /branches/fundraising/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php:r98263-100243 |
47 | 47 | Merged /trunk/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938 |
48 | 48 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/minfraud/minfraud.body.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | return TRUE; |
70 | 70 | } |
71 | 71 | |
72 | | - $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Raw() ); |
| 72 | + $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Unstaged_Escaped() ); |
73 | 73 | $this->query_minfraud( $minfraud_query ); |
74 | 74 | $localAction = $this->determine_action( $this->minfraud_response['riskScore'] ); |
75 | 75 | $this->gateway_adapter->setValidationAction( $localAction ); |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | // reset the data hash |
78 | 78 | $this->gateway_adapter->unsetHash(); |
79 | 79 | $this->gateway_adapter->setActionHash( $this->generate_hash( $localAction ) ); |
80 | | - $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Raw() ) ); |
| 80 | + $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Unstaged_Escaped() ) ); |
81 | 81 | |
82 | 82 | // Write the query/response to the log |
83 | 83 | $this->log_query( $minfraud_query, $localAction ); |
— | — | @@ -88,13 +88,13 @@ |
89 | 89 | */ |
90 | 90 | public function log_query( $minfraud_query, $action ) { |
91 | 91 | if ( $this->log_fh ) { |
92 | | - $log_message = '"' . addslashes( $this->gateway_adapter->getData_Raw( 'comment' ) ) . '"'; |
93 | | - $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Raw( 'amount' ) . ' ' . $this->gateway_adapter->getData_Raw( 'currency_code' ) ) . '"'; |
| 92 | + $log_message = '"' . addslashes( $this->gateway_adapter->getData_Unstaged_Escaped( 'comment' ) ) . '"'; |
| 93 | + $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Unstaged_Escaped( 'amount' ) . ' ' . $this->gateway_adapter->getData_Unstaged_Escaped( 'currency_code' ) ) . '"'; |
94 | 94 | $log_message .= "\t" . '"' . addslashes( json_encode( $minfraud_query ) ) . '"'; |
95 | 95 | $log_message .= "\t" . '"' . addslashes( json_encode( $this->minfraud_response ) ) . '"'; |
96 | 96 | $log_message .= "\t" . '"' . addslashes( $action ) . '"'; |
97 | | - $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Raw( 'referrer' ) ) . '"'; |
98 | | - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'minFraud query', $log_message ); |
| 97 | + $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Unstaged_Escaped( 'referrer' ) ) . '"'; |
| 98 | + $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'minFraud query', $log_message ); |
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | */ |
113 | 113 | public function can_bypass_minfraud() { |
114 | 114 | // if the data bits data_hash and action are not set, we need to hit minFraud |
115 | | - $localdata = $this->gateway_adapter->getData_Raw(); |
| 115 | + $localdata = $this->gateway_adapter->getData_Unstaged_Escaped(); |
116 | 116 | if ( !isset($localdata['data_hash']) || !strlen( $localdata['data_hash'] ) || !isset($localdata['action']) || !strlen( $localdata['action'] ) ) { |
117 | 117 | return FALSE; |
118 | 118 | } |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | // compare the data hash to make sure it's legit |
125 | 125 | if ( $this->compare_hash( $data_hash, serialize( $localdata ) ) ) { |
126 | 126 | |
127 | | - $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Raw() ) ); // hash the data array |
| 127 | + $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Unstaged_Escaped() ) ); // hash the data array |
128 | 128 | // check to see if we have a valid action set for us to bypass minfraud |
129 | 129 | $actions = array( 'process', 'challenge', 'review', 'reject' ); |
130 | 130 | $action_hash = $localdata['action']; // a hash of the action to take passed in by the form submission |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/minfraud/minfraud.body.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
131 | 131 | Merged /trunk/extensions/DonationInterface/extras/minfraud/minfraud.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938 |
132 | 132 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/minfraud/minfraud.body.php:r99568 |
133 | 133 | Merged /branches/fundraising/extensions/DonationInterface/extras/minfraud/minfraud.body.php:r98263-100243 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | // if the trxn has been outright rejected, log it |
13 | 13 | if ( $this->gateway_adapter->getValidationAction() == 'reject' ) { |
14 | 14 | $this->log( |
15 | | - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Rejected' |
| 15 | + $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Rejected' |
16 | 16 | ); |
17 | 17 | return TRUE; |
18 | 18 | } |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | return FALSE; |
23 | 23 | |
24 | 24 | $this->log( |
25 | | - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), "Gateway response: " . addslashes( $this->gateway_adapter->getTransactionMessage() ), '"' . addslashes( json_encode( $this->gateway_adapter->getTransactionData() ) ) . '"' |
| 25 | + $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), "Gateway response: " . addslashes( $this->gateway_adapter->getTransactionMessage() ), '"' . addslashes( json_encode( $this->gateway_adapter->getTransactionData() ) ) . '"' |
26 | 26 | ); |
27 | 27 | return TRUE; |
28 | 28 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
29 | 29 | Merged /trunk/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938 |
30 | 30 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php:r99568 |
31 | 31 | Merged /branches/fundraising/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php:r98263-100243 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php |
— | — | @@ -42,12 +42,12 @@ |
43 | 43 | $captcha_resp = $this->check_captcha(); |
44 | 44 | if ( $captcha_resp->is_valid ) { |
45 | 45 | // if validated, update the action and move on |
46 | | - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Captcha passed' ); |
| 46 | + $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Captcha passed' ); |
47 | 47 | $this->gateway_adapter->setValidationAction( 'process' ); |
48 | 48 | return TRUE; |
49 | 49 | } else { |
50 | 50 | $this->recap_err = $captcha_resp->error; |
51 | | - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Captcha failed' ); |
| 51 | + $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Captcha failed' ); |
52 | 52 | } |
53 | 53 | } |
54 | 54 | // display captcha |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | $useSSL = $this->gateway_adapter->getGlobal( 'RecaptchaUseSSL' ); |
66 | 66 | |
67 | 67 | // log that a captcha's been triggered |
68 | | - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Captcha triggered' ); |
| 68 | + $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Captcha triggered' ); |
69 | 69 | |
70 | 70 | // construct the HTML used to display the captcha |
71 | 71 | $captcha_html = Xml::openElement( 'div', array( 'id' => 'mw-donate-captcha' ) ); |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | |
78 | 78 | //TODO: use setValidationErrors and getValidationErrors everywhere, and |
79 | 79 | //refactor all the form constructors one more time. Eventually. |
80 | | - $data = $this->gateway_adapter->getData_Raw(); |
| 80 | + $data = $this->gateway_adapter->getData_Unstaged_Escaped(); |
81 | 81 | $errors = $this->gateway_adapter->getValidationErrors(); |
82 | 82 | $form_obj = new $form_class( $this->gateway_adapter, $errors ); |
83 | 83 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
84 | 84 | Merged /branches/fundraising/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php:r98263-100243 |
85 | 85 | Merged /trunk/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938 |
86 | 86 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php |
— | — | @@ -1,9 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnLetter2 extends Gateway_Form_OneStepTwoColumn { |
5 | | - public $paypal = false; // true for paypal only version |
6 | 5 | |
7 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
8 | 7 | global $wgScriptPath; |
9 | 8 | |
10 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -11,27 +10,17 @@ |
12 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter.css' ); |
13 | 12 | } |
14 | 13 | |
15 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
16 | 15 | } |
17 | 16 | |
18 | 17 | public function generateFormStart() { |
19 | | - global $wgOut, $wgRequest; |
20 | | - |
21 | | - $this->paypal = $wgRequest->getBool( 'paypal', false ); |
22 | | - |
23 | 18 | $form = parent::generateBannerHeader(); |
24 | 19 | |
25 | 20 | $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) ); |
26 | 21 | $form .= Xml::openElement( 'tr' ); |
27 | 22 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
28 | 23 | |
29 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
30 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
31 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
32 | | - |
33 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
34 | | - // if the template doesn't exist, prevent the display of the red link |
35 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 24 | + $template = self::generateTextTemplate(); |
36 | 25 | $form .= $template; |
37 | 26 | |
38 | 27 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -82,7 +71,7 @@ |
83 | 72 | } |
84 | 73 | |
85 | 74 | protected function generateBillingFields() { |
86 | | - global $wgScriptPath, $wgRequest; |
| 75 | + global $wgScriptPath; |
87 | 76 | $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes"; |
88 | 77 | |
89 | 78 | $form = ''; |
— | — | @@ -145,12 +134,8 @@ |
146 | 135 | } |
147 | 136 | |
148 | 137 | // anonymous |
149 | | - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true; |
150 | | - $form .= '<tr>'; |
151 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
152 | | - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
153 | | - $form .= '</tr>'; |
154 | | - |
| 138 | + $form .= $this->getCommentOptionField(); |
| 139 | + |
155 | 140 | // email agreement |
156 | 141 | $form .= $this->getEmailOptField(); |
157 | 142 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
158 | 143 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609 |
159 | 144 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php:r99568 |
160 | 145 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php:r95724-100157 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php |
— | — | @@ -1,9 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnLetter3 extends Gateway_Form_OneStepTwoColumn { |
5 | | - public $paypal = false; // true for paypal only version |
6 | 5 | |
7 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
8 | 7 | global $wgScriptPath; |
9 | 8 | |
10 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -11,27 +10,17 @@ |
12 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter.css' ); |
13 | 12 | } |
14 | 13 | |
15 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
16 | 15 | } |
17 | 16 | |
18 | 17 | public function generateFormStart() { |
19 | | - global $wgOut, $wgRequest; |
20 | | - |
21 | | - $this->paypal = $wgRequest->getBool( 'paypal', false ); |
22 | | - |
23 | 18 | $form = parent::generateBannerHeader(); |
24 | 19 | |
25 | 20 | $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) ); |
26 | 21 | $form .= Xml::openElement( 'tr' ); |
27 | 22 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
28 | 23 | |
29 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
30 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
31 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
32 | | - |
33 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
34 | | - // if the template doesn't exist, prevent the display of the red link |
35 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 24 | + $template = self::generateTextTemplate(); |
36 | 25 | $form .= $template; |
37 | 26 | |
38 | 27 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -82,7 +71,7 @@ |
83 | 72 | } |
84 | 73 | |
85 | 74 | protected function generateBillingFields() { |
86 | | - global $wgScriptPath, $wgRequest; |
| 75 | + global $wgScriptPath; |
87 | 76 | $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes"; |
88 | 77 | |
89 | 78 | $form = ''; |
— | — | @@ -145,11 +134,7 @@ |
146 | 135 | } |
147 | 136 | |
148 | 137 | // anonymous |
149 | | - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true; |
150 | | - $form .= '<tr>'; |
151 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
152 | | - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
153 | | - $form .= '</tr>'; |
| 138 | + $form .= $this->getCommentOptionField(); |
154 | 139 | |
155 | 140 | // email agreement |
156 | 141 | $form .= $this->getEmailOptField(); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
157 | 142 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php:r95724-100157 |
158 | 143 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609 |
159 | 144 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php |
— | — | @@ -1,9 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnLetter4 extends Gateway_Form_OneStepTwoColumn { |
5 | | - public $paypal = false; // true for paypal only version |
6 | 5 | |
7 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
8 | 7 | global $wgScriptPath; |
9 | 8 | |
10 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -11,27 +10,17 @@ |
12 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter4.css' ); |
13 | 12 | } |
14 | 13 | |
15 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
16 | 15 | } |
17 | 16 | |
18 | 17 | public function generateFormStart() { |
19 | | - global $wgOut, $wgRequest; |
20 | | - |
21 | | - $this->paypal = $wgRequest->getBool( 'paypal', false ); |
22 | | - |
23 | 18 | $form = parent::generateBannerHeader(); |
24 | 19 | |
25 | 20 | $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) ); |
26 | 21 | $form .= Xml::openElement( 'tr' ); |
27 | 22 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
28 | 23 | |
29 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
30 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
31 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
32 | | - |
33 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
34 | | - // if the template doesn't exist, prevent the display of the red link |
35 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 24 | + $template = self::generateTextTemplate(); |
36 | 25 | $form .= $template; |
37 | 26 | |
38 | 27 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -82,7 +71,7 @@ |
83 | 72 | } |
84 | 73 | |
85 | 74 | protected function generateBillingFields() { |
86 | | - global $wgScriptPath, $wgRequest; |
| 75 | + global $wgScriptPath; |
87 | 76 | $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes"; |
88 | 77 | |
89 | 78 | $form = ''; |
— | — | @@ -145,11 +134,7 @@ |
146 | 135 | } |
147 | 136 | |
148 | 137 | // anonymous |
149 | | - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true; |
150 | | - $form .= '<tr>'; |
151 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
152 | | - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
153 | | - $form .= '</tr>'; |
| 138 | + $form .= $this->getCommentOptionField(); |
154 | 139 | |
155 | 140 | // email agreement |
156 | 141 | $form .= $this->getEmailOptField(); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
157 | 142 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php:r95724-100157 |
158 | 143 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609 |
159 | 144 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnLetter5 extends Gateway_Form_OneStepTwoColumn { |
5 | 5 | |
6 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
7 | 7 | global $wgScriptPath; |
8 | 8 | |
9 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -10,11 +10,11 @@ |
11 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter5.css' ); |
12 | 12 | } |
13 | 13 | |
14 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | public function generateFormStart() { |
18 | | - global $wgOut, $wgRequest; |
| 18 | + global $wgOut; |
19 | 19 | |
20 | 20 | $form = parent::generateBannerHeader(); |
21 | 21 | |
— | — | @@ -22,13 +22,7 @@ |
23 | 23 | $form .= Xml::openElement( 'tr' ); |
24 | 24 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
25 | 25 | |
26 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
27 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
28 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
29 | | - |
30 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
31 | | - // if the template doesn't exist, prevent the display of the red link |
32 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 26 | + $template = self::generateTextTemplate(); |
33 | 27 | $form .= $template; |
34 | 28 | |
35 | 29 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -79,7 +73,7 @@ |
80 | 74 | } |
81 | 75 | |
82 | 76 | protected function generateBillingFields() { |
83 | | - global $wgScriptPath, $wgRequest; |
| 77 | + global $wgScriptPath; |
84 | 78 | $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes"; |
85 | 79 | |
86 | 80 | $form = ''; |
— | — | @@ -93,24 +87,24 @@ |
94 | 88 | // amount |
95 | 89 | $otherChecked = false; |
96 | 90 | $amount = -1; |
97 | | - if ( $this->form_data['amount'] != 100 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) { |
| 91 | + if ( $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) { |
98 | 92 | $otherChecked = true; |
99 | | - $amount = $this->form_data['amountOther']; |
| 93 | + $amount = $this->getEscapedValue( 'amountOther' ); |
100 | 94 | } |
101 | 95 | $form .= '<tr>'; |
102 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 96 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
103 | 97 | $form .= '</tr>'; |
104 | 98 | $form .= '<tr>'; |
105 | 99 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>'; |
106 | | - $form .= '<td>' . Xml::radio( 'amount', 100, $this->form_data['amount'] == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' . |
107 | | - Xml::radio( 'amount', 50, $this->form_data['amount'] == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' . |
108 | | - Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' . |
109 | | - Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' . |
| 100 | + $form .= '<td>' . Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' . |
| 101 | + Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' . |
| 102 | + Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' . |
| 103 | + Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' . |
110 | 104 | '</td>'; |
111 | 105 | $form .= '</tr>'; |
112 | 106 | $form .= '<tr>'; |
113 | 107 | $form .= '<td class="label"></td>'; |
114 | | - $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) . |
| 108 | + $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) . |
115 | 109 | ' ' . $this->generateCurrencyDropdown() . '</td>'; |
116 | 110 | $form .= '</tr>'; |
117 | 111 | |
— | — | @@ -121,7 +115,7 @@ |
122 | 116 | $form .= $this->getEmailField(); |
123 | 117 | |
124 | 118 | // email opt-in |
125 | | - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true; |
| 119 | + $email_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'email-opt' ) : true; |
126 | 120 | $form .= '<tr>'; |
127 | 121 | $form .= '<td class="label"> </td>'; |
128 | 122 | $form .= '<td class="check-option">' . Xml::check( 'email-opt', $email_opt_value ); |
— | — | @@ -132,15 +126,15 @@ |
133 | 127 | $form .= Xml::closeElement( 'label' ); |
134 | 128 | $form .= '</td>'; |
135 | 129 | $form .= '</tr>'; |
136 | | - |
| 130 | + |
137 | 131 | $form .= '<tr>'; |
138 | 132 | $form .= '<td class="label">' . wfMsg( 'donate_interface-payment-type' ) . '</td>'; |
139 | 133 | $form .= '<td>' . |
140 | | - Xml::radio( 'card_type', 'cc1', $this->form_data['card_type'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' . |
141 | | - Xml::radio( 'card_type', 'cc2', $this->form_data['card_type'] == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' . |
142 | | - Xml::radio( 'card_type', 'cc3', $this->form_data['card_type'] == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' . |
143 | | - Xml::radio( 'card_type', 'cc4', $this->form_data['card_type'] == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' . |
144 | | - Xml::radio( 'card_type', 'pp', $this->form_data['card_type'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' . |
| 134 | + Xml::radio( 'card_type', 'cc1', $this->getEscapedValue( 'card_type' ) == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' . |
| 135 | + Xml::radio( 'card_type', 'cc2', $this->getEscapedValue( 'card_type' ) == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' . |
| 136 | + Xml::radio( 'card_type', 'cc3', $this->getEscapedValue( 'card_type' ) == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' . |
| 137 | + Xml::radio( 'card_type', 'cc4', $this->getEscapedValue( 'card_type' ) == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' . |
| 138 | + Xml::radio( 'card_type', 'pp', $this->getEscapedValue( 'card_type' ) == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' . |
145 | 139 | '</td>'; |
146 | 140 | $form .= '</tr>'; |
147 | 141 | |
— | — | @@ -172,22 +166,12 @@ |
173 | 167 | $form .= '</tr>'; |
174 | 168 | $form .= '<tr>'; |
175 | 169 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-postal' ), 'zip' ) . '</td>'; |
176 | | - $form .= '<td>' . Xml::input( 'zip', '15', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) . |
| 170 | + $form .= '<td>' . Xml::input( 'zip', '15', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) . |
177 | 171 | '</td>'; |
178 | 172 | $form .= '</tr>'; |
179 | 173 | // country |
180 | 174 | $form .= $this->getCountryField(); |
181 | 175 | |
182 | | - /* |
183 | | - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true; |
184 | | - $form .= '<tr>'; |
185 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
186 | | - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
187 | | - $form .= '</tr>'; |
188 | | - |
189 | | - $form .= $this->getEmailOptField(); |
190 | | - */ |
191 | | - |
192 | 176 | return $form; |
193 | 177 | } |
194 | 178 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
195 | 179 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php:r95724-100157 |
196 | 180 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609 |
197 | 181 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnLetter6 extends Gateway_Form_OneStepTwoColumn { |
5 | 5 | |
6 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
7 | 7 | global $wgScriptPath; |
8 | 8 | |
9 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -10,11 +10,11 @@ |
11 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter6.css' ); |
12 | 12 | } |
13 | 13 | |
14 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | public function generateFormStart() { |
18 | | - global $wgOut, $wgRequest; |
| 18 | + global $wgOut; |
19 | 19 | |
20 | 20 | $form = parent::generateBannerHeader(); |
21 | 21 | |
— | — | @@ -22,13 +22,7 @@ |
23 | 23 | $form .= Xml::openElement( 'tr' ); |
24 | 24 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
25 | 25 | |
26 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
27 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
28 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
29 | | - |
30 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
31 | | - // if the template doesn't exist, prevent the display of the red link |
32 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 26 | + $template = self::generateTextTemplate(); |
33 | 27 | $form .= $template; |
34 | 28 | |
35 | 29 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -79,7 +73,7 @@ |
80 | 74 | } |
81 | 75 | |
82 | 76 | protected function generateBillingFields() { |
83 | | - global $wgScriptPath, $wgRequest; |
| 77 | + global $wgScriptPath; |
84 | 78 | $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes"; |
85 | 79 | |
86 | 80 | $form = ''; |
— | — | @@ -93,29 +87,29 @@ |
94 | 88 | // amount |
95 | 89 | $otherChecked = false; |
96 | 90 | $amount = -1; |
97 | | - if ( $this->form_data['amount'] != 100 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) { |
| 91 | + if ( $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) { |
98 | 92 | $otherChecked = true; |
99 | | - $amount = $this->form_data['amountOther']; |
| 93 | + $amount = $this->getEscapedValue( 'amountOther' ); |
100 | 94 | } |
101 | 95 | $form .= '<tr>'; |
102 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 96 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
103 | 97 | $form .= '</tr>'; |
104 | 98 | $form .= '<tr>'; |
105 | 99 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>'; |
106 | | - $form .= '<td>' . Xml::radio( 'amount', 100, $this->form_data['amount'] == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' . |
107 | | - Xml::radio( 'amount', 50, $this->form_data['amount'] == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' . |
108 | | - Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' . |
109 | | - Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' . |
| 100 | + $form .= '<td>' . Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' . |
| 101 | + Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' . |
| 102 | + Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' . |
| 103 | + Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' . |
110 | 104 | '</td>'; |
111 | 105 | $form .= '</tr>'; |
112 | 106 | $form .= '<tr>'; |
113 | 107 | $form .= '<td class="label"></td>'; |
114 | | - $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) . |
| 108 | + $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) . |
115 | 109 | ' ' . $this->generateCurrencyDropdown() . '</td>'; |
116 | 110 | $form .= '</tr>'; |
117 | 111 | |
118 | 112 | // email opt-in |
119 | | - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true; |
| 113 | + $email_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'email-opt' ) : true; |
120 | 114 | $form .= '<tr>'; |
121 | 115 | $form .= '<td class="label"> </td>'; |
122 | 116 | $form .= '<td class="check-option">' . Xml::check( 'email-opt', $email_opt_value ); |
— | — | @@ -130,17 +124,17 @@ |
131 | 125 | $form .= '<tr>'; |
132 | 126 | $form .= '<td class="label">' . wfMsg( 'donate_interface-payment-type' ) . '</td>'; |
133 | 127 | $form .= '<td>' . |
134 | | - Xml::radio( 'card_type', 'cc1', $this->form_data['card_type'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' . |
135 | | - Xml::radio( 'card_type', 'cc2', $this->form_data['card_type'] == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' . |
136 | | - Xml::radio( 'card_type', 'cc3', $this->form_data['card_type'] == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' . |
137 | | - Xml::radio( 'card_type', 'cc4', $this->form_data['card_type'] == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' . |
138 | | - Xml::radio( 'card_type', 'pp', $this->form_data['card_type'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' . |
| 128 | + Xml::radio( 'card_type', 'cc1', $this->getEscapedValue( 'card_type' ) == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' . |
| 129 | + Xml::radio( 'card_type', 'cc2', $this->getEscapedValue( 'card_type' ) == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' . |
| 130 | + Xml::radio( 'card_type', 'cc3', $this->getEscapedValue( 'card_type' ) == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' . |
| 131 | + Xml::radio( 'card_type', 'cc4', $this->getEscapedValue( 'card_type' ) == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' . |
| 132 | + Xml::radio( 'card_type', 'pp', $this->getEscapedValue( 'card_type' ) == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' . |
139 | 133 | '</td>'; |
140 | 134 | $form .= '</tr>'; |
141 | 135 | |
142 | 136 | $form .= '</table>'; |
143 | 137 | |
144 | | - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) { |
| 138 | + if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) { |
145 | 139 | $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) ); |
146 | 140 | } else { |
147 | 141 | $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc', 'style' => 'display: none;' ) ); |
— | — | @@ -180,29 +174,19 @@ |
181 | 175 | $form .= '</tr>'; |
182 | 176 | $form .= '<tr>'; |
183 | 177 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-postal' ), 'zip' ) . '</td>'; |
184 | | - $form .= '<td>' . Xml::input( 'zip', '15', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) . |
| 178 | + $form .= '<td>' . Xml::input( 'zip', '15', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) . |
185 | 179 | '</td>'; |
186 | 180 | $form .= '</tr>'; |
187 | 181 | // country |
188 | 182 | $form .= $this->getCountryField(); |
189 | 183 | |
190 | | - /* |
191 | | - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true; |
192 | | - $form .= '<tr>'; |
193 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
194 | | - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
195 | | - $form .= '</tr>'; |
196 | | - |
197 | | - $form .= $this->getEmailOptField(); |
198 | | - */ |
199 | | - |
200 | 184 | return $form; |
201 | 185 | } |
202 | 186 | |
203 | 187 | public function generateFormSubmit() { |
204 | 188 | |
205 | 189 | // cc submit button |
206 | | - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) { |
| 190 | + if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) { |
207 | 191 | $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit' ) ); |
208 | 192 | } else { |
209 | 193 | $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit', 'style' => 'display: none;' ) ); |
— | — | @@ -216,7 +200,7 @@ |
217 | 201 | $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit |
218 | 202 | |
219 | 203 | // paypal submit button |
220 | | - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) { |
| 204 | + if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) { |
221 | 205 | $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal', 'style' => 'display: none;' ) ); |
222 | 206 | } else { |
223 | 207 | $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal' ) ); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
224 | 208 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php:r95724-100157 |
225 | 209 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609 |
226 | 210 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoStepTwoColumnLetter extends Gateway_Form_TwoStepTwoColumn { |
5 | | - public function __construct( &$gateway, &$form_errors ) { |
| 5 | + public function __construct( &$gateway ) { |
6 | 6 | global $wgScriptPath; |
7 | 7 | |
8 | 8 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -9,11 +9,11 @@ |
10 | 10 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter.css' ); |
11 | 11 | } |
12 | 12 | |
13 | | - parent::__construct( $gateway, $form_errors ); |
| 13 | + parent::__construct( $gateway ); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function generateFormStart() { |
17 | | - global $wgOut, $wgRequest; |
| 17 | + global $wgOut; |
18 | 18 | |
19 | 19 | $form = parent::generateBannerHeader(); |
20 | 20 | |
— | — | @@ -21,13 +21,7 @@ |
22 | 22 | $form .= Xml::openElement( 'tr' ); |
23 | 23 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
24 | 24 | |
25 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
26 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
27 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
28 | | - |
29 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
30 | | - // if the template doesn't exist, prevent the display of the red link |
31 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 25 | + $template = self::generateTextTemplate(); |
32 | 26 | $form .= $template; |
33 | 27 | |
34 | 28 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -90,16 +84,16 @@ |
91 | 85 | |
92 | 86 | // amount |
93 | 87 | $form .= '<tr>'; |
94 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 88 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
95 | 89 | $form .= '</tr>'; |
96 | 90 | $form .= '<tr>'; |
97 | 91 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>'; |
98 | | - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
| 92 | + $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
99 | 93 | ' ' . $this->generateCurrencyDropdown() . '</td>'; |
100 | 94 | $form .= '</tr>'; |
101 | 95 | |
102 | 96 | // card logos |
103 | | - if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
| 97 | + if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) { |
104 | 98 | $form .= '<tr id="four_cards" style="display:table-row;">'; |
105 | 99 | $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
106 | 100 | $form .= '</tr>'; |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
107 | 101 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php:r95724-100157 |
108 | 102 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609 |
109 | 103 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnLetter7 extends Gateway_Form_OneStepTwoColumn { |
5 | 5 | |
6 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
7 | 7 | global $wgScriptPath; |
8 | 8 | |
9 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter7.css' ); |
12 | 12 | } |
13 | 13 | |
14 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | public function loadPlaceholders() { |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | } |
137 | 137 | |
138 | 138 | public function generateFormStart() { |
139 | | - global $wgOut, $wgRequest; |
| 139 | + global $wgOut; |
140 | 140 | |
141 | 141 | $form = parent::generateBannerHeader(); |
142 | 142 | |
— | — | @@ -143,13 +143,7 @@ |
144 | 144 | $form .= Xml::openElement( 'tr' ); |
145 | 145 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
146 | 146 | |
147 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
148 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
149 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
150 | | - |
151 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
152 | | - // if the template doesn't exist, prevent the display of the red link |
153 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 147 | + $template = self::generateTextTemplate(); |
154 | 148 | $form .= $template; |
155 | 149 | |
156 | 150 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -214,63 +208,49 @@ |
215 | 209 | // amount |
216 | 210 | $otherChecked = false; |
217 | 211 | $amount = -1; |
218 | | - if ( $this->form_data['amount'] != 250 && $this->form_data['amount'] != 150 && $this->form_data['amount'] != 100 && $this->form_data['amount'] != 75 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) { |
| 212 | + if ( $this->getEscapedValue( 'amount' ) != 250 && $this->getEscapedValue( 'amount' ) != 150 && $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 75 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) { |
219 | 213 | $otherChecked = true; |
220 | | - $amount = $this->form_data['amountOther']; |
| 214 | + $amount = $this->getEscapedValue( 'amountOther' ); |
221 | 215 | } |
222 | 216 | $form .= '<tr>'; |
223 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 217 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
224 | 218 | $form .= '</tr>'; |
225 | 219 | $form .= '<tr>'; |
226 | 220 | $form .= '<td class="label"><div style="padding-top:4px;">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</div></td>'; |
227 | 221 | $form .= '<td>' . |
228 | 222 | '<table cellspacing="3" cellpadding="0" border="0" style="margin-bottom:0.2em;"><tr>' . |
229 | | - '<td>'.Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$20 '.'</td>'. |
230 | | - '<td>'.Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$35 '.'</td>'. |
231 | | - '<td>'.Xml::radio( 'amount', 50, $this->form_data['amount'] == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$50 '.'</td>'. |
232 | | - '<td>'.Xml::radio( 'amount', 75, $this->form_data['amount'] == 75, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$75 '.'</td>'. |
| 223 | + '<td>'.Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$20 '.'</td>'. |
| 224 | + '<td>'.Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$35 '.'</td>'. |
| 225 | + '<td>'.Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$50 '.'</td>'. |
| 226 | + '<td>'.Xml::radio( 'amount', 75, $this->getEscapedValue( 'amount' ) == 75, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$75 '.'</td>'. |
233 | 227 | '</tr><tr>' . |
234 | | - '<td>'.Xml::radio( 'amount', 100, $this->form_data['amount'] == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$100 '.'</td>'. |
235 | | - '<td>'.Xml::radio( 'amount', 150, $this->form_data['amount'] == 150, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$150 '.'</td>'. |
236 | | - '<td>'.Xml::radio( 'amount', 250, $this->form_data['amount'] == 250, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$250 '.'</td>'. |
237 | | - '<td>'.Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ).Html::hidden( 'currency_code', 'USD' ).'</td>'. |
| 228 | + '<td>'.Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$100 '.'</td>'. |
| 229 | + '<td>'.Xml::radio( 'amount', 150, $this->getEscapedValue( 'amount' ) == 150, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$150 '.'</td>'. |
| 230 | + '<td>'.Xml::radio( 'amount', 250, $this->getEscapedValue( 'amount' ) == 250, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$250 '.'</td>'. |
| 231 | + '<td>'.Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ).Html::hidden( 'currency_code', 'USD' ).'</td>'. |
238 | 232 | '</tr></table>' . |
239 | 233 | '</td>'; |
240 | 234 | $form .= '</tr>'; |
241 | 235 | |
242 | | - // email opt-in |
243 | | - /* |
244 | | - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true; |
245 | | - $form .= '<tr>'; |
246 | | - $form .= '<td class="label"> </td>'; |
247 | | - $form .= '<td class="check-option">' . Xml::check( 'email-opt', $email_opt_value ); |
248 | | - $form .= ' '; |
249 | | - $form .= Xml::openElement( 'label', array( 'for' => 'email-opt' ) ); |
250 | | - $form .= wfMsg( 'donate_interface-email-agreement' ); |
251 | | - $form .= Xml::closeElement( 'label' ); |
252 | | - $form .= '</td>'; |
253 | | - $form .= '</tr>'; |
254 | | - */ |
255 | | - |
256 | 236 | // Payment type |
257 | 237 | $form .= '<tr>'; |
258 | 238 | $form .= '<td class="label""><div style="padding-top:9px;">' . wfMsg( 'donate_interface-payment-type' ) . '</div></td>'; |
259 | 239 | $form .= '<td>' . |
260 | 240 | '<p style="border: 1px solid rgb(187, 187, 187); float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0 8px 0 0; padding: 5px 5px 5px 3px; white-space: nowrap;">'. |
261 | | - Xml::radio( 'card_type', 'cc1', $this->form_data['card_type'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' . |
| 241 | + Xml::radio( 'card_type', 'cc1', $this->getEscapedValue( 'card_type' ) == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' . |
262 | 242 | ' <label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' . |
263 | 243 | ' <label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' . |
264 | 244 | ' <label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' . |
265 | 245 | '</p>'. |
266 | 246 | '<p style="border: 1px solid transparent; float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0; padding: 5px 5px 5px 3px; white-space: nowrap;">'. |
267 | | - Xml::radio( 'card_type', 'pp', $this->form_data['card_type'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' . |
| 247 | + Xml::radio( 'card_type', 'pp', $this->getEscapedValue( 'card_type' ) == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' . |
268 | 248 | '</p>'. |
269 | 249 | '</td>'; |
270 | 250 | $form .= '</tr>'; |
271 | 251 | |
272 | 252 | $form .= '</table>'; |
273 | 253 | |
274 | | - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) { |
| 254 | + if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) { |
275 | 255 | $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) ); |
276 | 256 | } else { |
277 | 257 | $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc', 'style' => 'display: none;' ) ); |
— | — | @@ -302,8 +282,8 @@ |
303 | 283 | $form .= '</tr>'; |
304 | 284 | $form .= '<tr>'; |
305 | 285 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-name-on-card' ), 'fname' ) . '</td>'; |
306 | | - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
307 | | - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
| 286 | + $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
| 287 | + Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
308 | 288 | $form .= "</tr>"; |
309 | 289 | |
310 | 290 | // street |
— | — | @@ -312,7 +292,7 @@ |
313 | 293 | $form .= '</tr>'; |
314 | 294 | $form .= '<tr>'; |
315 | 295 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-billing-address' ), 'street' ) . '</td>'; |
316 | | - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
| 296 | + $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
317 | 297 | '</td>'; |
318 | 298 | $form .= '</tr>'; |
319 | 299 | |
— | — | @@ -322,9 +302,9 @@ |
323 | 303 | $form .= '</tr>'; |
324 | 304 | $form .= '<tr>'; |
325 | 305 | $form .= '<td class="label"> </td>'; |
326 | | - $form .= '<td>' . Xml::input( 'city', '18', $this->form_data['city'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' . |
| 306 | + $form .= '<td>' . Xml::input( 'city', '18', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' . |
327 | 307 | $this->generateStateDropdown() . ' ' . |
328 | | - Xml::input( 'zip', '5', $this->form_data['zip'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) . |
| 308 | + Xml::input( 'zip', '5', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) . |
329 | 309 | Html::hidden( 'country', 'US' ) . |
330 | 310 | '</td>'; |
331 | 311 | $form .= '</tr>'; |
— | — | @@ -346,21 +326,11 @@ |
347 | 327 | $form .= '</tr>'; |
348 | 328 | $form .= '<tr>'; |
349 | 329 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-email-receipt' ), 'emailAdd' ) . '</td>'; |
350 | | - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
| 330 | + $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
351 | 331 | Html::hidden( 'email-opt', 1 ) . |
352 | 332 | '</td>'; |
353 | 333 | $form .= '</tr>'; |
354 | 334 | |
355 | | - /* |
356 | | - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true; |
357 | | - $form .= '<tr>'; |
358 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
359 | | - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
360 | | - $form .= '</tr>'; |
361 | | - |
362 | | - $form .= $this->getEmailOptField(); |
363 | | - */ |
364 | | - |
365 | 335 | return $form; |
366 | 336 | } |
367 | 337 | |
— | — | @@ -368,7 +338,7 @@ |
369 | 339 | global $wgScriptPath; |
370 | 340 | |
371 | 341 | // cc submit button |
372 | | - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) { |
| 342 | + if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) { |
373 | 343 | $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit' ) ); |
374 | 344 | } else { |
375 | 345 | $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit', 'style' => 'display: none;' ) ); |
— | — | @@ -382,7 +352,7 @@ |
383 | 353 | $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit |
384 | 354 | |
385 | 355 | // paypal submit button |
386 | | - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) { |
| 356 | + if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) { |
387 | 357 | $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal', 'style' => 'display: none;' ) ); |
388 | 358 | } else { |
389 | 359 | $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal' ) ); |
— | — | @@ -439,7 +409,7 @@ |
440 | 410 | // generate dropdown of state opts |
441 | 411 | foreach ( $states as $value => $state_name ) { |
442 | 412 | if ( $value !== 'YY' && $value !== 'XX' ) { |
443 | | - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false; |
| 413 | + $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false; |
444 | 414 | $state_opts .= Xml::option( $value, $value, $selected ); |
445 | 415 | } |
446 | 416 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
447 | 417 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php:r95724-100157 |
448 | 418 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609 |
449 | 419 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnPayPal extends Gateway_Form_OneStepTwoColumn { |
5 | | - public function __construct( &$gateway, &$form_errors ) { |
6 | | - parent::__construct( $gateway, $form_errors ); |
| 5 | + public function __construct( &$gateway ) { |
| 6 | + parent::__construct( $gateway ); |
7 | 7 | } |
8 | 8 | |
9 | 9 | public function generateFormStart() { |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
10 | 10 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php:r95724-100157 |
11 | 11 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,107609 |
12 | 12 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/SingleColumn.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | |
4 | 4 | class Gateway_Form_SingleColumn extends Gateway_Form_TwoColumnLetter { |
5 | 5 | |
6 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
7 | 7 | global $wgScriptPath; |
8 | 8 | |
9 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/SingleColumn.css' ); |
12 | 12 | } |
13 | 13 | |
14 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
15 | 15 | } |
16 | 16 | |
17 | 17 | public function generateFormEnd() { |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/SingleColumn.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
18 | 18 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/SingleColumn.php:r95724-100157 |
19 | 19 | Merged /trunk/extensions/DonationInterface/gateway_forms/SingleColumn.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,107609 |
20 | 20 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/SingleColumn.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoStepTwoColumnLetterCA extends Gateway_Form_TwoStepTwoColumn { |
5 | | - public function __construct( &$gateway, &$form_errors ) { |
| 5 | + public function __construct( &$gateway ) { |
6 | 6 | global $wgScriptPath; |
7 | 7 | |
8 | 8 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -9,11 +9,11 @@ |
10 | 10 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter.css' ); |
11 | 11 | } |
12 | 12 | |
13 | | - parent::__construct( $gateway, $form_errors ); |
| 13 | + parent::__construct( $gateway ); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function generateFormStart() { |
17 | | - global $wgOut, $wgRequest; |
| 17 | + global $wgOut; |
18 | 18 | |
19 | 19 | $form = parent::generateBannerHeader(); |
20 | 20 | |
— | — | @@ -21,13 +21,7 @@ |
22 | 22 | $form .= Xml::openElement( 'tr' ); |
23 | 23 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
24 | 24 | |
25 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
26 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
27 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
28 | | - |
29 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
30 | | - // if the template doesn't exist, prevent the display of the red link |
31 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 25 | + $template = self::generateTextTemplate(); |
32 | 26 | $form .= $template; |
33 | 27 | |
34 | 28 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -90,16 +84,16 @@ |
91 | 85 | |
92 | 86 | // amount |
93 | 87 | $form .= '<tr>'; |
94 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 88 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
95 | 89 | $form .= '</tr>'; |
96 | 90 | $form .= '<tr>'; |
97 | 91 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>'; |
98 | | - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
| 92 | + $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
99 | 93 | ' ' . $this->generateCurrencyDropdown( 'CAD' ) . '</td>'; |
100 | 94 | $form .= '</tr>'; |
101 | 95 | |
102 | 96 | // card logos |
103 | | - if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
| 97 | + if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) { |
104 | 98 | $form .= '<tr id="four_cards" style="display:table-row;">'; |
105 | 99 | $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
106 | 100 | $form .= '</tr>'; |
— | — | @@ -182,7 +176,7 @@ |
183 | 177 | |
184 | 178 | // generate dropdown of state opts |
185 | 179 | foreach ( $states as $value => $state_name ) { |
186 | | - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false; |
| 180 | + $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false; |
187 | 181 | $state_opts .= Xml::option( wfMsg( 'donate_interface-province-dropdown-' . $value ), $value, $selected ); |
188 | 182 | } |
189 | 183 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
190 | 184 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php:r95724-100157 |
191 | 185 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609 |
192 | 186 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/Form.php |
— | — | @@ -15,30 +15,19 @@ |
16 | 16 | public $hidden_fields; |
17 | 17 | |
18 | 18 | /** |
19 | | - * An array of form data, collected from the gateway parameter. |
20 | | - * @var array |
21 | | - */ |
22 | | - public $form_data; |
23 | | - |
24 | | - /** |
25 | 19 | * The id of the form. |
26 | 20 | * |
27 | 21 | * This should also be the name of the form |
28 | 22 | * |
29 | 23 | * @var string |
30 | 24 | */ |
| 25 | + //TODO: Determine what this is, and either take measures to reference |
| 26 | + //something closer to the source data via the gateway object, or get rid of |
| 27 | + //it. If this is (as the comment suggests) also the name of the form, |
| 28 | + //my vote goes for option 2. |
31 | 29 | public $form_id = 'payment'; |
32 | 30 | |
33 | 31 | /** |
34 | | - * The name of the form. |
35 | | - * |
36 | | - * This should also be the id of the form |
37 | | - * |
38 | | - * @var string |
39 | | - */ |
40 | | - public $form_name = 'payment'; |
41 | | - |
42 | | - /** |
43 | 32 | * An array of form errors, passed from the payflow pro object |
44 | 33 | * @var array |
45 | 34 | */ |
— | — | @@ -55,20 +44,14 @@ |
56 | 45 | * @var string |
57 | 46 | */ |
58 | 47 | protected $captcha_html; |
59 | | - |
| 48 | + |
60 | 49 | /** |
61 | | - * The payment method |
62 | | - * @var string |
| 50 | + * Tells us if we're paypal only or not. |
| 51 | + * @var boolean |
63 | 52 | */ |
64 | | - protected $payment_method = ''; |
| 53 | + public $paypal = false; // true for paypal only version |
65 | 54 | |
66 | 55 | /** |
67 | | - * The payment submethod |
68 | | - * @var string |
69 | | - */ |
70 | | - protected $payment_submethod = ''; |
71 | | - |
72 | | - /** |
73 | 56 | * Required method for returning the full HTML for a form. |
74 | 57 | * |
75 | 58 | * Code invoking forms will expect this method to be set. Requiring only |
— | — | @@ -79,13 +62,17 @@ |
80 | 63 | */ |
81 | 64 | abstract function getForm(); |
82 | 65 | |
83 | | - public function __construct( &$gateway, &$error ) { |
84 | | - global $wgOut; |
| 66 | + public function __construct( &$gateway ) { |
| 67 | + global $wgOut, $wgRequest; |
85 | 68 | |
86 | 69 | $this->gateway = & $gateway; |
87 | 70 | $this->test = $this->gateway->getGlobal( "Test" ); |
88 | | - $this->form_data = $this->gateway->getData_Raw(); |
89 | | - $this->form_errors = & $error; |
| 71 | + $gateway_errors = $this->gateway->getAllErrors(); |
| 72 | + if ( !is_array( $gateway_errors ) ){ |
| 73 | + $gateway_errors = array(); |
| 74 | + } |
| 75 | + $this->form_errors = array_merge( DataValidator::getEmptyErrorArray(), $gateway_errors ); |
| 76 | + $this->paypal = $wgRequest->getBool( 'paypal', false ); |
90 | 77 | |
91 | 78 | /** |
92 | 79 | * add form-specific css - the path can be set in child classes |
— | — | @@ -119,14 +106,15 @@ |
120 | 107 | |
121 | 108 | /** |
122 | 109 | * Initialize the form |
123 | | - * |
| 110 | + * Called by the main Form construtror, this was clearly meant to be |
| 111 | + * overridden where necessary in child classes. |
124 | 112 | */ |
125 | 113 | protected function init() { |
126 | 114 | } |
127 | 115 | |
128 | 116 | /** |
129 | | - * Override the link in the logo to redirec to a particular form |
130 | | - * rather than the main page |
| 117 | + * Override the link in the logo to redirect to a particular form |
| 118 | + * rather than the main page. Called by the form class constructor. |
131 | 119 | */ |
132 | 120 | public function loadLogoLinkOverride() { |
133 | 121 | global $wgOut; |
— | — | @@ -160,6 +148,7 @@ |
161 | 149 | |
162 | 150 | /** |
163 | 151 | * Generates the donation footer ("There are other ways to give...") |
| 152 | + * This function is not used by any RapidHTML forms. |
164 | 153 | * @return string of HTML |
165 | 154 | */ |
166 | 155 | public function generateDonationFooter() { |
— | — | @@ -184,6 +173,7 @@ |
185 | 174 | |
186 | 175 | /** |
187 | 176 | * Generate the menu select of countries |
| 177 | + * This function is not used by any RapidHTML forms. |
188 | 178 | * @fixme It would be great if we could default the country to the user's locale |
189 | 179 | * @fixme We should also do a locale-based asort on the country dropdown |
190 | 180 | * (see http://us.php.net/asort) |
— | — | @@ -202,10 +192,10 @@ |
203 | 193 | |
204 | 194 | // generate a dropdown option for each country |
205 | 195 | foreach ( $countries as $iso_value => $full_name ) { |
206 | | - // Note: If the server has the php5-geoip package, $this->form_data['country'] will |
| 196 | + // Note: If the server has the php5-geoip package, $this->getEscapedValue( 'country' ) will |
207 | 197 | // always have a value. |
208 | | - if ( $this->form_data['country'] ) { |
209 | | - $selected = ( $iso_value == $this->form_data['country'] ) ? true : false; |
| 198 | + if ( $this->getEscapedValue( 'country' ) ) { |
| 199 | + $selected = ( $iso_value == $this->getEscapedValue( 'country' ) ) ? true : false; |
210 | 200 | } else { |
211 | 201 | $selected = ( $iso_value == $defaultCountry ) ? true : false; // Select default |
212 | 202 | } |
— | — | @@ -227,7 +217,9 @@ |
228 | 218 | } |
229 | 219 | |
230 | 220 | /** |
231 | | - * Genereat the menu select of credit cards |
| 221 | + * Generate the menu select of credit cards |
| 222 | + * getCreditCardTypeField helper function, and getCreditCardTypeField is |
| 223 | + * only used by TwoStepTwoColumn.php. |
232 | 224 | * |
233 | 225 | * @fixme Abstract out the setting of avaiable cards |
234 | 226 | * @return string |
— | — | @@ -245,7 +237,7 @@ |
246 | 238 | // generate a dropdown opt for each card |
247 | 239 | foreach ( $available_cards as $value => $card_name ) { |
248 | 240 | // only load the card value if we're in testing mode |
249 | | - $selected = ( $value == $this->form_data['card_type'] && $this->test ) ? true : false; |
| 241 | + $selected = ( $value == $this->getEscapedValue( 'card_type' ) && $this->test ) ? true : false; |
250 | 242 | $card_options .= Xml::option( $card_name, $value, $selected ); |
251 | 243 | } |
252 | 244 | |
— | — | @@ -262,13 +254,19 @@ |
263 | 255 | return $card_menu; |
264 | 256 | } |
265 | 257 | |
| 258 | + /** |
| 259 | + * Generates the expiry month dropdown form element. |
| 260 | + * This function is not used by any RapidHTML forms. |
| 261 | + * @global type $wgLang |
| 262 | + * @return type |
| 263 | + */ |
266 | 264 | public function generateExpiryMonthDropdown() { |
267 | 265 | global $wgLang; |
268 | 266 | |
269 | 267 | // derive the previously set expiry month, if set |
270 | 268 | $month = NULL; |
271 | | - if ( $this->form_data['expiration'] ) { |
272 | | - $month = substr( $this->form_data['expiration'], 0, 2 ); |
| 269 | + if ( $this->getEscapedValue( 'expiration' ) ) { |
| 270 | + $month = substr( $this->getEscapedValue( 'expiration' ), 0, 2 ); |
273 | 271 | } |
274 | 272 | |
275 | 273 | $expiry_months = ''; |
— | — | @@ -293,11 +291,17 @@ |
294 | 292 | return $expiry_month_menu; |
295 | 293 | } |
296 | 294 | |
| 295 | + /** |
| 296 | + * Generates the expiry year dropdown form element. |
| 297 | + * This function is not used by any RapidHTML forms. |
| 298 | + * @global type $wgLang |
| 299 | + * @return type |
| 300 | + */ |
297 | 301 | public function generateExpiryYearDropdown() { |
298 | 302 | // derive the previously set expiry year, if set |
299 | 303 | $year = NULL; |
300 | | - if ( $this->form_data['expiration'] ) { |
301 | | - $year = substr( $this->form_data['expiration'], 2, 2 ); |
| 304 | + if ( $this->getEscapedValue( 'expiration' ) ) { |
| 305 | + $year = substr( $this->getEscapedValue( 'expiration' ), 2, 2 ); |
302 | 306 | } |
303 | 307 | |
304 | 308 | $expiry_years = ''; |
— | — | @@ -322,6 +326,7 @@ |
323 | 327 | |
324 | 328 | /** |
325 | 329 | * Generates the dropdown for states |
| 330 | + * This function is not used by any RapidHTML forms. |
326 | 331 | * @fixme Alpha sort (ideally locale alpha sort) states in dropdown |
327 | 332 | * AFTER state names are translated |
328 | 333 | * @return string The entire HTML select element for the state dropdown list |
— | — | @@ -335,7 +340,7 @@ |
336 | 341 | |
337 | 342 | // generate dropdown of state opts |
338 | 343 | foreach ( $states as $value => $state_name ) { |
339 | | - $selected = ( $this->form_data['state'] == $value ) ? true : false; |
| 344 | + $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false; |
340 | 345 | $state_opts .= Xml::option( wfMsg( 'donate_interface-state-dropdown-' . $value ), $value, $selected ); |
341 | 346 | } |
342 | 347 | |
— | — | @@ -353,6 +358,7 @@ |
354 | 359 | |
355 | 360 | /** |
356 | 361 | * Generates the dropdown list for available currencies |
| 362 | + * This function is not used by any RapidHTML forms. |
357 | 363 | * |
358 | 364 | * @param string $defaultCurrencyCode default currency code to select |
359 | 365 | * @param boolean $showCardsOnCurrencyChange Allow javascript onchange="showCards();" to be executed. |
— | — | @@ -368,8 +374,8 @@ |
369 | 375 | $availableCurrencies = $this->gateway->getCurrencies(); |
370 | 376 | |
371 | 377 | // If a currency has already been posted, use that, otherwise use the default. |
372 | | - if ( $this->form_data['currency_code'] ) { |
373 | | - $selectedCurrency = $this->form_data['currency_code']; |
| 378 | + if ( $this->getEscapedValue( 'currency_code' ) ) { |
| 379 | + $selectedCurrency = $this->getEscapedValue( 'currency_code' ); |
374 | 380 | } else { |
375 | 381 | $selectedCurrency = $defaultCurrencyCode; |
376 | 382 | } |
— | — | @@ -409,12 +415,16 @@ |
410 | 416 | |
411 | 417 | /** |
412 | 418 | * Generates the radio buttons for selecting a donation amount |
| 419 | + * This function appears to be used only by the Universal Test form, and as |
| 420 | + * such should be moved to that class and away from the class all the forms |
| 421 | + * are eventually descended from. |
413 | 422 | * |
414 | 423 | * @param array $options |
415 | 424 | * |
416 | 425 | * $options: |
417 | 426 | * - displayCurrencyDropdown: Display the currency dropdown selector |
418 | 427 | * - showCardsOnCurrencyChange: Passed to @see Gateway_Form::generateStateDropdown() |
| 428 | + * - setCurrency: ??? |
419 | 429 | * |
420 | 430 | * @todo |
421 | 431 | * - Use Xml object to generate form elements. |
— | — | @@ -423,6 +433,7 @@ |
424 | 434 | */ |
425 | 435 | public function generateAmountByRadio( $options = array() ) { |
426 | 436 | |
| 437 | + //TODO: Stop using extract. |
427 | 438 | extract( $options ); |
428 | 439 | |
429 | 440 | $showCardsOnCurrencyChange = isset( $showCardsOnCurrencyChange ) ? (boolean) $showCardsOnCurrencyChange : true; |
— | — | @@ -430,7 +441,7 @@ |
431 | 442 | $setCurrency = isset( $setCurrency ) ? (string) $setCurrency : ''; |
432 | 443 | $displayCurrencyDropdown = empty( $setCurrency ) ? $displayCurrencyDropdown : false; |
433 | 444 | |
434 | | - $amount = isset( $this->form_data['amount'] ) ? (string) $this->form_data['amount'] : '0'; |
| 445 | + $amount = !is_null( $this->getEscapedValue( 'amount' ) ) ? (string) $this->getEscapedValue( 'amount' ) : '0'; |
435 | 446 | |
436 | 447 | // Treat values as string for comparison |
437 | 448 | $amountValues = array('5', '10', '20', '35', '50', '100', '250',); |
— | — | @@ -483,38 +494,38 @@ |
484 | 495 | |
485 | 496 | /** |
486 | 497 | * Set the hidden field array |
487 | | - * |
488 | 498 | * If you pass nothing in, we'll set the fields for you. |
| 499 | + * This function is not used by any RapidHTML forms. |
489 | 500 | * @param array $hidden_fields |
490 | 501 | */ |
491 | 502 | public function setHiddenFields( $hidden_fields = NULL ) { |
492 | 503 | if ( !$hidden_fields ) { |
493 | 504 | $hidden_fields = array( |
494 | | - 'utm_source' => $this->form_data['utm_source'], |
495 | | - 'utm_medium' => $this->form_data['utm_medium'], |
496 | | - 'utm_campaign' => $this->form_data['utm_campaign'], |
497 | | - 'language' => $this->form_data['language'], |
498 | | - 'referrer' => $this->form_data['referrer'], |
499 | | - 'comment' => $this->form_data['comment'], |
500 | | - 'comment-option' => $this->form_data['comment-option'], |
501 | | - 'email-opt' => $this->form_data['email-opt'], |
502 | | - 'size' => $this->form_data['size'], |
503 | | - 'premium_language' => $this->form_data['premium_language'], |
| 505 | + 'utm_source' => $this->getEscapedValue( 'utm_source' ), |
| 506 | + 'utm_medium' => $this->getEscapedValue( 'utm_medium' ), |
| 507 | + 'utm_campaign' => $this->getEscapedValue( 'utm_campaign' ), |
| 508 | + 'language' => $this->getEscapedValue( 'language' ), |
| 509 | + 'referrer' => $this->getEscapedValue( 'referrer' ), |
| 510 | + 'comment' => $this->getEscapedValue( 'comment' ), |
| 511 | + 'comment-option' => $this->getEscapedValue( 'comment-option' ), |
| 512 | + 'email-opt' => $this->getEscapedValue( 'email-opt' ), |
| 513 | + 'size' => $this->getEscapedValue( 'size' ), |
| 514 | + 'premium_language' => $this->getEscapedValue( 'premium_language' ), |
504 | 515 | // process has been disabled - may no longer be needed. |
505 | | - //'process' => isset( $this->form_data['process'] ) ? $this->form_data['process'] : 'CreditCard', |
| 516 | + //'process' => !is_null( $this->getEscapedValue( 'process' ) ) ? $this->getEscapedValue( 'process' ) : 'CreditCard', |
506 | 517 | // payment_method is no longer set to: processed |
507 | | - 'payment_method' => isset( $this->form_data['payment_method'] ) ? $this->form_data['payment_method'] : '', |
508 | | - 'payment_submethod' => isset( $this->form_data['payment_submethod'] ) ? $this->form_data['payment_submethod'] : '', |
509 | | - 'token' => $this->form_data['token'], |
510 | | - 'order_id' => $this->form_data['order_id'], |
511 | | - 'i_order_id' => $this->form_data['i_order_id'], |
512 | | - 'numAttempt' => $this->form_data['numAttempt'], |
513 | | - 'contribution_tracking_id' => $this->form_data['contribution_tracking_id'], |
514 | | - 'data_hash' => $this->form_data['data_hash'], |
515 | | - 'action' => $this->form_data['action'], |
516 | | - 'owa_session' => $this->form_data['owa_session'], |
517 | | - 'owa_ref' => $this->form_data['owa_ref'], |
518 | | - 'gateway' => $this->form_data['gateway'], |
| 518 | + 'payment_method' => !is_null( $this->getEscapedValue( 'payment_method' ) ) ? $this->getEscapedValue( 'payment_method' ) : '', |
| 519 | + 'payment_submethod' => !is_null( $this->getEscapedValue( 'payment_submethod' ) ) ? $this->getEscapedValue( 'payment_submethod' ) : '', |
| 520 | + 'token' => $this->getEscapedValue( 'token' ), |
| 521 | + 'order_id' => $this->getEscapedValue( 'order_id' ), |
| 522 | + 'i_order_id' => $this->getEscapedValue( 'i_order_id' ), |
| 523 | + 'numAttempt' => $this->getEscapedValue( 'numAttempt' ), |
| 524 | + 'contribution_tracking_id' => $this->getEscapedValue( 'contribution_tracking_id' ), |
| 525 | + 'data_hash' => $this->getEscapedValue( 'data_hash' ), |
| 526 | + 'action' => $this->getEscapedValue( 'action' ), |
| 527 | + 'owa_session' => $this->getEscapedValue( 'owa_session' ), |
| 528 | + 'owa_ref' => $this->getEscapedValue( 'owa_ref' ), |
| 529 | + 'gateway' => $this->getEscapedValue( 'gateway' ), |
519 | 530 | ); |
520 | 531 | } |
521 | 532 | |
— | — | @@ -523,7 +534,7 @@ |
524 | 535 | |
525 | 536 | /** |
526 | 537 | * Gets an array of the hidden fields for the form |
527 | | - * |
| 538 | + * This function is not used by any RapidHTML forms. |
528 | 539 | * @return array |
529 | 540 | */ |
530 | 541 | public function getHiddenFields() { |
— | — | @@ -559,6 +570,14 @@ |
560 | 571 | $this->captcha_html = $html; |
561 | 572 | } |
562 | 573 | |
| 574 | + /** |
| 575 | + * generateBannerHeader |
| 576 | + * Generates a banner header based on the existance of set masthead data, |
| 577 | + * and/or a gateway header defined in LocalSettings. |
| 578 | + * This function is not used by any RapidHTML forms. |
| 579 | + * @global type $wgOut |
| 580 | + * @global type $wgRequest |
| 581 | + */ |
563 | 582 | protected function generateBannerHeader() { |
564 | 583 | global $wgOut, $wgRequest; |
565 | 584 | $g = $this->gateway; |
— | — | @@ -568,18 +587,45 @@ |
569 | 588 | |
570 | 589 | // intro text |
571 | 590 | if ( $wgRequest->getText( 'masthead', false ) ) { |
572 | | - $template = $wgOut->parse( '{{' . $wgRequest->getText( 'masthead' ) . '/' . $this->form_data['language'] . '}}' ); |
| 591 | + $parse = '{{' . htmlspecialchars( $wgRequest->getText( 'masthead' ), ENT_COMPAT, 'UTF-8', false ) . '/' . $this->getEscapedValue( 'language' ) . '}}'; |
| 592 | + $template = $wgOut->parse( $parse ); |
573 | 593 | } elseif ( $header ) { |
574 | | - $header = str_replace( '@language', $this->form_data['language'], $header ); |
575 | | - $template = $wgOut->parse( $header ); |
| 594 | + $header = str_replace( '@language', $this->getEscapedValue( 'language' ), $header ); |
| 595 | + $template = $wgOut->parse( htmlspecialchars( $header, ENT_COMPAT, 'UTF-8', false ) ); |
576 | 596 | } |
577 | | - |
| 597 | + |
578 | 598 | // make sure that we actually have a matching template to display so we don't display the 'redlink' |
579 | 599 | if ( strlen( $template ) && !preg_match( '/redlink\=1/', $template ) ) { |
580 | 600 | $wgOut->addHtml( $template ); |
581 | 601 | } |
582 | 602 | } |
| 603 | + |
| 604 | + /** |
| 605 | + * generateTextTemplate: Loads the text from the appropraite template. |
| 606 | + * This function is not used by any RapidHTML forms. |
| 607 | + * @global type $wgOut |
| 608 | + * @global type $wgRequest |
| 609 | + * @return string |
| 610 | + */ |
| 611 | + protected function generateTextTemplate() { |
| 612 | + global $wgOut, $wgRequest; |
| 613 | + $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
| 614 | + |
| 615 | + //TODO: determine if this next line is really as silly as it looks. I don't think we should be using $wgRequest here at all. |
| 616 | + //(See DonationData::setLanguage()) |
| 617 | + if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->getEscapedValue( 'language' ); |
| 618 | + |
| 619 | + $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . htmlspecialchars( $text_template, ENT_COMPAT, 'UTF-8', false ) . '}}' ) : ''; |
| 620 | + // if the template doesn't exist, prevent the display of the red link |
| 621 | + if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 622 | + return $template; |
| 623 | + } |
583 | 624 | |
| 625 | + /** |
| 626 | + * Builds and returns the email form field |
| 627 | + * This function is not used by any RapidHTML forms. |
| 628 | + * @return string |
| 629 | + */ |
584 | 630 | protected function getEmailField() { |
585 | 631 | // email |
586 | 632 | $form = '<tr>'; |
— | — | @@ -587,40 +633,50 @@ |
588 | 634 | $form .= '</tr>'; |
589 | 635 | $form .= '<tr>'; |
590 | 636 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-email' ), 'emailAdd' ) . '</td>'; |
591 | | - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
| 637 | + $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
592 | 638 | '</td>'; |
593 | 639 | $form .= '</tr>'; |
594 | 640 | return $form; |
595 | 641 | } |
596 | 642 | |
| 643 | + /** |
| 644 | + * Builds and returns the amount form field. |
| 645 | + * This function is not used by any RapidHTML forms. |
| 646 | + * @return string |
| 647 | + */ |
597 | 648 | protected function getAmountField() { |
598 | 649 | $otherChecked = false; |
599 | 650 | $amount = -1; |
600 | | - if ( $this->form_data['amount'] != 100 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) { |
| 651 | + if ( $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) { |
601 | 652 | $otherChecked = true; |
602 | | - $amount = $this->form_data['amountOther']; |
| 653 | + $amount = $this->getEscapedValue( 'amountOther' ); |
603 | 654 | } |
604 | 655 | $form = '<tr>'; |
605 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 656 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
606 | 657 | $form .= '</tr>'; |
607 | 658 | $form .= '<tr>'; |
608 | 659 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>'; |
609 | | - $form .= '<td>' . Xml::radio( 'amount', 100, $this->form_data['amount'] == 100 ) . '100 ' . |
610 | | - Xml::radio( 'amount', 50, $this->form_data['amount'] == 50 ) . '50 ' . |
611 | | - Xml::radio( 'amount', 35, $this->form_data['amount'] == 35 ) . '35 ' . |
612 | | - Xml::radio( 'amount', 20, $this->form_data['amount'] == 20 ) . '20 ' . |
| 660 | + $form .= '<td>' . Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100 ) . '100 ' . |
| 661 | + Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50 ) . '50 ' . |
| 662 | + Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35 ) . '35 ' . |
| 663 | + Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20 ) . '20 ' . |
613 | 664 | '</td>'; |
614 | 665 | $form .= '</tr>'; |
615 | 666 | $form .= '<tr>'; |
616 | 667 | $form .= '<td class="label"></td>'; |
617 | | - $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-other' ) . '\' )', 'onblur' => 'document.getElementById("otherRadio").value = this.value;if (this.value > 0) document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'id' => 'amountOther' ) ) . |
| 668 | + $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-other' ) . '\' )', 'onblur' => 'document.getElementById("otherRadio").value = this.value;if (this.value > 0) document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'id' => 'amountOther' ) ) . |
618 | 669 | ' ' . $this->generateCurrencyDropdown() . '</td>'; |
619 | 670 | $form .= '</tr>'; |
620 | 671 | return $form; |
621 | 672 | } |
622 | 673 | |
| 674 | + /** |
| 675 | + * getCardnumberField builds and returns the credit card number field. |
| 676 | + * This function is not used by any RapidHTML forms. |
| 677 | + * @return string |
| 678 | + */ |
623 | 679 | protected function getCardnumberField() { |
624 | | - $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data['card_num'] : ''; |
| 680 | + $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'card_num' ) : ''; |
625 | 681 | $form = ''; |
626 | 682 | if ( $this->form_errors['card_num'] ) { |
627 | 683 | $form .= '<tr>'; |
— | — | @@ -640,8 +696,13 @@ |
641 | 697 | return $form; |
642 | 698 | } |
643 | 699 | |
| 700 | + /** |
| 701 | + * Builds and returns the cvv form field |
| 702 | + * This function is not used by any RapidHTML forms. |
| 703 | + * @return string |
| 704 | + */ |
644 | 705 | protected function getCvvField() { |
645 | | - $cvv = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data['cvv'] : ''; |
| 706 | + $cvv = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'cvv' ) : ''; |
646 | 707 | |
647 | 708 | $form = '<tr>'; |
648 | 709 | $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['cvv'] . '</span></td>'; |
— | — | @@ -654,42 +715,62 @@ |
655 | 716 | return $form; |
656 | 717 | } |
657 | 718 | |
| 719 | + /** |
| 720 | + * Builds and returns the street form element. |
| 721 | + * This function is not used by any RapidHTML forms. |
| 722 | + * @return string |
| 723 | + */ |
658 | 724 | protected function getStreetField() { |
659 | 725 | $form = '<tr>'; |
660 | 726 | $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['street'] . '</span></td>'; |
661 | 727 | $form .= '</tr>'; |
662 | 728 | $form .= '<tr>'; |
663 | 729 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-street' ), 'street' ) . '</td>'; |
664 | | - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
| 730 | + $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
665 | 731 | '</td>'; |
666 | 732 | $form .= '</tr>'; |
667 | 733 | return $form; |
668 | 734 | } |
669 | 735 | |
| 736 | + /** |
| 737 | + * getCityField builds and returns the city form element. |
| 738 | + * This function is not used by any RapidHTML forms. |
| 739 | + * @return string |
| 740 | + */ |
670 | 741 | protected function getCityField() { |
671 | 742 | $form = '<tr>'; |
672 | 743 | $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['city'] . '</span></td>'; |
673 | 744 | $form .= '</tr>'; |
674 | 745 | $form .= '<tr>'; |
675 | 746 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-city' ), 'city' ) . '</td>'; |
676 | | - $form .= '<td>' . Xml::input( 'city', '30', $this->form_data['city'], array( 'type' => 'text', 'maxlength' => '40', 'id' => 'city', 'class' => 'fullwidth' ) ) . |
| 747 | + $form .= '<td>' . Xml::input( 'city', '30', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'maxlength' => '40', 'id' => 'city', 'class' => 'fullwidth' ) ) . |
677 | 748 | '</td>'; |
678 | 749 | $form .= '</tr>'; |
679 | 750 | return $form; |
680 | 751 | } |
681 | 752 | |
| 753 | + /** |
| 754 | + * Builds and returns the zip (postal) code form element. |
| 755 | + * This function is not used by any RapidHTML forms. |
| 756 | + * @return string |
| 757 | + */ |
682 | 758 | protected function getZipField() { |
683 | 759 | $form = '<tr>'; |
684 | 760 | $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['zip'] . '</span></td>'; |
685 | 761 | $form .= '</tr>'; |
686 | 762 | $form .= '<tr>'; |
687 | 763 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-postal' ), 'zip' ) . '</td>'; |
688 | | - $form .= '<td>' . Xml::input( 'zip', '30', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '9', 'id' => 'zip', 'class' => 'fullwidth' ) ) . |
| 764 | + $form .= '<td>' . Xml::input( 'zip', '30', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'maxlength' => '9', 'id' => 'zip', 'class' => 'fullwidth' ) ) . |
689 | 765 | '</td>'; |
690 | 766 | $form .= '</tr>'; |
691 | 767 | return $form; |
692 | 768 | } |
693 | 769 | |
| 770 | + /** |
| 771 | + * Builds and returns the name-related form controls. |
| 772 | + * This function is not used by any RapidHTML forms. |
| 773 | + * @return string |
| 774 | + */ |
694 | 775 | protected function getNameField() { |
695 | 776 | $form = '<tr>'; |
696 | 777 | $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['fname'] . '</span></td>'; |
— | — | @@ -699,12 +780,17 @@ |
700 | 781 | $form .= '</tr>'; |
701 | 782 | $form .= '<tr>'; |
702 | 783 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-name' ), 'fname' ) . '</td>'; |
703 | | - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-fname' ) . '\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
704 | | - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-lname' ) . '\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
| 784 | + $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-fname' ) . '\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
| 785 | + Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-lname' ) . '\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
705 | 786 | $form .= "</tr>"; |
706 | 787 | return $form; |
707 | 788 | } |
708 | 789 | |
| 790 | + /** |
| 791 | + * Builds and returns the comment message. |
| 792 | + * This function is not used by any RapidHTML forms. |
| 793 | + * @return string |
| 794 | + */ |
709 | 795 | protected function getCommentMessageField() { |
710 | 796 | $form = '<tr>'; |
711 | 797 | $form .= '<td colspan="2">'; |
— | — | @@ -714,17 +800,26 @@ |
715 | 801 | return $form; |
716 | 802 | } |
717 | 803 | |
| 804 | + /** |
| 805 | + * Builds and returns the comment form field. |
| 806 | + * This function is not used by any RapidHTML forms. |
| 807 | + * @return string |
| 808 | + */ |
718 | 809 | protected function getCommentField() { |
719 | 810 | $form = '<tr>'; |
720 | 811 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-comment' ), 'comment' ) . '</td>'; |
721 | | - $form .= '<td>' . Xml::input( 'comment', '30', $this->form_data['comment'], array( 'type' => 'text', 'maxlength' => '200', 'class' => 'fullwidth' ) ) . '</td>'; |
| 812 | + $form .= '<td>' . Xml::input( 'comment', '30', $this->getEscapedValue( 'comment' ), array( 'type' => 'text', 'maxlength' => '200', 'class' => 'fullwidth' ) ) . '</td>'; |
722 | 813 | $form .= '</tr>'; |
723 | 814 | return $form; |
724 | 815 | } |
725 | 816 | |
| 817 | + /** |
| 818 | + * Builds and returns the comment option checkbox. |
| 819 | + * This function is not used by any RapidHTML forms. |
| 820 | + * @return string |
| 821 | + */ |
726 | 822 | protected function getCommentOptionField() { |
727 | | - global $wgRequest; |
728 | | - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data['comment-option'] : true; |
| 823 | + $comment_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'comment-option' ) : true; |
729 | 824 | $form = '<tr>'; |
730 | 825 | $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
731 | 826 | $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
— | — | @@ -732,9 +827,13 @@ |
733 | 828 | return $form; |
734 | 829 | } |
735 | 830 | |
| 831 | + /** |
| 832 | + * Builds and returns the email-opt checkbox. |
| 833 | + * This function is not used by any RapidHTML forms. |
| 834 | + * @return string |
| 835 | + */ |
736 | 836 | protected function getEmailOptField() { |
737 | | - global $wgRequest; |
738 | | - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data['email-opt'] : true; |
| 837 | + $email_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'email-opt' ) : true; |
739 | 838 | $form = '<tr>'; |
740 | 839 | $form .= '<td class="check-option" colspan="2">' . Xml::check( 'email-opt', $email_opt_value ); |
741 | 840 | $form .= ' '; |
— | — | @@ -747,6 +846,12 @@ |
748 | 847 | return $form; |
749 | 848 | } |
750 | 849 | |
| 850 | + /** |
| 851 | + * Builds and returns the paypal button form element. |
| 852 | + * This function is only used in TwoColumnPayPal.php. |
| 853 | + * @global type $wgScriptPath |
| 854 | + * @return string |
| 855 | + */ |
751 | 856 | protected function getPaypalButton() { |
752 | 857 | global $wgScriptPath; |
753 | 858 | $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes"; |
— | — | @@ -761,6 +866,11 @@ |
762 | 867 | return $form; |
763 | 868 | } |
764 | 869 | |
| 870 | + /** |
| 871 | + * Builds and returns the state dropdown form element. |
| 872 | + * This function is not used by any RapidHTML forms. |
| 873 | + * @return string |
| 874 | + */ |
765 | 875 | protected function getStateField() { |
766 | 876 | $form = '<tr>'; |
767 | 877 | $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['state'] . '</span></td>'; |
— | — | @@ -772,6 +882,12 @@ |
773 | 883 | return $form; |
774 | 884 | } |
775 | 885 | |
| 886 | + /** |
| 887 | + * Builds and returns the country form element. |
| 888 | + * This function is not used by any RapidHTML forms. |
| 889 | + * @param type $defaultCountry |
| 890 | + * @return string |
| 891 | + */ |
776 | 892 | protected function getCountryField( $defaultCountry = null ) { |
777 | 893 | $form = '<tr>'; |
778 | 894 | $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['country'] . '</span></td>'; |
— | — | @@ -783,6 +899,11 @@ |
784 | 900 | return $form; |
785 | 901 | } |
786 | 902 | |
| 903 | + /** |
| 904 | + * Builds and returns the card type dropdown. |
| 905 | + * This function is only used by TwoStepTwoColumn.php |
| 906 | + * @return string |
| 907 | + */ |
787 | 908 | protected function getCreditCardTypeField() { |
788 | 909 | $form = '<tr>'; |
789 | 910 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-card' ), 'card_type' ) . '</td>'; |
— | — | @@ -791,6 +912,11 @@ |
792 | 913 | return $form; |
793 | 914 | } |
794 | 915 | |
| 916 | + /** |
| 917 | + * Builds and returns the credit card expiry form controls. |
| 918 | + * This function is not used by any RapidHTML forms. |
| 919 | + * @return string |
| 920 | + */ |
795 | 921 | protected function getExpiryField() { |
796 | 922 | $form = '<tr>'; |
797 | 923 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-expiration' ), 'expiration' ) . '</td>'; |
— | — | @@ -799,16 +925,31 @@ |
800 | 926 | return $form; |
801 | 927 | } |
802 | 928 | |
| 929 | + /** |
| 930 | + * Uses resource loader to load the form validation javascript. |
| 931 | + * @global type $wgOut |
| 932 | + */ |
803 | 933 | protected function loadValidateJs() { |
804 | 934 | global $wgOut; |
805 | 935 | $wgOut->addModules( 'di.form.core.validate' ); |
806 | 936 | } |
807 | 937 | |
| 938 | + /** |
| 939 | + * Uses the resource loader to add the api client side javascript, usually |
| 940 | + * only when the form is caching. |
| 941 | + * @global type $wgOut |
| 942 | + */ |
808 | 943 | protected function loadApiJs() { |
809 | 944 | global $wgOut; |
810 | 945 | $wgOut->addModules( 'pfp.form.core.api' ); |
811 | 946 | } |
812 | 947 | |
| 948 | + /** |
| 949 | + * Loads the OWA javascript. |
| 950 | + * if OWA is enabled, this is called by the main form constructor. |
| 951 | + * @global type $wgOut |
| 952 | + * @global type $wgScriptPath |
| 953 | + */ |
813 | 954 | protected function loadOwaJs() { |
814 | 955 | global $wgOut, $wgScriptPath; |
815 | 956 | $wgOut->addHeadItem( 'owa_tracker', '<script type="text/javascript" src="https://owa.wikimedia.org/owa/modules/base/js/owa.tracker-combined-min.js"></script>' ); |
— | — | @@ -823,7 +964,7 @@ |
824 | 965 | |
825 | 966 | /** |
826 | 967 | * Generate HTML for <noscript> tags |
827 | | - * |
| 968 | + * This function is not used by any RapidHTML forms. |
828 | 969 | * For displaying when a user does not have Javascript enabled in their browser. |
829 | 970 | */ |
830 | 971 | protected function getNoScript() { |
— | — | @@ -865,7 +1006,9 @@ |
866 | 1007 | unset( $query_array['_cache_'] ); |
867 | 1008 | |
868 | 1009 | // make sure no other data that might overwrite posted data makes it into the URL |
869 | | - foreach ( $this->form_data as $key => $value ) { |
| 1010 | + |
| 1011 | + $all_form_data = $this->gateway->getData_Unstaged_Escaped(); |
| 1012 | + foreach ( $all_form_data as $key => $value ) { |
870 | 1013 | unset( $query_array[$key] ); |
871 | 1014 | } |
872 | 1015 | |
— | — | @@ -875,88 +1018,32 @@ |
876 | 1019 | |
877 | 1020 | /** |
878 | 1021 | * Get the form id |
879 | | - * |
| 1022 | + * This function appears to be used only by the Universal Test form, and as |
| 1023 | + * such should be moved to that class and away from the class all the forms |
| 1024 | + * are eventually descended from. |
880 | 1025 | * @return string |
881 | 1026 | */ |
882 | 1027 | protected function getFormId() { |
883 | | - |
| 1028 | + //TODO: Determine what this is, and either take measures to reference |
| 1029 | + //something closer to the source data, move it to a child class, or get rid of it. |
884 | 1030 | return $this->form_id; |
885 | 1031 | } |
886 | 1032 | |
887 | 1033 | /** |
888 | | - * Set the form id |
889 | | - * |
890 | | - * @param string $value The form_id value |
891 | | - */ |
892 | | - protected function setFormId( $value = '' ) { |
893 | | - |
894 | | - $this->form_id = (string) $value; |
895 | | - } |
896 | | - |
897 | | - /** |
898 | 1034 | * Get the form name |
899 | | - * |
| 1035 | + * This function appears to be used only by the Universal Test form, and as |
| 1036 | + * such should be moved to that class and away from the class all the forms |
| 1037 | + * are eventually descended from. |
900 | 1038 | * @return string |
901 | 1039 | */ |
902 | 1040 | protected function getFormName() { |
903 | 1041 | |
904 | | - return $this->form_name; |
| 1042 | + return $this->getEscapedValue( 'form_name' ); |
905 | 1043 | } |
906 | 1044 | |
907 | 1045 | /** |
908 | | - * Set the form name |
909 | | - * |
910 | | - * @param string $value The form_name value |
| 1046 | + * Create and return the Verisign logo (small size) form element. |
911 | 1047 | */ |
912 | | - protected function setFormName( $value = '' ) { |
913 | | - |
914 | | - $this->form_name = (string) $value; |
915 | | - } |
916 | | - |
917 | | - /** |
918 | | - * Get the payment method |
919 | | - * |
920 | | - * @return string |
921 | | - */ |
922 | | - protected function getPaymentMethod() { |
923 | | - |
924 | | - return $this->payment_method; |
925 | | - } |
926 | | - |
927 | | - /** |
928 | | - * Set the payment method |
929 | | - * |
930 | | - * @param string $value The payment method value |
931 | | - */ |
932 | | - protected function setPaymentMethod( $value = '' ) { |
933 | | - |
934 | | - $this->payment_method = (string) $value; |
935 | | - } |
936 | | - |
937 | | - /** |
938 | | - * Get the payment submethod |
939 | | - * |
940 | | - * @return string |
941 | | - */ |
942 | | - protected function getPaymentSubmethod() { |
943 | | - |
944 | | - return $this->payment_submethod; |
945 | | - } |
946 | | - |
947 | | - /** |
948 | | - * Set the payment submethod |
949 | | - * |
950 | | - * @param string $value The payment submethod value |
951 | | - */ |
952 | | - protected function setPaymentSubmethod( $value = '' ) { |
953 | | - |
954 | | - $this->payment_submethod = (string) $value; |
955 | | - } |
956 | | - |
957 | | - /** |
958 | | - * Create the Verisign logo (small size) |
959 | | - * |
960 | | - */ |
961 | 1048 | protected function getSmallSecureLogo() { |
962 | 1049 | |
963 | 1050 | $form = '<table id="secureLogo" width="130" border="0" cellpadding="2" cellspacing="0" title=' . wfMsg('donate_interface-securelogo-title') . '>'; |
— | — | @@ -966,5 +1053,17 @@ |
967 | 1054 | $form .= '</table>'; |
968 | 1055 | return $form; |
969 | 1056 | } |
| 1057 | + |
| 1058 | + /** |
| 1059 | + * Pulls normalized and escaped data from the $gateway object. |
| 1060 | + * For more information, see GatewayAdapter::getData_Unstaged_Escaped in |
| 1061 | + * $IP/extensions/DonationData/gateway_common/gateway.adapter.php |
| 1062 | + * @param string $key The value to fetch from the adapter. |
| 1063 | + * @return mixed The escaped value in the adapter, or null if none exists. |
| 1064 | + * Note: The value could still be a blank string in some cases. |
| 1065 | + */ |
| 1066 | + protected function getEscapedValue( $key ) { |
| 1067 | + return $this->gateway->getData_Unstaged_Escaped( $key ); |
| 1068 | + } |
970 | 1069 | } |
971 | 1070 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/Form.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
972 | 1071 | Merged /trunk/extensions/DonationInterface/gateway_forms/Form.php:r105938,106109,106158,107609,108541 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php |
— | — | @@ -1,9 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoColumnLetter extends Gateway_Form_OneStepTwoColumn { |
5 | | - public $paypal = false; // true for paypal only version |
6 | 5 | |
7 | | - public function __construct( &$gateway, &$form_errors ) { |
| 6 | + public function __construct( &$gateway ) { |
8 | 7 | global $wgScriptPath; |
9 | 8 | |
10 | 9 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -11,27 +10,17 @@ |
12 | 11 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter.css' ); |
13 | 12 | } |
14 | 13 | |
15 | | - parent::__construct( $gateway, $form_errors ); |
| 14 | + parent::__construct( $gateway ); |
16 | 15 | } |
17 | 16 | |
18 | 17 | public function generateFormStart() { |
19 | | - global $wgOut, $wgRequest; |
20 | | - |
21 | | - $this->paypal = $wgRequest->getBool( 'paypal', false ); |
22 | | - |
23 | 18 | $form = parent::generateBannerHeader(); |
24 | 19 | |
25 | 20 | $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) ); |
26 | 21 | $form .= Xml::openElement( 'tr' ); |
27 | 22 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
28 | 23 | |
29 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
30 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
31 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
32 | | - |
33 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
34 | | - // if the template doesn't exist, prevent the display of the red link |
35 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 24 | + $template = self::generateTextTemplate(); |
36 | 25 | $form .= $template; |
37 | 26 | |
38 | 27 | $form .= Xml::closeElement( 'td' ); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
39 | 28 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609 |
40 | 29 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php:r99568 |
41 | 30 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php:r95724-100157 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoStepTwoColumnPremium extends Gateway_Form_TwoStepTwoColumn { |
5 | | - public function __construct( &$gateway, &$form_errors ) { |
| 5 | + public function __construct( &$gateway ) { |
6 | 6 | global $wgScriptPath; |
7 | 7 | |
8 | 8 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -9,11 +9,11 @@ |
10 | 10 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnPremium.css' ); |
11 | 11 | } |
12 | 12 | |
13 | | - parent::__construct( $gateway, $form_errors ); |
| 13 | + parent::__construct( $gateway ); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function generateFormStart() { |
17 | | - global $wgRequest, $wgScriptPath; |
| 17 | + global $wgScriptPath; |
18 | 18 | |
19 | 19 | $form = parent::generateBannerHeader(); |
20 | 20 | |
— | — | @@ -26,12 +26,12 @@ |
27 | 27 | $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/wikipedia-ten-tshirt-front.png", 'width' => '300', 'height' => '280' ) ) . "<br/>"; |
28 | 28 | $form .= Xml::openElement( 'div', array( 'id' => 'premium-values' ) ); |
29 | 29 | $form .= Xml::openElement( 'div', array( 'id' => 'premium-size' ) ); |
30 | | - $sizeDisplay = '<span id="size-display">'.$wgRequest->getText( 'size' ).'</span>'; |
| 30 | + $sizeDisplay = '<span id="size-display">'.$this->getEscapedValue( 'size' ).'</span>'; |
31 | 31 | $form .= wfMsg( 'donate_interface-shirt-size-2', $sizeDisplay ); |
32 | 32 | $form .= Xml::closeElement( 'div' ); // close div#premium-size |
33 | 33 | $form .= wfMsg( 'donate_interface-on-the-back' ) . "<br/>"; |
34 | 34 | $form .= Xml::openElement( 'div', array( 'id' => 'premium-language' ) ); |
35 | | - $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/wordmarks/".$wgRequest->getText( 'premium_language' )."-wordmark.png", 'width' => '200', 'height' => '92' ) ); |
| 35 | + $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/wordmarks/".$this->getEscapedValue( 'premium_language' )."-wordmark.png", 'width' => '200', 'height' => '92' ) ); |
36 | 36 | $form .= Xml::closeElement( 'div' ); // close div#premium-language |
37 | 37 | $form .= Xml::closeElement( 'div' ); // close div#premium-values |
38 | 38 | $form .= Xml::closeElement( 'div' ); // close div#premium-confirmation |
— | — | @@ -96,16 +96,16 @@ |
97 | 97 | |
98 | 98 | // amount |
99 | 99 | $form .= '<tr>'; |
100 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 100 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
101 | 101 | $form .= '</tr>'; |
102 | 102 | $form .= '<tr>'; |
103 | 103 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>'; |
104 | | - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
| 104 | + $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
105 | 105 | ' ' . $this->generateCurrencyDropdown() . '</td>'; |
106 | 106 | $form .= '</tr>'; |
107 | 107 | |
108 | 108 | // card logos |
109 | | - if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
| 109 | + if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) { |
110 | 110 | $form .= '<tr id="four_cards" style="display:table-row;">'; |
111 | 111 | $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
112 | 112 | $form .= '</tr>'; |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | $form .= $this->getZipField(); |
144 | 144 | |
145 | 145 | // country |
146 | | - $form .= $this->getCountryField( $this->form_data[ 'country2' ] ); |
| 146 | + $form .= $this->getCountryField( $this->getEscapedValue( 'country2' ) ); |
147 | 147 | |
148 | 148 | /* |
149 | 149 | $form .= '<tr>'; |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | } |
178 | 178 | |
179 | 179 | // Temporary |
180 | | - $form .= Html::hidden( 'country2', $this->form_data[ 'country2' ] ); |
| 180 | + $form .= Html::hidden( 'country2', $this->getEscapedValue( 'country2' ) ); |
181 | 181 | |
182 | 182 | $form .= Xml::closeElement( 'form' ); // close form 'payment' |
183 | 183 | $form .= $this->generateDonationFooter(); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
184 | 184 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php:r95724-100157 |
185 | 185 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609 |
186 | 186 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php |
— | — | @@ -2,8 +2,8 @@ |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoStepTwoColumn extends Gateway_Form { |
5 | 5 | |
6 | | - public function __construct( &$gateway, &$form_errors ) { |
7 | | - parent::__construct( $gateway, $form_errors ); |
| 6 | + public function __construct( &$gateway ) { |
| 7 | + parent::__construct( $gateway ); |
8 | 8 | } |
9 | 9 | |
10 | 10 | public function loadPlaceholders() { |
— | — | @@ -166,11 +166,11 @@ |
167 | 167 | |
168 | 168 | // amount |
169 | 169 | $form = '<tr>'; |
170 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 170 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
171 | 171 | $form .= '</tr>'; |
172 | 172 | $form .= '<tr>'; |
173 | 173 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>'; |
174 | | - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
| 174 | + $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) . |
175 | 175 | ' ' . $this->generateCurrencyDropdown() . '</td>'; |
176 | 176 | $form .= '</tr>'; |
177 | 177 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
178 | 178 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php:r95724-100157 |
179 | 179 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609 |
180 | 180 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoStepTwoColumnLetter2 extends Gateway_Form_TwoStepTwoColumnLetter { |
5 | | - public function __construct( &$gateway, &$form_errors ) { |
| 5 | + public function __construct( &$gateway ) { |
6 | 6 | global $wgScriptPath; |
7 | 7 | |
8 | 8 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -9,6 +9,6 @@ |
10 | 10 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter2.css' ); |
11 | 11 | } |
12 | 12 | |
13 | | - parent::__construct( $gateway, $form_errors ); |
| 13 | + parent::__construct( $gateway ); |
14 | 14 | } |
15 | 15 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
16 | 16 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php:r95724-100157 |
17 | 17 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,107609 |
18 | 18 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php |
— | — | @@ -1,14 +1,14 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoStepTwoColumnLetter3 extends Gateway_Form_TwoStepTwoColumn { |
5 | | - public function __construct( &$gateway, &$form_errors ) { |
| 5 | + public function __construct( &$gateway ) { |
6 | 6 | global $wgExtensionAssetsPath; |
7 | 7 | |
8 | 8 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
9 | 9 | if ( !strlen( $this->getStylePath() ) ) { |
10 | 10 | $this->setStylePath( $wgExtensionAssetsPath . '/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter3.css' ); |
11 | 11 | } |
12 | | - parent::__construct( $gateway, $form_errors ); |
| 12 | + parent::__construct( $gateway ); |
13 | 13 | } |
14 | 14 | |
15 | 15 | public function loadPlaceholders() { |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | } |
117 | 117 | |
118 | 118 | public function generateFormStart() { |
119 | | - global $wgOut, $wgRequest; |
| 119 | + global $wgOut; |
120 | 120 | |
121 | 121 | $form = parent::generateBannerHeader(); |
122 | 122 | |
— | — | @@ -123,13 +123,7 @@ |
124 | 124 | $form .= Xml::openElement( 'tr' ); |
125 | 125 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
126 | 126 | |
127 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
128 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
129 | | - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ]; |
130 | | - |
131 | | - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : ''; |
132 | | - // if the template doesn't exist, prevent the display of the red link |
133 | | - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL; |
| 127 | + $template = self::generateTextTemplate(); |
134 | 128 | $form .= $template; |
135 | 129 | |
136 | 130 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -201,7 +195,7 @@ |
202 | 196 | |
203 | 197 | // amount |
204 | 198 | $form .= '<tr>'; |
205 | | - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>'; |
| 199 | + $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>'; |
206 | 200 | $form .= '</tr>'; |
207 | 201 | $form .= '<tr>'; |
208 | 202 | $form .= '<td colspan="2">'; |
— | — | @@ -213,11 +207,11 @@ |
214 | 208 | $form .= '</tr>'; |
215 | 209 | $form .= '<tr>'; |
216 | 210 | $form .= '<td class="amount_data">'.wfMsg( 'donate_interface-donation' ).'</td>'; |
217 | | - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] . |
218 | | - Html::hidden( 'amount', $this->form_data['amount'] ) . |
| 211 | + $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'amount' ) . |
| 212 | + Html::hidden( 'amount', $this->getEscapedValue( 'amount' ) ) . |
219 | 213 | '</td>'; |
220 | | - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency_code' ] . |
221 | | - Html::hidden( 'currency_code', $this->form_data['currency_code'] ) . |
| 214 | + $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'currency_code' ) . |
| 215 | + Html::hidden( 'currency_code', $this->getEscapedValue( 'currency_code' ) ) . |
222 | 216 | '</td>'; |
223 | 217 | $form .= '</tr>'; |
224 | 218 | $form .= '</table>'; |
— | — | @@ -232,7 +226,7 @@ |
233 | 227 | // card logos |
234 | 228 | $form .= '<tr>'; |
235 | 229 | $form .= '<td class="label"> </td>'; |
236 | | - if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
| 230 | + if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) { |
237 | 231 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
238 | 232 | } else { |
239 | 233 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>'; |
— | — | @@ -240,7 +234,7 @@ |
241 | 235 | $form .= '</tr>'; |
242 | 236 | |
243 | 237 | // card number |
244 | | - $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data[ 'card_num' ] : ''; |
| 238 | + $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'card_num' ) : ''; |
245 | 239 | $form .= ''; |
246 | 240 | if ( $this->form_errors['card_num'] ) { |
247 | 241 | $form .= '<tr>'; |
— | — | @@ -276,8 +270,8 @@ |
277 | 271 | $form .= '</tr>'; |
278 | 272 | $form .= '<tr>'; |
279 | 273 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-name-on-card' ), 'fname' ) . '</td>'; |
280 | | - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
281 | | - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
| 274 | + $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
| 275 | + Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
282 | 276 | $form .= "</tr>"; |
283 | 277 | |
284 | 278 | // street |
— | — | @@ -286,7 +280,7 @@ |
287 | 281 | $form .= '</tr>'; |
288 | 282 | $form .= '<tr>'; |
289 | 283 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-billing-address' ), 'street' ) . '</td>'; |
290 | | - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
| 284 | + $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
291 | 285 | '</td>'; |
292 | 286 | $form .= '</tr>'; |
293 | 287 | |
— | — | @@ -296,9 +290,9 @@ |
297 | 291 | $form .= '</tr>'; |
298 | 292 | $form .= '<tr>'; |
299 | 293 | $form .= '<td class="label"> </td>'; |
300 | | - $form .= '<td>' . Xml::input( 'city', '18', $this->form_data['city'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' . |
| 294 | + $form .= '<td>' . Xml::input( 'city', '18', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' . |
301 | 295 | $this->generateStateDropdown() . ' ' . |
302 | | - Xml::input( 'zip', '5', $this->form_data['zip'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) . |
| 296 | + Xml::input( 'zip', '5', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) . |
303 | 297 | Html::hidden( 'country', 'US' ) . |
304 | 298 | '</td>'; |
305 | 299 | $form .= '</tr>'; |
— | — | @@ -320,7 +314,7 @@ |
321 | 315 | $form .= '</tr>'; |
322 | 316 | $form .= '<tr>'; |
323 | 317 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-email-receipt' ), 'emailAdd' ) . '</td>'; |
324 | | - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
| 318 | + $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
325 | 319 | '</td>'; |
326 | 320 | $form .= '</tr>'; |
327 | 321 | |
— | — | @@ -368,7 +362,7 @@ |
369 | 363 | // generate dropdown of state opts |
370 | 364 | foreach ( $states as $value => $state_name ) { |
371 | 365 | if ( $value !== 'YY' && $value !== 'XX' ) { |
372 | | - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false; |
| 366 | + $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false; |
373 | 367 | $state_opts .= Xml::option( $value, $value, $selected ); |
374 | 368 | } |
375 | 369 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
376 | 370 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php:r95724-100157 |
377 | 371 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609 |
378 | 372 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/RapidHtml.php |
— | — | @@ -92,12 +92,14 @@ |
93 | 93 | '#emailAdd', |
94 | 94 | ); |
95 | 95 | |
96 | | - public function __construct( &$gateway, &$form_errors ) { |
| 96 | + public function __construct( &$gateway ) { |
97 | 97 | global $wgRequest; |
98 | | - parent::__construct( $gateway, $form_errors ); |
| 98 | + parent::__construct( $gateway ); |
| 99 | + $form_errors = $this->form_errors; |
99 | 100 | |
100 | 101 | $this->loadValidateJs(); |
101 | 102 | |
| 103 | + //Not sure if we should be using $wgRequest here. Depends if we want the normalized one or not. |
102 | 104 | $country = $wgRequest->getText( 'country', '' ); |
103 | 105 | // Get error passed via query string |
104 | 106 | $error = $wgRequest->getText( 'error' ); |
— | — | @@ -180,8 +182,8 @@ |
181 | 183 | foreach ( $this->data_tokens as $token ) { |
182 | 184 | $key = substr( $token, 1, strlen( $token )); //get the token string w/o the '@' |
183 | 185 | if ( $key == 'emailAdd' ) $key = 'email'; |
184 | | - if ( array_key_exists( $key, $this->form_data )) { |
185 | | - $replace = $this->form_data[ $key ]; |
| 186 | + if ( $this->getEscapedValue( $key ) ) { |
| 187 | + $replace = $this->getEscapedValue( $key ); |
186 | 188 | } else { |
187 | 189 | $replace = ''; |
188 | 190 | } |
— | — | @@ -254,7 +256,7 @@ |
255 | 257 | } else { |
256 | 258 | $params[ $k ] .= '?'; |
257 | 259 | } |
258 | | - $params[ $k ] .= "language=" . $this->form_data['language']. "&country=" . $this->form_data['country']; |
| 260 | + $params[ $k ] .= "language=" . $this->getEscapedValue( 'language' ) . "&country=" . $this->getEscapedValue( 'country' ); |
259 | 261 | } |
260 | 262 | } |
261 | 263 | // TODO: add support for message variations here as well |
— | — | @@ -286,7 +288,7 @@ |
287 | 289 | * @return string The HTML form containing translated messages |
288 | 290 | */ |
289 | 291 | public function replace_blocks( $html ){ |
290 | | - global $wgRequest, $wgGlobalCollectGatewayHtmlFormDir; |
| 292 | + global $wgRequest; |
291 | 293 | if( $wgRequest->getText( 'debug', 'false' ) == 'true' ){ |
292 | 294 | # do not replace tokens |
293 | 295 | return $html; |
— | — | @@ -300,14 +302,15 @@ |
301 | 303 | |
302 | 304 | foreach( $matches[ 1 ] as $i => $key ){ |
303 | 305 | # $matches[ 1 ] is specified in the code, not user input |
304 | | - $filepath = $wgGlobalCollectGatewayHtmlFormDir . '/_' . $matches[ 1 ][ $i ] . '/'; |
| 306 | + $filepath = $this->gateway->getGlobal('HtmlFormDir') . '/_' . $matches[ 1 ][ $i ] . '/'; |
305 | 307 | |
306 | 308 | $var = 'default'; |
307 | 309 | |
308 | | - # check to see if the parameter is, in fact, an element of form_data |
309 | | - if( array_key_exists( $matches[ 2 ][ $i ], $this->form_data ) ){ |
| 310 | + # check to see if the parameter is, in fact, an element in DonationData |
| 311 | + $param = $this->getEscapedValue( $matches[ 2 ][ $i ] ); |
| 312 | + if( $param ){ |
310 | 313 | # get the value of the element and super-escape |
311 | | - $var = $this->make_safe( $this->form_data[ $matches[ 2 ][ $i ] ], 'default' ); |
| 314 | + $var = $this->make_safe( $param, 'default' ); |
312 | 315 | } |
313 | 316 | |
314 | 317 | # oh, and we only allow with the extension .html |
— | — | @@ -341,7 +344,7 @@ |
342 | 345 | // currency code |
343 | 346 | $start = strpos( $html, 'name="currency_code"' ); |
344 | 347 | if ( $start ) { |
345 | | - $currency_code = $this->form_data['currency_code']; |
| 348 | + $currency_code = $this->getEscapedValue( 'currency_code' ); |
346 | 349 | $end = strpos( $html, '</select>', $start ); |
347 | 350 | $str = substr( $html, $start, ( $end - $start ) ); |
348 | 351 | $str = str_replace( 'value="' . $currency_code . '"', 'value="' . $currency_code . '" selected="selected"', $str ); |
— | — | @@ -349,7 +352,7 @@ |
350 | 353 | } |
351 | 354 | |
352 | 355 | // mos |
353 | | - $month = substr( $this->form_data['expiration'], 0, 2 ); |
| 356 | + $month = substr( $this->getEscapedValue( 'expiration' ), 0, 2 ); |
354 | 357 | $start = strpos( $html, 'name="mos"' ); |
355 | 358 | if ( $start ) { |
356 | 359 | $end = strpos( $html, '</select>', $start ); |
— | — | @@ -359,7 +362,7 @@ |
360 | 363 | } |
361 | 364 | |
362 | 365 | // year |
363 | | - $year = substr( $this->form_data['expiration'], 2, 2 ); |
| 366 | + $year = substr( $this->getEscapedValue( 'expiration' ), 2, 2 ); |
364 | 367 | $start = strpos( $html, 'name="year"' ); |
365 | 368 | if ( $start ) { |
366 | 369 | $end = strpos( $html, '</select>', $start ); |
— | — | @@ -370,7 +373,7 @@ |
371 | 374 | } |
372 | 375 | |
373 | 376 | // state |
374 | | - $state = $this->form_data['state']; |
| 377 | + $state = $this->getEscapedValue( 'state' ); |
375 | 378 | $start = strpos( $html, 'name="state"' ); |
376 | 379 | if ( $start ) { |
377 | 380 | $end = strpos( $html, '</select>', $start ); |
— | — | @@ -380,7 +383,7 @@ |
381 | 384 | } |
382 | 385 | |
383 | 386 | //country |
384 | | - $country = $this->form_data['country']; |
| 387 | + $country = $this->getEscapedValue( 'country' ); |
385 | 388 | $start = strpos( $html, 'name="country"' ); |
386 | 389 | if ( $start ) { |
387 | 390 | $end = strpos( $html, '</select>', $start ); |
— | — | @@ -414,10 +417,12 @@ |
415 | 418 | * Load API js if this form needs to support cacheing |
416 | 419 | */ |
417 | 420 | public function handle_cacheability() { |
| 421 | + //We may change this from checking one thing in $wgRequest, to a |
| 422 | + //reference to $this->gateway->isCaching(). Little more robust. |
418 | 423 | global $wgRequest; |
419 | 424 | if ( $wgRequest->getText( '_cache_', false )) { |
420 | 425 | $this->loadApiJs(); |
421 | | -} |
| 426 | + } |
422 | 427 | } |
423 | 428 | |
424 | 429 | /** |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/RapidHtml.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
425 | 430 | Merged /trunk/extensions/DonationInterface/gateway_forms/RapidHtml.php:r106109,106158,107609,107690 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_TwoStepTwoColumnPremiumUS extends Gateway_Form_TwoStepTwoColumn { |
5 | | - public function __construct( &$gateway, &$form_errors ) { |
| 5 | + public function __construct( &$gateway ) { |
6 | 6 | global $wgScriptPath; |
7 | 7 | |
8 | 8 | // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnPremiumUS.css' ); |
11 | 11 | } |
12 | 12 | |
13 | | - parent::__construct( $gateway, $form_errors ); |
| 13 | + parent::__construct( $gateway ); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function loadPlaceholders() { |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | } |
123 | 123 | |
124 | 124 | public function generateFormStart() { |
125 | | - global $wgRequest, $wgScriptPath; |
| 125 | + global $wgScriptPath; |
126 | 126 | |
127 | 127 | $form = parent::generateBannerHeader(); |
128 | 128 | |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | |
133 | 133 | $form .= Xml::openElement( 'div', array( 'id' => 'premium-confirmation' ) ); |
134 | 134 | $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/Wikipedia-ten-tshirt-back.jpg", 'width' => '300', 'height' => '300' ) ); |
135 | | - $form .= wfMsg( 'donate_interface-shirt-size-2', $wgRequest->getText( 'size' ) ); |
| 135 | + $form .= wfMsg( 'donate_interface-shirt-size-2', $this->getEscapedValue( 'size' ) ); |
136 | 136 | $form .= Xml::closeElement( 'div' ); // close div#premium-confirmation |
137 | 137 | |
138 | 138 | $form .= Xml::closeElement( 'td' ); |
— | — | @@ -197,11 +197,11 @@ |
198 | 198 | $form .= '</tr>'; |
199 | 199 | $form .= '<tr>'; |
200 | 200 | $form .= '<td class="amount_data">'.wfMsg( 'donate_interface-donation' ).'</td>'; |
201 | | - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] . |
202 | | - Html::hidden( 'amount', $this->form_data['amount'] ) . |
| 201 | + $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'amount' ) . |
| 202 | + Html::hidden( 'amount', $this->getEscapedValue( 'amount' ) ) . |
203 | 203 | '</td>'; |
204 | | - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency_code' ] . |
205 | | - Html::hidden( 'currency_code', $this->form_data['currency_code'] ) . |
| 204 | + $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'currency_code' ) . |
| 205 | + Html::hidden( 'currency_code', $this->getEscapedValue( 'currency_code' ) ) . |
206 | 206 | '</td>'; |
207 | 207 | $form .= '</tr>'; |
208 | 208 | $form .= '</table>'; |
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | // card logos |
218 | 218 | $form .= '<tr>'; |
219 | 219 | $form .= '<td class="label"> </td>'; |
220 | | - if ( $this->form_data[ 'currency_code' ] == 'USD' ) { |
| 220 | + if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) { |
221 | 221 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>'; |
222 | 222 | } else { |
223 | 223 | $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>'; |
— | — | @@ -224,7 +224,7 @@ |
225 | 225 | $form .= '</tr>'; |
226 | 226 | |
227 | 227 | // card number |
228 | | - $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data[ 'card_num' ] : ''; |
| 228 | + $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'card_num' ) : ''; |
229 | 229 | $form .= ''; |
230 | 230 | if ( $this->form_errors['card_num'] ) { |
231 | 231 | $form .= '<tr>'; |
— | — | @@ -260,8 +260,8 @@ |
261 | 261 | $form .= '</tr>'; |
262 | 262 | $form .= '<tr>'; |
263 | 263 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-name-on-card' ), 'fname' ) . '</td>'; |
264 | | - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
265 | | - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
| 264 | + $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) . |
| 265 | + Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>'; |
266 | 266 | $form .= "</tr>"; |
267 | 267 | |
268 | 268 | // street |
— | — | @@ -270,7 +270,7 @@ |
271 | 271 | $form .= '</tr>'; |
272 | 272 | $form .= '<tr>'; |
273 | 273 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-billing-address' ), 'street' ) . '</td>'; |
274 | | - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
| 274 | + $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
275 | 275 | '</td>'; |
276 | 276 | $form .= '</tr>'; |
277 | 277 | |
— | — | @@ -280,9 +280,9 @@ |
281 | 281 | $form .= '</tr>'; |
282 | 282 | $form .= '<tr>'; |
283 | 283 | $form .= '<td class="label"> </td>'; |
284 | | - $form .= '<td>' . Xml::input( 'city', '18', $this->form_data['city'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' . |
| 284 | + $form .= '<td>' . Xml::input( 'city', '18', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' . |
285 | 285 | $this->generateStateDropdown() . ' ' . |
286 | | - Xml::input( 'zip', '5', $this->form_data['zip'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) . |
| 286 | + Xml::input( 'zip', '5', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) . |
287 | 287 | Html::hidden( 'country', 'US' ) . |
288 | 288 | '</td>'; |
289 | 289 | $form .= '</tr>'; |
— | — | @@ -293,7 +293,7 @@ |
294 | 294 | $form .= '</tr>'; |
295 | 295 | $form .= '<tr>'; |
296 | 296 | $form .= '<td class="label"> </td>'; |
297 | | - $form .= '<td>' . $this->generateCountryDropdown( $this->form_data['country2'] ) . '</td>'; |
| 297 | + $form .= '<td>' . $this->generateCountryDropdown( $this->getEscapedValue( 'country2' ) ) . '</td>'; |
298 | 298 | $form .= '</tr>'; |
299 | 299 | |
300 | 300 | // email |
— | — | @@ -302,7 +302,7 @@ |
303 | 303 | $form .= '</tr>'; |
304 | 304 | $form .= '<tr>'; |
305 | 305 | $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-email-receipt' ), 'emailAdd' ) . '</td>'; |
306 | | - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
| 306 | + $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
307 | 307 | '</td>'; |
308 | 308 | $form .= '</tr>'; |
309 | 309 | |
— | — | @@ -350,7 +350,7 @@ |
351 | 351 | // generate dropdown of state opts |
352 | 352 | foreach ( $states as $value => $state_name ) { |
353 | 353 | if ( $value !== 'YY' && $value !== 'XX' ) { |
354 | | - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false; |
| 354 | + $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false; |
355 | 355 | $state_opts .= Xml::option( $value, $value, $selected ); |
356 | 356 | } |
357 | 357 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
358 | 358 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php:r99568 |
359 | 359 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php:r95724-100157 |
360 | 360 | Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php |
— | — | @@ -1,10 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class Gateway_Form_OneStepTwoColumn extends Gateway_Form { |
5 | | - public $paypal = false; // true for paypal only version |
6 | 5 | |
7 | | - public function __construct( &$gateway, &$form_errors ) { |
8 | | - parent::__construct( $gateway, $form_errors ); |
| 6 | + public function __construct( &$gateway ) { |
| 7 | + parent::__construct( $gateway ); |
9 | 8 | |
10 | 9 | // update the list of hidden fields we need to use in this form. |
11 | 10 | $this->updateHiddenFields(); |
— | — | @@ -120,10 +119,6 @@ |
121 | 120 | } |
122 | 121 | |
123 | 122 | public function generateFormStart() { |
124 | | - global $wgRequest; |
125 | | - |
126 | | - $this->paypal = $wgRequest->getBool( 'paypal', false ); |
127 | | - |
128 | 123 | $form = $this->generateBannerHeader(); |
129 | 124 | |
130 | 125 | $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) ); |
— | — | @@ -197,34 +192,16 @@ |
198 | 193 | return $form; |
199 | 194 | } |
200 | 195 | |
201 | | - protected function generateBannerHeader() { |
202 | | - global $wgOut, $wgRequest; |
203 | | - $template = ''; |
204 | | - |
205 | | - // intro text |
206 | | - if ( $wgRequest->getText( 'masthead', false ) ) { |
207 | | - $template = $wgOut->parse( '{{' . $wgRequest->getText( 'masthead' ) . '/' . $this->form_data[ 'language' ] . '}}' ); |
208 | | - } elseif ( $this->gateway->getGlobal( "Header" ) ) { |
209 | | - $header = str_replace( '@language', $this->form_data[ 'language' ], $this->gateway->getGlobal( "Header" ) ); |
210 | | - $template = $wgOut->parse( $header ); |
211 | | - } |
212 | | - |
213 | | - // make sure that we actually have a matching template to display so we don't display the 'redlink' |
214 | | - if ( strlen( $template ) && !preg_match( '/redlink\=1/', $template ) ) { |
215 | | - $wgOut->addHtml( $template ); |
216 | | - } |
217 | | - } |
218 | | - |
219 | 196 | protected function generatePersonalContainer() { |
220 | | - global $wgRequest, $wgScriptPath; |
| 197 | + global $wgScriptPath; |
221 | 198 | $form = ''; |
222 | 199 | $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' ) ); |
223 | 200 | $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header', 'id' => 'payflow-cc-form-header-personal' ), wfMsg( 'donate_interface-make-your-donation' ) ); |
224 | 201 | if ( !$this->paypal ) { |
225 | | - $source = htmlspecialchars( $wgRequest->getText( 'utm_source' ) ); |
226 | | - $medium = htmlspecialchars( $wgRequest->getText( 'utm_medium' ) ); |
227 | | - $campaign = htmlspecialchars( $wgRequest->getText( 'utm_campaign' ) ); |
228 | | - $formname = htmlspecialchars( $wgRequest->getText( 'form_name' ) ); |
| 202 | + $source = $this->getEscapedValue( 'utm_source' ); |
| 203 | + $medium = $this->getEscapedValue( 'utm_medium' ); |
| 204 | + $campaign = $this->getEscapedValue( 'utm_campaign' ); |
| 205 | + $formname = $this->getEscapedValue( 'form_name' ); |
229 | 206 | $form .= Xml::Tags( 'p', array( 'id' => 'payflowpro_gateway-cc_otherways' ), wfMsg( 'donate_interface-paypal', $wgScriptPath, $formname, $source, $medium, $campaign ) ); |
230 | 207 | } |
231 | 208 | $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) ); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
232 | 209 | Merged /trunk/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609 |
233 | 210 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php:r99568 |
234 | 211 | Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php:r95724-100157 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | $this->setHeaders(); |
91 | 91 | |
92 | 92 | if ( $forbidden ){ |
93 | | - $this->adapter->log( "Resultswitcher: Request forbidden. " . $f_message . " Querystring Order ID: $qs_oid Adapter Order ID: " . $this->adapter->getData_Raw( 'order_id' ) ); |
| 93 | + $this->adapter->log( "Resultswitcher: Request forbidden. " . $f_message . " Querystring Order ID: $qs_oid Adapter Order ID: " . $this->adapter->getData_Unstaged_Escaped( 'order_id' ) ); |
94 | 94 | return; |
95 | 95 | } else { |
96 | 96 | $this->adapter->log( "Resultswitcher: OK to process Order ID: " . $qs_oid ); |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | $oid = $wgRequest->getText( 'order_id' ); |
103 | 103 | |
104 | 104 | //this next block is for credit card coming back from GC. Only that. Nothing else, ever. |
105 | | - if ( $this->adapter->getData_Raw( 'payment_method') === 'cc' ) { |
| 105 | + if ( $this->adapter->getData_Unstaged_Escaped( 'payment_method') === 'cc' ) { |
106 | 106 | if ( !array_key_exists( 'order_status', $_SESSION ) || !array_key_exists( $oid, $_SESSION['order_status'] ) || !is_array( $_SESSION['order_status'][$oid] ) ) { |
107 | 107 | $_SESSION['order_status'][$oid] = $this->adapter->do_transaction( 'Confirm_CreditCard' ); |
108 | 108 | $_SESSION['order_status'][$oid]['data']['count'] = 0; |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | function getDeclinedResultPage() { |
150 | 150 | global $wgOut; |
151 | 151 | |
152 | | - $displayData = $this->adapter->getData_Raw(); |
| 152 | + $displayData = $this->adapter->getData_Unstaged_Escaped(); |
153 | 153 | $failpage = $this->adapter->getFailPage(); |
154 | 154 | |
155 | 155 | if ( $failpage ) { |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
156 | 156 | Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php:r105938 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.alias.php |
— | — | @@ -6,8 +6,3 @@ |
7 | 7 | $specialPageAliases['en'] = array( |
8 | 8 | 'GlobalCollectGateway' => array( 'GlobalCollectGateway' ), |
9 | 9 | ); |
10 | | - |
11 | | -/** |
12 | | - * For backwards compatibility with MediaWiki 1.15 and earlier. |
13 | | - */ |
14 | | -$aliases =& $specialPageAliases; |
\ No newline at end of file |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.alias.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
15 | 10 | Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.alias.php:r107322 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/TwoStepAmount.php |
— | — | @@ -1,983 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * Wikimedia Foundation |
5 | | - * |
6 | | - * LICENSE |
7 | | - * |
8 | | - * This program is free software; you can redistribute it and/or modify |
9 | | - * it under the terms of the GNU General Public License as published by |
10 | | - * the Free Software Foundation; either version 2 of the License, or |
11 | | - * (at your option) any later version. |
12 | | - * |
13 | | - * This program is distributed in the hope that it will be useful, |
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | - * GNU General Public License for more details. |
17 | | - * |
18 | | - * @since r98249 |
19 | | - * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org> |
20 | | - */ |
21 | | - |
22 | | -/** |
23 | | - * This form is designed for bank transfers |
24 | | - */ |
25 | | -class Gateway_Form_TwoStepAmount extends Gateway_Form { |
26 | | - |
27 | | - /** |
28 | | - * The default value of section header tags. |
29 | | - * |
30 | | - * A value of 3 => h3 |
31 | | - * |
32 | | - * @var integer $sectionHeaderLevel |
33 | | - */ |
34 | | - public $sectionHeaderLevel = 3; |
35 | | - |
36 | | - /** |
37 | | - * The appeal |
38 | | - * |
39 | | - * @var string $appeal |
40 | | - */ |
41 | | - public $appeal = ''; |
42 | | - |
43 | | - /** |
44 | | - * The default appeal |
45 | | - * |
46 | | - */ |
47 | | - const DEFAULT_APPEAL = <<<HTML |
48 | | - <h2 id="appeal-head"> <span class="mw-headline" id="From_Wikipedia_programmer_Brandon_Harris">From Wikipedia programmer Brandon Harris</span></h2> |
49 | | - <div id="appeal-body" class="plainlinks"> |
50 | | - <p>I feel like I'm living the first line of my obituary.</p> |
51 | | - <p>I don't think there will be anything else that I do in my life as important as what I do now for Wikipedia. We're not just building an encyclopedia, we're working to make people free. When we have access to free knowledge, we are better people. We understand the world is bigger than us, and we become infected with tolerance and understanding.</p> |
52 | | - <p>Wikipedia is the 5th largest website in the world. I work at the small non-profit that keeps it on the web. We don't run ads because doing so would sacrifice our independence. The site is not and should never be a propaganda tool.</p> |
53 | | - <p>Our work is possible because of donations from our readers. Will you help protect Wikipedia by donating $5, $10, $20 or whatever you can afford?</p> |
54 | | - <p>I work at the Wikimedia Foundation because everything in my soul tells me it's the right thing to do. I've worked at huge tech companies, doing some job to build some crappy thing that's designed to steal money from some kid who doesn't know it. I would come home from work crushed.</p> |
55 | | - <p>You might not know this, but the Wikimedia Foundation operates with a very small staff. Most other top-ten sites have tens of thousands of people and massive budgets. But they produce a fraction of what we pull off with sticks and wire.</p> |
56 | | - <p>When you give to Wikipedia, you're supporting free knowledge around the world. You're not only leaving a legacy for your children and for their children, you're elevating people around the world who have access to this treasure. You're assuring that one day everyone else will too.</p> |
57 | | - <p>Thank you,</p> |
58 | | - <p><strong>Brandon Harris</strong><br /></p> |
59 | | - <p>Programmer, Wikimedia Foundation</p> |
60 | | - </div> |
61 | | -HTML; |
62 | | - |
63 | | - //////////////////////////////////////////////////////////////////////////// |
64 | | - // |
65 | | - // Form methods |
66 | | - // |
67 | | - //////////////////////////////////////////////////////////////////////////// |
68 | | - |
69 | | - /** |
70 | | - * Initialize the form |
71 | | - * |
72 | | - * This is called at the end of the constructor |
73 | | - * |
74 | | - */ |
75 | | - protected function init() { |
76 | | - |
77 | | - $this->setPaymentMethod( $this->form_data['payment_method'] ); |
78 | | - $this->setPaymentSubmethod( $this->form_data['payment_submethod'] ); |
79 | | - |
80 | | - // Should process be deprecated? |
81 | | - $this->form_data['process'] = 'other'; |
82 | | - |
83 | | - // Initialize the appeal |
84 | | - $this->appeal = self::DEFAULT_APPEAL; |
85 | | - |
86 | | - $this->loadResources(); |
87 | | - } |
88 | | - |
89 | | - /** |
90 | | - * Required method for returning the full HTML for a form. |
91 | | - * |
92 | | - * @return string The entire form HTML |
93 | | - */ |
94 | | - public function getForm() { |
95 | | - |
96 | | - return $this->getFormPage(); |
97 | | - |
98 | | - $form = ''; |
99 | | - |
100 | | - $form .= $this->generateFormStart(); |
101 | | - $form .= $this->generateFormEnd(); |
102 | | - return $form; |
103 | | - } |
104 | | - |
105 | | - /** |
106 | | - * Get the form messages by type. |
107 | | - * |
108 | | - * Since this displays to the end user, if a key does not exist, it fails |
109 | | - * silently and returns an empty string. |
110 | | - * |
111 | | - * @param string $type |
112 | | - * @param array $options |
113 | | - * |
114 | | - * @todo |
115 | | - * - Move to the parent class |
116 | | - * - This returns error messages by paragraph tags, but it may be better to do this as a list. |
117 | | - * |
118 | | - * @return string Returns an HTML string |
119 | | - */ |
120 | | - protected function getFormMessagesByType( $type, $options = array() ) { |
121 | | - |
122 | | - if ( isset( $options['type'] ) ) { |
123 | | - unset( $options['type'] ); |
124 | | - } |
125 | | - |
126 | | - extract( $options ); |
127 | | - |
128 | | - $defaultErrorClass = 'payment_error_message payment_error_message_' . strtolower( $type ); |
129 | | - |
130 | | - $errorClass = isset( $errorClass ) ? $errorClass : $defaultErrorClass; |
131 | | - |
132 | | - $return = ''; |
133 | | - |
134 | | - if ( isset( $this->form_errors[ $type ] ) ) { |
135 | | - |
136 | | - if ( is_array( $this->form_errors[ $type ] ) ) { |
137 | | - |
138 | | - // Loop through messages and display them as paragraphs |
139 | | - foreach ( $this->form_errors[ $type ] as $message ) { |
140 | | - $return .= Xml::tags( 'p', array( 'class' => $errorClass ), $message ); |
141 | | - } |
142 | | - } else { |
143 | | - |
144 | | - // Display single message |
145 | | - $return .= Xml::tags( 'p', array( 'class' => $errorClass ), $this->form_errors[ $type ] ); |
146 | | - } |
147 | | - } |
148 | | - |
149 | | - return $return; |
150 | | - } |
151 | | - |
152 | | - /** |
153 | | - * Get the form messages |
154 | | - * |
155 | | - * @param array $options |
156 | | - * |
157 | | - * @return string Returns an HTML string |
158 | | - */ |
159 | | - protected function getFormMessages( $options = array() ) { |
160 | | - |
161 | | - $return = ''; |
162 | | - |
163 | | - // We want this container to exist so it can be populated with javascript messages. |
164 | | - $return .= Xml::openElement( 'div', array( 'id' => 'payment_form_messages' ) ); |
165 | | - |
166 | | - $return .= $this->getFormMessagesByType('general'); |
167 | | - |
168 | | - $return .= $this->getFormMessagesByType('invalidamount'); |
169 | | - |
170 | | - $return .= $this->getFormMessagesByType('retryMsg'); |
171 | | - |
172 | | - $return .= Xml::closeElement( 'div' ); // payment_form_messages |
173 | | - |
174 | | - return $return; |
175 | | - } |
176 | | - |
177 | | - /** |
178 | | - * Get the section header tag |
179 | | - * |
180 | | - * @param string $section The section label |
181 | | - * @param array $options |
182 | | - * |
183 | | - * @return string Returns an HTML string |
184 | | - */ |
185 | | - protected function getFormSectionHeaderTag( $section, $options = array() ) { |
186 | | - |
187 | | - // Make sure $section does not get overridden. |
188 | | - if ( isset( $options['section'] ) ) { |
189 | | - |
190 | | - unset( $options['section'] ); |
191 | | - } |
192 | | - |
193 | | - extract( $options ); |
194 | | - |
195 | | - $headerLevel = isset( $headerLevel ) ? (integer) $headerLevel : (integer) $this->sectionHeaderLevel; |
196 | | - $headerId = isset( $headerId ) ? (string) $headerId : ''; |
197 | | - $headerClass = isset( $headerClass ) ? (string) $headerClass : ''; |
198 | | - |
199 | | - // Set maximum level to 6 |
200 | | - $headerLevel = ( $headerLevel > 6 ) ? 6 : $headerLevel; |
201 | | - |
202 | | - // Set minimum level to 2 |
203 | | - $headerLevel = ( $headerLevel < 2 ) ? 2 : $headerLevel; |
204 | | - |
205 | | - $headerTag = 'h' . $headerLevel; |
206 | | - |
207 | | - $headerOptions = array(); |
208 | | - |
209 | | - // Add a header class |
210 | | - if ( !empty( $headerClass ) ) { |
211 | | - $headerOptions['class'] = $headerClass; |
212 | | - } |
213 | | - |
214 | | - // Add a header id |
215 | | - if ( !empty( $headerId ) ) { |
216 | | - $headerOptions['id'] = $headerId; |
217 | | - } |
218 | | - |
219 | | - $return = Xml::tags( $headerTag, $headerOptions, $section ); |
220 | | - |
221 | | - return $return; |
222 | | - } |
223 | | - |
224 | | - /** |
225 | | - * Load form resources |
226 | | - */ |
227 | | - protected function loadResources() { |
228 | | - |
229 | | - $this->loadValidateJs(); |
230 | | - } |
231 | | - |
232 | | - /** |
233 | | - * Load extra javascript |
234 | | - */ |
235 | | - protected function loadValidateJs() { |
236 | | - global $wgOut; |
237 | | - $wgOut->addModules( 'gc.form.core.validate' ); |
238 | | - |
239 | | - $js = "\n" . '<script type="text/javascript">' |
240 | | - . "var validatePaymentForm = { |
241 | | - formId: '" . $this->getFormId() . "', |
242 | | - payment_method: '" . $this->getPaymentMethod() . "', |
243 | | - payment_submethod: '" . $this->getPaymentSubmethod() . "', |
244 | | - }" |
245 | | - . '</script>' . "\n"; |
246 | | - $wgOut->addHeadItem( 'loadValidateJs', $js ); |
247 | | - } |
248 | | - |
249 | | - //////////////////////////////////////////////////////////////////////////// |
250 | | - // |
251 | | - // Get and set html snippets of code for form |
252 | | - // |
253 | | - //////////////////////////////////////////////////////////////////////////// |
254 | | - |
255 | | - /** |
256 | | - * Set the appeal |
257 | | - * |
258 | | - * @param string $appeal The html appeal text |
259 | | - * @param array $options |
260 | | - * |
261 | | - * @return string Returns an HTML string |
262 | | - */ |
263 | | - protected function setAppeal( $appeal, $options = array() ) { |
264 | | - |
265 | | - $this->appeal = $appeal; |
266 | | - } |
267 | | - |
268 | | - /** |
269 | | - * Get the appeal |
270 | | - * |
271 | | - * @param array $options |
272 | | - * |
273 | | - * @return string Returns an HTML string |
274 | | - */ |
275 | | - protected function getAppeal( $options = array() ) { |
276 | | - |
277 | | - $return = ''; |
278 | | - |
279 | | - $return .= Xml::openElement( 'div', array( 'id' => 'appeal' ) ); |
280 | | - |
281 | | - $return .= Xml::openElement( 'div', array( 'id' => 'appeal-content' ) ); |
282 | | - |
283 | | - $return .= $this->appeal; |
284 | | - |
285 | | - $return .= Xml::closeElement( 'div' ); // appeal-content |
286 | | - |
287 | | - $return .= Xml::closeElement( 'div' ); // appeal |
288 | | - |
289 | | - return $return; |
290 | | - } |
291 | | - |
292 | | - /** |
293 | | - * Generate the bank transfer component |
294 | | - * |
295 | | - * Nothing is being added right now. |
296 | | - * |
297 | | - * @param array $options |
298 | | - * |
299 | | - * @return string Returns an HTML string |
300 | | - */ |
301 | | - protected function getBankTransfer( $options = array() ) { |
302 | | - |
303 | | - extract( $options ); |
304 | | - |
305 | | - $return = ''; |
306 | | - |
307 | | - return $return; |
308 | | - } |
309 | | - |
310 | | - /** |
311 | | - * Generate the credit card component |
312 | | - * |
313 | | - * Nothing is being added right now. |
314 | | - * |
315 | | - * @param array $options |
316 | | - * |
317 | | - * @return string Returns an HTML string |
318 | | - */ |
319 | | - protected function getCreditCard( $options = array() ) { |
320 | | - |
321 | | - extract( $options ); |
322 | | - |
323 | | - $return = ''; |
324 | | - |
325 | | - return $return; |
326 | | - } |
327 | | - |
328 | | - /** |
329 | | - * Generate the direct debit component |
330 | | - * |
331 | | - * @param array $options |
332 | | - * |
333 | | - * @return string Returns an HTML string |
334 | | - */ |
335 | | - protected function getDirectDebit( $options = array() ) { |
336 | | - |
337 | | - extract( $options ); |
338 | | - |
339 | | - $return = ''; |
340 | | - |
341 | | - $ignore = isset( $ignore ) ? (array) $ignore : array(); |
342 | | - |
343 | | - if ( $this->getPaymentMethod() != 'dd' ) { |
344 | | - |
345 | | - // No direct debit fields need to be loaded. |
346 | | - return $return; |
347 | | - } |
348 | | - |
349 | | - $fields = array( |
350 | | - 'account_name' => array( 'required' => true, ), |
351 | | - 'account_number' => array( 'required' => true, ), |
352 | | - 'authorization_id' => array( 'required' => true, ), |
353 | | - 'bank_check_digit' => array( 'required' => true, ), |
354 | | - 'bank_code' => array( 'required' => true, ), |
355 | | - 'bank_name' => array( 'required' => true, ), |
356 | | - 'branch_code' => array( 'required' => true, ), |
357 | | - 'iban' => array( 'required' => true, ), |
358 | | - ); |
359 | | - |
360 | | - $country = isset( $this->form_data['country'] ) ? $this->form_data['country'] : ''; |
361 | | - |
362 | | - if ( $country == 'AT' ) { |
363 | | - |
364 | | - unset( $fields['bank_check_digit'] ); |
365 | | - unset( $fields['branch_code'] ); |
366 | | - unset( $fields['iban'] ); |
367 | | - } |
368 | | - elseif ( $country == 'BE' ) { |
369 | | - |
370 | | - unset( $fields['branch_code'] ); |
371 | | - unset( $fields['iban'] ); |
372 | | - } |
373 | | - elseif ( $country == 'IT' ) { |
374 | | - |
375 | | - unset( $fields['iban'] ); |
376 | | - } |
377 | | - elseif ( $country == 'NL' ) { |
378 | | - |
379 | | - unset( $fields['bank_check_digit'] ); |
380 | | - unset( $fields['branch_code'] ); |
381 | | - unset( $fields['iban'] ); |
382 | | - } |
383 | | - elseif ( $country == 'ES' ) { |
384 | | - |
385 | | - unset( $fields['iban'] ); |
386 | | - } |
387 | | - |
388 | | - |
389 | | - foreach ( $fields as $field => $meta ) { |
390 | | - |
391 | | - // Skip ignored fields |
392 | | - if ( in_array( $field, $ignore ) ) { |
393 | | - |
394 | | - continue; |
395 | | - } |
396 | | - |
397 | | - $return .= '<tr>'; |
398 | | - $return .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-dd-' . $field ), $field ) . '</td>'; |
399 | | - |
400 | | - $return .= '<td>'; |
401 | | - |
402 | | - $required = isset ( $meta['required'] ) ? (boolean) $meta['required'] : false ; |
403 | | - $elementClass = ''; |
404 | | - $elementClass .= $required ? ' required ' : '' ; |
405 | | - $elementClass = trim( $elementClass ); |
406 | | - |
407 | | - $return .= Xml::input( $field, '', $this->form_data[ $field ], array( 'class' => $elementClass, 'type' => 'text', 'maxlength' => '32', 'id' => $field ) ); |
408 | | - $return .= '</td>'; |
409 | | - $return .= '</tr>'; |
410 | | - } |
411 | | - |
412 | | - return $return; |
413 | | - } |
414 | | - |
415 | | - /** |
416 | | - * Get the end of the form |
417 | | - * |
418 | | - * This method gets the hidden fields and appends the closing form tag. |
419 | | - * |
420 | | - * @param array $options |
421 | | - * |
422 | | - * @return string Returns an HTML string |
423 | | - */ |
424 | | - protected function getFormEnd( $options = array() ) { |
425 | | - |
426 | | - extract( $options ); |
427 | | - |
428 | | - $return = ''; |
429 | | - |
430 | | - $return .= $this->generateFormSubmit(); |
431 | | - |
432 | | - // Add hidden fields |
433 | | - foreach ( $this->getHiddenFields() as $field => $value ) { |
434 | | - |
435 | | - $return .= Html::hidden( $field, $value ); |
436 | | - } |
437 | | - |
438 | | - $return .= Xml::closeElement( 'form' ); |
439 | | - |
440 | | - return $return; |
441 | | - } |
442 | | - |
443 | | - /** |
444 | | - * Get the page including form and content |
445 | | - * |
446 | | - * @param array $options |
447 | | - * |
448 | | - * @return string Returns an HTML string |
449 | | - */ |
450 | | - protected function getFormPage( $options = array() ) { |
451 | | - |
452 | | - extract( $options ); |
453 | | - |
454 | | - $return = ''; |
455 | | - |
456 | | - $headerLevel = isset( $headerLevel ) ? (integer) $headerLevel : 3; |
457 | | - |
458 | | - // Tell the user they need JavaScript enabled. |
459 | | - $return .= $this->getNoScript(); |
460 | | - |
461 | | - // Display the form messages |
462 | | - $return .= $this->getFormMessages( $options ); |
463 | | - |
464 | | - $return .= Xml::openElement( 'div', array( 'id' => 'payment_form_container' ) ); |
465 | | - |
466 | | - $return .= $this->getFormStart(); |
467 | | - |
468 | | - $return .= $this->getCaptchaHTML(); |
469 | | - |
470 | | - $return .= $this->getFormSectionAmount(); |
471 | | - |
472 | | - $return .= $this->getFormSectionPersonal(); |
473 | | - |
474 | | - $return .= $this->getFormSectionPayment(); |
475 | | - |
476 | | - $return .= $this->getFormEnd(); |
477 | | - |
478 | | - $return .= $this->generateDonationFooter(); |
479 | | - |
480 | | - $return .= Xml::closeElement( 'div' ); // payment_form_container |
481 | | - |
482 | | - // Display the appeal |
483 | | - $return .= $this->getAppeal( $options ); |
484 | | - |
485 | | - return $return; |
486 | | - } |
487 | | - |
488 | | - /** |
489 | | - * Get the page including form and content |
490 | | - * |
491 | | - * @param array $options |
492 | | - * |
493 | | - * @return string Returns an HTML string |
494 | | - */ |
495 | | - protected function generateFormSubmit( $options = array() ) { |
496 | | - |
497 | | - extract( $options ); |
498 | | - |
499 | | - $return = ''; |
500 | | - |
501 | | - // submit button |
502 | | - $return .= Xml::openElement( 'div', array( 'id' => 'payment_gateway-form-submit' ) ); |
503 | | - $return .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) ); |
504 | | - $return .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'donate_interface-submit-button' ), 'type' => 'submit' ) ); |
505 | | - $return .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button |
506 | | - $return .= Xml::closeElement( 'div' ); // close div#payment_gateway-form-submit |
507 | | - |
508 | | - return $return; |
509 | | - } |
510 | | - |
511 | | - /** |
512 | | - * Get the start of the form |
513 | | - * |
514 | | - * @param array $options |
515 | | - * |
516 | | - * @return string Returns an HTML string |
517 | | - */ |
518 | | - protected function getFormStart( $options = array() ) { |
519 | | - |
520 | | - extract( $options ); |
521 | | - |
522 | | - $return = ''; |
523 | | - |
524 | | - $formOptions = array( |
525 | | - 'action' => $this->getNoCacheAction(), |
526 | | - 'autocomplete' => 'off', |
527 | | - 'id' => $this->getFormId(), |
528 | | - 'method' => 'post', |
529 | | - 'name' => $this->getFormName(), |
530 | | - 'onsubmit' => '', |
531 | | - ); |
532 | | - |
533 | | - // Xml::element seems to convert html to htmlentities |
534 | | - $return .= Xml::openElement( 'form', $formOptions ); |
535 | | - |
536 | | - return $return; |
537 | | - } |
538 | | - |
539 | | - /** |
540 | | - * Generate the bank transfer component |
541 | | - * |
542 | | - * Nothing is being added right now. |
543 | | - * |
544 | | - * @param array $options |
545 | | - * |
546 | | - * @return string Returns an HTML string |
547 | | - */ |
548 | | - protected function getRealTimeBankTransfer( $options = array() ) { |
549 | | - |
550 | | - extract( $options ); |
551 | | - |
552 | | - $return = ''; |
553 | | - |
554 | | - $payment_submethod = $this->gateway->getPaymentSubmethodMeta( $this->getPaymentSubmethod() ); |
555 | | - if ( !isset( $payment_submethod['issuerids'] ) || empty( $payment_submethod['issuerids'] ) ) { |
556 | | - |
557 | | - // No issuer_id to load |
558 | | - return $return; |
559 | | - } |
560 | | - |
561 | | - $selectOptions = ''; |
562 | | - |
563 | | - // generate dropdown of issuer_ids |
564 | | - foreach ( $payment_submethod['issuerids'] as $issuer_id => $issuer_id_label ) { |
565 | | - $selected = ( $this->form_data['issuer_id'] == $issuer_id ) ? true : false; |
566 | | - //$selectOptions .= Xml::option( wfMsg( 'donate_interface-rtbt-' . $issuer_id ), $issuer_id_label, $selected ); |
567 | | - $selectOptions .= Xml::option( $issuer_id_label, $issuer_id, $selected ); |
568 | | - } |
569 | | - $return .= '<tr>'; |
570 | | - $return .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-rtbt-issuer_id' ), 'issuer_id' ) . '</td>'; |
571 | | - |
572 | | - $return .= '<td>'; |
573 | | - $return .= Xml::openElement( |
574 | | - 'select', |
575 | | - array( |
576 | | - 'name' => 'issuer_id', |
577 | | - 'id' => 'issuer_id', |
578 | | - 'onchange' => '', |
579 | | - ) ); |
580 | | - $return .= $selectOptions; |
581 | | - $return .= Xml::closeElement( 'select' ); |
582 | | - |
583 | | - $return .= '</td>'; |
584 | | - $return .= '</tr>'; |
585 | | - |
586 | | - return $return; |
587 | | - } |
588 | | - |
589 | | - //////////////////////////////////////////////////////////////////////////// |
590 | | - // |
591 | | - // Form sections |
592 | | - // |
593 | | - //////////////////////////////////////////////////////////////////////////// |
594 | | - |
595 | | - /** |
596 | | - * Get the donation amount section |
597 | | - * |
598 | | - * @param array $options |
599 | | - * |
600 | | - * Fields: |
601 | | - * - amount|amountRadio |
602 | | - * - currency_code |
603 | | - * |
604 | | - * @return string Returns an HTML string |
605 | | - */ |
606 | | - protected function getFormSectionAmount( $options = array() ) { |
607 | | - |
608 | | - $return = ''; |
609 | | - |
610 | | - $id = 'section_amount'; |
611 | | - |
612 | | - $headerOptions = $options; |
613 | | - |
614 | | - $headerOptions['id'] = $id . '_header'; |
615 | | - |
616 | | - $return .= $this->getFormSectionHeaderTag( wfMsg( 'donate_interface-payment_method-' . $this->getPaymentMethod() ), $headerOptions ); |
617 | | - |
618 | | - $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id |
619 | | - |
620 | | - $radioOptions = array(); |
621 | | - $radioOptions['showCardsOnCurrencyChange'] = false; |
622 | | - |
623 | | - $country = isset( $this->form_data['country'] ) ? $this->form_data['country'] : ''; |
624 | | - |
625 | | - if ( $country == 'SG' ) { |
626 | | - $radioOptions['setCurrency'] = 'SGD'; |
627 | | - } |
628 | | - |
629 | | - $return .= $this->generateAmountByRadio( $radioOptions ); |
630 | | - |
631 | | - $return .= Xml::closeElement( 'div' ); // $id |
632 | | - |
633 | | - return $return; |
634 | | - } |
635 | | - |
636 | | - /** |
637 | | - * Get the personal information section |
638 | | - * |
639 | | - * @param array $options |
640 | | - * |
641 | | - * Fields: |
642 | | - * - fname |
643 | | - * - lname |
644 | | - * - email |
645 | | - * - street |
646 | | - * - city |
647 | | - * - zip |
648 | | - * - country |
649 | | - * |
650 | | - * @return string Returns an HTML string |
651 | | - */ |
652 | | - protected function getFormSectionPersonal( $options = array() ) { |
653 | | - |
654 | | - $return = ''; |
655 | | - |
656 | | - $id = 'section_personal'; |
657 | | - |
658 | | - $headerOptions = $options; |
659 | | - |
660 | | - $headerOptions['id'] = $id . '_header'; |
661 | | - |
662 | | - $return .= $this->getFormSectionHeaderTag( wfMsg( 'donate_interface-cc-form-header-personal' ), $headerOptions ); |
663 | | - |
664 | | - $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id |
665 | | - |
666 | | - $return .= Xml::openElement( 'table', array( 'id' => $id . '_table' ) ); |
667 | | - |
668 | | - $return .= $this->getNameField(); |
669 | | - |
670 | | - // email |
671 | | - $return .= $this->getEmailField(); |
672 | | - |
673 | | - // street |
674 | | - $return .= $this->getStreetField(); |
675 | | - |
676 | | - // city |
677 | | - $return .= $this->getCityField(); |
678 | | - |
679 | | - // state |
680 | | - $return .= $this->getStateField(); |
681 | | - |
682 | | - // zip |
683 | | - $return .= $this->getZipField(); |
684 | | - |
685 | | - // country |
686 | | - $return .= $this->getCountryField(); |
687 | | - |
688 | | - $return .= Xml::closeElement( 'table' ); // close $id . '_table' |
689 | | - |
690 | | - $return .= Xml::closeElement( 'div' ); // $id |
691 | | - |
692 | | - return $return; |
693 | | - } |
694 | | - |
695 | | - /** |
696 | | - * Get the payment information section |
697 | | - * |
698 | | - * @param array $options |
699 | | - * |
700 | | - * Fields: |
701 | | - * - rtbt |
702 | | - * - bt |
703 | | - * - dd |
704 | | - * |
705 | | - * @return string Returns an HTML string |
706 | | - */ |
707 | | - protected function getFormSectionPayment( $options = array() ) { |
708 | | - |
709 | | - $return = ''; |
710 | | - |
711 | | - $id = 'section_personal'; |
712 | | - |
713 | | - $headerOptions = $options; |
714 | | - |
715 | | - $headerOptions['id'] = $id . '_header'; |
716 | | - |
717 | | - $return .= $this->getFormSectionHeaderTag( wfMsg( 'donate_interface-cc-form-header-payment' ), $headerOptions ); |
718 | | - |
719 | | - $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id |
720 | | - |
721 | | - $return .= Xml::openElement( 'table', array( 'id' => $id . '_table' ) ); |
722 | | - |
723 | | - switch ( $this->getPaymentMethod() ) { |
724 | | - case 'bt': |
725 | | - $return .= $this->getBankTransfer(); |
726 | | - break; |
727 | | - case 'cc': |
728 | | - $return .= $this->getCreditCard(); |
729 | | - break; |
730 | | - case 'dd': |
731 | | - $return .= $this->getDirectDebit(); |
732 | | - break; |
733 | | - case 'rtbt': |
734 | | - $return .= $this->getRealTimeBankTransfer(); |
735 | | - break; |
736 | | - default: |
737 | | - $return .= $this->getCreditCard(); |
738 | | - break; |
739 | | - } |
740 | | - |
741 | | - $return .= Xml::closeElement( 'table' ); // close $id . '_table' |
742 | | - |
743 | | - $return .= Xml::closeElement( 'div' ); // $id |
744 | | - |
745 | | - return $return; |
746 | | - } |
747 | | - |
748 | | - //////////////////////////////////////////////////////////////////////////// |
749 | | - // |
750 | | - // Deprecated |
751 | | - // |
752 | | - //////////////////////////////////////////////////////////////////////////// |
753 | | - |
754 | | - /** |
755 | | - * Generate the payment information |
756 | | - * |
757 | | - * @todo |
758 | | - * - a large part of this method is for debugging and may need to be removed. |
759 | | - */ |
760 | | - public function generateFormPaymentInformation() { |
761 | | - |
762 | | - $form = ''; |
763 | | - |
764 | | - // Payment debugging information |
765 | | - $form .= Xml::openElement( 'div', array( 'id' => 'mw-payment-information' ) ); |
766 | | - |
767 | | - $form .= Xml::tags( 'h2', array(), 'Payment debugging information' ); |
768 | | - |
769 | | - $form .= Xml::openElement( 'ul', array() ); // open div#mw-payment-information ul |
770 | | - $form .= Xml::tags( 'li', array(), 'payment_method: ' . $this->getPaymentMethod() ); |
771 | | - $form .= Xml::tags( 'li', array(), 'payment_submethod: ' . $this->getPaymentSubmethod() ); |
772 | | - |
773 | | - if ( isset( $this->form_data['issuer_id'] ) ) { |
774 | | - $form .= Xml::tags( 'li', array(), 'issuer_id: ' . $this->form_data['issuer_id'] ); |
775 | | - } |
776 | | - |
777 | | - $form .= Xml::closeElement( 'ul' ); // close div#mw-payment-information ul |
778 | | - |
779 | | - $form .= Xml::tags( 'h3', array(), 'Payment choices' ); |
780 | | - |
781 | | - $form .= Xml::tags( 'h4', array(), 'Payment method:' ); |
782 | | - |
783 | | - $form .= Xml::openElement( 'ul', array() ); // open div#mw-payment-information ul |
784 | | - |
785 | | - // Payment methods that are not supported by this form. |
786 | | - $ignorePaymentMethod = array( 'cc', ); |
787 | | - |
788 | | - // Loop through forms to display |
789 | | - foreach ( $this->gateway->getPaymentMethods() as $payment_method => $payment_methodMeta ) { |
790 | | - |
791 | | - if ( in_array( $payment_method, $ignorePaymentMethod ) ) { |
792 | | - continue; |
793 | | - } |
794 | | - |
795 | | - $form .= Xml::openElement( 'li', array() ); |
796 | | - |
797 | | - $form .= Xml::tags( 'span', array(), $payment_method ); |
798 | | - |
799 | | - foreach ( $payment_methodMeta['types'] as $payment_submethod ) { |
800 | | - $form .= ' - ' . Xml::tags( 'a', array('href'=>'?form_name=TwoStepAmount&payment_method=' . $payment_method . '&payment_submethod=' . $payment_submethod), $payment_submethod ); |
801 | | - } |
802 | | - |
803 | | - $form .= Xml::closeElement( 'li' ); |
804 | | - } |
805 | | - |
806 | | - $form .= Xml::closeElement( 'ul' ); // close div#mw-payment-information ul |
807 | | - |
808 | | - $form .= Xml::closeElement( 'div' ); // close div#mw-payment-information |
809 | | - |
810 | | - return $form; |
811 | | - } |
812 | | - |
813 | | - /** |
814 | | - * Generate the issuerId for real time bank transfer |
815 | | - */ |
816 | | - public function generateFormIssuerIdDropdown() { |
817 | | - |
818 | | - $form = ''; |
819 | | - //return $form; |
820 | | - |
821 | | - $payment_submethod = $this->gateway->getPaymentSubmethodMeta( $this->getPaymentSubmethod() ); |
822 | | - if ( !isset( $payment_submethod['issuerids'] ) || empty( $payment_submethod['issuerids'] ) ) { |
823 | | - |
824 | | - // No issuer_id to load |
825 | | - return $form; |
826 | | - } |
827 | | - |
828 | | - $selectOptions = ''; |
829 | | - |
830 | | - // generate dropdown of issuer_ids |
831 | | - foreach ( $payment_submethod['issuerids'] as $issuer_id => $issuer_id_label ) { |
832 | | - $selected = ( $this->form_data['issuer_id'] == $issuer_id ) ? true : false; |
833 | | - //$selectOptions .= Xml::option( wfMsg( 'donate_interface-rtbt-' . $issuer_id ), $issuer_id_label, $selected ); |
834 | | - $selectOptions .= Xml::option( $issuer_id_label, $issuer_id, $selected ); |
835 | | - } |
836 | | - $form .= '<tr>'; |
837 | | - $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-rtbt-issuer_id' ), 'issuer_id' ) . '</td>'; |
838 | | - |
839 | | - $form .= '<td>'; |
840 | | - $form .= Xml::openElement( |
841 | | - 'select', |
842 | | - array( |
843 | | - 'name' => 'issuer_id', |
844 | | - 'id' => 'issuer_id', |
845 | | - 'onchange' => '', |
846 | | - ) ); |
847 | | - $form .= $selectOptions; |
848 | | - $form .= Xml::closeElement( 'select' ); |
849 | | - |
850 | | - $form .= '</td>'; |
851 | | - $form .= '</tr>'; |
852 | | - |
853 | | - return $form; |
854 | | - } |
855 | | - |
856 | | - |
857 | | - /** |
858 | | - * Generate the first part of the form |
859 | | - */ |
860 | | - public function generateFormStart() { |
861 | | - |
862 | | - $form = ''; |
863 | | - |
864 | | - //$form .= $this->generateBannerHeader(); |
865 | | - |
866 | | - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) ); |
867 | | - |
868 | | - // provide a place at the top of the form for displaying general messages |
869 | | - if ( $this->form_errors['general'] ) { |
870 | | - $form .= Xml::openElement( 'div', array( 'id' => 'mw-payment-general-error' ) ); |
871 | | - if ( is_array( $this->form_errors['general'] ) ) { |
872 | | - foreach ( $this->form_errors['general'] as $this->form_errors_msg ) { |
873 | | - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg ); |
874 | | - } |
875 | | - } else { |
876 | | - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg ); |
877 | | - } |
878 | | - $form .= Xml::closeElement( 'div' ); |
879 | | - } |
880 | | - |
881 | | - // add noscript tags for javascript disabled browsers |
882 | | - $form .= $this->getNoScript(); |
883 | | - |
884 | | - $form .= $this->generateFormPaymentInformation(); |
885 | | - |
886 | | - // open form |
887 | | - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) ); |
888 | | - |
889 | | - // Xml::element seems to convert html to htmlentities |
890 | | - $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>"; |
891 | | - $form .= Xml::openElement( 'form', array( 'id' => $this->getFormId(), 'name' => $this->getFormName(), 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => '', 'autocomplete' => 'off' ) ); |
892 | | - |
893 | | - $form .= Xml::openElement( 'div', array( 'id' => 'left-column', 'class' => 'payment-cc-form-section' ) ); |
894 | | - $form .= $this->generatePersonalContainer(); |
895 | | - $form .= $this->generatePaymentContainer(); |
896 | | - $form .= $this->generateFormSubmit(); |
897 | | - $form .= Xml::closeElement( 'div' ); // close div#left-column |
898 | | - |
899 | | - //$form .= Xml::openElement( 'div', array( 'id' => 'right-column', 'class' => 'payment-cc-form-section' ) ); |
900 | | - |
901 | | - return $form; |
902 | | - } |
903 | | - |
904 | | - public function generateFormEnd() { |
905 | | - $form = ''; |
906 | | - // add hidden fields |
907 | | - $hidden_fields = $this->getHiddenFields(); |
908 | | - foreach ( $hidden_fields as $field => $value ) { |
909 | | - $form .= Html::hidden( $field, $value ); |
910 | | - } |
911 | | - |
912 | | - $form .= Xml::closeElement( 'form' ); |
913 | | - $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard-form |
914 | | - $form .= $this->generateDonationFooter(); |
915 | | - $form .= Xml::closeElement( 'div' ); // div#close mw-creditcard |
916 | | - return $form; |
917 | | - } |
918 | | - |
919 | | - protected function generatePersonalContainer() { |
920 | | - $form = ''; |
921 | | - $form .= Xml::openElement( 'div', array( 'id' => 'payment_gateway-personal-info' ) ); ; |
922 | | - //$form .= Xml::tags( 'h3', array( 'class' => 'payment-cc-form-header', 'id' => 'payment-cc-form-header-personal' ), wfMsg( 'donate_interface-cc-form-header-personal' ) ); |
923 | | - $form .= Xml::openElement( 'table', array( 'id' => 'payment-table-donor' ) ); |
924 | | - |
925 | | - $form .= $this->generatePersonalFields(); |
926 | | - |
927 | | - $form .= Xml::closeElement( 'table' ); // close table#payment-table-donor |
928 | | - $form .= Xml::closeElement( 'div' ); // close div#payment_gateway-personal-info |
929 | | - |
930 | | - return $form; |
931 | | - } |
932 | | - |
933 | | - protected function generatePersonalFields() { |
934 | | - // first name |
935 | | - $form = $this->getNameField(); |
936 | | - |
937 | | - // country |
938 | | - $form .= $this->getCountryField(); |
939 | | - |
940 | | - // street |
941 | | - $form .= $this->getStreetField(); |
942 | | - |
943 | | - |
944 | | - // city |
945 | | - $form .= $this->getCityField(); |
946 | | - |
947 | | - // state |
948 | | - $form .= $this->getStateField(); |
949 | | - |
950 | | - // zip |
951 | | - $form .= $this->getZipField(); |
952 | | - |
953 | | - // email |
954 | | - $form .= $this->getEmailField(); |
955 | | - |
956 | | - return $form; |
957 | | - } |
958 | | - |
959 | | - protected function generatePaymentContainer() { |
960 | | - $form = ''; |
961 | | - // credit card info |
962 | | - $form .= Xml::openElement( 'div', array( 'id' => 'donation-payment-info' ) ); |
963 | | - //$form .= Xml::tags( 'h3', array( 'class' => 'payment-cc-form-header', 'id' => 'payment-cc-form-header-payment' ), wfMsg( 'donate_interface-cc-form-header-payment' ) ); |
964 | | - $form .= Xml::openElement( 'table', array( 'id' => 'donation-table-cc' ) ); |
965 | | - |
966 | | - $form .= $this->generatePaymentFields(); |
967 | | - |
968 | | - $form .= Xml::closeElement( 'table' ); // close table#payment-table-cc |
969 | | - $form .= Xml::closeElement( 'div' ); // close div#payment_gateway-payment-info |
970 | | - |
971 | | - return $form; |
972 | | - } |
973 | | - |
974 | | - protected function generatePaymentFields() { |
975 | | - // amount |
976 | | - $form .= $this->generateAmountByRadio(); |
977 | | - |
978 | | - $form .= $this->generateFormIssuerIdDropdown(); |
979 | | - $form .= $this->generateFormDirectDebit(); |
980 | | - |
981 | | - |
982 | | - return $form; |
983 | | - } |
984 | | -} |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | $final .= " Status $status = $count\n"; |
127 | 127 | } |
128 | 128 | } |
129 | | - |
| 129 | + $this->adapter->log($final); |
130 | 130 | echo $final; |
131 | 131 | } |
132 | 132 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
133 | 133 | Merged /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php:r105938 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphan_adapter.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | //re-init all these arrays, because this is a batch thing. |
38 | 38 | $this->hard_data = array( ); |
39 | 39 | $this->transaction_results = array( ); |
40 | | - $this->raw_data = array( ); |
| 40 | + $this->unstaged_data = array( ); |
41 | 41 | $this->staged_data = array( ); |
42 | 42 | |
43 | 43 | $this->hard_data['order_id'] = $data['order_id']; |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | |
46 | 46 | $this->dataObj = new DonationData( get_called_class(), false, $data ); |
47 | 47 | |
48 | | - $this->raw_data = $this->dataObj->getData(); |
| 48 | + $this->unstaged_data = $this->dataObj->getDataEscaped(); |
49 | 49 | |
50 | 50 | if ( $useDB ){ |
51 | 51 | $this->hard_data = array_merge( $this->hard_data, $this->getUTMInfoFromDB() ); |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | } |
63 | 63 | $this->reAddHardData(); |
64 | 64 | |
65 | | - $this->staged_data = $this->raw_data; |
| 65 | + $this->staged_data = $this->unstaged_data; |
66 | 66 | |
67 | 67 | $this->setPostDefaults(); |
68 | 68 | $this->defineTransactions(); |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | //anywhere else, and this would constitute abuse of the system. |
88 | 88 | //so don't do it. |
89 | 89 | foreach ( $this->hard_data as $key => $val ) { |
90 | | - $this->raw_data[$key] = $val; |
| 90 | + $this->unstaged_data[$key] = $val; |
91 | 91 | $this->staged_data[$key] = $val; |
92 | 92 | } |
93 | 93 | } |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | switch ( $transaction ) { |
97 | 97 | case 'SET_PAYMENT': |
98 | 98 | case 'CANCEL_PAYMENT': |
99 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ": CVV: " . $this->getData_Raw( 'cvv_result' ) . ": AVS: " . $this->getData_Raw( 'avs_result' ) ); |
| 99 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ": CVV: " . $this->getData_Unstaged_Escaped( 'cvv_result' ) . ": AVS: " . $this->getData_Unstaged_Escaped( 'avs_result' ) ); |
100 | 100 | //and then go on, unless you're testing, in which case: |
101 | 101 | // return "NOPE"; |
102 | 102 | // break; |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | return null; |
132 | 132 | } |
133 | 133 | |
134 | | - $ctid = $this->getData_Raw( 'contribution_tracking_id' ); |
| 134 | + $ctid = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ); |
135 | 135 | |
136 | 136 | $data = array( ); |
137 | 137 | |
— | — | @@ -191,11 +191,11 @@ |
192 | 192 | return; |
193 | 193 | } |
194 | 194 | |
195 | | - if ( !is_null( $this->getData_Raw( 'date' ) ) ) { |
196 | | - $timestamp = $this->getData_Raw( 'date' ); |
| 195 | + if ( !is_null( $this->getData_Unstaged_Escaped( 'date' ) ) ) { |
| 196 | + $timestamp = $this->getData_Unstaged_Escaped( 'date' ); |
197 | 197 | } else { |
198 | | - if ( !is_null( $this->getData_Raw( 'ts' ) ) ) { |
199 | | - $timestamp = strtotime( $this->getData_Raw( 'ts' ) ); //I hate that this works. |
| 198 | + if ( !is_null( $this->getData_Unstaged_Escaped( 'ts' ) ) ) { |
| 199 | + $timestamp = strtotime( $this->getData_Unstaged_Escaped( 'ts' ) ); //I hate that this works. |
200 | 200 | } else { |
201 | 201 | $timestamp = time(); |
202 | 202 | } |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | 'gateway_txn_id' => $this->getTransactionGatewayTxnID(), |
210 | 210 | //'language' => '', |
211 | 211 | ); |
212 | | - $transaction += $this->getData_Raw(); |
| 212 | + $transaction += $this->getData_Unstaged_Escaped(); |
213 | 213 | |
214 | 214 | try { |
215 | 215 | wfRunHooks( $hook, array( $transaction ) ); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphan_adapter.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
216 | 216 | Merged /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphan_adapter.php:r105938 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -86,12 +86,11 @@ |
87 | 87 | $payment_submethod = $this->adapter->getPaymentSubmethod(); |
88 | 88 | |
89 | 89 | // Check form for errors |
90 | | - $form_errors = $this->validateForm( $this->errors, $this->adapter->getPaymentSubmethodFormValidation() ); |
| 90 | + $form_errors = $this->validateForm( $this->adapter->getPaymentSubmethodFormValidation() ); |
91 | 91 | |
92 | 92 | // If there were errors, redisplay form, otherwise proceed to next step |
93 | 93 | if ( $form_errors ) { |
94 | | - |
95 | | - $this->displayForm( $this->errors ); |
| 94 | + $this->displayForm(); |
96 | 95 | } else { // The submitted form data is valid, so process it |
97 | 96 | // allow any external validators to have their way with the data |
98 | 97 | // Execute the proper transaction code: |
— | — | @@ -179,18 +178,20 @@ |
180 | 179 | |
181 | 180 | //TODO: Get rid of $data out here completely, by putting this logic inside the adapter somewhere. |
182 | 181 | //All we seem to be doing with it now, is internal adapter logic outside of the adapter. |
183 | | - $data = $this->adapter->getData_Raw(); |
| 182 | + $data = $this->adapter->getData_Unstaged_Escaped(); |
184 | 183 | |
185 | 184 | // If the result of the previous transaction was failure, set the retry message. |
186 | 185 | if ( $data && array_key_exists( 'response', $data ) && $data['response'] == 'failure' ) { |
187 | | - $this->errors['retryMsg'] = wfMsg( 'php-response-declined' ); |
| 186 | + $error['retryMsg'] = wfMsg( 'php-response-declined' ); |
| 187 | + $this->adapter->addManualError( $error ); |
188 | 188 | } |
189 | 189 | |
190 | | - $this->displayForm( $this->errors ); |
| 190 | + $this->displayForm(); |
191 | 191 | } |
192 | 192 | } else { //token mismatch |
193 | | - $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
194 | | - $this->displayForm( $this->errors ); |
| 193 | + $error['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
| 194 | + $this->adapter->addManualError( $error ); |
| 195 | + $this->displayForm(); |
195 | 196 | } |
196 | 197 | } |
197 | 198 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
198 | 199 | Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php:r105938,107609 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -591,7 +591,6 @@ |
592 | 592 | 'label' => 'Bank transfer', |
593 | 593 | 'types' => array( 'bt', ), |
594 | 594 | 'validation' => array( 'creditCard' => false, ) |
595 | | - //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
596 | 595 | ); |
597 | 596 | |
598 | 597 | // Credit Cards |
— | — | @@ -605,7 +604,6 @@ |
606 | 605 | 'label' => 'Direct Debit', |
607 | 606 | 'types' => array( 'dd_at', 'dd_be', 'dd_ch', 'dd_de', 'dd_es','dd_fr', 'dd_gb', 'dd_it', 'dd_nl', ), |
608 | 607 | 'validation' => array( 'creditCard' => false, ) |
609 | | - //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
610 | 608 | ); |
611 | 609 | |
612 | 610 | // eWallets |
— | — | @@ -613,7 +611,6 @@ |
614 | 612 | 'label' => 'eWallets', |
615 | 613 | 'types' => array( 'ew_cashu', 'ew_moneybookers', 'ew_paypal', 'ew_webmoney', ), |
616 | 614 | 'validation' => array( 'address' => false, 'creditCard' => false, ) |
617 | | - //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
618 | 615 | ); |
619 | 616 | |
620 | 617 | // Bank Transfers |
— | — | @@ -621,7 +618,6 @@ |
622 | 619 | 'label' => 'Online bank transfer', |
623 | 620 | 'types' => array( 'bpay', ), |
624 | 621 | 'validation' => array( 'creditCard' => false, ) |
625 | | - //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
626 | 622 | ); |
627 | 623 | |
628 | 624 | // Real Time Bank Transfers |
— | — | @@ -1074,9 +1070,9 @@ |
1075 | 1071 | $is_orphan = false; |
1076 | 1072 | if ( count( $addme ) ){ //nothing unusual here. |
1077 | 1073 | $this->addData( $addme ); |
1078 | | - $logmsg = $this->getData_Raw( 'contribution_tracking_id' ) . ': '; |
1079 | | - $logmsg .= 'CVV Result: ' . $this->getData_Raw( 'cvv_result' ); |
1080 | | - $logmsg .= ', AVS Result: ' . $this->getData_Raw( 'avs_result' ); |
| 1074 | + $logmsg = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ': '; |
| 1075 | + $logmsg .= 'CVV Result: ' . $this->getData_Unstaged_Escaped( 'cvv_result' ); |
| 1076 | + $logmsg .= ', AVS Result: ' . $this->getData_Unstaged_Escaped( 'avs_result' ); |
1081 | 1077 | self::log( $logmsg ); |
1082 | 1078 | } else { //this is an orphan transaction. |
1083 | 1079 | $this->staged_data['order_id'] = $this->staged_data['i_order_id']; |
— | — | @@ -1109,9 +1105,9 @@ |
1110 | 1106 | $gotCVV = true; |
1111 | 1107 | $this->addData( $addme ); |
1112 | 1108 | $this->staged_data['order_id'] = $this->staged_data['i_order_id']; |
1113 | | - $logmsg = $this->getData_Raw( 'contribution_tracking_id' ) . ': '; |
1114 | | - $logmsg .= 'CVV Result: ' . $this->getData_Raw( 'cvv_result' ); |
1115 | | - $logmsg .= ', AVS Result: ' . $this->getData_Raw( 'avs_result' ); |
| 1109 | + $logmsg = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ': '; |
| 1110 | + $logmsg .= 'CVV Result: ' . $this->getData_Unstaged_Escaped( 'cvv_result' ); |
| 1111 | + $logmsg .= ', AVS Result: ' . $this->getData_Unstaged_Escaped( 'avs_result' ); |
1116 | 1112 | self::log( $logmsg ); |
1117 | 1113 | $this->runPreProcessHooks(); |
1118 | 1114 | $status_result['action'] = $this->getValidationAction(); |
— | — | @@ -1222,7 +1218,7 @@ |
1223 | 1219 | |
1224 | 1220 | if ( $problemflag ){ |
1225 | 1221 | //we have probably had a communication problem that could mean stranded payments. |
1226 | | - $problemmessage = $this->getData_Raw( 'contribution_tracking_id' ) . ':' . $this->getData_Raw( 'order_id' ) . ' ' . $problemmessage; |
| 1222 | + $problemmessage = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ':' . $this->getData_Unstaged_Escaped( 'order_id' ) . ' ' . $problemmessage; |
1227 | 1223 | self::log( $problemmessage ); |
1228 | 1224 | //hurm. It would be swell if we had a message that told the user we had some kind of internal error. |
1229 | 1225 | $ret = array( |
— | — | @@ -1252,7 +1248,7 @@ |
1253 | 1249 | $xmlString = $this->stripXMLResponseHeaders( $rawResponse ); |
1254 | 1250 | $displayXML = $this->formatXmlString( $xmlString ); |
1255 | 1251 | $realXML = new DomDocument( '1.0' ); |
1256 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ": Raw XML Response:\n" . $displayXML ); //I am apparently a huge fibber. |
| 1252 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ": Raw XML Response:\n" . $displayXML ); //I am apparently a huge fibber. |
1257 | 1253 | $realXML->loadXML( trim( $xmlString ) ); |
1258 | 1254 | return $realXML; |
1259 | 1255 | } |
— | — | @@ -1646,7 +1642,7 @@ |
1647 | 1643 | //set the transaction result message |
1648 | 1644 | $responseStatus = isset( $response['STATUSID'] ) ? $response['STATUSID'] : ''; |
1649 | 1645 | $this->setTransactionResult( "Response Status: " . $responseStatus, 'txn_message' ); //TODO: Translate for GC. |
1650 | | - $this->setTransactionResult( $this->getData_Raw( 'order_id' ), 'gateway_txn_id' ); |
| 1646 | + $this->setTransactionResult( $this->getData_Unstaged_Escaped( 'order_id' ), 'gateway_txn_id' ); |
1651 | 1647 | } |
1652 | 1648 | |
1653 | 1649 | /** |
— | — | @@ -2032,7 +2028,7 @@ |
2033 | 2029 | // Get the default returnto |
2034 | 2030 | $returnto = $this->getData_Staged( 'returnto' ); |
2035 | 2031 | |
2036 | | - if ( $this->getData_Raw( 'payment_method' ) === 'cc' ){ |
| 2032 | + if ( $this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc' ){ |
2037 | 2033 | |
2038 | 2034 | // Add order ID to the returnto URL, only if it's not already there. |
2039 | 2035 | //TODO: This needs to be more robust (like actually pulling the |
— | — | @@ -2053,7 +2049,7 @@ |
2054 | 2050 | |
2055 | 2051 | protected function pre_process_insert_orderwithpayment(){ |
2056 | 2052 | $this->incrementNumAttempt(); |
2057 | | - if ( $this->getData_Raw( 'payment_method' ) === 'cc' ){ |
| 2053 | + if ( $this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc' ){ |
2058 | 2054 | $this->addDonorDataToSession(); |
2059 | 2055 | } |
2060 | 2056 | } |
— | — | @@ -2074,7 +2070,7 @@ |
2075 | 2071 | } |
2076 | 2072 | |
2077 | 2073 | protected function pre_process_get_orderstatus(){ |
2078 | | - if ( $this->getData_Raw( 'payment_method' ) === 'cc' ){ |
| 2074 | + if ( $this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc' ){ |
2079 | 2075 | $this->runPreProcessHooks(); |
2080 | 2076 | } |
2081 | 2077 | } |
— | — | @@ -2084,13 +2080,13 @@ |
2085 | 2081 | * determine if we want to fail the transaction ourselves or not. |
2086 | 2082 | */ |
2087 | 2083 | public function getCVVResult(){ |
2088 | | - if ( is_null( $this->getData_Raw( 'cvv_result' ) ) ){ |
| 2084 | + if ( is_null( $this->getData_Unstaged_Escaped( 'cvv_result' ) ) ){ |
2089 | 2085 | return null; |
2090 | 2086 | } |
2091 | 2087 | |
2092 | 2088 | $cvv_map = $this->getGlobal( 'CvvMap' ); |
2093 | 2089 | |
2094 | | - $result = $cvv_map[$this->getData_Raw( 'cvv_result' )]; |
| 2090 | + $result = $cvv_map[$this->getData_Unstaged_Escaped( 'cvv_result' )]; |
2095 | 2091 | return $result; |
2096 | 2092 | |
2097 | 2093 | } |
— | — | @@ -2100,7 +2096,7 @@ |
2101 | 2097 | * determine if we want to fail the transaction ourselves or not. |
2102 | 2098 | */ |
2103 | 2099 | public function getAVSResult(){ |
2104 | | - if ( is_null( $this->getData_Raw( 'avs_result' ) ) ){ |
| 2100 | + if ( is_null( $this->getData_Unstaged_Escaped( 'avs_result' ) ) ){ |
2105 | 2101 | return null; |
2106 | 2102 | } |
2107 | 2103 | //Best guess here: |
— | — | @@ -2108,7 +2104,7 @@ |
2109 | 2105 | |
2110 | 2106 | $avs_map = $this->getGlobal( 'AvsMap' ); |
2111 | 2107 | |
2112 | | - $result = $avs_map[$this->getData_Raw( 'avs_result' )]; |
| 2108 | + $result = $avs_map[$this->getData_Unstaged_Escaped( 'avs_result' )]; |
2113 | 2109 | return $result; |
2114 | 2110 | } |
2115 | 2111 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2116 | 2112 | Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r105938,106366 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -163,16 +163,22 @@ |
164 | 164 | protected $staged_vars = array(); |
165 | 165 | protected $return_value_map; |
166 | 166 | protected $staged_data; |
167 | | - protected $raw_data; |
| 167 | + protected $unstaged_data; |
168 | 168 | protected $postdatadefaults; |
169 | 169 | protected $xmlDoc; |
170 | 170 | protected $dataObj; |
171 | 171 | protected $transaction_results; |
172 | | - protected $form_class; |
173 | 172 | protected $validation_errors; |
| 173 | + protected $manual_errors = array(); |
174 | 174 | protected $current_transaction; |
175 | 175 | protected $action; |
176 | 176 | public $debugarray; |
| 177 | + /** |
| 178 | + * A boolean that will tell us if we've posted to ourselves. A little more telling than |
| 179 | + * $wgRequest->wasPosted(), as something else could have posted to us. |
| 180 | + * @var boolean |
| 181 | + */ |
| 182 | + public $posted = false; |
177 | 183 | protected $batch = false; |
178 | 184 | |
179 | 185 | //ALL OF THESE need to be redefined in the children. Much voodoo depends on the accuracy of these constants. |
— | — | @@ -221,9 +227,10 @@ |
222 | 228 | |
223 | 229 | $this->dataObj = new DonationData( get_called_class(), self::getGlobal( 'Test' ), $external_data ); |
224 | 230 | |
225 | | - $this->raw_data = $this->dataObj->getData(); |
226 | | - $this->staged_data = $this->raw_data; |
| 231 | + $this->unstaged_data = $this->dataObj->getDataEscaped(); |
| 232 | + $this->staged_data = $this->unstaged_data; |
227 | 233 | |
| 234 | + //If we ever put numAttempt in the session, we'll probably want to re-examine which form value we want to use here. |
228 | 235 | $this->posted = ( $this->dataObj->wasPosted() && ( !is_null( $wgRequest->getVal( 'numAttempt', null ) ) ) ); |
229 | 236 | |
230 | 237 | $this->setPostDefaults( $postDefaults ); |
— | — | @@ -284,7 +291,7 @@ |
285 | 292 | $page = self::getGlobal( "FailPage" ); |
286 | 293 | if ( $page ) { |
287 | 294 | |
288 | | - $language = $this->getData_Raw( 'language' ); |
| 295 | + $language = $this->getData_Unstaged_Escaped( 'language' ); |
289 | 296 | |
290 | 297 | $page .= '?uselang=' . $language; |
291 | 298 | } |
— | — | @@ -300,7 +307,7 @@ |
301 | 308 | * @return string A URL |
302 | 309 | */ |
303 | 310 | protected function appendLanguageAndMakeURL( $url ){ |
304 | | - $language = $this->getData_Raw( 'language' ); |
| 311 | + $language = $this->getData_Unstaged_Escaped( 'language' ); |
305 | 312 | //make sure we don't already have the language in there... |
306 | 313 | $dirs = explode('/', $url); |
307 | 314 | if ( !is_array($dirs) || !in_array( $language, $dirs ) ){ |
— | — | @@ -387,20 +394,24 @@ |
388 | 395 | /** |
389 | 396 | * This is the ONLY getData type function anything should be using |
390 | 397 | * outside the adapter. |
391 | | - * Please note that in this case, raw means it's been normalized and |
392 | | - * sanitized by DonationData. Mostly, we qualify it as "raw" because it's |
393 | | - * not been staged for this adapter. |
| 398 | + * Short explanation of the data population up to now: |
| 399 | + * *) When the gateway adapter is constructed, it constructs a DonationData |
| 400 | + * object. |
| 401 | + * *) On construction, the DonationData object pulls donation data from an |
| 402 | + * appropriate source, and normalizes the entire data set for storage. |
| 403 | + * *) The gateway adapter pulls normalized, html escaped data out of the |
| 404 | + * DonationData object, as the base of its own data set. |
394 | 405 | * @param string $val The specific key you're looking for (if any) |
395 | 406 | * @return mixed An array of all the raw, unstaged (but normalized and |
396 | 407 | * sanitized) data sent to the adapter, or if $val was set, either the |
397 | 408 | * specific value held for $val, or null if none exists. |
398 | 409 | */ |
399 | | - public function getData_Raw( $val = '' ) { |
| 410 | + public function getData_Unstaged_Escaped( $val = '' ) { |
400 | 411 | if ( $val === '' ) { |
401 | | - return $this->raw_data; |
| 412 | + return $this->unstaged_data; |
402 | 413 | } else { |
403 | | - if ( array_key_exists( $val, $this->raw_data ) ) { |
404 | | - return $this->raw_data[$val]; |
| 414 | + if ( array_key_exists( $val, $this->unstaged_data ) ) { |
| 415 | + return $this->unstaged_data[$val]; |
405 | 416 | } else { |
406 | 417 | return null; |
407 | 418 | } |
— | — | @@ -798,9 +809,7 @@ |
799 | 810 | //reset, in case this isn't our first time. |
800 | 811 | $this->transaction_results = array(); |
801 | 812 | $this->setValidationAction('process', true); |
802 | | - |
803 | | - $this->log( 'ReferrerHeaderTest (' . $this->getData_Raw( 'contribution_tracking_id' ) . "): Value @ do_transaction = " . $this->getData_Raw( 'referrer' ) ); |
804 | | - |
| 813 | + |
805 | 814 | try { |
806 | 815 | $this->setCurrentTransaction( $transaction ); |
807 | 816 | |
— | — | @@ -948,7 +957,7 @@ |
949 | 958 | } |
950 | 959 | |
951 | 960 | // log that the transaction is essentially complete |
952 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . " Transaction complete." ); |
| 961 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . " Transaction complete." ); |
953 | 962 | |
954 | 963 | $this->debugarray[] = 'numAttempt = ' . $this->getData_Staged('numAttempt'); |
955 | 964 | |
— | — | @@ -1031,7 +1040,7 @@ |
1032 | 1041 | */ |
1033 | 1042 | public function getPaymentMethod() { |
1034 | 1043 | |
1035 | | - return $this->getData_Raw('payment_method'); |
| 1044 | + return $this->getData_Unstaged_Escaped('payment_method'); |
1036 | 1045 | } |
1037 | 1046 | |
1038 | 1047 | /** |
— | — | @@ -1066,7 +1075,7 @@ |
1067 | 1076 | */ |
1068 | 1077 | public function getPaymentSubmethod() { |
1069 | 1078 | |
1070 | | - return $this->getData_Raw('payment_submethod'); |
| 1079 | + return $this->getData_Unstaged_Escaped('payment_submethod'); |
1071 | 1080 | } |
1072 | 1081 | |
1073 | 1082 | /** |
— | — | @@ -1131,15 +1140,15 @@ |
1132 | 1141 | $results = array(); |
1133 | 1142 | |
1134 | 1143 | while ( $i++ <= 3 ) { |
1135 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Preparing to send transaction to ' . self::getGatewayName() ); |
| 1144 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Preparing to send transaction to ' . self::getGatewayName() ); |
1136 | 1145 | $results['result'] = curl_exec( $ch ); |
1137 | 1146 | $results['headers'] = curl_getinfo( $ch ); |
1138 | 1147 | |
1139 | 1148 | if ( $results['headers']['http_code'] != 200 && $results['headers']['http_code'] != 403 ) { |
1140 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Failed sending transaction to ' . self::getGatewayName() . ', retrying' ); |
| 1149 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Failed sending transaction to ' . self::getGatewayName() . ', retrying' ); |
1141 | 1150 | sleep( 1 ); |
1142 | 1151 | } elseif ( $results['headers']['http_code'] == 200 || $results['headers']['http_code'] == 403 ) { |
1143 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Finished sending transaction to ' . self::getGatewayName() ); |
| 1152 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Finished sending transaction to ' . self::getGatewayName() ); |
1144 | 1153 | break; |
1145 | 1154 | } |
1146 | 1155 | } |
— | — | @@ -1151,7 +1160,7 @@ |
1152 | 1161 | //TODO: i18n here! |
1153 | 1162 | //TODO: But also, fire off some kind of "No response from the gateway" thing to somebody so we know right away. |
1154 | 1163 | $results['message'] = 'No response from ' . self::getGatewayName() . '. Please try again later!'; |
1155 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' No response from ' . self::getGatewayName() . ': ' . curl_error( $ch ) ); |
| 1164 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' No response from ' . self::getGatewayName() . ': ' . curl_error( $ch ) ); |
1156 | 1165 | curl_close( $ch ); |
1157 | 1166 | return false; |
1158 | 1167 | } |
— | — | @@ -1315,7 +1324,7 @@ |
1316 | 1325 | } |
1317 | 1326 | |
1318 | 1327 | $params = array( |
1319 | | - 'contribution_id' => $this->dataObj->getVal( 'contribution_tracking_id' ), |
| 1328 | + 'contribution_id' => $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ), |
1320 | 1329 | 'duration' => $this->getStopwatch( $function ), |
1321 | 1330 | 'gateway' => self::getGatewayName(), |
1322 | 1331 | 'function' => $function, |
— | — | @@ -1510,7 +1519,7 @@ |
1511 | 1520 | 'gateway_txn_id' => $this->getTransactionGatewayTxnID(), |
1512 | 1521 | //'language' => '', |
1513 | 1522 | ); |
1514 | | - $transaction += $this->getData_Raw(); |
| 1523 | + $transaction += $this->getData_Unstaged_Escaped(); |
1515 | 1524 | |
1516 | 1525 | try { |
1517 | 1526 | wfRunHooks( $hook, array( $transaction ) ); |
— | — | @@ -1532,7 +1541,7 @@ |
1533 | 1542 | return; |
1534 | 1543 | } |
1535 | 1544 | |
1536 | | - if ($this->getData_Raw( 'payment_method' ) === 'cc'){ |
| 1545 | + if ($this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc'){ |
1537 | 1546 | global $wgCCLimboStompQueueName; |
1538 | 1547 | if ( !isset( $wgCCLimboStompQueueName ) || $wgCCLimboStompQueueName === false ){ |
1539 | 1548 | return; |
— | — | @@ -1554,7 +1563,7 @@ |
1555 | 1564 | 'date' => time(), |
1556 | 1565 | 'gateway_txn_id' => $this->getTransactionGatewayTxnID(), |
1557 | 1566 | 'correlation-id' => $this->getCorrelationID(), |
1558 | | - 'payment_method' => $this->getData_Raw( 'payment_method' ), |
| 1567 | + 'payment_method' => $this->getData_Unstaged_Escaped( 'payment_method' ), |
1559 | 1568 | 'antimessage' => 'true' |
1560 | 1569 | ); |
1561 | 1570 | } else { |
— | — | @@ -1563,14 +1572,14 @@ |
1564 | 1573 | 'date' => time(), |
1565 | 1574 | 'gateway_txn_id' => $this->getTransactionGatewayTxnID(), |
1566 | 1575 | 'correlation-id' => $this->getCorrelationID(), |
1567 | | - 'payment_method' => $this->getData_Raw( 'payment_method' ), |
| 1576 | + 'payment_method' => $this->getData_Unstaged_Escaped( 'payment_method' ), |
1568 | 1577 | ); |
1569 | 1578 | |
1570 | | - $raw_data = array(); |
| 1579 | + $unstaged_local = array(); |
1571 | 1580 | foreach ( $stomp_fields as $field ){ |
1572 | | - $raw_data[$field] = $this->getData_Raw( $field ); |
| 1581 | + $unstaged_local[$field] = $this->getData_Unstaged_Escaped( $field ); |
1573 | 1582 | } |
1574 | | - $transaction = array_merge( $raw_data, $transaction ); |
| 1583 | + $transaction = array_merge( $unstaged_local, $transaction ); |
1575 | 1584 | } |
1576 | 1585 | |
1577 | 1586 | try { |
— | — | @@ -1581,7 +1590,7 @@ |
1582 | 1591 | } |
1583 | 1592 | |
1584 | 1593 | protected function getCorrelationID(){ |
1585 | | - return $this->getIdentifier() . '-' . $this->getData_Raw('order_id'); |
| 1594 | + return $this->getIdentifier() . '-' . $this->getData_Unstaged_Escaped('order_id'); |
1586 | 1595 | } |
1587 | 1596 | |
1588 | 1597 | function smooshVarsForStaging() { |
— | — | @@ -1670,7 +1679,7 @@ |
1671 | 1680 | } |
1672 | 1681 | |
1673 | 1682 | function getPaypalRedirectURL() { |
1674 | | - $currency = $this->getData_Raw( 'currency_code' ); |
| 1683 | + $currency = $this->getData_Unstaged_Escaped( 'currency_code' ); |
1675 | 1684 | |
1676 | 1685 | // update the utm source to set the payment instrument to pp rather than cc |
1677 | 1686 | $data['payment_method'] = 'pp'; |
— | — | @@ -1720,9 +1729,9 @@ |
1721 | 1730 | ); |
1722 | 1731 | $ret = array(); |
1723 | 1732 | foreach ( $paypalkeys as $key ){ |
1724 | | - $val = $this->getData_Raw( $key ); |
| 1733 | + $val = $this->getData_Unstaged_Escaped( $key ); |
1725 | 1734 | if (!is_null( $val )){ |
1726 | | - $ret[$key] = $this->getData_Raw( $key ); |
| 1735 | + $ret[$key] = $this->getData_Unstaged_Escaped( $key ); |
1727 | 1736 | } |
1728 | 1737 | } |
1729 | 1738 | return $ret; |
— | — | @@ -1874,14 +1883,10 @@ |
1875 | 1884 | } |
1876 | 1885 | } |
1877 | 1886 | |
1878 | | - public function setFormClass( $formClassName ) { |
1879 | | - //I'm adding this because Captcha needs it, and we're gonna fire the hook inside. Nothing else really needs it as far as I know. |
1880 | | - $this->form_class = $formClassName; |
1881 | | - } |
1882 | | - |
1883 | 1887 | public function getFormClass() { |
1884 | | - if ( isset( $this->form_class ) && class_exists( $this->form_class ) ) { |
1885 | | - return $this->form_class; |
| 1888 | + $form_class = $this->getData_Unstaged_Escaped( 'form_class' ); |
| 1889 | + if ( ( $form_class ) && class_exists( $form_class ) ) { |
| 1890 | + return $form_class; |
1886 | 1891 | } else { |
1887 | 1892 | return false; |
1888 | 1893 | } |
— | — | @@ -1891,7 +1896,8 @@ |
1892 | 1897 | return get_called_class(); |
1893 | 1898 | } |
1894 | 1899 | |
1895 | | - public function setValidationErrors( $errors ) { |
| 1900 | + //only the gateway should be setting validation errors. Everybody else should set manual errors. |
| 1901 | + protected function setValidationErrors( $errors ) { |
1896 | 1902 | $this->validation_errors = $errors; |
1897 | 1903 | } |
1898 | 1904 | |
— | — | @@ -1903,6 +1909,35 @@ |
1904 | 1910 | } |
1905 | 1911 | } |
1906 | 1912 | |
| 1913 | + public function addManualError( $errors, $reset = false ) { |
| 1914 | + if ( $reset ){ |
| 1915 | + $this->manual_errors = array(); |
| 1916 | + return; |
| 1917 | + } |
| 1918 | + $this->manual_errors = array_merge( $this->manual_errors, $errors ); |
| 1919 | + } |
| 1920 | + |
| 1921 | + public function getManualErrors() { |
| 1922 | + if ( !empty( $this->manual_errors ) ) { |
| 1923 | + return $this->manual_errors; |
| 1924 | + } else { |
| 1925 | + return false; |
| 1926 | + } |
| 1927 | + } |
| 1928 | + |
| 1929 | + public function getAllErrors(){ |
| 1930 | + $validation = $this->getValidationErrors(); |
| 1931 | + $manual = $this->getManualErrors(); |
| 1932 | + $return = array(); |
| 1933 | + if ( is_array( $validation ) ){ |
| 1934 | + $return = array_merge( $return, $validation ); |
| 1935 | + } |
| 1936 | + if ( is_array( $manual ) ){ |
| 1937 | + $return = array_merge( $return, $manual ); |
| 1938 | + } |
| 1939 | + return $return; |
| 1940 | + } |
| 1941 | + |
1907 | 1942 | public function incrementNumAttempt() { |
1908 | 1943 | $this->dataObj->incrementNumAttempt(); |
1909 | 1944 | $this->refreshGatewayValueFromSource( 'numAttempt' ); |
— | — | @@ -1932,9 +1967,9 @@ |
1933 | 1968 | */ |
1934 | 1969 | function runPreProcessHooks() { |
1935 | 1970 | // allow any external validators to have their way with the data |
1936 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . " Preparing to query MaxMind" ); |
| 1971 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . " Preparing to query MaxMind" ); |
1937 | 1972 | wfRunHooks( 'GatewayValidate', array( &$this ) ); |
1938 | | - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Finished querying Maxmind' ); |
| 1973 | + self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Finished querying Maxmind' ); |
1939 | 1974 | |
1940 | 1975 | //DO NOT set some variable as getValidationAction() here, and keep |
1941 | 1976 | //checking that. getValidationAction could change with each one of these |
— | — | @@ -2004,7 +2039,7 @@ |
2005 | 2040 | /** |
2006 | 2041 | * Instead of pulling all the DonationData back through to update one local |
2007 | 2042 | * value, use this. It updates both staged_data (which is intended to be |
2008 | | - * staged and used _just_ by the gateway) and raw_data, which is actually |
| 2043 | + * staged and used _just_ by the gateway) and unstaged_data, which is actually |
2009 | 2044 | * just normalized and sanitized form data as entered by the user. |
2010 | 2045 | * |
2011 | 2046 | * TODO: handle the cases where $val is listed in the gateway adapter's |
— | — | @@ -2016,13 +2051,13 @@ |
2017 | 2052 | * our DonationData object. |
2018 | 2053 | */ |
2019 | 2054 | function refreshGatewayValueFromSource( $val ) { |
2020 | | - $refreshed = $this->dataObj->getVal( $val ); |
| 2055 | + $refreshed = $this->dataObj->getVal_Escaped( $val ); |
2021 | 2056 | if ( !is_null($refreshed) ){ |
2022 | 2057 | $this->staged_data[$val] = $refreshed; |
2023 | | - $this->raw_data[$val] = $refreshed; |
| 2058 | + $this->unstaged_data[$val] = $refreshed; |
2024 | 2059 | } else { |
2025 | 2060 | unset( $this->staged_data[$val] ); |
2026 | | - unset( $this->raw_data[$val] ); |
| 2061 | + unset( $this->unstaged_data[$val] ); |
2027 | 2062 | } |
2028 | 2063 | } |
2029 | 2064 | |
— | — | @@ -2100,5 +2135,23 @@ |
2101 | 2136 | return $this->batch; |
2102 | 2137 | } |
2103 | 2138 | } |
| 2139 | + |
| 2140 | + public function getOriginalValidationErrors( ){ |
| 2141 | + return $this->dataObj->getValidationErrors(); |
| 2142 | + } |
| 2143 | + |
| 2144 | + //TODO: Maybe validate on $unstaged_data directly? |
| 2145 | + public function revalidate( $check_not_empty = array() ){ |
| 2146 | + $validation_errors = $this->dataObj->getValidationErrors( true, $check_not_empty ); |
| 2147 | + $this->setValidationErrors( $validation_errors ); |
| 2148 | + return $this->validatedOK(); |
| 2149 | + } |
2104 | 2150 | |
2105 | | -} |
| 2151 | + public function validatedOK(){ |
| 2152 | + if ( $this->getValidationErrors() === false ){ |
| 2153 | + return true; |
| 2154 | + } |
| 2155 | + return false; |
| 2156 | + } |
| 2157 | + |
| 2158 | +} |
\ No newline at end of file |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/gateway.adapter.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2106 | 2159 | Merged /trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php:r105938,106109,106158,107609,107981 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | $this->dieUsage( "Invalid gateway <<<$gateway>>> passed to Donation API.", 'unknown_gateway' ); |
46 | 46 | } |
47 | 47 | |
48 | | - //$normalizedData = $gatewayObj->getData_Raw(); |
| 48 | + //$normalizedData = $gatewayObj->getData_Unstaged_Escaped(); |
49 | 49 | $outputResult = array(); |
50 | 50 | $outputResult['message'] = $result['message']; |
51 | 51 | $outputResult['status'] = $result['status']; |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
52 | 52 | Merged /trunk/extensions/DonationInterface/gateway_common/donation.api.php:r105938 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -1,24 +1,57 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * Description of DonationData |
6 | | - * |
| 5 | + * DonationData |
| 6 | + * This class is responsible for pulling all the data used by DonationInterface |
| 7 | + * from various sources. Once pulled, DonationData will then normalize and |
| 8 | + * sanitize the data for use by the various gateway adapters which connect to |
| 9 | + * the payment gateways, and through those gateway adapters, the forms that |
| 10 | + * provide the user interface. |
| 11 | + * |
| 12 | + * DonationData was not written to be instantiated by anything other than a |
| 13 | + * gateway adapter (or class descended from GatewayAdapter). |
| 14 | + * |
7 | 15 | * @author khorn |
8 | 16 | */ |
9 | 17 | class DonationData { |
10 | 18 | |
11 | 19 | protected $normalized = array( ); |
12 | 20 | public $boss; |
| 21 | + protected $validationErrors = null; |
13 | 22 | |
| 23 | + /** |
| 24 | + * DonationData constructor |
| 25 | + * @param string $owning_class The name of the class that instantiated this |
| 26 | + * instance of DonationData. This is used to grab gateway-specific functions |
| 27 | + * and values, such as the logging function and gateway-specific global |
| 28 | + * variables. |
| 29 | + * @param boolean $test Indicates if DonationData has been instantiated in |
| 30 | + * testing mode. Default is false. |
| 31 | + * @param mixed $data An optional array of donation data that will, if |
| 32 | + * present, circumvent the usual process of gathering the data from various |
| 33 | + * places in $wgRequest, or 'false' to gather the data the usual way. |
| 34 | + * Default is false. |
| 35 | + */ |
14 | 36 | function __construct( $owning_class, $test = false, $data = false ) { |
15 | | - //TODO: Actually think about this bit. |
16 | | - // ...and keep in mind we can re-populate if it's a test or whatever. (But that may not be a good idea either) |
17 | 37 | $this->boss = $owning_class; |
18 | 38 | $this->gatewayID = $this->getGatewayIdentifier(); |
19 | 39 | $this->populateData( $test, $data ); |
20 | 40 | } |
21 | 41 | |
22 | | - function populateData( $test = false, $external_data = false ) { |
| 42 | + /** |
| 43 | + * populateData, called on construct, pulls donation data from various |
| 44 | + * sources. Once the data has been pulled, it will handle any session data |
| 45 | + * if present, normalize the data regardless of the source, and handle the |
| 46 | + * caching variables. |
| 47 | + * @global Webrequest $wgRequest |
| 48 | + * @param boolean $test Indicates if DonationData has been instantiated in |
| 49 | + * testing mode. Default is false. |
| 50 | + * @param mixed $external_data An optional array of donation data that will, |
| 51 | + * if present, circumvent the usual process of gathering the data from |
| 52 | + * various places in $wgRequest, or 'false' to gather the data the usual way. |
| 53 | + * Default is false. |
| 54 | + */ |
| 55 | + protected function populateData( $test = false, $external_data = false ) { |
23 | 56 | global $wgRequest; |
24 | 57 | $this->normalized = array( ); |
25 | 58 | if ( is_array( $external_data ) ){ |
— | — | @@ -101,6 +134,8 @@ |
102 | 135 | 'direct_debit_text' => $wgRequest->getText( 'direct_debit_text', null ), |
103 | 136 | 'iban' => $wgRequest->getText( 'iban', null ), |
104 | 137 | 'transaction_type' => $wgRequest->getText( 'transaction_type', null ), |
| 138 | + 'form_name' => $wgRequest->getText( 'form_name', null ), |
| 139 | + 'ffname' => $wgRequest->getText( 'ffname', null ), |
105 | 140 | 'recurring' => $wgRequest->getVal( 'recurring', null ), //boolean type |
106 | 141 | ); |
107 | 142 | if ( !$this->wasPosted() ) { |
— | — | @@ -108,25 +143,12 @@ |
109 | 144 | } |
110 | 145 | } |
111 | 146 | |
112 | | - $posted_referrer = $wgRequest->getVal( 'referrer' ); |
113 | | - $tries = array( |
114 | | - 'referer', |
115 | | - 'referrer', |
116 | | - 'Referer', |
117 | | - 'Referrer' |
118 | | - ); |
119 | | - foreach ($tries as $trythis){ |
120 | | - $header[$trythis] = $wgRequest->getHeader( $trythis ); |
121 | | - } |
122 | | - |
123 | | - $this->log( 'ReferrerHeaderTest (' . $this->getVal( 'contribution_tracking_id' ) . "): Posted = $posted_referrer, Header Tries = " . print_r($header, true) . ', Final = ' . $this->getVal('referrer') ); |
124 | | - |
125 | 147 | //if we have saved any donation data to the session, pull them in as well. |
126 | 148 | $this->integrateDataFromSession(); |
127 | 149 | |
128 | 150 | $this->doCacheStuff(); |
129 | 151 | |
130 | | - $this->normalizeAndSanitize(); |
| 152 | + $this->normalize(); |
131 | 153 | |
132 | 154 | } |
133 | 155 | |
— | — | @@ -135,7 +157,7 @@ |
136 | 158 | * If donor session data has been set, pull the fields in the session that |
137 | 159 | * are populated, and merge that with the data set we already have. |
138 | 160 | */ |
139 | | - function integrateDataFromSession(){ |
| 161 | + protected function integrateDataFromSession(){ |
140 | 162 | if ( self::sessionExists() && array_key_exists( 'Donor', $_SESSION ) ) { |
141 | 163 | //if the thing coming in from the session isn't already something, |
142 | 164 | //replace it. |
— | — | @@ -154,14 +176,39 @@ |
155 | 177 | } |
156 | 178 | } |
157 | 179 | } |
158 | | - $this->log( 'ReferrerHeaderTest (' . $this->getVal( 'contribution_tracking_id' ) . "): Final After Session Integration = " . $this->getVal('referrer') ); |
159 | 180 | } |
160 | 181 | |
161 | | - function getData() { |
| 182 | + /** |
| 183 | + * Returns an array of normalized and escaped donation data |
| 184 | + * @return array |
| 185 | + */ |
| 186 | + public function getDataEscaped() { |
| 187 | + $escaped = $this->normalized; |
| 188 | + array_walk( $escaped, array( $this, 'sanitizeInput' ) ); |
| 189 | + return $escaped; |
| 190 | + } |
| 191 | + |
| 192 | + /** |
| 193 | + * Returns an array of normalized (but unescaped) donation data |
| 194 | + * @return array |
| 195 | + */ |
| 196 | + public function getDataUnescaped() { |
162 | 197 | return $this->normalized; |
163 | 198 | } |
164 | 199 | |
165 | | - function populateData_Test( $testdata = false ) { |
| 200 | + /** |
| 201 | + * populateData helper function. |
| 202 | + * If there is no external data provided upon DonationData construct, and |
| 203 | + * the object was instantiated in test mode, populateData_Test in intended |
| 204 | + * to provide a baseline minimum of data with which to run tests without |
| 205 | + * exploding. |
| 206 | + * Populates $this->normalized. |
| 207 | + * TODO: Implement an override for the test data, in the event that a |
| 208 | + * partial data array is provided when DonationData is instantiated. |
| 209 | + * @param array $testdata Intended to implement an override for any values |
| 210 | + * that may be provided on instantiation. |
| 211 | + */ |
| 212 | + protected function populateData_Test( $testdata = false ) { |
166 | 213 | // define arrays of cc's and cc #s for random selection |
167 | 214 | $cards = array( 'american' ); |
168 | 215 | $card_nums = array( |
— | — | @@ -231,11 +278,13 @@ |
232 | 279 | } |
233 | 280 | |
234 | 281 | /** |
235 | | - * Tells you if a value is something or not. |
236 | | - * @param string $key The field you would like to determine if it exists or not. |
237 | | - * @return boolean true if the field is something. False if it is null, or an empty string. |
| 282 | + * Tells you if a value in $this->normalized is something or not. |
| 283 | + * @param string $key The field you would like to determine if it exists in |
| 284 | + * a usable way or not. |
| 285 | + * @return boolean true if the field is something. False if it is null, or |
| 286 | + * an empty string. |
238 | 287 | */ |
239 | | - function isSomething( $key ) { |
| 288 | + public function isSomething( $key ) { |
240 | 289 | if ( array_key_exists( $key, $this->normalized ) ) { |
241 | 290 | if ( is_null($this->normalized[$key]) || $this->normalized[$key] === '' ) { |
242 | 291 | return false; |
— | — | @@ -246,8 +295,31 @@ |
247 | 296 | } |
248 | 297 | } |
249 | 298 | |
250 | | - function getVal( $key ) { |
| 299 | + /** |
| 300 | + * getVal_Escaped |
| 301 | + * @param string $key The data field you would like to retrieve. Pulls the |
| 302 | + * data from $this->normalized if it is found to be something. |
| 303 | + * @return mixed The normalized and escaped value of that $key. |
| 304 | + */ |
| 305 | + public function getVal_Escaped( $key ) { |
251 | 306 | if ( $this->isSomething( $key ) ) { |
| 307 | + //TODO: If we ever start sanitizing in a more complicated way, we should move this |
| 308 | + //off to a function and have both getVal_Escaped and sanitizeInput call that. |
| 309 | + return htmlspecialchars( $this->normalized[$key], ENT_COMPAT, 'UTF-8', false ); |
| 310 | + } else { |
| 311 | + return null; |
| 312 | + } |
| 313 | + } |
| 314 | + |
| 315 | + /** |
| 316 | + * getVal |
| 317 | + * For Internal Use Only! External objects should use getVal_Escaped. |
| 318 | + * @param string $key The data field you would like to retrieve directly |
| 319 | + * from $this->normalized. |
| 320 | + * @return mixed The normalized value of that $key. |
| 321 | + */ |
| 322 | + protected function getVal( $key ) { |
| 323 | + if ( $this->isSomething( $key ) ) { |
252 | 324 | return $this->normalized[$key]; |
253 | 325 | } else { |
254 | 326 | return null; |
— | — | @@ -256,14 +328,23 @@ |
257 | 329 | |
258 | 330 | /** |
259 | 331 | * Sets a key in the normalized data array, to a new value. |
| 332 | + * This function should only ever be used for keys that are not listed in |
| 333 | + * DonationData::getCalculatedFields(). |
| 334 | + * TODO: If the $key is listed in DonationData::getCalculatedFields(), use |
| 335 | + * DonationData::addData() instead. Or be a jerk about it and throw an |
| 336 | + * exception. (Personally I like the second one) |
260 | 337 | * @param string $key The key you want to set. |
261 | 338 | * @param string $val The value you'd like to assign to the key. |
262 | 339 | */ |
263 | | - function setVal( $key, $val ) { |
| 340 | + public function setVal( $key, $val ) { |
264 | 341 | $this->normalized[$key] = $val; |
265 | 342 | } |
266 | 343 | |
267 | | - function expunge( $key ) { |
| 344 | + /** |
| 345 | + * Removes a value from $this->normalized. |
| 346 | + * @param type $key |
| 347 | + */ |
| 348 | + public function expunge( $key ) { |
268 | 349 | if ( array_key_exists( $key, $this->normalized ) ) { |
269 | 350 | unset( $this->normalized[$key] ); |
270 | 351 | } |
— | — | @@ -271,12 +352,13 @@ |
272 | 353 | |
273 | 354 | /** |
274 | 355 | * Returns an array of all the fields that get re-calculated during a |
275 | | - * normalizeAndSanitize. |
276 | | - * This will most likely be used on the outside when in the process of |
277 | | - * adding data. |
| 356 | + * normalize. |
| 357 | + * This can be used on the outside when in the process of changing data, |
| 358 | + * particularly if any of the recalculted fields need to be restaged by the |
| 359 | + * gateway adapter. |
278 | 360 | * @return array An array of values matching all recauculated fields. |
279 | 361 | */ |
280 | | - function getCalculatedFields() { |
| 362 | + public function getCalculatedFields() { |
281 | 363 | $fields = array( |
282 | 364 | 'utm_source', |
283 | 365 | 'amount', |
— | — | @@ -294,10 +376,14 @@ |
295 | 377 | } |
296 | 378 | |
297 | 379 | /** |
298 | | - * Normalizes and Sanitizes the current set of data, just after it's been |
299 | | - * pulled (or re-pulled) from a source. |
| 380 | + * Normalizes the current set of data, just after it's been |
| 381 | + * pulled (or re-pulled) from a data source. |
| 382 | + * Care should be taken in the normalize helper functions to write code in |
| 383 | + * such a way that running them multiple times on the same array won't cause |
| 384 | + * the data to stroll off into the sunset: Normalize will definitely need to |
| 385 | + * be called multiple times against the same array. |
300 | 386 | */ |
301 | | - function normalizeAndSanitize() { |
| 387 | + protected function normalize() { |
302 | 388 | if ( !empty( $this->normalized ) ) { |
303 | 389 | $this->setUtmSource(); |
304 | 390 | $this->setNormalizedAmount(); |
— | — | @@ -308,15 +394,60 @@ |
309 | 395 | $this->setCountry(); |
310 | 396 | $this->handleContributionTrackingID(); |
311 | 397 | $this->setCurrencyCode(); |
312 | | - array_walk( $this->normalized, array( $this, 'sanitizeInput' ) ); |
| 398 | + $this->setFormClass(); |
| 399 | + |
| 400 | + $this->getValidationErrors(); |
313 | 401 | } |
314 | 402 | } |
315 | 403 | |
316 | 404 | /** |
317 | | - * normalizeAndSanitize helper function |
| 405 | + * normalize helper function |
| 406 | + * Sets the form class we will be using. |
| 407 | + * In the case that we are using forms, form_name will be harvested from |
| 408 | + * $wgRequest by populateData. If we are coming from somewhere that does not |
| 409 | + * use a form interface (like an api call), this logic should be skipped. |
| 410 | + * |
| 411 | + * For any specified form, if it is enabled and available, the class would |
| 412 | + * have been autoloaded at this point. If it is not enabled and available, |
| 413 | + * we will check the default for the calling gateway, and failing that, |
| 414 | + * throw an exception. |
| 415 | + * |
| 416 | + */ |
| 417 | + protected function setFormClass(){ |
| 418 | + //don't actually try to load the forms here... but do determine if what we've got in there will load or not. |
| 419 | + //Elsewise, set it to the default. |
| 420 | + $default = false; |
| 421 | + |
| 422 | + if ( $this->isSomething( 'form_name' ) ){ |
| 423 | + $class_name = "Gateway_Form_" . $this->getVal( 'form_name' ); |
| 424 | + } else { |
| 425 | + $default = true; |
| 426 | + $class_name = "Gateway_Form_" . $this->getGatewayGlobal( 'DefaultForm' ); |
| 427 | + } |
| 428 | + |
| 429 | + if ( !class_exists( $class_name ) ) { |
| 430 | + if (!$default){ //try that, then. |
| 431 | + $class_name_orig = $class_name; |
| 432 | + $class_name = "Gateway_Form_" . $this->getGatewayGlobal( 'DefaultForm' ); |
| 433 | + } |
| 434 | + |
| 435 | + if ( class_exists( $class_name ) ) { |
| 436 | + $this->setVal( 'form_name', $this->getGatewayGlobal( 'DefaultForm' ) ); |
| 437 | + } else { |
| 438 | + throw new MWException( 'Could not find form ' . $class_name_orig . ', nor default form ' . $class_name ); |
| 439 | + } |
| 440 | + } |
| 441 | + |
| 442 | + $this->setVal( 'form_class', $class_name ); |
| 443 | + } |
| 444 | + |
| 445 | + /** |
| 446 | + * normalize helper function |
318 | 447 | * Setting the country correctly. |
| 448 | + * If we have no country, we try to get something rational through GeoIP |
| 449 | + * lookup. |
319 | 450 | */ |
320 | | - function setCountry() { |
| 451 | + protected function setCountry() { |
321 | 452 | global $wgRequest; |
322 | 453 | if ( !$this->isSomething('country') ){ |
323 | 454 | // If no country was passed, try to do GeoIP lookup |
— | — | @@ -332,10 +463,12 @@ |
333 | 464 | } |
334 | 465 | |
335 | 466 | /** |
336 | | - * normalizeAndSanitize helper function |
| 467 | + * normalize helper function |
337 | 468 | * Setting the currency code correctly. |
| 469 | + * Historically, this value could come in through 'currency' or |
| 470 | + * 'currency_code'. After this fires, we will only have 'currency_code'. |
338 | 471 | */ |
339 | | - function setCurrencyCode() { |
| 472 | + protected function setCurrencyCode() { |
340 | 473 | global $wgRequest; |
341 | 474 | |
342 | 475 | //at this point, we can have either currency, or currency_code. |
— | — | @@ -359,14 +492,14 @@ |
360 | 493 | } |
361 | 494 | |
362 | 495 | /** |
363 | | - * normalizeAndSanitize helper function. |
| 496 | + * normalize helper function. |
364 | 497 | * Assures that if no contribution_tracking_id is present, a row is created |
365 | 498 | * in the Contribution tracking table, and that row is assigned to the |
366 | 499 | * current contribution we're tracking. |
367 | 500 | * If a contribution tracking id is already present, no new rows will be |
368 | 501 | * assigned. |
369 | 502 | */ |
370 | | - function handleContributionTrackingID(){ |
| 503 | + protected function handleContributionTrackingID(){ |
371 | 504 | if ( !$this->isSomething( 'contribution_tracking_id' ) && |
372 | 505 | ( !$this->isCaching() ) ){ |
373 | 506 | $this->saveContributionTracking(); |
— | — | @@ -379,7 +512,7 @@ |
380 | 513 | * calculate it from the data fields more than once. |
381 | 514 | * @return boolean true if we are going to be caching, false if we aren't. |
382 | 515 | */ |
383 | | - function isCaching(){ |
| 516 | + public function isCaching(){ |
384 | 517 | |
385 | 518 | static $cache = null; |
386 | 519 | |
— | — | @@ -404,11 +537,11 @@ |
405 | 538 | } |
406 | 539 | |
407 | 540 | /** |
408 | | - * normalizeAndSanitize helper function. |
| 541 | + * normalize helper function. |
409 | 542 | * Takes all possible sources for the intended donation amount, and |
410 | 543 | * normalizes them into the 'amount' field. |
411 | 544 | */ |
412 | | - function setNormalizedAmount() { |
| 545 | + protected function setNormalizedAmount() { |
413 | 546 | if ( !($this->isSomething( 'amount' )) || !(preg_match( '/^\d+(\.(\d+)?)?$/', $this->getVal( 'amount' ) ) ) ) { |
414 | 547 | if ( $this->isSomething( 'amountGiven' ) && preg_match( '/^\d+(\.(\d+)?)?$/', $this->getVal( 'amountGiven' ) ) ) { |
415 | 548 | $this->setVal( 'amount', number_format( $this->getVal( 'amountGiven' ), 2, '.', '' ) ); |
— | — | @@ -421,12 +554,12 @@ |
422 | 555 | } |
423 | 556 | |
424 | 557 | /** |
425 | | - * normalizeAndSanitize helper function. |
| 558 | + * normalize helper function. |
426 | 559 | * Ensures that order_id and i_order_id are ready to go, depending on what |
427 | 560 | * comes in populated or not, and where it came from. |
428 | 561 | * @return null |
429 | 562 | */ |
430 | | - function setNormalizedOrderIDs() { |
| 563 | + protected function setNormalizedOrderIDs() { |
431 | 564 | //basically, we need a new order_id every time we come through here, but if there's an internal already there, |
432 | 565 | //we want to use that one internally. So. |
433 | 566 | //Exception: If we pass in an order ID in the querystring: Don't mess with it. |
— | — | @@ -446,7 +579,7 @@ |
447 | 580 | /** |
448 | 581 | * Generate an order id exactly once for this go-round. |
449 | 582 | */ |
450 | | - static function generateOrderId() { |
| 583 | + protected static function generateOrderId() { |
451 | 584 | static $order_id = null; |
452 | 585 | if ( $order_id === null ) { |
453 | 586 | $order_id = ( double ) microtime() * 1000000 . mt_rand( 1000, 9999 ); |
— | — | @@ -464,18 +597,32 @@ |
465 | 598 | * @param $flags The flag constant for htmlspecialchars |
466 | 599 | * @param $double_encode Whether or not to double-encode strings |
467 | 600 | */ |
468 | | - public function sanitizeInput( &$value, $key, $flags=ENT_COMPAT, $double_encode=false ) { |
| 601 | + protected function sanitizeInput( &$value, $key, $flags=ENT_COMPAT, $double_encode=false ) { |
469 | 602 | $value = htmlspecialchars( $value, $flags, 'UTF-8', $double_encode ); |
470 | 603 | } |
471 | 604 | |
472 | | - function log( $message, $log_level=LOG_INFO ) { |
| 605 | + /** |
| 606 | + * log: This grabs the adapter class that instantiated DonationData, and |
| 607 | + * uses its log function. |
| 608 | + * @param string $message The message to log. |
| 609 | + * @param type $log_level |
| 610 | + */ |
| 611 | + protected function log( $message, $log_level=LOG_INFO ) { |
473 | 612 | $c = $this->getAdapterClass(); |
474 | 613 | if ( $c && is_callable( array( $c, 'log' ) )){ |
475 | 614 | $c::log( $message, $log_level ); |
476 | 615 | } |
477 | 616 | } |
478 | 617 | |
479 | | - function getGatewayIdentifier() { |
| 618 | + /** |
| 619 | + * getGatewayIdentifier |
| 620 | + * This grabs the adapter class that instantiated DonationData, and returns |
| 621 | + * the result of its 'getIdentifier' function. Used for normalizing the |
| 622 | + * 'gateway' value, and stashing and retrieving the edit token (and other |
| 623 | + * things, where needed) in the session. |
| 624 | + * @return type |
| 625 | + */ |
| 626 | + protected function getGatewayIdentifier() { |
480 | 627 | $c = $this->getAdapterClass(); |
481 | 628 | if ( $c && is_callable( array( $c, 'getIdentifier' ) ) ){ |
482 | 629 | return $c::getIdentifier(); |
— | — | @@ -484,7 +631,17 @@ |
485 | 632 | } |
486 | 633 | } |
487 | 634 | |
488 | | - function getGatewayGlobal( $varname ) { |
| 635 | + /** |
| 636 | + * getGatewayGlobal |
| 637 | + * This grabs the adapter class that instantiated DonationData, and returns |
| 638 | + * the result of its 'getGlobal' function for the $varname passed in. Used |
| 639 | + * to determine gateway-specific configuration settings. |
| 640 | + * @param string $varname the global variable (minus prefix) that we want to |
| 641 | + * check. |
| 642 | + * @return mixed The value of the gateway global if it exists. Else, the |
| 643 | + * value of the Donation Interface global if it exists. Else, null. |
| 644 | + */ |
| 645 | + protected function getGatewayGlobal( $varname ) { |
489 | 646 | $c = $this->getAdapterClass(); |
490 | 647 | if ( $c && is_callable( array( $c, 'getGlobal' ) ) ){ |
491 | 648 | return $c::getGlobal( $varname ); |
— | — | @@ -494,24 +651,24 @@ |
495 | 652 | } |
496 | 653 | |
497 | 654 | /** |
498 | | - * normalizeAndSanitize helper function. |
| 655 | + * normalize helper function. |
499 | 656 | * Sets the gateway to be the gateway that called this class in the first |
500 | 657 | * place. |
501 | 658 | */ |
502 | | - function setGateway() { |
| 659 | + protected function setGateway() { |
503 | 660 | //TODO: Hum. If we have some other gateway in the form data, should we go crazy here? (Probably) |
504 | 661 | $gateway = $this->gatewayID; |
505 | 662 | $this->setVal( 'gateway', $gateway ); |
506 | 663 | } |
507 | 664 | |
508 | 665 | /** |
509 | | - * normalizeAndSanitize helper function. |
| 666 | + * normalize helper function. |
510 | 667 | * If the language has not yet been set or is not valid, pulls the language code |
511 | 668 | * from the current global language object. |
512 | 669 | * Also sets the premium_language as the calculated language if it's not |
513 | 670 | * already set coming in (had been defaulting to english). |
514 | 671 | */ |
515 | | - function setLanguage() { |
| 672 | + protected function setLanguage() { |
516 | 673 | global $wgLang; |
517 | 674 | $language = false; |
518 | 675 | |
— | — | @@ -546,7 +703,7 @@ |
547 | 704 | * @global bool $wgUseSquid |
548 | 705 | * @global type $wgOut |
549 | 706 | */ |
550 | | - function doCacheStuff() { |
| 707 | + protected function doCacheStuff() { |
551 | 708 | //TODO: Wow, name. |
552 | 709 | // if _cache_ is requested by the user, do not set a session/token; dynamic data will be loaded via ajax |
553 | 710 | if ( $this->isCaching() ) { |
— | — | @@ -564,8 +721,18 @@ |
565 | 722 | } |
566 | 723 | } |
567 | 724 | |
568 | | - function getAnnoyingOrderIDLogLinePrefix() { |
569 | | - //TODO: ...aww. But it's so descriptive. |
| 725 | + /** |
| 726 | + * getAnnoyingOrderIDLogLinePrefix |
| 727 | + * Constructs and returns the annoying order ID log line prefix. |
| 728 | + * This has moved from being annoyingly all over the place in the edit token |
| 729 | + * logging code before it was functionalized, to being annoying to look at |
| 730 | + * in the logs because the two numbers in the prefix are frequently |
| 731 | + * identical (and large). |
| 732 | + * TODO: Determine if anything actually looks at both of those numbers, in |
| 733 | + * order to make this less annoying. Rename on success. |
| 734 | + * @return string Annoying Order ID Log Line Prefix in all its dubious glory. |
| 735 | + */ |
| 736 | + protected function getAnnoyingOrderIDLogLinePrefix() { |
570 | 737 | return $this->getVal( 'order_id' ) . ' ' . $this->getVal( 'i_order_id' ) . ': '; |
571 | 738 | } |
572 | 739 | |
— | — | @@ -578,6 +745,8 @@ |
579 | 746 | * a security risk for non-authenticated users. Until this is |
580 | 747 | * resolved in $wgUser, we'll use our own methods for token |
581 | 748 | * handling. |
| 749 | + * |
| 750 | + * Public so the api can get to it. |
582 | 751 | * |
583 | 752 | * @return string |
584 | 753 | */ |
— | — | @@ -600,10 +769,12 @@ |
601 | 770 | } |
602 | 771 | |
603 | 772 | /** |
| 773 | + * token_refreshAllTokenEverything |
604 | 774 | * In the case where we have an expired session (token mismatch), we go |
605 | | - * ahead and fix it for 'em for their next post. |
| 775 | + * ahead and fix it for 'em for their next post. We do this by refreshing |
| 776 | + * everything that has to do with the edit token. |
606 | 777 | */ |
607 | | - function token_refreshAllTokenEverything(){ |
| 778 | + protected function token_refreshAllTokenEverything(){ |
608 | 779 | $unsalted = self::token_generateToken(); |
609 | 780 | $gateway_ident = $this->gatewayID; |
610 | 781 | self::ensureSession(); |
— | — | @@ -612,7 +783,14 @@ |
613 | 784 | $this->setVal( 'token', $salted ); |
614 | 785 | } |
615 | 786 | |
616 | | - function token_applyMD5AndSalt( $clear_token ){ |
| 787 | + /** |
| 788 | + * token_applyMD5AndSalt |
| 789 | + * Takes a clear-text token, and returns the MD5'd result of the token plus |
| 790 | + * the configured gateway salt. |
| 791 | + * @param string $clear_token The original, unsalted, unencoded edit token. |
| 792 | + * @return string The salted and MD5'd token. |
| 793 | + */ |
| 794 | + protected function token_applyMD5AndSalt( $clear_token ){ |
617 | 795 | $salt = $this->getGatewayGlobal( 'Salt' ); |
618 | 796 | |
619 | 797 | if ( is_array( $salt ) ) { |
— | — | @@ -625,9 +803,10 @@ |
626 | 804 | |
627 | 805 | |
628 | 806 | /** |
629 | | - * Generate a token string |
630 | | - * |
631 | | - * @var mixed $padding |
| 807 | + * token_generateToken |
| 808 | + * Generate a random string to be used as an edit token. |
| 809 | + * @var string $padding A string with which we could pad out the random hex |
| 810 | + * further. |
632 | 811 | * @return string |
633 | 812 | */ |
634 | 813 | public static function token_generateToken( $padding = '' ) { |
— | — | @@ -636,12 +815,16 @@ |
637 | 816 | } |
638 | 817 | |
639 | 818 | /** |
640 | | - * Determine the validity of a token |
| 819 | + * token_matchEditToken |
| 820 | + * Determine the validity of a token by checking it against the salted |
| 821 | + * version of the clear-text token we have already stored in the session. |
| 822 | + * On failure, it resets the edit token both in the session and in the form, |
| 823 | + * so they will match on the user's next load. |
641 | 824 | * |
642 | 825 | * @var string $val |
643 | 826 | * @return bool |
644 | 827 | */ |
645 | | - function token_matchEditToken( $val ) { |
| 828 | + protected function token_matchEditToken( $val ) { |
646 | 829 | // fetch a salted version of the session token |
647 | 830 | $sessionSaltedToken = $this->token_getSaltedSessionToken(); |
648 | 831 | if ( $val != $sessionSaltedToken ) { |
— | — | @@ -653,12 +836,16 @@ |
654 | 837 | } |
655 | 838 | |
656 | 839 | /** |
| 840 | + * ensureSession |
657 | 841 | * Ensure that we have a session set for the current user. |
658 | | - * |
659 | 842 | * If we do not have a session set for the current user, |
660 | 843 | * start the session. |
| 844 | + * BE CAREFUL with this one, as creating sessions willy-nilly will break |
| 845 | + * squid caching for reasons that are not immediately obvious. |
| 846 | + * (See DonationData::doCacheStuff, and basically everything about setting |
| 847 | + * headers in $wgOut) |
661 | 848 | */ |
662 | | - public static function ensureSession() { |
| 849 | + protected static function ensureSession() { |
663 | 850 | // if the session is already started, do nothing |
664 | 851 | if ( self::sessionExists() ) |
665 | 852 | return; |
— | — | @@ -668,25 +855,40 @@ |
669 | 856 | } |
670 | 857 | |
671 | 858 | /** |
| 859 | + * sessionExists |
672 | 860 | * Checks to see if the session exists without actually creating one. |
673 | 861 | * @return bool true if we have a session, otherwise false. |
674 | 862 | */ |
675 | | - public static function sessionExists() { |
| 863 | + protected static function sessionExists() { |
676 | 864 | if ( session_id() ) |
677 | 865 | return true; |
678 | 866 | return false; |
679 | 867 | } |
680 | 868 | |
| 869 | + /** |
| 870 | + * token_checkTokens |
| 871 | + * The main function to check the salted and MD5'd token we should have |
| 872 | + * saved and gathered from $wgRequest, against the clear-text token we |
| 873 | + * should have saved to the user's session. |
| 874 | + * token_getSaltedSessionToken() will start off the process if this is a |
| 875 | + * first load, and there's no saved token in the session yet. |
| 876 | + * @global Webrequest $wgRequest |
| 877 | + * @staticvar string $match |
| 878 | + * @return type |
| 879 | + */ |
681 | 880 | public function token_checkTokens() { |
682 | 881 | global $wgRequest; |
683 | | - static $match = null; |
| 882 | + static $match = null; //because we only want to do this once per load. |
684 | 883 | |
685 | 884 | if ( $match === null ) { |
686 | 885 | if ( $this->isCaching() ){ |
687 | 886 | //This makes sense. |
688 | 887 | //If all three conditions for caching are currently true, the |
689 | 888 | //last thing we want to do is screw it up by setting a session |
690 | | - //token before the page loads. |
| 889 | + //token before the page loads, because sessions break caching. |
| 890 | + //The API will set the session and form token values immediately |
| 891 | + //after that first page load, which is all we care about saving |
| 892 | + //in the cache anyway. |
691 | 893 | return true; |
692 | 894 | } |
693 | 895 | |
— | — | @@ -712,7 +914,7 @@ |
713 | 915 | } |
714 | 916 | |
715 | 917 | /** |
716 | | - * normalizeAndSanitize helper function. |
| 918 | + * normalize helper function. |
717 | 919 | * |
718 | 920 | * Checks to see if the utm_source is set properly for the credit card |
719 | 921 | * form including any cc form variants (identified by utm_source_id). If |
— | — | @@ -766,10 +968,14 @@ |
767 | 969 | * because the form elements for comment anonymization and email opt-out |
768 | 970 | * are backwards (they are really opt-in) relative to contribution_tracking |
769 | 971 | * (which is opt-out), we need to reverse the values. |
| 972 | + * Difficulty here is compounded by the fact that these values come from |
| 973 | + * checkboxes on forms, which simply don't make it to $wgRequest if they are |
| 974 | + * not checked... or not present in the form at all. In other words, this |
| 975 | + * situation is painful and you probably want to leave it alone. |
770 | 976 | * NOTE: If you prune here, and there is a paypal redirect, you will have |
771 | 977 | * problems with the email-opt/optout and comment-option/anonymous. |
772 | 978 | */ |
773 | | - function setNormalizedOptOuts( $prune = false ) { |
| 979 | + protected function setNormalizedOptOuts( $prune = false ) { |
774 | 980 | $optout['optout'] = ( $this->isSomething( 'email-opt' ) && $this->getVal( 'email-opt' ) == "1" ) ? '0' : '1'; |
775 | 981 | $optout['anonymous'] = ( $this->isSomething( 'comment-option' ) && $this->getVal( 'comment-option' ) == "1" ) ? '0' : '1'; |
776 | 982 | foreach ( $optout as $thing => $stuff ) { |
— | — | @@ -896,6 +1102,15 @@ |
897 | 1103 | } |
898 | 1104 | } |
899 | 1105 | |
| 1106 | + /** |
| 1107 | + * addDonorDataToSession |
| 1108 | + * Adds all the fields that are required to make a well-formed stomp |
| 1109 | + * message, to the user's session for later use. This mechanism is used by gateways that |
| 1110 | + * have a user being directed somewhere out of our control, and then coming |
| 1111 | + * back to complete a transaction. (Globalcollect Hosted Credit Card, for |
| 1112 | + * example) |
| 1113 | + * |
| 1114 | + */ |
900 | 1115 | public function addDonorDataToSession() { |
901 | 1116 | self::ensureSession(); |
902 | 1117 | $donordata = $this->getStompMessageFields(); |
— | — | @@ -962,6 +1177,15 @@ |
963 | 1178 | session_destroy(); //killed on the server. |
964 | 1179 | } |
965 | 1180 | |
| 1181 | + /** |
| 1182 | + * addData |
| 1183 | + * Adds an array of data to the normalized array, and then re-normalizes it. |
| 1184 | + * NOTE: If any gateway is using this function, it should then immediately |
| 1185 | + * repopulate its own data set with the DonationData source, and then |
| 1186 | + * re-stage values as necessary. |
| 1187 | + * @param array $newdata An array of data to integrate with the existing |
| 1188 | + * data held by the DonationData object. |
| 1189 | + */ |
966 | 1190 | public function addData( $newdata ) { |
967 | 1191 | if ( is_array( $newdata ) && !empty( $newdata ) ) { |
968 | 1192 | foreach ( $newdata as $key => $val ) { |
— | — | @@ -970,9 +1194,14 @@ |
971 | 1195 | } |
972 | 1196 | } |
973 | 1197 | } |
974 | | - $this->normalizeAndSanitize(); |
| 1198 | + $this->normalize(); |
975 | 1199 | } |
976 | 1200 | |
| 1201 | + /** |
| 1202 | + * incrementNumAttempt |
| 1203 | + * Adds one to the 'numAttempt' field we use to keep track of how many times |
| 1204 | + * a donor has tried to do something. |
| 1205 | + */ |
977 | 1206 | public function incrementNumAttempt() { |
978 | 1207 | if ( $this->isSomething( 'numAttempt' ) ) { |
979 | 1208 | $attempts = $this->getVal( 'numAttempt' ); |
— | — | @@ -985,7 +1214,11 @@ |
986 | 1215 | } |
987 | 1216 | } |
988 | 1217 | |
989 | | - function getAdapterClass(){ |
| 1218 | + /** |
| 1219 | + * Gets the name of the adapter class that instantiated DonationData. |
| 1220 | + * @return mixed The name of the class if it exists, or false. |
| 1221 | + */ |
| 1222 | + protected function getAdapterClass(){ |
990 | 1223 | if ( class_exists( $this->boss ) ) { |
991 | 1224 | return $this->boss; |
992 | 1225 | } else { |
— | — | @@ -1001,7 +1234,7 @@ |
1002 | 1235 | * /extensions/DonationData/activemq_stomp/activemq_stomp.php |
1003 | 1236 | * to somewhere in DonationData. * |
1004 | 1237 | */ |
1005 | | - function getStompMessageFields(){ |
| 1238 | + public function getStompMessageFields(){ |
1006 | 1239 | $stomp_fields = array( |
1007 | 1240 | 'contribution_tracking_id', |
1008 | 1241 | 'optout', |
— | — | @@ -1059,6 +1292,37 @@ |
1060 | 1293 | } |
1061 | 1294 | return $posted; |
1062 | 1295 | } |
| 1296 | + |
| 1297 | + /** |
| 1298 | + * getValidationErrors |
| 1299 | + * This function will go through all the data we have pulled from wherever |
| 1300 | + * we've pulled it, and make sure it's safe and expected and everything. |
| 1301 | + * If it is not, it will return an array of errors ready for any |
| 1302 | + * DonationInterface form class derivitive to display. |
| 1303 | + */ |
| 1304 | + public function getValidationErrors( $recalculate = false, $check_not_empty = array() ){ |
| 1305 | + if ( is_null( $this->validationErrors ) || $recalculate ) { |
| 1306 | + $this->validationErrors = DataValidator::validate( $this->normalized, $check_not_empty ); |
| 1307 | + } |
| 1308 | + return $this->validationErrors; |
| 1309 | + } |
| 1310 | + |
| 1311 | + /** |
| 1312 | + * validatedOK |
| 1313 | + * Checks to see if the data validated ok (no errors). |
| 1314 | + * @return boolean True if no errors, false if errors exist. |
| 1315 | + */ |
| 1316 | + public function validatedOK() { |
| 1317 | + if ( is_null( $this->validationErrors ) ){ |
| 1318 | + $this->getValidationErrors(); |
| 1319 | + } |
| 1320 | + |
| 1321 | + if ( count( $this->validationErrors ) === 0 ){ |
| 1322 | + return true; |
| 1323 | + } |
| 1324 | + return false; |
| 1325 | + } |
| 1326 | + |
1063 | 1327 | } |
1064 | 1328 | |
1065 | 1329 | ?> |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1066 | 1330 | Merged /trunk/extensions/DonationInterface/gateway_common/DonationData.php:r105938,105941,105953,106109,106158,106259,106493,106495,106836,107609 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/GatewayForm.php |
— | — | @@ -18,354 +18,132 @@ |
19 | 19 | |
20 | 20 | /** |
21 | 21 | * GatewayForm |
| 22 | + * This class is the generic unlisted special page in charge of actually |
| 23 | + * displaying the form. Each gateway will have one or more direct descendants of |
| 24 | + * this class, with most of the gateway-specific control logic in its execute |
| 25 | + * function. For instance: extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
22 | 26 | * |
23 | 27 | */ |
24 | 28 | class GatewayForm extends UnlistedSpecialPage { |
25 | 29 | |
26 | 30 | /** |
27 | | - * A container for the form class |
28 | | - * |
29 | | - * Used to loard the form object to display the CC form |
30 | | - * @var object |
31 | | - */ |
32 | | - public $form_class; |
33 | | - |
34 | | - /** |
35 | 31 | * An array of form errors |
36 | 32 | * @var array $errors |
37 | 33 | */ |
38 | 34 | public $errors = array( ); |
39 | 35 | |
40 | 36 | /** |
41 | | - * The adapter object |
| 37 | + * The gateway adapter object |
42 | 38 | * @var object $adapter |
43 | 39 | */ |
44 | 40 | public $adapter; |
45 | 41 | |
46 | 42 | /** |
47 | | - * The form is assumed to be successful. Errors in the form must set this to |
48 | | - * false. |
49 | | - * |
50 | | - * @var boolean |
51 | | - */ |
52 | | - public $validateFormResult = true; |
53 | | - |
54 | | - /** |
55 | 43 | * Constructor |
56 | 44 | */ |
57 | 45 | public function __construct() { |
58 | 46 | $me = get_called_class(); |
59 | 47 | parent::__construct( $me ); |
60 | | - $this->errors = $this->getPossibleErrors(); |
61 | | - $this->setFormClass(); |
62 | 48 | } |
63 | 49 | |
64 | 50 | /** |
65 | | - * Checks posted form data for errors and returns array of messages |
66 | | - * |
67 | | - * @param array $data Reference to the data of the form |
68 | | - * @param array $error Reference to the error messages of the form |
| 51 | + * Checks current dataset for validation errors |
| 52 | + * TODO: As with every other bit of gateway-related logic that should |
| 53 | + * definitely be available to every entry point, and functionally has very |
| 54 | + * little to do with being contained within what in an ideal world would be |
| 55 | + * a piece of mostly UI, this function needs to be moved inside the gateway |
| 56 | + * adapter class. |
69 | 57 | * @param array $options |
70 | | - * OPTIONAL - You may require certain field groups to be validated |
71 | | - * - address - Validates: street, city, state, zip |
72 | | - * - amount - Validates: amount |
73 | | - * - creditCard - Validates: card_num, cvv, expiration and sets the card |
74 | | - * - email - Validates: email |
75 | | - * - name - Validates: fname, lname |
| 58 | + * OPTIONAL - In addition to all non-optional validation which verifies |
| 59 | + * that all populated fields contain an appropriate data type, you may |
| 60 | + * require certain field groups to be non-empty. |
| 61 | + * - address - Validation requires non-empty: street, city, state, zip |
| 62 | + * - amount - Validation requires non-empty: amount |
| 63 | + * - creditCard - Validation requires non-empty: card_num, cvv, expiration and card_type |
| 64 | + * - email - Validation requires non-empty: email |
| 65 | + * - name - Validation requires non-empty: fname, lname |
76 | 66 | * |
77 | | - * @return 0|1 Returns 0 on success and 1 on failure |
| 67 | + * @return boolean Returns true on an error-free validation, otherwise false. |
78 | 68 | */ |
79 | | - public function validateForm( &$error, $options = array() ) { |
| 69 | + public function validateForm( $options = array() ) { |
80 | 70 | |
81 | | - $data = $this->adapter->getData_Raw(); |
| 71 | + $check_not_empty = array(); |
82 | 72 | |
83 | | - extract( $options ); |
84 | | - |
85 | | - // Set which items will be validated |
86 | | - $address = isset( $address ) ? ( boolean ) $address : true; |
87 | | - $amount = isset( $amount ) ? ( boolean ) $amount : true; |
88 | | - $creditCard = isset( $creditCard ) ? ( boolean ) $creditCard : false; |
89 | | - $email = isset( $email ) ? ( boolean ) $email : true; |
90 | | - $name = isset( $name ) ? ( boolean ) $name : true; |
91 | | - |
92 | | - // These are set in the order they will most likely appear on the form. |
93 | | - |
94 | | - if ( $name ) { |
95 | | - $this->validateName( $data, $error ); |
| 73 | + foreach ( $options as $option ){ |
| 74 | + $add_checks = array(); |
| 75 | + switch( $option ){ |
| 76 | + case 'address' : |
| 77 | + $add_checks = array( |
| 78 | + 'street', |
| 79 | + 'city', |
| 80 | + 'state', |
| 81 | + 'country', |
| 82 | + 'zip', //this should really be added or removed, depending on the country and/or gateway requirements. |
| 83 | + //however, that's not happening in this class in the code I'm replacing, so... |
| 84 | + //TODO: Something clever in the DataValidator with data groups like these. |
| 85 | + ); |
| 86 | + break; |
| 87 | + case 'amount' : |
| 88 | + $add_checks[] = 'amount'; |
| 89 | + break; |
| 90 | + case 'creditCard' : |
| 91 | + $add_checks = array( |
| 92 | + 'card_num', |
| 93 | + 'cvv', |
| 94 | + 'expiration', |
| 95 | + 'card_type' |
| 96 | + ); |
| 97 | + break; |
| 98 | + case 'email' : |
| 99 | + $add_checks[] = 'email'; |
| 100 | + break; |
| 101 | + case 'name' : |
| 102 | + $add_checks = array( |
| 103 | + 'fname', |
| 104 | + 'lname' |
| 105 | + ); |
| 106 | + break; |
| 107 | + } |
| 108 | + $check_not_empty = array_merge( $check_not_empty, $add_checks ); |
96 | 109 | } |
97 | | - |
98 | | - if ( $address ) { |
99 | | - $this->validateAddress( $data, $error ); |
100 | | - } |
101 | | - |
102 | | - if ( $amount ) { |
103 | | - $this->validateAmount( $data, $error ); |
104 | | - } |
105 | | - |
106 | | - if ( $email ) { |
107 | | - $this->validateEmail( $data, $error ); |
108 | | - } |
109 | | - |
110 | | - if ( $creditCard ) { |
111 | | - $this->validateCreditCard( $data, $error ); |
112 | | - } |
113 | | - |
114 | | - /* |
115 | | - * $error_result would return 0 on success, 1 on failure. |
116 | | - * |
117 | | - * This is done for backward compatibility. |
118 | | - */ |
119 | | - return $this->getValidateFormResult() ? 0 : 1; |
120 | | - } |
121 | | - |
122 | | - /** |
123 | | - * Validates the address |
124 | | - * |
125 | | - * Required: |
126 | | - * - street |
127 | | - * - city |
128 | | - * - state |
129 | | - * - zip |
130 | | - * - country |
131 | | - * |
132 | | - * @param array $data Reference to the data of the form |
133 | | - * @param array $error Reference to the error messages of the form |
134 | | - * |
135 | | - * @see GatewayForm::validateForm() |
136 | | - */ |
137 | | - public function validateAddress( &$data, &$error ) { |
138 | | - |
139 | | - if ( empty( $data['street'] ) ) { |
140 | | - |
141 | | - $error['street'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-street' ) ); |
142 | | - |
143 | | - $this->setValidateFormResult( false ); |
144 | | - } |
145 | | - |
146 | | - if ( empty( $data['city'] ) ) { |
147 | | - |
148 | | - $error['city'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-city' ) ); |
149 | | - |
150 | | - $this->setValidateFormResult( false ); |
151 | | - } |
152 | | - |
153 | | - if ( empty( $data['state'] ) || $data['state'] == 'YY' ) { |
154 | | - |
155 | | - $error['state'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-state-province' ) ); |
156 | | - |
157 | | - $this->setValidateFormResult( false ); |
158 | | - } |
159 | | - |
160 | | - if ( empty( $data['country'] ) || !array_key_exists( $data['country'], $this->getCountries() )) { |
161 | | - |
162 | | - $error['country'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-country' ) ); |
163 | | - |
164 | | - $this->setValidateFormResult( false ); |
165 | | - } |
166 | | - |
167 | | - $ignoreCountries = array(); |
168 | 110 | |
169 | | - if ( empty( $data['zip'] ) && !in_array( $data['country'], $ignoreCountries ) ) { |
| 111 | + $validated_ok = $this->adapter->revalidate( $check_not_empty ); |
170 | 112 | |
171 | | - $error['zip'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-zip' ) ); |
172 | | - |
173 | | - $this->setValidateFormResult( false ); |
174 | | - } |
| 113 | + return !$validated_ok; |
175 | 114 | } |
176 | 115 | |
177 | 116 | /** |
178 | | - * Validates the amount contributed |
179 | | - * |
180 | | - * @param array $data Reference to the data of the form |
181 | | - * @param array $error Reference to the error messages of the form |
182 | | - * |
183 | | - * @see GatewayForm::validateForm() |
184 | | - */ |
185 | | - public function validateAmount( &$data, &$error ) { |
186 | | - |
187 | | - if ( empty( $data['amount'] ) ) { |
188 | | - |
189 | | - $error['amount'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-amount' ) ); |
190 | | - |
191 | | - $this->setValidateFormResult( false ); |
192 | | - } |
193 | | - |
194 | | - // check amount |
195 | | - $priceFloor = $this->adapter->getGlobal( 'PriceFloor' ); |
196 | | - $priceCeiling = $this->adapter->getGlobal( 'PriceCeiling' ); |
197 | | - if ( !preg_match( '/^\d+(\.(\d+)?)?$/', $data['amount'] ) || |
198 | | - ( ( float ) $this->convert_to_usd( $data['currency_code'], $data['amount'] ) < ( float ) $priceFloor || |
199 | | - ( float ) $this->convert_to_usd( $data['currency_code'], $data['amount'] ) > ( float ) $priceCeiling ) ) { |
200 | | - |
201 | | - $error['invalidamount'] = wfMsg( 'donate_interface-error-msg-invalid-amount' ); |
202 | | - |
203 | | - $this->setValidateFormResult( false ); |
204 | | - } |
205 | | - } |
206 | | - |
207 | | - /** |
208 | | - * Validates a credit card |
209 | | - * |
210 | | - * @param array $data Reference to the data of the form |
211 | | - * @param array $error Reference to the error messages of the form |
212 | | - * |
213 | | - * @see GatewayForm::validateForm() |
214 | | - */ |
215 | | - public function validateCreditCard( &$data, &$error ) { |
216 | | - |
217 | | - if ( empty( $data['card_num'] ) ) { |
218 | | - |
219 | | - $error['card_num'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-card_num' ) ); |
220 | | - |
221 | | - $this->setValidateFormResult( false ); |
222 | | - } |
223 | | - |
224 | | - if ( empty( $data['cvv'] ) ) { |
225 | | - |
226 | | - $error['cvv'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-cvv' ) ); |
227 | | - |
228 | | - $this->setValidateFormResult( false ); |
229 | | - } |
230 | | - |
231 | | - if ( empty( $data['expiration'] ) ) { |
232 | | - |
233 | | - $error['expiration'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-expiration' ) ); |
234 | | - |
235 | | - $this->setValidateFormResult( false ); |
236 | | - } |
237 | | - |
238 | | - // validate that credit card number entered is correct and set the card type |
239 | | - if ( preg_match( '/^3[47][0-9]{13}$/', $data['card_num'] ) ) { // american express |
240 | | - $data['card'] = 'american'; |
241 | | - } elseif ( preg_match( '/^5[1-5][0-9]{14}$/', $data['card_num'] ) ) { // mastercard |
242 | | - $data['card'] = 'mastercard'; |
243 | | - } elseif ( preg_match( '/^4[0-9]{12}(?:[0-9]{3})?$/', $data['card_num'] ) ) {// visa |
244 | | - $data['card'] = 'visa'; |
245 | | - } elseif ( preg_match( '/^6(?:011|5[0-9]{2})[0-9]{12}$/', $data['card_num'] ) ) { // discover |
246 | | - $data['card'] = 'discover'; |
247 | | - } else { // an invalid credit card number was entered |
248 | | - $error['card_num'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-card-num' ) ); |
249 | | - |
250 | | - $this->setValidateFormResult( false ); |
251 | | - } |
252 | | - } |
253 | | - |
254 | | - /** |
255 | | - * Validates an email address. |
256 | | - * |
257 | | - * @param array $data Reference to the data of the form |
258 | | - * @param array $error Reference to the error messages of the form |
259 | | - * |
260 | | - * @see GatewayForm::validateForm() |
261 | | - */ |
262 | | - public function validateEmail( &$data, &$error ) { |
263 | | - |
264 | | - if ( empty( $data['email'] ) ) { |
265 | | - |
266 | | - $error['email'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-email-empty' ) ); |
267 | | - |
268 | | - $this->setValidateFormResult( false ); |
269 | | - } |
270 | | - |
271 | | - // is email address valid? |
272 | | - $isEmail = User::isValidEmailAddr( $data['email'] ); |
273 | | - |
274 | | - // create error message (supercedes empty field message) |
275 | | - if ( !$isEmail ) { |
276 | | - $error['email'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-email' ) ); |
277 | | - |
278 | | - $this->setValidateFormResult( false ); |
279 | | - } |
280 | | - } |
281 | | - |
282 | | - /** |
283 | | - * Validates the name |
284 | | - * |
285 | | - * @param array $data Reference to the data of the form |
286 | | - * @param array $error Reference to the error messages of the form |
287 | | - * |
288 | | - * @see GatewayForm::validateForm() |
289 | | - */ |
290 | | - public function validateName( &$data, &$error ) { |
291 | | - |
292 | | - if ( empty( $data['fname'] ) ) { |
293 | | - |
294 | | - $error['fname'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-fname' ) ); |
295 | | - |
296 | | - $this->setValidateFormResult( false ); |
297 | | - } |
298 | | - |
299 | | - if ( empty( $data['lname'] ) ) { |
300 | | - |
301 | | - $error['lname'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-lname' ) ); |
302 | | - |
303 | | - $this->setValidateFormResult( false ); |
304 | | - } |
305 | | - } |
306 | | - |
307 | | - /** |
308 | 117 | * Build and display form to user |
309 | 118 | * |
310 | | - * @param $error Array: array of error messages returned by validate_form function |
311 | | - * |
312 | 119 | * The message at the top of the form can be edited in the payflow_gateway.i18n.php file |
313 | 120 | */ |
314 | | - public function displayForm( &$error ) { |
| 121 | + public function displayForm() { |
315 | 122 | global $wgOut; |
316 | 123 | |
317 | 124 | $form_class = $this->getFormClass(); |
318 | | - $form_obj = new $form_class( $this->adapter, $error ); |
319 | | - $form = $form_obj->getForm(); |
320 | | - $wgOut->addHTML( $form ); |
321 | | - } |
322 | | - |
323 | | - /** |
324 | | - * Set the form class to use to generate the CC form |
325 | | - * |
326 | | - * @param string $class_name The class name of the form to use |
327 | | - */ |
328 | | - public function setFormClass( $class_name = NULL ) { |
329 | | - if ( !$class_name ) { |
330 | | - global $wgRequest; |
331 | | - $defaultForm = $this->adapter->getGlobal( 'DefaultForm' ); |
332 | | - $form_class = $wgRequest->getText( 'form_name', $defaultForm ); |
333 | | - |
334 | | - // make sure our form class exists before going on, if not try loading default form class |
335 | | - $class_name = "Gateway_Form_" . $form_class; |
336 | | - if ( !class_exists( $class_name ) ) { |
337 | | - $class_name_orig = $class_name; |
338 | | - $class_name = "Gateway_Form_" . $defaultForm; |
339 | | - if ( !class_exists( $class_name ) ) { |
340 | | - throw new MWException( 'Could not load form ' . $class_name_orig . ' nor default form ' . $class_name ); |
341 | | - } |
342 | | - } |
| 125 | + if ( $form_class && class_exists( $form_class ) ){ |
| 126 | + $form_obj = new $form_class( $this->adapter ); |
| 127 | + $form = $form_obj->getForm(); |
| 128 | + $wgOut->addHTML( $form ); |
| 129 | + } else { |
| 130 | + throw new MWException( 'No valid form to load.' ); |
343 | 131 | } |
344 | | - $this->form_class = $class_name; |
345 | | - |
346 | | - //this should... maybe replace the other thing? I need it in the adapter so reCaptcha can get to it. |
347 | | - $this->adapter->setFormClass( $class_name ); |
348 | 132 | } |
349 | 133 | |
350 | 134 | /** |
351 | 135 | * Get the currently set form class |
352 | | - * |
353 | | - * Will set the form class if the form class not already set |
354 | | - * Using logic in setFormClass() |
355 | | - * @return string |
| 136 | + * @return mixed string containing the valid and enabled form class, otherwise false. |
356 | 137 | */ |
357 | 138 | public function getFormClass() { |
358 | | - if ( !isset( $this->form_class ) ) { |
359 | | - $this->setFormClass(); |
360 | | - } |
361 | | - return $this->form_class; |
| 139 | + return $this->adapter->getFormClass(); |
362 | 140 | } |
363 | 141 | |
364 | 142 | /** |
365 | | - * Get the currently set form class |
| 143 | + * displayResultsForDebug |
366 | 144 | * |
367 | | - * Will set the form class if the form class not already set |
368 | | - * Using logic in setFormClass() |
369 | | - * @return string |
| 145 | + * Displays useful information for debugging purposes. |
| 146 | + * Enable with $wgDonationInterfaceDisplayDebug, or the adapter equivalent. |
| 147 | + * @return null |
370 | 148 | */ |
371 | 149 | protected function displayResultsForDebug( $results = array() ) { |
372 | 150 | global $wgOut; |
— | — | @@ -423,54 +201,11 @@ |
424 | 202 | } |
425 | 203 | } |
426 | 204 | |
427 | | - public function getPossibleErrors() { |
428 | | - return array( |
429 | | - 'general' => '', |
430 | | - 'retryMsg' => '', |
431 | | - 'invalidamount' => '', |
432 | | - 'card_num' => '', |
433 | | - 'card_type' => '', |
434 | | - 'cvv' => '', |
435 | | - 'fname' => '', |
436 | | - 'lname' => '', |
437 | | - 'city' => '', |
438 | | - 'country' => '', |
439 | | - 'street' => '', |
440 | | - 'state' => '', |
441 | | - 'zip' => '', |
442 | | - 'emailAdd' => '', |
443 | | - ); |
444 | | - } |
445 | | - |
446 | 205 | /** |
447 | | - * Convert an amount for a particular currency to an amount in USD |
448 | | - * |
449 | | - * This is grosley rudimentary and likely wildly inaccurate. |
450 | | - * This mimicks the hard-coded values used by the WMF to convert currencies |
451 | | - * for validatoin on the front-end on the first step landing pages of their |
452 | | - * donation process - the idea being that we can get a close approximation |
453 | | - * of converted currencies to ensure that contributors are not going above |
454 | | - * or below the price ceiling/floor, even if they are using a non-US currency. |
455 | | - * |
456 | | - * In reality, this probably ought to use some sort of webservice to get real-time |
457 | | - * conversion rates. |
458 | | - * |
459 | | - * @param string $currency_code |
460 | | - * @param float $amount |
461 | | - * @return float |
| 206 | + * logs messages to the current gateway adapter's configured log location |
| 207 | + * @param string $msg The message to log |
| 208 | + * @param string $log_level The severity level of the message. |
462 | 209 | */ |
463 | | - static function convert_to_usd( $currency_code, $amount ) { |
464 | | - require_once( dirname( __FILE__ ) . '/currencyRates.inc' ); |
465 | | - $rates = getCurrencyRates(); |
466 | | - $code = strtoupper( $currency_code ); |
467 | | - if ( array_key_exists( $code, $rates ) ) { |
468 | | - $usd_amount = $amount / $rates[$code]; |
469 | | - } else { |
470 | | - $usd_amount = $amount; |
471 | | - } |
472 | | - return $usd_amount; |
473 | | - } |
474 | | - |
475 | 210 | public function log( $msg, $log_level=LOG_INFO ) { |
476 | 211 | $this->adapter->log( $msg, $log_level ); |
477 | 212 | } |
— | — | @@ -489,7 +224,8 @@ |
490 | 225 | // if we don't have a URL enabled throw a graceful error to the user |
491 | 226 | if ( !strlen( $this->adapter->getGlobal( 'PaypalURL' ) ) ) { |
492 | 227 | $gateway_identifier = $this->adapter->getIdentifier(); |
493 | | - $this->errors['general']['nopaypal'] = wfMsg( $gateway_identifier . '_gateway-error-msg-nopaypal' ); |
| 228 | + $error['general']['nopaypal'] = wfMsg( $gateway_identifier . '_gateway-error-msg-nopaypal' ); |
| 229 | + $this->adapter->addManualError( $error ); |
494 | 230 | return; |
495 | 231 | } |
496 | 232 | // submit the data to the paypal redirect URL |
— | — | @@ -506,26 +242,6 @@ |
507 | 243 | } |
508 | 244 | |
509 | 245 | /** |
510 | | - * Get validate form result |
511 | | - * |
512 | | - * @return boolean |
513 | | - */ |
514 | | - public function getValidateFormResult() { |
515 | | - |
516 | | - return ( boolean ) $this->validateFormResult; |
517 | | - } |
518 | | - |
519 | | - /** |
520 | | - * Set validate form result |
521 | | - * |
522 | | - * @param boolean $validateFormResult |
523 | | - */ |
524 | | - public function setValidateFormResult( $validateFormResult ) { |
525 | | - |
526 | | - $this->validateFormResult = empty( $validateFormResult ) ? false : ( boolean ) $validateFormResult; |
527 | | - } |
528 | | - |
529 | | - /** |
530 | 246 | * Handle the result from the gateway |
531 | 247 | * |
532 | 248 | * If there are errors, then this will return to the form. |
— | — | @@ -572,21 +288,19 @@ |
573 | 289 | // Display debugging results |
574 | 290 | $this->displayResultsForDebug(); |
575 | 291 | |
576 | | - $this->errors['general'] = ( !isset( $this->errors['general'] ) || empty( $this->errors['general'] ) ) ? array() : (array) $this->errors['general']; |
577 | | - |
578 | | - $this->errors['retryMsg'] = ( !isset( $this->errors['retryMsg'] ) || empty( $this->errors['retryMsg'] ) ) ? array() : (array) $this->errors['retryMsg']; |
579 | | - |
580 | 292 | foreach ( $this->adapter->getTransactionErrors() as $code => $message ) { |
581 | 293 | |
| 294 | + $error = array(); |
582 | 295 | if ( strpos( $code, 'internal' ) === 0 ) { |
583 | | - $this->errors['retryMsg'][ $code ] = $message; |
| 296 | + $error['retryMsg'][ $code ] = $message; |
584 | 297 | } |
585 | 298 | else { |
586 | | - $this->errors['general'][ $code ] = $message; |
| 299 | + $error['general'][ $code ] = $message; |
587 | 300 | } |
| 301 | + $this->adapter->addManualError( $error ); |
588 | 302 | } |
589 | 303 | |
590 | | - return $this->displayForm( $this->errors ); |
| 304 | + return $this->displayForm(); |
591 | 305 | } |
592 | 306 | |
593 | 307 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/GatewayForm.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
594 | 308 | Merged /trunk/extensions/DonationInterface/gateway_common/GatewayForm.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,99570-101026,101056,101060,101063-101064,101071-101074,101076,101099,101109,101112,101163,101180,101192,101200,101205,101207,101217,101230,101232,101236,101335,101382,101399,101441,101501-101504,101512,101541,101547,101549,101553-101555,101557,101559,101561,101563,101576,101578-101579,101631,101633,101638,101669,101676,101679,101689,101700,101706,101719,101740,101747,101757,101764,101778-101779,101781,101785-101789,101798,101823,101826,101837,101846,101852,101870-101872,101878,101882,101890,101892,101910,101917,101929,101947,101949-101951,101955-101960,101962,101964-101966,101996,102003,102011-102012,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102123-102127,102130,102134,102140,102147,102151-102152,102155-102156,102186,102188-102242,102252,102258-102261,102263,102267,102269,102307-102309,102313,102318,102332,102338,102341-102342,102345,102364,102419,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681-102682,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102733,102736,102740,102752,102763,102805,102807,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102878,102915,102921-102923,102926-102928,102932,102936,102938,102942-102943,102946,102953,102960-102961,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103050,103058,103067,103077,103080,103130,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103261-103262,103264,103275,103278,103284,103289-103291,103325,103371,103397,103399,103401,103411,103413,103421,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,104065,104194,104210,104243,104298,104362,104485,104539,104587,104611,105534,105584,105593-105594,105600,105611,105938,106109,106158,106954,107106,107182,107261,107287,107342,107412,107536,107544,107609,107981,108522 |
595 | 309 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/GatewayForm.php:r99568 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/country.specific.i18n.php |
— | — | @@ -33,6 +33,9 @@ |
34 | 34 | $messages['pt']['donate_interface-donor-fname-gq'] = 'Nome'; |
35 | 35 | $messages['pt']['donate_interface-donor-lname-gq'] = 'Apelido'; |
36 | 36 | |
| 37 | +/* KE - Kenya */ |
| 38 | +$messages['en']['donate_interface-donor-lname-ke'] = 'Surname'; |
| 39 | + |
37 | 40 | /* TZ - Tanzania */ |
38 | 41 | $messages['en']['donate_interface-donor-lname-tz'] = 'Surname'; |
39 | 42 | |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/country.specific.i18n.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
40 | 43 | Merged /trunk/extensions/DonationInterface/gateway_common/country.specific.i18n.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,99570-101026,101056,101060,101063-101064,101071-101074,101076,101099,101109,101112,101163,101180,101192,101200,101205,101207,101217,101230,101232,101236,101335,101382,101399,101441,101501-101504,101512,101541,101547,101549,101553-101555,101557,101559,101561,101563,101576,101578-101579,101631,101633,101638,101669,101676,101679,101689,101700,101706,101719,101740,101747,101757,101764,101778-101779,101781,101785-101789,101798,101823,101826,101837,101846,101852,101870-101872,101878,101882,101890,101892,101910,101917,101929,101947,101949-101951,101955-101960,101962,101964-101966,101996,102003,102011-102012,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102123-102127,102130,102134,102140,102147,102151-102152,102155-102156,102186,102188-102242,102252,102258-102261,102263,102267,102269,102307-102309,102313,102318,102332,102338,102341-102342,102345,102364,102419,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681-102682,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102733,102736,102740,102752,102763,102805,102807,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102878,102915,102921-102923,102926-102928,102932,102936,102938,102942-102943,102946,102953,102960-102961,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103050,103058,103067,103077,103080,103130,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103261-103262,103264,103275,103278,103284,103289-103291,103325,103371,103397,103399,103401,103411,103413,103421,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,104065,104194,104210,104243,104298,104362,104485,104539,104587,104611,105534,105584,105593-105594,105600,105611,106954,107106,107182,107261,107287,107342,107412,107536,107544,112188 |
41 | 44 | Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/country.specific.i18n.php:r99568 |