[MediaWiki-commits] [Gerrit] Disallow setting contribution tracking ID from request - change (mediawiki...DonationInterface)

2016-06-10 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Disallow setting contribution tracking ID from request
..


Disallow setting contribution tracking ID from request

Should be OK since we don't generate that on donatewiki any more.

It will be generated fresh whenever it's not in session.

Bug: T137155
Change-Id: I92c90f20069b1633d21032be30e6770a65d24a14
---
M adyen_gateway/forms/js/adyen.js
M gateway_common/DonationData.php
M gateway_common/donation.api.php
M gateway_common/i18n/interface/en.json
M gateway_common/i18n/interface/qqq.json
M gateway_forms/RapidHtml.php
M gateway_forms/mustache/index.html.mustache
M globalcollect_gateway/forms/html/bt/bt.html
M globalcollect_gateway/forms/html/cash/boletos.html
M globalcollect_gateway/forms/html/cc/cc-a.html
M globalcollect_gateway/forms/html/cc/cc-jvma.html
M globalcollect_gateway/forms/html/cc/cc-vjma.html
M globalcollect_gateway/forms/html/cc/cc-vm.html
M globalcollect_gateway/forms/html/cc/cc-vma.html
M globalcollect_gateway/forms/html/cc/cc-vmad.html
M globalcollect_gateway/forms/html/cc/cc-vmaj.html
M globalcollect_gateway/forms/html/cc/cc-vmd.html
M globalcollect_gateway/forms/html/cc/cc-vmj.html
M globalcollect_gateway/forms/html/cc/cc.html
M globalcollect_gateway/forms/html/dd/dd-recurring.html
M globalcollect_gateway/forms/html/dd/dd.html
M globalcollect_gateway/forms/html/ew/ew-alipay.html
M globalcollect_gateway/forms/html/ew/ew-webmoney.html
M globalcollect_gateway/forms/html/ew/ew-yandex.html
M globalcollect_gateway/forms/html/obt/obt-bpay.html
M globalcollect_gateway/forms/html/rcc/rcc-vm.html
M globalcollect_gateway/forms/html/rcc/rcc-vma.html
M globalcollect_gateway/forms/html/rcc/rcc-vmad.html
M globalcollect_gateway/forms/html/rcc/rcc-vmaj.html
M globalcollect_gateway/forms/html/rcc/rcc-vmd.html
M globalcollect_gateway/forms/html/rcc/rcc-vmj.html
M globalcollect_gateway/forms/html/rcc/rcc.html
M globalcollect_gateway/forms/html/rtbt/rtbt-enets.html
M globalcollect_gateway/forms/html/rtbt/rtbt-eps.html
M globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
M globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
M globalcollect_gateway/forms/html/rtbt/rtbt-sofo-GB.html
M globalcollect_gateway/forms/html/rtbt/rtbt-sofo.html
M globalcollect_gateway/forms/html/webitects2nd-AU.html
M globalcollect_gateway/forms/html/webitects2nd-US.html
M globalcollect_gateway/forms/html/webitects2nd-amex.html
M globalcollect_gateway/forms/html/webitects2nd.html
M globalcollect_gateway/forms/html/webitects2nd_green-US.html
M globalcollect_gateway/forms/html/webitects_2_3step-CA.html
M globalcollect_gateway/forms/html/webitects_2_3step.html
M globalcollect_gateway/forms/html/webitects_2_3stepB-US.html
M globalcollect_gateway/forms/js/gc.js
M globalcollect_gateway/forms/js/webitects.js
M tests/Adapter/GatewayAdapterTest.php
M worldpay_gateway/forms/html/worldpay-dd-test.html
M worldpay_gateway/forms/html/worldpay-test.html
M worldpay_gateway/forms/html/worldpay.html
M worldpay_gateway/forms/js/worldpay.js
M worldpay_gateway/i18n/en.json
M worldpay_gateway/i18n/qqq.json
M worldpay_gateway/worldpay.api.php
56 files changed, 6 insertions(+), 60 deletions(-)

Approvals:
  XenoRyet: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/adyen_gateway/forms/js/adyen.js b/adyen_gateway/forms/js/adyen.js
index d223505..9679547 100644
--- a/adyen_gateway/forms/js/adyen.js
+++ b/adyen_gateway/forms/js/adyen.js
@@ -25,7 +25,6 @@
payment_method: 'cc',
language: $( '#language' ).val(),
payment_submethod: $( 
'input[name="payment_submethod"]:checked' ).val().toLowerCase(),
-   contribution_tracking_id: $( 
'#contribution_tracking_id' ).val(),
utm_source: $( '#utm_source' ).val(),
utm_campaign: $( '#utm_campaign' ).val(),
utm_medium: $( '#utm_medium' ).val(),
diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index 34f246d..32ad120 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -71,7 +71,6 @@
'language',
'uselang',
'wmf_token',
-   'contribution_tracking_id',
'data_hash',
'action',
'gateway',
@@ -188,7 +187,7 @@
return;
}
//fields that should always overwrite with their original values
-   $overwrite = array( 'referrer' );
+   $overwrite = array( 'referrer', 'contribution_tracking_id' );
foreach ( $donorData as $key => $val ) {
if ( !$this->isSomething( $key ) ) {
$this->setVal( $key, $val );
diff --git a/gateway_common/donation.api.php b/gateway_common/donation.api.php
index 

[MediaWiki-commits] [Gerrit] Disallow setting contribution tracking ID from request - change (mediawiki...DonationInterface)

2016-05-19 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289731

Change subject: Disallow setting contribution tracking ID from request
..

Disallow setting contribution tracking ID from request

Should be OK since we don't generate that on donatewiki any more.

It will be generated fresh whenever it's not in session.

Bug: T135745
Change-Id: I92c90f20069b1633d21032be30e6770a65d24a14
---
M gateway_common/DonationData.php
M tests/Adapter/GatewayAdapterTest.php
2 files changed, 7 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/31/289731/1

diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index 02064d0..b8d3f0d 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -71,7 +71,6 @@
'language',
'uselang',
'wmf_token',
-   'contribution_tracking_id',
'data_hash',
'action',
'gateway',
@@ -486,6 +485,10 @@
 * @return bool True if a new record was created
 */
protected function handleContributionTrackingID() {
+   $ctid = $this->gateway->session_getData( 'Donor', 
'contribution_tracking_id' );
+   if ( $ctid ) {
+   $this->setVal( 'contribution_tracking_id', $ctid );
+   }
if ( !$this->isSomething( 'contribution_tracking_id' ) ) {
$ctid = $this->saveContributionTrackingData();
if ( $ctid ) {
diff --git a/tests/Adapter/GatewayAdapterTest.php 
b/tests/Adapter/GatewayAdapterTest.php
index d5700b3..49d9847 100644
--- a/tests/Adapter/GatewayAdapterTest.php
+++ b/tests/Adapter/GatewayAdapterTest.php
@@ -133,15 +133,15 @@
public function testResetOnGatewaySwitch() {
// Fill the session with some GlobalCollect stuff
$init = $this->getDonorTestData( 'FR' );
-   $init['contribution_tracking_id'] = mt_rand();
$firstRequest = $this->setUpRequest( $init );
$globalcollect_gateway = new TestingGlobalCollectAdapter();
$globalcollect_gateway->do_transaction( 'Donate' );
 
$session = $firstRequest->getSessionArray();
+   $ctId = $session['contribution_tracking_id'];
$this->assertEquals( 'globalcollect', 
$session['Donor']['gateway'], 'Test setup failed.' );
 
-   //Then simpulate switching to Worldpay
+   //Then simulate switching to Worldpay
$session['sequence'] = 2;
unset( $init['order_id'] );
 
@@ -150,7 +150,7 @@
$worldpay_gateway->batch_mode = true;
 
$session = $secondRequest->getSessionArray();
-   $expected_order_id = 
"{$init['contribution_tracking_id']}.{$session['sequence']}";
+   $expected_order_id = "$ctId.{$session['sequence']}";
$this->assertEquals( $expected_order_id, 
$worldpay_gateway->getData_Unstaged_Escaped( 'order_id' ),
'Order ID was not regenerated on gateway switch!' );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/289731
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92c90f20069b1633d21032be30e6770a65d24a14
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits