Index: branches/fundraising/OWA/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -925,7 +925,15 @@ |
926 | 926 | wfSetupSession(); |
927 | 927 | } |
928 | 928 | |
929 | | - function get_owa_ref_id($ref){ |
| 929 | + /** |
| 930 | + * Fetches ID for reference URL for OWA tracking |
| 931 | + * |
| 932 | + * In the event that the URL is not already in the database, insert it |
| 933 | + * and return it's id. Otehrewise, just return its id. |
| 934 | + * @param string $ref The reference URL |
| 935 | + * @return int The id for the reference URL - 0 if not found |
| 936 | + */ |
| 937 | + function get_owa_ref_id( $ref ) { |
930 | 938 | // Replication lag means sometimes a new event will not exist in the table yet |
931 | 939 | $dbw = contributionTrackingConnection(); |
932 | 940 | $id_num = $dbw->selectField( |
— | — | @@ -956,9 +964,10 @@ |
957 | 965 | public function fnGetFormData( $amount, $numAttempt, $token, $order_id ) { |
958 | 966 | global $wgPayflowGatewayTest, $wgRequest; |
959 | 967 | |
960 | | - $owa_ref = $wgRequest->getText( 'owa_ref', null); |
961 | | - if($owa_ref != null && !is_numeric($owa_ref)){ |
962 | | - $owa_ref = $this->get_owa_ref($owa_ref); |
| 968 | + // fetch ID for the url reference for OWA tracking |
| 969 | + $owa_ref = $wgRequest->getText( 'owa_ref', null ); |
| 970 | + if( $owa_ref != null && !is_numeric( $owa_ref )){ |
| 971 | + $owa_ref = $this->get_owa_ref_id( $owa_ref ); |
963 | 972 | } |
964 | 973 | |
965 | 974 | // if we're in testing mode and an action hasn't yet be specified, prepopulate the form |
Index: branches/fundraising/OWA/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php |
— | — | @@ -10,10 +10,6 @@ |
11 | 11 | // we only want to load this JS if the form is being rendered |
12 | 12 | $this->loadValidateJs(); // validation JS |
13 | 13 | |
14 | | - if(defined('OWA')){ |
15 | | - $this->loadOwaJs(); |
16 | | - } |
17 | | - |
18 | 14 | $first = wfMsg( 'payflowpro_gateway-first' ); |
19 | 15 | $last = wfMsg( 'payflowpro_gateway-last' ); |
20 | 16 | $js = <<<EOT |
Index: branches/fundraising/OWA/DonationInterface/payflowpro_gateway/forms/Form.php |
— | — | @@ -64,7 +64,18 @@ |
65 | 65 | if ( !strlen( $this->getStylePath())) { |
66 | 66 | $this->setStylePath(); |
67 | 67 | } |
| 68 | + |
68 | 69 | $wgOut->addExtensionStyle( $this->getStylePath() ); |
| 70 | + |
| 71 | + /** |
| 72 | + * if OWA is enabled, load the JS. |
| 73 | + * |
| 74 | + * We do this here (rather than in individual forms) because if OWA is |
| 75 | + * enabled, we ALWAYS want to make sure it gets included. |
| 76 | + */ |
| 77 | + if(defined('OWA')){ |
| 78 | + $this->loadOwaJs(); |
| 79 | + } |
69 | 80 | } |
70 | 81 | |
71 | 82 | /** |
Index: branches/fundraising/OWA/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php |
— | — | @@ -15,12 +15,8 @@ |
16 | 16 | $this->loadValidateJs(); // validation JS |
17 | 17 | |
18 | 18 | $this->loadApiJs(); // API/Ajax JS |
19 | | - |
20 | | - if(defined('OWA')){ |
21 | | - $this->loadOwaJs(); |
22 | | - } |
23 | 19 | } |
24 | | - |
| 20 | + |
25 | 21 | /** |
26 | 22 | * Required method for constructing the entire form |
27 | 23 | * |
Index: branches/fundraising/OWA/DonationInterface/payflowpro_gateway/owa_get_info.js |
— | — | @@ -6,8 +6,8 @@ |
7 | 7 | //NOTE: This only works as long as sid is the last param in the OWA cookie |
8 | 8 | if(owaS_start_index >= 0){ |
9 | 9 | var owaSessionID = owa_s_val.substr(owaS_start_index + owa_s_ident.length); |
10 | | - if(document.getElementById("owa_session_id") && |
11 | | - document.getElementById("owa_pageref")){ |
| 10 | + if(document.getElementById("owa_session") && |
| 11 | + document.getElementById("owa_ref")){ |
12 | 12 | document.getElementById("owa_session").value = owaSessionID; |
13 | 13 | document.getElementById("owa_ref").value = encode(window.location); |
14 | 14 | } |