[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: WIP merged vendor dirs for payments-wiki

2018-01-22 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405822 )

Change subject: WIP merged vendor dirs for payments-wiki
..

WIP merged vendor dirs for payments-wiki

Use the composer merge plugin to put all the extension dependencies
into the top-level vendor directory.

TODO: make sure we can update CI to work for all the things, including
dev dependencies and adding new dependencies

Bug: T185547
Depends-On: I09db8170994a187b06816e88d5d01e73567b46a1
Depends-On: I8090150374e1146cebf1f62aeb92ca43c31d0f89
Depends-On: I795169577204fabea276364c966b65a321d6a7fb
Change-Id: Ic3a88c5bbb73fac7dd3f9e4d55fb59f0f299a2d6
---
M composer.json
M extensions/DonationInterface
M extensions/FundraisingEmailUnsubscribe
M vendor
4 files changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/405822/1

diff --git a/composer.json b/composer.json
index 3880520..2c32d80 100644
--- a/composer.json
+++ b/composer.json
@@ -53,7 +53,8 @@
"nmred/kafka-php": "0.1.5",
"phpunit/phpunit": "4.8.36",
"wikimedia/testing-access-wrapper": "~1.0",
-   "wikimedia/avro": "1.7.7"
+   "wikimedia/avro": "1.7.7",
+   "etsy/phan": "0.8"
},
"suggest": {
"ext-apc": "Local data and opcode cache",
@@ -93,7 +94,8 @@
"extra": {
"merge-plugin": {
"include": [
-   "composer.local.json"
+   "composer.local.json",
+   "extensions/*/composer.json"
],
"merge-dev": false
}
diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 6ddd13b..279d86c 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 6ddd13bb7b227354a5338745b587ca3d9e69497a
+Subproject commit 279d86c4869d6a4284d54e01c83ac9527076c819
diff --git a/extensions/FundraisingEmailUnsubscribe 
b/extensions/FundraisingEmailUnsubscribe
index b4f69ed..2609bae 16
--- a/extensions/FundraisingEmailUnsubscribe
+++ b/extensions/FundraisingEmailUnsubscribe
@@ -1 +1 @@
-Subproject commit b4f69edb163d459a48fec7599b48003fb1982023
+Subproject commit 2609bae6d88fdfadefca69dde9910c5dc6486e48
diff --git a/vendor b/vendor
index ec4d316..7ad981a 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit ec4d3165a5e97ed273a3e518ba657a5f389f8abb
+Subproject commit 7ad981a35e100a6b0a6ca0ec5743a48b83d74ac4

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3a88c5bbb73fac7dd3f9e4d55fb59f0f299a2d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...FundraisingEmailUnsubscribe[master]: WIP: Remove vendor dir

2018-01-22 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405818 )

Change subject: WIP: Remove vendor dir
..

WIP: Remove vendor dir

Idea is to use Composer merge plugin to de-duplicate it all into the
top-level mediawiki vendor dir.

Bug: T185547
Change-Id: I09db8170994a187b06816e88d5d01e73567b46a1
---
M extension.json
D vendor/.htaccess
D vendor/autoload.php
D vendor/clio/clio/LICENSE
D vendor/clio/clio/README.md
D vendor/clio/clio/composer.json
D vendor/clio/clio/src/Clio/Console.php
D vendor/clio/clio/src/Clio/Daemon.php
D vendor/coderkungfu/php-queue/.gitignore
D vendor/coderkungfu/php-queue/.travis.yml
D vendor/coderkungfu/php-queue/README.md
D vendor/coderkungfu/php-queue/composer.json
D vendor/coderkungfu/php-queue/demo/cli.php
D vendor/coderkungfu/php-queue/demo/config.php
D vendor/coderkungfu/php-queue/demo/htdocs/.htaccess
D vendor/coderkungfu/php-queue/demo/htdocs/index.php
D vendor/coderkungfu/php-queue/demo/htdocs/index_secured.php
D vendor/coderkungfu/php-queue/demo/queues/BeanstalkSampleQueue.php
D vendor/coderkungfu/php-queue/demo/queues/SampleQueue.php
D vendor/coderkungfu/php-queue/demo/queues/logs/.htaccess
D vendor/coderkungfu/php-queue/demo/runners/BeanstalkSampleDaemon.php
D vendor/coderkungfu/php-queue/demo/runners/README.md
D vendor/coderkungfu/php-queue/demo/runners/SampleRunner.php
D vendor/coderkungfu/php-queue/demo/runners/logs/.htaccess
D vendor/coderkungfu/php-queue/demo/workers/SampleWorker.php
D vendor/coderkungfu/php-queue/phpunit.travis.xml
D vendor/coderkungfu/php-queue/phpunit.xml.dist
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/AmazonS3.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/AmazonSQS.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Aws/AmazonS3V1.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Aws/AmazonS3V2.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Aws/AmazonSQSV1.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Aws/AmazonSQSV2.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Base.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Beanstalkd.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/CSV.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/FS.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/IronMQ.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/LocalFS.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Memcache.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/MongoDB.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/PDO.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Predis.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Proxy.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/Stomp.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/WindowsAzureBlob.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Backend/WindowsAzureServiceBus.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Base.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Cli.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Daemon.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Exception/BackendException.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Exception/Exception.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Exception/JobNotFoundException.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Exception/JsonException.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Exception/QueueNotFoundException.php
D 
vendor/coderkungfu/php-queue/src/PHPQueue/Exception/WorkerNotFoundException.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Helpers.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Interfaces/AtomicReadBuffer.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Interfaces/Auth.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Interfaces/Config.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Interfaces/FifoQueueStore.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Job.php
D vendor/coderkungfu/php-queue/src/PHPQueue/JobQueue.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Json.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Logger.php
D vendor/coderkungfu/php-queue/src/PHPQueue/REST.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Runner.php
D vendor/coderkungfu/php-queue/src/PHPQueue/Worker.php
D vendor/coderkungfu/php-queue/test/Demo/Workers/SampleWorkerTest.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/AmazonS3V1Test.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/AmazonS3V2Test.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/AmazonSQSV1Test.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/AmazonSQSV2Test.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/BeanstalkdTest.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/CSVTest.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/IronMQTest.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/LocalFSTest.php
D vendor/coderkungfu/php-queue/test/PHPQueue/Backend/MemcacheTest.php
D 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: WIP remove vendor submodule

2018-01-22 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405817 )

Change subject: WIP remove vendor submodule
..

WIP remove vendor submodule

Instead, use composer merge plugin to merge all libraries into the
top-level mediawiki vendor dir, avoiding duplication and potential
conflict.

Bug: T185547
Change-Id: I795169577204fabea276364c966b65a321d6a7fb
---
M .gitmodules
D composer.lock
D vendor
3 files changed, 0 insertions(+), 1,596 deletions(-)


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

diff --git a/.gitmodules b/.gitmodules
index dc9dce9..e69de29 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "vendor"]
-   path = vendor
-   url = 
https://gerrit.wikimedia.org/r/mediawiki/extensions/DonationInterface/vendor
diff --git a/composer.lock b/composer.lock
deleted file mode 100644
index 5d275a2..000
--- a/composer.lock
+++ /dev/null
@@ -1,1592 +0,0 @@
-{
-"_readme": [
-"This file locks the dependencies of your project to a known state",
-"Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
-"This file is @generated automatically"
-],
-"content-hash": "7f1096380f4f378b06eaccb8d71984a3",
-"packages": [
-{
-"name": "addshore/psr-6-mediawiki-bagostuff-adapter",
-"version": "0.1",
-"source": {
-"type": "git",
-"url": 
"https://github.com/addshore/psr-6-mediawiki-bagostuff-adapter.git;,
-"reference": "92f3bb69bf3e7f51b8b66ae74b6a4a291637354c"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/addshore/psr-6-mediawiki-bagostuff-adapter/zipball/92f3bb69bf3e7f51b8b66ae74b6a4a291637354c;,
-"reference": "92f3bb69bf3e7f51b8b66ae74b6a4a291637354c",
-"shasum": ""
-},
-"require": {
-"psr/cache": "^1.0.0"
-},
-"require-dev": {
-"cache/integration-tests": "~0.9.1",
-"jakub-onderka/php-parallel-lint": "^0.9.2",
-"mediawiki/mediawiki-codesniffer": "^0.7.2",
-"phpunit/phpunit": "~4.8.0|~5.3.0"
-},
-"type": "library",
-"autoload": {
-"psr-4": {
-"Addshore\\Psr\\Cache\\MWBagOStuffAdapter\\": "src/"
-}
-},
-"notification-url": "https://packagist.org/downloads/;,
-"license": [
-"GPL-2.0+"
-],
-"authors": [
-{
-"name": "Addshore"
-}
-],
-"description": "A MediaWiki BagOStuff PSR-6 adapter library",
-"keywords": [
-"cache",
-"mediawiki"
-],
-"time": "2017-02-16T14:33:59+00:00"
-},
-{
-"name": "amzn/login-and-pay-with-amazon-sdk-php",
-"version": "dev-master",
-"source": {
-"type": "git",
-"url": 
"https://github.com/ejegg/login-and-pay-with-amazon-sdk-php;,
-"reference": "198cc8ccab51e270909602cee38706b4d1f6bbba"
-},
-"require": {
-"ext-curl": "*",
-"php": ">=5.3.0",
-"psr/log": "^1.0"
-},
-"type": "library",
-"autoload": {
-"psr-4": {
-"PayWithAmazon\\": "PayWithAmazon/"
-}
-},
-"license": [
-"Apache OSL-2"
-],
-"authors": [
-{
-"name": "Amazon Payments",
-"email": "eps-...@amazon.com"
-}
-],
-"description": "Pay with Amazon SDK",
-"homepage": 
"https://github.com/amzn/login-and-pay-with-amazon-sdk-php;,
-"keywords": [
-"amazon",
-"amazon payments",
-"pay",
-"pay with amazon",
-"payment",
-"payments"
-],
-"time": "2017-12-15T15:03:21+00:00"
-},
-{
-"name": "clio/clio",
-"version": "0.1.8",
-"source": {
-"type": "git",
-"url": "https://github.com/nramenta/clio.git;,
-"reference": "6a9f600b73fa213e817d5c1e67a4641aecd156ef"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/nramenta/clio/zipball/6a9f600b73fa213e817d5c1e67a4641aecd156ef;,
-"reference": "6a9f600b73fa213e817d5c1e67a4641aecd156ef",
-   

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Fix typos in comments

2018-01-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405006 )

Change subject: Fix typos in comments
..

Fix typos in comments

Only the unintentional misspellings!

Note: there is a misspelled 'Threshhold' setting that I didn't touch
here, but which we should correct sometime.

Change-Id: I4c9a2b20e49ba8095a8d50d271ac5c4fd3790e0d
---
M DonationInterface.php
M README.txt
M gateway_common/DataValidator.php
M gateway_common/DonationData.php
M gateway_common/GatewayType.php
M gateway_common/MessageUtils.php
M gateway_common/gateway.adapter.php
M gateway_forms/Form.php
M globalcollect_gateway/IngenicoMethodCodec.php
M globalcollect_gateway/globalcollect.adapter.php
10 files changed, 21 insertions(+), 20 deletions(-)


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

diff --git a/DonationInterface.php b/DonationInterface.php
index a405afa..8504269 100644
--- a/DonationInterface.php
+++ b/DonationInterface.php
@@ -3,7 +3,7 @@
 /**
  * Donation Interface
  *
- *  To install the DontaionInterface extension, put the following line in 
LocalSettings.php:
+ *  To install the DonationInterface extension, put the following line in 
LocalSettings.php:
  * require_once( "\$IP/extensions/DonationInterface/DonationInterface.php" 
);
  *
  */
diff --git a/README.txt b/README.txt
index 1781e10..680188a 100644
--- a/README.txt
+++ b/README.txt
@@ -1,11 +1,11 @@
 Donation Interface
 
-To install the DontaionInterface extension, put the following line in 
LocalSettings.php:
+To install the DonationInterface extension, put the following line in 
LocalSettings.php:
   wfLoadExtension( 'DonationInterface' );
 
 All of this extension's globals can be overridden on a per-gateway basis by
 adding a setting with the same name, but with 'DonationInterface' replaced
-with the gatway's name. To override $wgDonationInterfaceUseSyslog just for
+with the gateway's name. To override $wgDonationInterfaceUseSyslog just for
 Adyen, add
   $wgAdyenGatewayUseSyslog = true;
 to LocalSettings.php.
diff --git a/gateway_common/DataValidator.php b/gateway_common/DataValidator.php
index e30a3bc..5847584 100644
--- a/gateway_common/DataValidator.php
+++ b/gateway_common/DataValidator.php
@@ -382,7 +382,7 @@
 * Checks to make sure that the $value is present in the $data array, 
and not null or an empty string.
 * Anything else that is 'falseish' is still perfectly valid to have as 
a data point.
 * TODO: Consider doing this in a batch.
-* @param string $value The value to check for non-emptyness.
+* @param string $value The value to check for non-emptiness.
 * @return bool True if the $value is not missing or empty, otherwise 
false.
 */
protected static function validate_not_empty( $value ) {
@@ -577,7 +577,7 @@
 
/**
 * Takes either an IP address, or an IP address with a CIDR block, and
-* expands it to an array containing all the relevent addresses so we 
can do
+* expands it to an array containing all the relevant addresses so we 
can do
 * things like save the expanded list to memcache, and use in_array().
 * @param string $ip Either a single address, or a block.
 * @return array An expanded list of IP addresses denoted by $ip.
diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index 39d1828..f729089 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -287,9 +287,9 @@
 * Returns an array of all the fields that get re-calculated during a
 * normalize.
 * This can be used on the outside when in the process of changing data,
-* particularly if any of the recalculted fields need to be restaged by 
the
+* particularly if any of the recalculated fields need to be restaged 
by the
 * gateway adapter.
-* @return array An array of values matching all recauculated fields.
+* @return array An array of values matching all recalculated fields.
 */
public function getCalculatedFields() {
$fields = array(
diff --git a/gateway_common/GatewayType.php b/gateway_common/GatewayType.php
index b5226f9..ca577fb 100644
--- a/gateway_common/GatewayType.php
+++ b/gateway_common/GatewayType.php
@@ -62,7 +62,7 @@
 * First array key: Some way for us to id the transaction. Doesn't 
actually have to be the gateway's name for it, but I'm going with that until I 
have a reason not to.
 * Second array key:
 *  'request' contains the structure of that request. 
Leaves in the array tree will eventually be mapped to actual values of ours,
-*  according to the precidence established in the 
getTransactionSpecificValue function.
+*  according to the precedence established in the 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Fix extra params on method calls

2018-01-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405005 )

Change subject: Fix extra params on method calls
..

Fix extra params on method calls

That nasty generated HTML should die in any case...

Change-Id: I2a82733fe554aafec1a2470309ad2aa19b647315
---
M gateway_common/GatewayPage.php
M globalcollect_gateway/orphan.adapter.php
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php
index 30dcd1a..682a02a 100644
--- a/gateway_common/GatewayPage.php
+++ b/gateway_common/GatewayPage.php
@@ -276,7 +276,7 @@
$output->addHTML( Html::openElement( 'ul' ) );
foreach ( $data as $key => $value ) {
if ( is_array( $value ) ) {
-   $output->addHTML( Html::openElement( 
'li', null, $key ) . Html::openElement( 'ul' ) );
+   $output->addHTML( Html::openElement( 
'li', null ) . Html::openElement( 'ul' ) );
foreach ( $value as $key2 => $val2 ) {
$output->addHTML( 
Html::element( 'li', null, "$key2: $val2" ) );
}
diff --git a/globalcollect_gateway/orphan.adapter.php 
b/globalcollect_gateway/orphan.adapter.php
index f61c75f..ebde7cf 100644
--- a/globalcollect_gateway/orphan.adapter.php
+++ b/globalcollect_gateway/orphan.adapter.php
@@ -42,7 +42,7 @@
}
if ( $final ) {
// FIXME
-   $this->stageData( 'response' );
+   $this->stageData();
}
foreach ( $unstaged as $key => $val ) {
$unstaged[$key] = $this->staged_data[$key];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a82733fe554aafec1a2470309ad2aa19b647315
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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Add missing @return tags

2018-01-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405003 )

Change subject: Add missing @return tags
..

Add missing @return tags

And a few other fixups in the same phpdoc blocks.

Change-Id: Ia911d6b0964b26574470a56b8c3c27e04e4143c1
---
M amazon_gateway/amazon.adapter.php
M gateway_common/MessageUtils.php
M gateway_common/gateway.adapter.php
M special/GatewayFormChooser.php
4 files changed, 9 insertions(+), 3 deletions(-)


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

diff --git a/amazon_gateway/amazon.adapter.php 
b/amazon_gateway/amazon.adapter.php
index 27c8920..5f4eb4c 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -168,6 +168,8 @@
 * the first place.
 * @param string $functionName
 * @param array $parameters
+* @throws ResponseProcessingException on call failure or error code
+* @return array Results of the SDK client call
 */
protected function callPwaClient( $functionName, $parameters ) {
$callMe = array( $this->client, $functionName );
diff --git a/gateway_common/MessageUtils.php b/gateway_common/MessageUtils.php
index 572da6d..2beb642 100644
--- a/gateway_common/MessageUtils.php
+++ b/gateway_common/MessageUtils.php
@@ -48,6 +48,7 @@
 * @param string $country
 * @param string $language
 * @param array $params extra message parameters
+* @return string Localized message
 */
public static function getCountrySpecificMessage( $key, $country, 
$language, $params = array() ) {
return self::languageSpecificFallback(
diff --git a/gateway_common/gateway.adapter.php 
b/gateway_common/gateway.adapter.php
index 7d11b22..7c9a124 100644
--- a/gateway_common/gateway.adapter.php
+++ b/gateway_common/gateway.adapter.php
@@ -556,7 +556,8 @@
/**
 * Gets a global variable according to @see getGlobal rules, then 
replaces
 * $country and $language with values from gateway instance data.
-* @param string $varname
+* @param string $varname Name of setting to retrieve
+* @return string Localized setting
 */
public function localizeGlobal( $varname ) {
$value = self::getGlobal( $varname );
diff --git a/special/GatewayFormChooser.php b/special/GatewayFormChooser.php
index 645408a..5b323ed 100644
--- a/special/GatewayFormChooser.php
+++ b/special/GatewayFormChooser.php
@@ -125,7 +125,8 @@
 * to get one.
 * @param array $other_params An array of any params that DonationData
 * will harvest and understand.
-* @throw UnexpectedValueException
+* @throws MWException on ambiguous gateway or bad gateway name
+* @return string The form URL
 */
static function buildPaymentsFormURL( $form_key, $other_params = 
array() ) {
global $wgDonationInterfaceDefaultAppeal;
@@ -603,7 +604,8 @@
 * @param string $gateway The gateway used for the payment that failed
 * @param string $payment_method The code for the payment method that 
failed
 * @param string $payment_submethod Code for the payment submethod that 
failed
-* @throws RuntimeException
+* @throws RuntimeException if no form found
+* @return string The name of the best error form
 */
static function getBestErrorForm( $gateway, $payment_method, 
$payment_submethod = null ) {
global $wgDonationInterfaceAllowedHtmlForms;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia911d6b0964b26574470a56b8c3c27e04e4143c1
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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Fix parameters in phpDoc blocks

2018-01-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405004 )

Change subject: Fix parameters in phpDoc blocks
..

Fix parameters in phpDoc blocks

Add missing parameters, correct types, add descriptions.
Use @inheritdoc for overridden methods in subclasses

Change-Id: Ia837c71ef914df7977d05c934e8b85e32f2b3896
---
M adyen_gateway/AdyenHostedSignature.php
M adyen_gateway/FullNameWithExceptions.php
M adyen_gateway/adyen.adapter.php
M amazon_gateway/amazon.adapter.php
M astropay_gateway/AstroPayFinancialNumbers.php
M astropay_gateway/AstroPayMethodCodec.php
M astropay_gateway/astropay.adapter.php
M extras/custom_filters/custom_filters.body.php
M gateway_common/DonationData.php
M gateway_common/GatewayPage.php
M gateway_common/GatewayType.php
M gateway_common/StreetAddress.php
M gateway_common/gateway.adapter.php
M globalcollect_gateway/IngenicoMethodCodec.php
M globalcollect_gateway/globalcollect.adapter.php
M modules/CurrencyRatesModule.php
M paypal_gateway/express_checkout/paypal_express.adapter.php
M special/GatewayFormChooser.php
18 files changed, 45 insertions(+), 13 deletions(-)


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

diff --git a/adyen_gateway/AdyenHostedSignature.php 
b/adyen_gateway/AdyenHostedSignature.php
index 78fea55..8bb045a 100644
--- a/adyen_gateway/AdyenHostedSignature.php
+++ b/adyen_gateway/AdyenHostedSignature.php
@@ -3,6 +3,7 @@
 class AdyenHostedSignature implements StagingHelper {
/**
 * Sign the Adyen API request
+* @inheritdoc
 */
public function stage( GatewayType $adapter, $normalized, &$stagedData 
) {
$params = $adapter->buildRequestParams();
diff --git a/adyen_gateway/FullNameWithExceptions.php 
b/adyen_gateway/FullNameWithExceptions.php
index b14564c..637faca 100644
--- a/adyen_gateway/FullNameWithExceptions.php
+++ b/adyen_gateway/FullNameWithExceptions.php
@@ -5,6 +5,7 @@
 * We're automatically filling and hiding the cardholder name box, 
except
 * for Hebrew speakers, who Amir tells us enter contact name and billing
 * name in different scripts.
+* @inheritdoc
 * TODO: If anyone wants more languages on the list, make a config file
 */
public function stage( GatewayType $adapter, $normalized, &$stagedData 
) {
diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php
index 9a68fdb..673971f 100644
--- a/adyen_gateway/adyen.adapter.php
+++ b/adyen_gateway/adyen.adapter.php
@@ -159,6 +159,7 @@
/**
 * FIXME: I can't help but feel like it's bad that the parent's 
do_transaction
 * is never used at all.
+* @inheritdoc
 */
function do_transaction( $transaction ) {
$this->ensureUniqueOrderID();
diff --git a/amazon_gateway/amazon.adapter.php 
b/amazon_gateway/amazon.adapter.php
index 5f4eb4c..302d31f 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -217,6 +217,8 @@
 * we can check on the capture status.  TODO: determine if capture 
status
 * check is really needed.  According to our tech contact, Amazon 
guarantees
 * that the capture will eventually succeed if the authorization 
succeeds.
+* @param bool $recurring whether the payment is recurring
+* @throws ResponseProcessingException
 */
protected function authorizeAndCapturePayment( $recurring = false ) {
if ( $recurring ) {
@@ -381,6 +383,7 @@
/**
 * Replace decimal point with a dash to comply with Amazon's 
restrictions on
 * seller reference ID format.
+* @inheritdoc
 */
public function generateOrderID( $dataObj = null ) {
$dotted = parent::generateOrderID( $dataObj );
diff --git a/astropay_gateway/AstroPayFinancialNumbers.php 
b/astropay_gateway/AstroPayFinancialNumbers.php
index babc1ed..0fde4c9 100644
--- a/astropay_gateway/AstroPayFinancialNumbers.php
+++ b/astropay_gateway/AstroPayFinancialNumbers.php
@@ -9,6 +9,7 @@
/**
 * They need a 20 char string for a customer ID - give them the first 20
 * characters of the email address for easy lookup
+* @inheritdoc
 */
protected function stage_donor_id( GatewayType $adapter, $normalized, 
&$stagedData ) {
if ( !isset( $stagedData['email'] ) ) {
diff --git a/astropay_gateway/AstroPayMethodCodec.php 
b/astropay_gateway/AstroPayMethodCodec.php
index a064443..f2182c3 100644
--- a/astropay_gateway/AstroPayMethodCodec.php
+++ b/astropay_gateway/AstroPayMethodCodec.php
@@ -3,6 +3,7 @@
 class AstroPayMethodCodec implements UnstagingHelper {
/**
 * Transforms the astropay payment method into our method name
+* @inheritdoc
 */
public function unstage( 

[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Stop inserting extra 'A/B testing' boards

2018-01-09 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/327792 )

Change subject: Stop inserting extra 'A/B testing' boards
..


Stop inserting extra 'A/B testing' boards

Change-Id: Ibb3026cec2a6ce25bc82c8f0a1e5245c5f16d580
---
M schema/0002_abtesting.sql
1 file changed, 6 insertions(+), 5 deletions(-)

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



diff --git a/schema/0002_abtesting.sql b/schema/0002_abtesting.sql
index f632a71..37d3d0a 100644
--- a/schema/0002_abtesting.sql
+++ b/schema/0002_abtesting.sql
@@ -6,13 +6,14 @@
 insert ignore into dash_user (id, display_name)
value (1, 'Dev User');
 
--- TODO: Make idempotent
+set @board_count = ( select count(*) FROM dash_board WHERE display_name='A/B 
Testing' AND owner_id = 1 );
+
 insert ignore into dash_board (display_name, description, owner_id, is_shared)
-   values ('A/B Testing', 'Banner A/B test results', 1, true);
+   SELECT 'A/B Testing', 'Banner A/B test results', 1, 1
+   FROM dash_user u
+   WHERE id = 1 AND @board_count = 0;
 
-set @bid = (select id from dash_board where display_name = 'A/B Testing');
-
-update dash_user set default_board = @bid where id = 1;
+set @bid = (select id from dash_board where owner_id = 1 AND display_name = 
'A/B Testing');
 
 insert ignore into dash_widget_instance (widget_id, owner_id, display_name, 
is_shared)
select @wid, 1, display_name, 1 from dash_widget where id = @wid;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb3026cec2a6ce25bc82c8f0a1e5245c5f16d580
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Adyen test IPN messages: use right account

2018-01-09 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403230 )

Change subject: Adyen test IPN messages: use right account
..

Adyen test IPN messages: use right account

WikimediaCOM isn't the thing anymore, and we have that in the db.

What we DON'T have in the pending db is the actual PSP reference.
Right now, the only way to test actual interaction with the sandbox
server is to look at the donation in
https://ca-test.adyen.com/ca/ca/payments/showList.shtml
then edit the generated auth_success.x.xml and put in the correct
originalReference

Change-Id: If2c25c760e8862d1d6c696a6e5593cb736a47d33
---
M Maintenance/CreateIpnMessagesFromPendingDb.php
M Tests/IPNTemplates/adyen/auth_success.xml
M Tests/IPNTemplates/adyen/capture_success.xml
3 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/30/403230/1

diff --git a/Maintenance/CreateIpnMessagesFromPendingDb.php 
b/Maintenance/CreateIpnMessagesFromPendingDb.php
index 5fc6aff..dde83d5 100644
--- a/Maintenance/CreateIpnMessagesFromPendingDb.php
+++ b/Maintenance/CreateIpnMessagesFromPendingDb.php
@@ -84,6 +84,9 @@
$replacements['[[ASTROPAY_SIGNATURE_SUCCESS]]'] = 
$this->getAstroPaySignature( $pendingMessage, '9' );
$replacements['[[ASTROPAY_SIGNATURE_FAILURE]]'] = 
$this->getAstroPaySignature( $pendingMessage, '8' );
}
+   if ( isset( $pendingMessage['gateway_account'] ) ) {
+   $replacements['[[ACCOUNT_CODE]]'] = 
$pendingMessage['gateway_account'];
+   }
foreach ( $templates as $template ) {
$fullPath = $this->templateDir . $template;
if ( is_dir( $fullPath ) ) {
diff --git a/Tests/IPNTemplates/adyen/auth_success.xml 
b/Tests/IPNTemplates/adyen/auth_success.xml
index f053f3c..c004508 100644
--- a/Tests/IPNTemplates/adyen/auth_success.xml
+++ b/Tests/IPNTemplates/adyen/auth_success.xml
@@ -22,7 +22,7 @@


AUTHORISATION

2016-01-25T17:07:36.862+01:00
-   
WikimediaCOM
+   
[[ACCOUNT_CODE]]

[[ORDER_ID]]

CANCEL
diff --git a/Tests/IPNTemplates/adyen/capture_success.xml 
b/Tests/IPNTemplates/adyen/capture_success.xml
index 41cf808..fb22ca2 100644
--- a/Tests/IPNTemplates/adyen/capture_success.xml
+++ b/Tests/IPNTemplates/adyen/capture_success.xml
@@ -13,7 +13,7 @@
 
 CAPTURE
 2015-12-11T20:30:03+01:00
-WikimediaCOM
+
[[ACCOUNT_CODE]]
 [[ORDER_ID]]
 
 
[[PROCESSOR_REF_1]]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2c25c760e8862d1d6c696a6e5593cb736a47d33
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: WIP fix classmap for Adyen WSDL

2018-01-09 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403222 )

Change subject: WIP fix classmap for Adyen WSDL
..

WIP fix classmap for Adyen WSDL

And move options out of loop

Change-Id: I3ffbfcd70e78b87b8f128dcb58d50a25f69ecbaf
---
M PaymentProviders/Adyen/WSDL/Payment.php
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/22/403222/1

diff --git a/PaymentProviders/Adyen/WSDL/Payment.php 
b/PaymentProviders/Adyen/WSDL/Payment.php
index 0a92fee..7217d29 100644
--- a/PaymentProviders/Adyen/WSDL/Payment.php
+++ b/PaymentProviders/Adyen/WSDL/Payment.php
@@ -506,11 +506,11 @@
$this->retries = 
Context::get()->getProviderConfiguration()->val( 'curl/retries' );
foreach ( self::$classmap as $key => $value ) {
if ( !isset( $options['classmap'][$key] ) ) {
-   $options['classmap'][$key] = $value;
+   $options['classmap'][$key] = 
'\SmashPig\PaymentProviders\Adyen\WSDL\\' . $value;
}
-   $options['connection_timeout'] = 
Context::get()->getProviderConfiguration()->val( 'curl/timeout' );
-   $options['exceptions'] = true;
}
+   $options['connection_timeout'] = 
Context::get()->getProviderConfiguration()->val( 'curl/timeout' );
+   $options['exceptions'] = true;
parent::__construct( $wsdl, $options );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ffbfcd70e78b87b8f128dcb58d50a25f69ecbaf
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into deployment

2018-01-09 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403217 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

88ed4c9 Use newer construct function
daee116 Revert "Add logging for debugging"

Change-Id: Iff8842c3f07f598b133b43079bd74bc00f66c68b
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/17/403217/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff8842c3f07f598b133b43079bd74bc00f66c68b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Revert "Add logging for debugging"

2018-01-09 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/403201 )

Change subject: Revert "Add logging for debugging"
..


Revert "Add logging for debugging"

This reverts commit bc9a8a8e29cf6cabaae697ad3bb8eb62ddb18a29.

Change-Id: I6874b9412c51928a07536a69f3fb64c57ecc
---
M PaymentProviders/Adyen/AdyenPaymentsAPI.php
M PaymentProviders/Adyen/WSDL/Payment.php
2 files changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/PaymentProviders/Adyen/AdyenPaymentsAPI.php 
b/PaymentProviders/Adyen/AdyenPaymentsAPI.php
index 8f2068b..cf1d555 100644
--- a/PaymentProviders/Adyen/AdyenPaymentsAPI.php
+++ b/PaymentProviders/Adyen/AdyenPaymentsAPI.php
@@ -43,7 +43,6 @@
 
try {
$resp = $this->soapClient->capture( $data );
-   Logger::info( 'Adyen capture response', print_r( $resp 
) );
} catch ( \Exception $ex ) {
Logger::error( 'SOAP capture request threw exception!', 
null, $ex );
return false;
diff --git a/PaymentProviders/Adyen/WSDL/Payment.php 
b/PaymentProviders/Adyen/WSDL/Payment.php
index 85dad94..0a92fee 100644
--- a/PaymentProviders/Adyen/WSDL/Payment.php
+++ b/PaymentProviders/Adyen/WSDL/Payment.php
@@ -636,7 +636,6 @@
 
protected function makeApiCall ( $path, $parameters ) {
$count = 0;
-   Logger::info( 'Adyen payments retries value', print_r( 
$this->retries ) );
while ( $count < $this->retries ) {
try {
return $this->__soapCall(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6874b9412c51928a07536a69f3fb64c57ecc
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Mepps 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Revert "Add logging for debugging"

2018-01-09 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403201 )

Change subject: Revert "Add logging for debugging"
..

Revert "Add logging for debugging"

This reverts commit bc9a8a8e29cf6cabaae697ad3bb8eb62ddb18a29.

Change-Id: I6874b9412c51928a07536a69f3fb64c57ecc
---
M PaymentProviders/Adyen/AdyenPaymentsAPI.php
M PaymentProviders/Adyen/WSDL/Payment.php
2 files changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/01/403201/1

diff --git a/PaymentProviders/Adyen/AdyenPaymentsAPI.php 
b/PaymentProviders/Adyen/AdyenPaymentsAPI.php
index 8f2068b..cf1d555 100644
--- a/PaymentProviders/Adyen/AdyenPaymentsAPI.php
+++ b/PaymentProviders/Adyen/AdyenPaymentsAPI.php
@@ -43,7 +43,6 @@
 
try {
$resp = $this->soapClient->capture( $data );
-   Logger::info( 'Adyen capture response', print_r( $resp 
) );
} catch ( \Exception $ex ) {
Logger::error( 'SOAP capture request threw exception!', 
null, $ex );
return false;
diff --git a/PaymentProviders/Adyen/WSDL/Payment.php 
b/PaymentProviders/Adyen/WSDL/Payment.php
index 85dad94..0a92fee 100644
--- a/PaymentProviders/Adyen/WSDL/Payment.php
+++ b/PaymentProviders/Adyen/WSDL/Payment.php
@@ -636,7 +636,6 @@
 
protected function makeApiCall ( $path, $parameters ) {
$count = 0;
-   Logger::info( 'Adyen payments retries value', print_r( 
$this->retries ) );
while ( $count < $this->retries ) {
try {
return $this->__soapCall(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6874b9412c51928a07536a69f3fb64c57ecc
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-16819 improve on CRM_Utils_Request::retrieve

2018-01-08 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402905 )

Change subject: CRM-16819 improve on CRM_Utils_Request::retrieve
..


CRM-16819 improve on CRM_Utils_Request::retrieve

I'm proposing this as an improved (but not perfect) way to retrieve data from 
http requests.

The biggest issue IMHO with the CRM_Utils_Request::retrieve method is that the 
third
parameter is & - and if any of the subsequent parameters need to be passed a 
NULL
array must be generated. The practice of passing a specific static NULL array 
is known to
have caused errors due to contamination. This commit offers an alternate 
function without that
parameter (my suggestion is to create a new function again where we really do 
want  to
work but in general it seems flakey to me). I have also re-ordered the 
parameters as I perceive
 as being more commonly required than  (renamed from 'abort').

I have also made it so the new function will throw an exception rather than use 
the deprecated
fatal - as a new function I feel we can enforce this change and I have made 
some changes
to the error message thrown in the validate function so it returns a list of 
permissable
values for the  string as the existing error is hard for developers to work 
with, as it
can be hard to realise why 'int' is wrong (casing) or what should have been 
passed.

Finally I made the visibility on CRM_Utils_Retrieve::getValues protected. This 
function
is not called from within core & is downright unsafe as it does no validation 
so we should
not permit anyone to accidentally use it (I have no reason to think they have

Change-Id: I5531ed061cf3b7f486aa57d073b425d0874c4df0
---
M CRM/Utils/Request.php
M CRM/Utils/Type.php
2 files changed, 77 insertions(+), 14 deletions(-)

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



diff --git a/CRM/Utils/Request.php b/CRM/Utils/Request.php
index 2748e07..ad6bf09 100644
--- a/CRM/Utils/Request.php
+++ b/CRM/Utils/Request.php
@@ -79,17 +79,15 @@
*   Default value of the variable if not present.
* @param string $method
*   Where to look for the variable - 'GET', 'POST' or 'REQUEST'.
+   * @param bool $isThrowException
+   *   Should a an exception be thrown rather than a fatal.
*
* @return mixed
*   The value of the variable
+   *
+   * @throws \CRM_Core_Exception
*/
-  public static function retrieve($name, $type, &$store = NULL, $abort = 
FALSE, $default = NULL, $method = 'REQUEST') {
-
-// hack to detect stuff not yet converted to new style
-if (!is_string($type)) {
-  CRM_Core_Error::backtrace();
-  CRM_Core_Error::fatal(ts("Please convert retrieve call to use new 
function signature"));
-}
+  public static function retrieve($name, $type, &$store = NULL, $abort = 
FALSE, $default = NULL, $method = 'REQUEST', $isThrowException = FALSE) {
 
 $value = NULL;
 switch ($method) {
@@ -117,6 +115,9 @@
 }
 
 if (!isset($value) && $abort) {
+  if ($isThrowException) {
+throw new CRM_Core_Exception(ts("Could not find valid value for %1", 
array(1 => $name)));
+  }
   CRM_Core_Error::fatal(ts("Could not find valid value for %1", array(1 => 
$name)));
 }
 
@@ -145,7 +146,7 @@
* @return mixed
*The value of the variable
*/
-  public static function getValue($name, $method) {
+  protected static function getValue($name, $method) {
 if (isset($method[$name])) {
   return $method[$name];
 }
@@ -165,6 +166,10 @@
   }
 
   /**
+   * @deprecated
+   *
+   * We should use a function that checks url values.
+   *
* This is a replacement for $_REQUEST which includes $_GET/$_POST
* but excludes $_COOKIE / $_ENV / $_SERVER.
*
@@ -186,4 +191,32 @@
 return $result;
   }
 
+  /**
+   * Retrieve a variable from the http request.
+   *
+   * @param string $name
+   *   Name of the variable to be retrieved.
+   * @param string $type
+   *   Type of the variable (see CRM_Utils_Type for details).
+   *   Most common options are:
+   *   - 'Integer'
+   *   - 'Positive'
+   *   - 'CommaSeparatedIntegers'
+   *   - 'Boolean'
+   *   - 'String'
+   *
+   * @param mixed $defaultValue
+   *   Default value of the variable if not present.
+   * @param bool $isRequired
+   *   Is the variable required for this function to proceed without an 
exception.
+   * @param string $method
+   *   Where to look for the value - GET|POST|REQUEST
+   *
+   * @return mixed
+   */
+  public static function retrieveValue($name, $type, $defaultValue = NULL, 
$isRequired = FALSE, $method = 'REQUEST') {
+$null = NULL;
+return CRM_Utils_Request::retrieve((string) $name, (string) $type, $null, 
(bool) $isRequired, $defaultValue, $method, TRUE);
+  }
+
 }
diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php
index fbe1c93..48e575e 100644
--- a/CRM/Utils/Type.php
+++ b/CRM/Utils/Type.php
@@ -369,13 +369,44 @@
*   The 

[MediaWiki-commits] [Gerrit] wikimedia...vendor[master]: Update Amazon SDK

2018-01-08 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402889 )

Change subject: Update Amazon SDK
..


Update Amazon SDK

Change-Id: If3cf11e0883d512e1bd817797bb4b6c62961d6db
---
A amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/PaymentsClient.php
M amzn/login-and-pay-with-amazon-sdk-php/composer.json
M composer/installed.json
6 files changed, 90 insertions(+), 72 deletions(-)

Approvals:
  Ejegg: Verified; Looks good to me, approved



diff --git a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php
new file mode 100644
index 000..4285620
--- /dev/null
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php
@@ -0,0 +1,18 @@
+ $value)
+{
+if(!is_null($value) && !is_array($value) && 
$key!=='proxy_password')
+{
+$array[$key] = trim($value);
+}
+}
+return $array;
+}
+}
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
index 899ae49..9ede9f2 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
@@ -1,5 +1,7 @@
  null,
'proxy_password'   => null,
'client_id'=> null,
-   'handle_throttle'  => true
+   'handle_throttle'  => true,
+'logger'=> null
);
 
 protected $modePath = null;
@@ -81,6 +90,17 @@
 $this->checkConfigKeys($configArray);
 } else {
 throw new \Exception('$config is of the incorrect type ' . 
gettype($configArray) . ' and should be of the type array');
+}
+if (empty($configArray['logger'])) {
+$this->logger = new NullLogger();
+} else {
+if ($configArray['logger'] instanceof LoggerInterface) {
+$this->logger = $configArray['logger'];
+} else {
+throw new \InvalidArgumentException(
+'Logger passed in config must implement 
Psr\Log\LoggerInterface'
+);
+}
 }
 } else {
throw new \Exception('$config cannot be null.');
@@ -127,7 +147,7 @@
 private function checkConfigKeys($config)
 {
 $config = array_change_key_case($config, CASE_LOWER);
-   $config = $this->trimArray($config);
+   $config = ArrayUtil::trimArray($config);
 
 foreach ($config as $key => $value) {
 if (array_key_exists($key, $this->config)) {
@@ -245,20 +265,6 @@
 public function getParameters()
 {
return trim($this->parameters);
-}
-
-/* Trim the input Array key values */
-
-protected function trimArray($array)
-{
-   foreach ($array as $key => $value)
-   {
-   if(!is_array($value) && $key!=='proxy_password')
-   {
-   $array[$key] = trim($value);
-   }
-   }
-   return $array;
 }
 
 /* setParametersAndPost - sets the parameters array with non empty values 
from the requestParameters array sent to API calls.
@@ -560,6 +566,7 @@
 $this->pauseOnRetry(++$retries, $statusCode);
 }
 } else {
+$this->logger->info("Returned status code $statusCode, 
not retrying.");
 $shouldRetry = false;
 }
 } catch (\Exception $e) {
@@ -582,6 +589,7 @@
 {
 if ($retries <= self::MAX_ERROR_RETRY) {
 $delay = (int) (pow(4, $retries) * $this->basePause);
+$this->logger->info("Returned status code $status on try $retries, 
waiting $delay microseconds.");
 usleep($delay);
 } else {
 throw new \Exception('Error Code: '. $status.PHP_EOL.'Maximum 
number of retry attempts - '. $retries .' reached');
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
index 2514af1..94318a0 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
@@ -5,9 +5,10 @@
  * Takes headers and body of the IPN message as input in the constructor
  * verifies that the IPN is from the right resource and has the 

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into deployment

2018-01-08 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402890 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

And update vendor submodule

6b519d0 Update Amazon SDK fork for array trim fix
89e7d21 Add missing action to Amazon config
bc9a8a8 Add logging for debugging

Change-Id: I8d7cc9609b3f4774839750c79d3c02afa7d4792b
---
M vendor
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/90/402890/1

diff --git a/vendor b/vendor
index b89734d..7b97158 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit b89734d24e091d9c01b11a71e81e666a1906cc7b
+Subproject commit 7b97158d84f6e0bc9601a64565d43465f9d9d9cf

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d7cc9609b3f4774839750c79d3c02afa7d4792b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...vendor[master]: Update Amazon SDK

2018-01-08 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402889 )

Change subject: Update Amazon SDK
..

Update Amazon SDK

Change-Id: If3cf11e0883d512e1bd817797bb4b6c62961d6db
---
A amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/PaymentsClient.php
M amzn/login-and-pay-with-amazon-sdk-php/composer.json
M composer/installed.json
6 files changed, 90 insertions(+), 72 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig/vendor 
refs/changes/89/402889/1

diff --git a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php
new file mode 100644
index 000..4285620
--- /dev/null
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/ArrayUtil.php
@@ -0,0 +1,18 @@
+ $value)
+{
+if(!is_null($value) && !is_array($value) && 
$key!=='proxy_password')
+{
+$array[$key] = trim($value);
+}
+}
+return $array;
+}
+}
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
index 899ae49..9ede9f2 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
@@ -1,5 +1,7 @@
  null,
'proxy_password'   => null,
'client_id'=> null,
-   'handle_throttle'  => true
+   'handle_throttle'  => true,
+'logger'=> null
);
 
 protected $modePath = null;
@@ -81,6 +90,17 @@
 $this->checkConfigKeys($configArray);
 } else {
 throw new \Exception('$config is of the incorrect type ' . 
gettype($configArray) . ' and should be of the type array');
+}
+if (empty($configArray['logger'])) {
+$this->logger = new NullLogger();
+} else {
+if ($configArray['logger'] instanceof LoggerInterface) {
+$this->logger = $configArray['logger'];
+} else {
+throw new \InvalidArgumentException(
+'Logger passed in config must implement 
Psr\Log\LoggerInterface'
+);
+}
 }
 } else {
throw new \Exception('$config cannot be null.');
@@ -127,7 +147,7 @@
 private function checkConfigKeys($config)
 {
 $config = array_change_key_case($config, CASE_LOWER);
-   $config = $this->trimArray($config);
+   $config = ArrayUtil::trimArray($config);
 
 foreach ($config as $key => $value) {
 if (array_key_exists($key, $this->config)) {
@@ -245,20 +265,6 @@
 public function getParameters()
 {
return trim($this->parameters);
-}
-
-/* Trim the input Array key values */
-
-protected function trimArray($array)
-{
-   foreach ($array as $key => $value)
-   {
-   if(!is_array($value) && $key!=='proxy_password')
-   {
-   $array[$key] = trim($value);
-   }
-   }
-   return $array;
 }
 
 /* setParametersAndPost - sets the parameters array with non empty values 
from the requestParameters array sent to API calls.
@@ -560,6 +566,7 @@
 $this->pauseOnRetry(++$retries, $statusCode);
 }
 } else {
+$this->logger->info("Returned status code $statusCode, 
not retrying.");
 $shouldRetry = false;
 }
 } catch (\Exception $e) {
@@ -582,6 +589,7 @@
 {
 if ($retries <= self::MAX_ERROR_RETRY) {
 $delay = (int) (pow(4, $retries) * $this->basePause);
+$this->logger->info("Returned status code $status on try $retries, 
waiting $delay microseconds.");
 usleep($delay);
 } else {
 throw new \Exception('Error Code: '. $status.PHP_EOL.'Maximum 
number of retry attempts - '. $retries .' reached');
diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
index 2514af1..94318a0 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/IpnHandler.php
@@ -5,9 +5,10 @@
  * Takes headers and body of the IPN message as input in the constructor
  * verifies that the 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: WIP donationInterface settings update

2018-01-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402404 )

Change subject: WIP donationInterface settings update
..

WIP donationInterface settings update

Change-Id: Id9b41d6c658cbc84315717f157e8902aa6b01b98
---
M puppet/modules/payments/manifests/donation_interface.pp
1 file changed, 2 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/04/402404/1

diff --git a/puppet/modules/payments/manifests/donation_interface.pp 
b/puppet/modules/payments/manifests/donation_interface.pp
index ba5009f..d851b7a 100644
--- a/puppet/modules/payments/manifests/donation_interface.pp
+++ b/puppet/modules/payments/manifests/donation_interface.pp
@@ -6,10 +6,12 @@
   mediawiki::extension { 'payments:DonationInterface':
 settings => {
   wgGlobalCollectGatewayEnabled => true,
+  wgIngenicoGatewayEnabled  => true,
   wgAdyenGatewayEnabled => true,
   wgAmazonGatewayEnabled=> true,
   wgAstroPayGatewayEnabled  => true,
   wgPaypalGatewayEnabled=> true,
+  wgPaypalExpressGatewayEnabled => true,
   wgDonationInterfaceEnableFormChooser  => true,
   wgDonationInterfaceEnableBannerHistoryLog => true,
   wgDonationInterfaceEnableQueue=> true,
@@ -43,23 +45,6 @@
 
   wgDonationInterfaceUseSyslog  => true,
 
-  wgDonationInterfaceDefaultQueueServer => {
-'type'=> 'PHPQueue\Backend\Predis',
-'servers' => 'tcp://localhost',
-  },
-
-  wgDonationInterfaceQueues => {
-'complete' => {
-  'queue' => 'donations',
-},
-  },
-
-  wgDonationInterfaceOrphanCron => {
-'enable'   => true,
-'max_per_execute'  => '',
-'override_command_line_params' => true,
-'target_execute_time'  => 300,
-  },
 },
 needs_update => true,
 require  => [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9b41d6c658cbc84315717f157e8902aa6b01b98
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Update Amazon SDK fork for array trim fix

2018-01-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402378 )

Change subject: Update Amazon SDK fork for array trim fix
..

Update Amazon SDK fork for array trim fix

Change-Id: I144a7ab114e320cf84b7e13debed7c6dac37f9fd
---
M composer.lock
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/78/402378/1

diff --git a/composer.lock b/composer.lock
index da5cb72..80ac4ff 100644
--- a/composer.lock
+++ b/composer.lock
@@ -12,11 +12,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/ejegg/login-and-pay-with-amazon-sdk-php;,
-"reference": "855d642f85f14c76ca810013b0323ae4ac37f1c6"
+"reference": "3349385d31f214fc2d2b7f68af289a957458559c"
 },
 "require": {
 "ext-curl": "*",
-"php": ">=5.3.0"
+"php": ">=5.3.0",
+"psr/log": "^1.0"
 },
 "type": "library",
 "autoload": {
@@ -43,7 +44,7 @@
 "payment",
 "payments"
 ],
-"time": "2016-02-17T00:44:20+00:00"
+"time": "2018-01-05T16:31:47+00:00"
 },
 {
 "name": "clio/clio",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I144a7ab114e320cf84b7e13debed7c6dac37f9fd
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: WIP SmashPig url aliases, including Amazon test

2018-01-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402373 )

Change subject: WIP SmashPig url aliases, including Amazon test
..

WIP SmashPig url aliases, including Amazon test

Change-Id: I8d2505d673af648fc6f0fe92375ad1b954039239
---
M puppet/modules/smashpig/templates/apache-site.erb
1 file changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/73/402373/1

diff --git a/puppet/modules/smashpig/templates/apache-site.erb 
b/puppet/modules/smashpig/templates/apache-site.erb
index 941b6c0..558623a 100644
--- a/puppet/modules/smashpig/templates/apache-site.erb
+++ b/puppet/modules/smashpig/templates/apache-site.erb
@@ -2,8 +2,25 @@
 
 ServerName <%= scope.lookupvar('smashpig::vhost_name') %>
 
+RewriteEngine on
+RewriteRule ^/adyen /smashpig_http_handler.php?p=adyen/listener [L,QSA]
+RewriteRule ^/amazon /smashpig_http_handler.php?p=amazon/listener [L,QSA]
+RewriteRule ^/astropay /smashpig_http_handler.php?p=astropay/listener [L,QSA]
+RewriteRule ^/globalcollect 
/smashpig_http_handler.php?p=globalcollect/listener [L,QSA]
+RewriteRule ^/paypal /smashpig_http_handler.php?p=paypal/listener [L,QSA]
+
+Alias /amazontest <%= scope.lookupvar('smashpig::dir') 
%>/PaymentProviders/Amazon/Tests/manual/
+
+Index index.html
+
 /PublicHttp">
 Options -Indexes
 AllowOverride all
 Require all granted
 
+
+/PaymentProviders/Amazon/Tests/manual/">
+Options -Indexes
+AllowOverride all
+Require all granted
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d2505d673af648fc6f0fe92375ad1b954039239
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Add missing action to Amazon config

2018-01-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402368 )

Change subject: Add missing action to Amazon config
..

Add missing action to Amazon config

Oops, the RetryAuth never actually happens unless this is here!

Bug: T183429
Change-Id: I55d8cbae1fd33fef890005f1951eb58cabbe8b00
---
M config/amazon/main.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/68/402368/1

diff --git a/config/amazon/main.yaml b/config/amazon/main.yaml
index 341a189..bc6c74b 100644
--- a/config/amazon/main.yaml
+++ b/config/amazon/main.yaml
@@ -8,6 +8,7 @@
 - SmashPig\PaymentProviders\Amazon\Actions\ReconstructMerchantReference
 - SmashPig\PaymentProviders\Amazon\Actions\CloseOrderReference
 - SmashPig\PaymentProviders\Amazon\Actions\AssociateRefundParent
+- SmashPig\PaymentProviders\Amazon\Actions\RetryAuthorization
 - SmashPig\PaymentProviders\Amazon\Actions\AddMessageToQueue
 
 endpoints:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55d8cbae1fd33fef890005f1951eb58cabbe8b00
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: YAML null: magic string instead of ~

2018-01-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402365 )

Change subject: YAML null: magic string instead of ~
..

YAML null: magic string instead of ~

Oops, ~ was coming through as the empty string!

Bug: T180168
Change-Id: I63b63ddb6da2b56171694a43edae5414fed032ba
---
M config/amazon/main.yaml
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/65/402365/1

diff --git a/config/amazon/main.yaml b/config/amazon/main.yaml
index a305af4..341a189 100644
--- a/config/amazon/main.yaml
+++ b/config/amazon/main.yaml
@@ -28,11 +28,11 @@
 sandbox: false
 
 proxy: 
-cabundle_file: ~ # /path/to/file
-proxy_host: ~ # 192.168.1.1
+cabundle_file: null # /path/to/file
+proxy_host: null # 192.168.1.1
 proxy_port: -1 # 8080
-proxy_username: ~ # proxyme
-proxy_password: ~ # plz
+proxy_username: null # proxyme
+proxy_password: null # plz
 
 # Override these to mock the Amazon SDK classes
 payments-client:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63b63ddb6da2b56171694a43edae5414fed032ba
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule

2018-01-02 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401539 )

Change subject: Update DonationInterface submodule
..

Update DonationInterface submodule

Change-Id: I435f73f56b5f1cf7d2bfa3c25f95179753e14cf1
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/401539/1

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 7e7b8df..6ddd13b 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 7e7b8dfcf1223cf3f5fbed2567a96d834e054e96
+Subproject commit 6ddd13bb7b227354a5338745b587ca3d9e69497a

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I435f73f56b5f1cf7d2bfa3c25f95179753e14cf1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment

2018-01-02 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401536 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

5d4269989 Localisation updates from https://translatewiki.net.
5065f0d4e Localisation updates from https://translatewiki.net.
8e6d7e503 Localisation updates from https://translatewiki.net.
069194486 Localisation updates from https://translatewiki.net.
cefc205d1 Properly serialize Amazon error messages
3c11fcc44 Amazon: show TY page on TransactionTimedOut
22ac6cb24 Localisation updates from https://translatewiki.net.
a3230c602 Localisation updates from https://translatewiki.net.
d3bfa632f Localisation updates from https://translatewiki.net.

Change-Id: I9d0fa9e700596c80034053c8055e0f153978a70f
---
D tests/phpunit/Adapter/Amazon/AmazonApiTest.php
D tests/phpunit/Adapter/Amazon/AmazonTest.php
2 files changed, 0 insertions(+), 401 deletions(-)


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

diff --git a/tests/phpunit/Adapter/Amazon/AmazonApiTest.php 
b/tests/phpunit/Adapter/Amazon/AmazonApiTest.php
deleted file mode 100644
index 3042a5b..000
--- a/tests/phpunit/Adapter/Amazon/AmazonApiTest.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<<< HEAD   (7e7b8d Update vendor submodule)
-===
-providerConfig = 
DonationInterface_Adapter_Amazon_Test::setUpAmazonTestingContext( $this );
-   }
-
-   public function testDoPaymentSuccess() {
-   $params = array(
-   'amount' => '1.55',
-   'currency' => 'USD',
-   'recurring' => '0',
-   'wmf_token' => 'e601502632e5e51dc2a17a0045162272+\\',
-   'orderReferenceId' => mt_rand( 0, 1000 ),
-   'action' => 'di_amazon_bill',
-   );
-   $session = array(
-   'Donor' => array(
-   'amount' => '1.55',
-   'currency' => 'USD',
-   'recurring' => '0',
-   'contribution_tracking_id' => mt_rand( 0, 
1000 ),
-   'country' => 'US',
-   ),
-   'amazonEditToken' => 'kjaskdjahsdkjsad',
-   );
-   $apiResult = $this->doApiRequest( $params, $session );
-   $redirect = $apiResult[0]['redirect'];
-   $this->assertEquals( 
'https://wikimediafoundation.org/wiki/Thank_You/en?country=US', $redirect );
-   $mockClient = $this->providerConfig->object( 'payments-client' 
);
-   $setOrderReferenceDetailsArgs = 
$mockClient->calls['setOrderReferenceDetails'][0];
-   $oid = $session['Donor']['contribution_tracking_id'] . '-1';
-   $this->assertEquals( $oid, 
$setOrderReferenceDetailsArgs['seller_order_id'], 'Did not set order id on 
order reference' );
-   $this->assertEquals( $params['amount'], 
$setOrderReferenceDetailsArgs['amount'], 'Did not set amount on order 
reference' );
-
-   $this->assertEquals( $params['currency'], 
$setOrderReferenceDetailsArgs['currency_code'], 'Did not set currency code on 
order reference' );
-   $message = QueueWrapper::getQueue( 'donations' )->pop();
-   $this->assertNotNull( $message, 'Not sending a message to the 
donations queue' );
-   $this->assertEquals( 'S01-0391295-0674065-C095112', 
$message['gateway_txn_id'], 'Queue message has wrong txn ID' );
-   }
-
-   /**
-* InvalidPaymentMethod error should show an error message in the
-* 'general' section.
-*/
-   public function testDoPaymentErrors() {
-   $params = array(
-   'amount' => '1.55',
-   'currency' => 'USD',
-   'recurring' => '0',
-   'wmf_token' => 'e601502632e5e51dc2a17a0045162272+\\',
-   'orderReferenceId' => mt_rand( 0, 1000 ),
-   'action' => 'di_amazon_bill',
-   );
-   $session = array(
-   'Donor' => array(
-   'amount' => '1.55',
-   'currency' => 'USD',
-   'recurring' => '0',
-   'contribution_tracking_id' => mt_rand( 0, 
1000 ),
-   'country' => 'US',
-   ),
-   'amazonEditToken' => 'kjaskdjahsdkjsad',
-   );
-   $mockClient = $this->providerConfig->object( 'payments-client' 
);
-   $mockClient->returns['authorize'][] = 'InvalidPaymentMethod';
-
-   $apiResult = $this->doApiRequest( $params, $session );
-   

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Fallback on NumberFormatter construct failure

2017-12-22 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399884 )

Change subject: Fallback on NumberFormatter construct failure
..

Fallback on NumberFormatter construct failure

Looks like the constructor returns null in some cases - maybe
impossible locales?

Bug: T182737
Change-Id: I29d2cca071743bb810f28bcf9547164bd4549ba2
---
M gateway_common/Amount.php
1 file changed, 7 insertions(+), 6 deletions(-)


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

diff --git a/gateway_common/Amount.php b/gateway_common/Amount.php
index f02d0f5..cfe11ac 100644
--- a/gateway_common/Amount.php
+++ b/gateway_common/Amount.php
@@ -174,12 +174,13 @@
$amount = self::round( $amount, $currencyCode );
if ( class_exists( 'NumberFormatter' ) ) {
$formatter = new NumberFormatter( $locale, 
NumberFormatter::CURRENCY );
-   return $formatter->formatCurrency(
-   floatval( $amount ),
-   $currencyCode
-   );
-   } else {
-   return "$amount $currencyCode";
+   if ( $formatter instanceof NumberFormatter ) {
+   return $formatter->formatCurrency(
+   floatval( $amount ),
+   $currencyCode
+   );
+   }
}
+   return "$amount $currencyCode";
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29d2cca071743bb810f28bcf9547164bd4549ba2
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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: WIP Amazon: automatic retry on TransactionTimedOut

2017-12-22 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399841 )

Change subject: WIP Amazon: automatic retry on TransactionTimedOut
..

WIP Amazon: automatic retry on TransactionTimedOut

Donor services has been doing this by hand

Bug: T183429
Change-Id: Ia959ac2e6efc27ddd2527d8aa38b153946132ff8
---
A PaymentProviders/Amazon/Actions/RetryAuthorization.php
M PaymentProviders/Amazon/AmazonListener.php
M PaymentProviders/Amazon/ExpatriatedMessages/AmazonMessage.php
A PaymentProviders/Amazon/ExpatriatedMessages/AuthorizationDeclined.php
A PaymentProviders/Amazon/ExpatriatedMessages/PaymentAuthorization.php
A PaymentProviders/Amazon/ReasonCode.php
A PaymentProviders/Amazon/Tests/Data/IPN/AuthorizationDeclined.json
7 files changed, 189 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/41/399841/1

diff --git a/PaymentProviders/Amazon/Actions/RetryAuthorization.php 
b/PaymentProviders/Amazon/Actions/RetryAuthorization.php
new file mode 100644
index 000..e81324b
--- /dev/null
+++ b/PaymentProviders/Amazon/Actions/RetryAuthorization.php
@@ -0,0 +1,66 @@
+getReasonCode() === 
ReasonCode::TRANSACTION_TIMED_OUT ) ) {
+   return true;
+   }
+   $config = Context::get()->getProviderConfiguration();
+
+   /**
+* @var PaymentsClientInterface $client
+*/
+   $client = $config->object( 'payments-client', true );
+
+   $orderReferenceId = $msg->getOrderReferenceId();
+
+   Logger::info(
+   "Retrying timed-out authorization on order reference 
$orderReferenceId"
+   );
+
+   try {
+   $response = $client->authorize(
+   [
+   'amazon_order_reference_id' => 
$orderReferenceId,
+   'authorization_amount' => 
$msg->getGross(),
+   'currency_code' => $msg->getCurrency(),
+   'capture_now' => true, // combine 
authorize and capture steps
+   'authorization_reference_id' => 
$msg->getOrderId(),
+   'transaction_timeout' => 1440, // whole 
day to retry
+   ]
+   )->toArray();
+
+   if ( !empty( $response['Error'] ) ) {
+   Logger::warning(
+   "Error retrying auth on order reference 
$orderReferenceId: " .
+   $response['Error']['Code'] . ': ' .
+   $response['Error']['Message']
+   );
+   return false;
+   }
+   } catch ( Exception $ex ) {
+   Logger::warning(
+   "Error retrying auth on order reference 
$orderReferenceId: " .
+   $ex->getMessage()
+   );
+   return false;
+   }
+
+   return true;
+   }
+}
diff --git a/PaymentProviders/Amazon/AmazonListener.php 
b/PaymentProviders/Amazon/AmazonListener.php
index d40a6e7..1351e2c 100644
--- a/PaymentProviders/Amazon/AmazonListener.php
+++ b/PaymentProviders/Amazon/AmazonListener.php
@@ -21,6 +21,9 @@
'Completed' => 
'SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\RefundCompleted',
'Declined' => 
'SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\RefundDeclined',
],
+   'PaymentAuthorize' => [
+   'Declined' => 
'SmashPig\PaymentProviders\Amazon\ExpatriatedMessages\AuthorizationDeclined',
+   ]
];
 
protected function parseEnvelope( Request $request ) {
@@ -87,6 +90,8 @@
return 
$values['CaptureDetails']['CaptureStatus']['State'];
case 'PaymentRefund':
return 
$values['RefundDetails']['RefundStatus']['State'];
+   case 'PaymentAuthorize':
+   return 
$values['AuthorizationDetails']['AuthorizationStatus']['State'];
default:
return false;
}
diff --git a/PaymentProviders/Amazon/ExpatriatedMessages/AmazonMessage.php 
b/PaymentProviders/Amazon/ExpatriatedMessages/AmazonMessage.php
index 2939874..43b0273 100644
--- a/PaymentProviders/Amazon/ExpatriatedMessages/AmazonMessage.php
+++ b/PaymentProviders/Amazon/ExpatriatedMessages/AmazonMessage.php
@@ -34,6 +34,14 @@
return true;
}
 
+   public function 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Amazon: show TY page on TransactionTimedOut

2017-12-22 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399832 )

Change subject: Amazon: show TY page on TransactionTimedOut
..

Amazon: show TY page on TransactionTimedOut

Show the TY page when donor services might push a payment through.

Bug: T183429
Change-Id: I7aa643f9014bdc9fd6b394e44c1ff130a998422e
---
M amazon_gateway/amazon.adapter.php
M tests/phpunit/Adapter/Amazon/AmazonTest.php
2 files changed, 24 insertions(+), 5 deletions(-)


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

diff --git a/amazon_gateway/amazon.adapter.php 
b/amazon_gateway/amazon.adapter.php
index 274fbd6..27c8920 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -49,12 +49,16 @@
 
// When an authorization or capture is declined, some reason codes 
indicate
// a situation where the donor can retry later or try a different card
-   protected $retry_errors = array(
+   protected $retry_reasons = array(
'InternalServerError',
'RequestThrottled',
'ServiceUnavailable',
'ProcessingFailure',
'InvalidPaymentMethod',
+   );
+
+   protected $pending_reasons = array(
+   'TransactionTimedOut',
);
 
function __construct( $options = array() ) {
@@ -411,12 +415,22 @@
 */
public function handleErrors( $exception, $resultData ) {
$errorCode = $exception->getErrorCode();
+   if ( array_search( $errorCode, $this->pending_reasons ) !== 
false ) {
+   // These reason codes mean the donation is in limbo. We 
can't
+   // do anything more about it right now, but donor 
services might
+   // push it through manually later.
+   $this->logger->info(
+   "Setting final status to pending on decline 
reason $errorCode"
+   );
+   $this->finalizeInternalStatus( FinalStatus::PENDING );
+   return;
+   }
$resultData->addError( new PaymentError(
$errorCode,
$exception->getMessage(),
LogLevel::ERROR
) );
-   if ( array_search( $errorCode, $this->retry_errors ) === false 
) {
+   if ( array_search( $errorCode, $this->retry_reasons ) === false 
) {
// Fail on anything we don't recognize as retry-able.  
For example:
// These two may show up if we start doing asynchronous 
authorization
// 'AmazonClosed',
diff --git a/tests/phpunit/Adapter/Amazon/AmazonTest.php 
b/tests/phpunit/Adapter/Amazon/AmazonTest.php
index a949780..dc4fa6a 100644
--- a/tests/phpunit/Adapter/Amazon/AmazonTest.php
+++ b/tests/phpunit/Adapter/Amazon/AmazonTest.php
@@ -219,8 +219,8 @@
}
 
/**
-* When the transaction times out, just gotta fail it till we work out 
an
-* asynchronous authorization flow
+* When the transaction times out, show the thank you page and call the
+* payment 'pending'.
 */
function testTransactionTimedOut() {
$init = $this->getDonorTestData( 'US' );
@@ -237,7 +237,12 @@
$gateway = $this->getFreshGatewayObject( $init );
$result = $gateway->doPayment();
 
-   $this->assertTrue( $result->isFailed(), 'Result should be 
failed' );
+   $this->assertEquals( FinalStatus::PENDING, 
$gateway->getFinalStatus() );
+   $this->assertFalse( $result->isFailed() );
+   $donationMessage = QueueWrapper::getQueue( 'donations' )->pop();
+   $this->assertNull( $donationMessage );
+   $paymentInitMessages = QueueWrapper::getQueue( 'payments-init' 
)->pop();
+   $this->assertEquals( FinalStatus::PENDING, 
$paymentInitMessages['payments_final_status'] );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7aa643f9014bdc9fd6b394e44c1ff130a998422e
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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: WIP template https nginx conf

2017-12-21 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399706 )

Change subject: WIP template https nginx conf
..

WIP template https nginx conf

Need to pass through to the right port

Change-Id: I8c0b5062f8967539892f92d3cc72c0e7a059e6dc
---
M puppet/modules/role/manifests/https.pp
R puppet/modules/role/templates/https/nginx.conf.erb
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/06/399706/1

diff --git a/puppet/modules/role/manifests/https.pp 
b/puppet/modules/role/manifests/https.pp
index a2fa2c7..de2160b 100644
--- a/puppet/modules/role/manifests/https.pp
+++ b/puppet/modules/role/manifests/https.pp
@@ -11,7 +11,7 @@
 }
 
 nginx::site { 'devwiki':
-source => 'puppet:///modules/role/https/nginx.conf',
+source => template('role/https/nginx.conf.erb'),
 notify => Service['nginx'],
 }
 
diff --git a/puppet/modules/role/files/https/nginx.conf 
b/puppet/modules/role/templates/https/nginx.conf.erb
similarity index 89%
rename from puppet/modules/role/files/https/nginx.conf
rename to puppet/modules/role/templates/https/nginx.conf.erb
index bdbfd32..c44c8c8 100644
--- a/puppet/modules/role/files/https/nginx.conf
+++ b/puppet/modules/role/templates/https/nginx.conf.erb
@@ -14,6 +14,6 @@
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 180s;
-   proxy_pass http://127.0.0.1;
+   proxy_pass http://127.0.0.1:<%= @forwarded_port %>;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c0b5062f8967539892f92d3cc72c0e7a059e6dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Properly serialize Amazon error messages

2017-12-21 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399659 )

Change subject: Properly serialize Amazon error messages
..

Properly serialize Amazon error messages

Need to break 'em down into simple hashes to feed to javascript

Bug: T183477
Change-Id: Ie8c92e14431a7fd1113112d396928dbc2f5652b2
---
M amazon_gateway/amazon.api.php
M gateway_common/donation.api.php
M tests/phpunit/Adapter/Amazon/AmazonApiTest.php
3 files changed, 42 insertions(+), 5 deletions(-)


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

diff --git a/amazon_gateway/amazon.api.php b/amazon_gateway/amazon.api.php
index ca0b80e..1b5b8b9 100644
--- a/amazon_gateway/amazon.api.php
+++ b/amazon_gateway/amazon.api.php
@@ -32,7 +32,10 @@
$output->addValue(
null,
'errors',
-   $adapter->getErrorState()->getErrors()
+   DonationApi::serializeErrors(
+   $adapter->getErrorState()->getErrors(),
+   $adapter
+   )
);
} elseif ( $token && $adapter->checkTokens() ) {
if ( $recurring ) {
@@ -55,7 +58,10 @@
$output->addValue(
null,
'errors',
-   $result->getErrors()
+   DonationApi::serializeErrors(
+   $result->getErrors(),
+   $adapter
+   )
);
} else {
$output->addValue(
diff --git a/gateway_common/donation.api.php b/gateway_common/donation.api.php
index 71e8545..7b98148 100644
--- a/gateway_common/donation.api.php
+++ b/gateway_common/donation.api.php
@@ -30,7 +30,7 @@
$validated_ok = $gatewayObj->validatedOK();
if ( !$validated_ok ) {
$errors = $gatewayObj->getErrorState()->getErrors();
-   $outputResult['errors'] = $this->serializeErrors( 
$errors, $gatewayObj );
+   $outputResult['errors'] = self::serializeErrors( 
$errors, $gatewayObj );
// FIXME: What is this junk?  Smaller API, like 
getResult()->addErrors
$this->getResult()->setIndexedTagName( 
$outputResult['errors'], 'error' );
$this->getResult()->addValue( null, 'result', 
$outputResult );
@@ -94,7 +94,7 @@
}
}
if ( !empty( $errors ) ) {
-   $outputResult['errors'] = $this->serializeErrors( 
$errors, $gatewayObj );
+   $outputResult['errors'] = self::serializeErrors( 
$errors, $gatewayObj );
$this->getResult()->setIndexedTagName( 
$outputResult['errors'], 'error' );
}
 
@@ -104,7 +104,7 @@
$this->getResult()->addValue( null, 'result', $outputResult );
}
 
-   protected function serializeErrors( $errors, GatewayAdapter $adapter ) {
+   public static function serializeErrors( $errors, GatewayAdapter 
$adapter ) {
$serializedErrors = array();
foreach ( $errors as $error ) {
if ( $error instanceof ValidationError ) {
diff --git a/tests/phpunit/Adapter/Amazon/AmazonApiTest.php 
b/tests/phpunit/Adapter/Amazon/AmazonApiTest.php
index acff8af..80f8f01 100644
--- a/tests/phpunit/Adapter/Amazon/AmazonApiTest.php
+++ b/tests/phpunit/Adapter/Amazon/AmazonApiTest.php
@@ -54,4 +54,35 @@
$this->assertNotNull( $message, 'Not sending a message to the 
donations queue' );
$this->assertEquals( 'S01-0391295-0674065-C095112', 
$message['gateway_txn_id'], 'Queue message has wrong txn ID' );
}
+
+   /**
+* InvalidPaymentMethod error should show an error message in the
+* 'general' section.
+*/
+   public function testDoPaymentErrors() {
+   $params = array(
+   'amount' => '1.55',
+   'currency' => 'USD',
+   'recurring' => '0',
+   'wmf_token' => 'e601502632e5e51dc2a17a0045162272+\\',
+   'orderReferenceId' => mt_rand( 0, 1000 ),
+   'action' => 'di_amazon_bill',
+   );
+   $session = array(
+   'Donor' => array(
+   'amount' => '1.55',
+   'currency' => 'USD',
+

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Revert "Reset deploy branch to match production"

2017-12-19 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399180 )

Change subject: Revert "Reset deploy branch to match production"
..

Revert "Reset deploy branch to match production"

This reverts commit b322bac9b70dcc0e807207e3d83e30f52cdfd0b5.

This should leave the deploy branch with everything merged in
up to Eileen's risk score fixes.

Change-Id: I77d36684b985ae03608cf04a02fad0bf79632506
---
M civicrm
M composer.json
M composer.lock
M sites/all/modules/queue2civicrm/DonationQueueConsumer.php
A sites/all/modules/queue2civicrm/DonationStats.php
M sites/all/modules/queue2civicrm/queue2civicrm.info
M sites/all/modules/queue2civicrm/queue2civicrm.module
M sites/all/modules/thank_you/make_thank_you.drush.inc
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
M vendor
10 files changed, 349 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/80/399180/1

diff --git a/civicrm b/civicrm
index a82f2e7..b2fab9d 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit a82f2e7ea633af7477a2c8859b97dbe13ddda5d7
+Subproject commit b2fab9d9d24b1187e845ec601f4165683278243c
diff --git a/composer.json b/composer.json
index 72a398e..81456c6 100644
--- a/composer.json
+++ b/composer.json
@@ -25,7 +25,8 @@
 "phpseclib/phpseclib":  "~2.0",
 "predis/predis": "1.*",
 "twig/twig": "1.*",
-"wikimedia/composer-merge-plugin": "^1.4"
+"wikimedia/composer-merge-plugin": "^1.4",
+"jackgleeson/stats-collector": "dev-master"
 },
 "repositories": [
   {
diff --git a/composer.lock b/composer.lock
index e06dee5..2ae68da 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"content-hash": "32a4c6d1dba52d233ae8892c1908badf",
+"content-hash": "f5b1e547c9865d17802925641c804265",
 "packages": [
 {
 "name": "addshore/psr-6-mediawiki-bagostuff-adapter",
@@ -353,6 +353,65 @@
 "time": "2017-06-30T14:54:48+00:00"
 },
 {
+"name": "dflydev/dot-access-data",
+"version": "v1.1.0",
+"source": {
+"type": "git",
+"url": 
"https://github.com/dflydev/dflydev-dot-access-data.git;,
+"reference": "3fbd874921ab2c041e899d044585a2ab9795df8a"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a;,
+"reference": "3fbd874921ab2c041e899d044585a2ab9795df8a",
+"shasum": ""
+},
+"require": {
+"php": ">=5.3.2"
+},
+"type": "library",
+"extra": {
+"branch-alias": {
+"dev-master": "1.0-dev"
+}
+},
+"autoload": {
+"psr-0": {
+"Dflydev\\DotAccessData": "src"
+}
+},
+"notification-url": "https://packagist.org/downloads/;,
+"license": [
+"MIT"
+],
+"authors": [
+{
+"name": "Dragonfly Development Inc.",
+"email": "i...@dflydev.com",
+"homepage": "http://dflydev.com;
+},
+{
+"name": "Beau Simensen",
+"email": "b...@dflydev.com",
+"homepage": "http://beausimensen.com;
+},
+{
+"name": "Carlos Frutos",
+"email": "car...@kiwing.it",
+"homepage": "https://github.com/cfrutos;
+}
+],
+"description": "Given a deep data structure, access data by dot 
notation.",
+"homepage": "https://github.com/dflydev/dflydev-dot-access-data;,
+"keywords": [
+"access",
+"data",
+"dot",
+"notation"
+],
+"time": "2017-01-20T21:14:22+00:00"
+},
+{
 "name": "geoip2/geoip2",
 "version": "v2.6.0",
 "source": {
@@ -627,6 +686,46 @@
 "password"
 ],
 "time": "2014-11-20T16:49:30+00:00"
+},
+{
+"name": "jackgleeson/stats-collector",
+"version": "dev-master",
+"source": {
+"type": "git",
+"url": "https://github.com/jackgleeson/stats-collector.git;,
+"reference": "1c792bbeac77d4781fbb788f341b601636696df5"
+},
+  

[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule

2017-12-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398943 )

Change subject: Update DonationInterface submodule
..

Update DonationInterface submodule

Change-Id: I05503803266df2658644e6c2692a1e1b6dea5d33
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/398943/1

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 07d5efb..7e7b8df 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 07d5efbc9c811094bbd5647705e84f04c6f32769
+Subproject commit 7e7b8dfcf1223cf3f5fbed2567a96d834e054e96

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05503803266df2658644e6c2692a1e1b6dea5d33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...vendor[master]: Update Amazon SDK for logging

2017-12-18 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398906 )

Change subject: Update Amazon SDK for logging
..


Update Amazon SDK for logging

Change-Id: I70bc7c763aa19c3bc47ba54d9710756ad0ad61f6
---
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
M amzn/login-and-pay-with-amazon-sdk-php/composer.json
M composer/autoload_classmap.php
M composer/autoload_static.php
M composer/installed.json
5 files changed, 70 insertions(+), 45 deletions(-)

Approvals:
  Ejegg: Verified; Looks good to me, approved



diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
index 899ae49..5e6eecf 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
@@ -1,5 +1,7 @@
  null,
'proxy_password'   => null,
'client_id'=> null,
-   'handle_throttle'  => true
+   'handle_throttle'  => true,
+'logger'=> null
);
 
 protected $modePath = null;
@@ -81,6 +89,17 @@
 $this->checkConfigKeys($configArray);
 } else {
 throw new \Exception('$config is of the incorrect type ' . 
gettype($configArray) . ' and should be of the type array');
+}
+if (empty($configArray['logger'])) {
+$this->logger = new NullLogger();
+} else {
+if ($configArray['logger'] instanceof LoggerInterface) {
+$this->logger = $configArray['logger'];
+} else {
+throw new \InvalidArgumentException(
+'Logger passed in config must implement 
Psr\Log\LoggerInterface'
+);
+}
 }
 } else {
throw new \Exception('$config cannot be null.');
@@ -560,6 +579,7 @@
 $this->pauseOnRetry(++$retries, $statusCode);
 }
 } else {
+$this->logger->info("Returned status code $statusCode, 
not retrying.");
 $shouldRetry = false;
 }
 } catch (\Exception $e) {
@@ -582,6 +602,7 @@
 {
 if ($retries <= self::MAX_ERROR_RETRY) {
 $delay = (int) (pow(4, $retries) * $this->basePause);
+$this->logger->info("Returned status code $status on try $retries, 
waiting $delay microseconds.");
 usleep($delay);
 } else {
 throw new \Exception('Error Code: '. $status.PHP_EOL.'Maximum 
number of retry attempts - '. $retries .' reached');
diff --git a/amzn/login-and-pay-with-amazon-sdk-php/composer.json 
b/amzn/login-and-pay-with-amazon-sdk-php/composer.json
index a34204b..3aecf61 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/composer.json
+++ b/amzn/login-and-pay-with-amazon-sdk-php/composer.json
@@ -25,6 +25,7 @@
},
"require": {
   "ext-curl": "*",
-  "php": ">=5.3.0"
+  "php": ">=5.3.0",
+  "psr/log": "^1.0"
}
 }
diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php
index 42bf3e5..354c9be 100644
--- a/composer/autoload_classmap.php
+++ b/composer/autoload_classmap.php
@@ -33,13 +33,13 @@
 'BlankAddressFields' => $baseDir . '/adyen_gateway/BlankAddressFields.php',
 'CallbackFilterIterator' => $vendorDir . 
'/symfony/polyfill-php54/Resources/stubs/CallbackFilterIterator.php',
 'CleanupRecurringLength' => $baseDir . 
'/paypal_gateway/CleanupRecurringLength.php',
+'ClientErrorApi' => $baseDir . '/gateway_common/clientError.api.php',
 'ClientSideValidationHelper' => $baseDir . 
'/gateway_common/ClientSideValidationHelper.php',
 'Clio\\Console' => $vendorDir . '/clio/clio/src/Clio/Console.php',
 'Clio\\Daemon' => $vendorDir . '/clio/clio/src/Clio/Daemon.php',
 'Composer\\CaBundle\\CaBundle' => $vendorDir . 
'/composer/ca-bundle/src/CaBundle.php',
 'ConfigurationReader' => $baseDir . 
'/gateway_common/ConfigurationReader.php',
 'ContributionTrackingPlusUnique' => $baseDir . 
'/gateway_common/ContributionTrackingPlusUnique.php',
-'CountryCodes' => $baseDir . '/gateway_forms/includes/CountryCodes.php',
 'CountryValidation' => $baseDir . '/gateway_common/CountryValidation.php',
 'DataValidator' => $baseDir . '/gateway_common/DataValidator.php',
 'DonationApi' => $baseDir . '/gateway_common/donation.api.php',
@@ -338,6 +338,7 @@
 'PHPQueue\\Runner' => $vendorDir . 
'/coderkungfu/php-queue/src/PHPQueue/Runner.php',
 'PHPQueue\\Worker' => $vendorDir . 
'/coderkungfu/php-queue/src/PHPQueue/Worker.php',
 'POP3' => $vendorDir . 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Update vendor submodule

2017-12-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398907 )

Change subject: Update vendor submodule
..

Update vendor submodule

Change-Id: I6734e901e75730f65fb7a684807e82cd2d88c3f2
---
M vendor
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/vendor b/vendor
index 53851be..7281dde 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit 53851be57e9e8e5e45021d033ffb0fe9c97e2616
+Subproject commit 7281ddeef907a9ccdab007fb5d6a7e1ae067493d

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...vendor[master]: Update Amazon SDK for logging

2017-12-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398906 )

Change subject: Update Amazon SDK for logging
..

Update Amazon SDK for logging

Change-Id: I70bc7c763aa19c3bc47ba54d9710756ad0ad61f6
---
M amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
M amzn/login-and-pay-with-amazon-sdk-php/composer.json
M composer/autoload_classmap.php
M composer/autoload_static.php
M composer/installed.json
5 files changed, 70 insertions(+), 45 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface/vendor 
refs/changes/06/398906/1

diff --git 
a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php 
b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
index 899ae49..5e6eecf 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
+++ b/amzn/login-and-pay-with-amazon-sdk-php/PayWithAmazon/BaseClient.php
@@ -1,5 +1,7 @@
  null,
'proxy_password'   => null,
'client_id'=> null,
-   'handle_throttle'  => true
+   'handle_throttle'  => true,
+'logger'=> null
);
 
 protected $modePath = null;
@@ -81,6 +89,17 @@
 $this->checkConfigKeys($configArray);
 } else {
 throw new \Exception('$config is of the incorrect type ' . 
gettype($configArray) . ' and should be of the type array');
+}
+if (empty($configArray['logger'])) {
+$this->logger = new NullLogger();
+} else {
+if ($configArray['logger'] instanceof LoggerInterface) {
+$this->logger = $configArray['logger'];
+} else {
+throw new \InvalidArgumentException(
+'Logger passed in config must implement 
Psr\Log\LoggerInterface'
+);
+}
 }
 } else {
throw new \Exception('$config cannot be null.');
@@ -560,6 +579,7 @@
 $this->pauseOnRetry(++$retries, $statusCode);
 }
 } else {
+$this->logger->info("Returned status code $statusCode, 
not retrying.");
 $shouldRetry = false;
 }
 } catch (\Exception $e) {
@@ -582,6 +602,7 @@
 {
 if ($retries <= self::MAX_ERROR_RETRY) {
 $delay = (int) (pow(4, $retries) * $this->basePause);
+$this->logger->info("Returned status code $status on try $retries, 
waiting $delay microseconds.");
 usleep($delay);
 } else {
 throw new \Exception('Error Code: '. $status.PHP_EOL.'Maximum 
number of retry attempts - '. $retries .' reached');
diff --git a/amzn/login-and-pay-with-amazon-sdk-php/composer.json 
b/amzn/login-and-pay-with-amazon-sdk-php/composer.json
index a34204b..3aecf61 100644
--- a/amzn/login-and-pay-with-amazon-sdk-php/composer.json
+++ b/amzn/login-and-pay-with-amazon-sdk-php/composer.json
@@ -25,6 +25,7 @@
},
"require": {
   "ext-curl": "*",
-  "php": ">=5.3.0"
+  "php": ">=5.3.0",
+  "psr/log": "^1.0"
}
 }
diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php
index 42bf3e5..354c9be 100644
--- a/composer/autoload_classmap.php
+++ b/composer/autoload_classmap.php
@@ -33,13 +33,13 @@
 'BlankAddressFields' => $baseDir . '/adyen_gateway/BlankAddressFields.php',
 'CallbackFilterIterator' => $vendorDir . 
'/symfony/polyfill-php54/Resources/stubs/CallbackFilterIterator.php',
 'CleanupRecurringLength' => $baseDir . 
'/paypal_gateway/CleanupRecurringLength.php',
+'ClientErrorApi' => $baseDir . '/gateway_common/clientError.api.php',
 'ClientSideValidationHelper' => $baseDir . 
'/gateway_common/ClientSideValidationHelper.php',
 'Clio\\Console' => $vendorDir . '/clio/clio/src/Clio/Console.php',
 'Clio\\Daemon' => $vendorDir . '/clio/clio/src/Clio/Daemon.php',
 'Composer\\CaBundle\\CaBundle' => $vendorDir . 
'/composer/ca-bundle/src/CaBundle.php',
 'ConfigurationReader' => $baseDir . 
'/gateway_common/ConfigurationReader.php',
 'ContributionTrackingPlusUnique' => $baseDir . 
'/gateway_common/ContributionTrackingPlusUnique.php',
-'CountryCodes' => $baseDir . '/gateway_forms/includes/CountryCodes.php',
 'CountryValidation' => $baseDir . '/gateway_common/CountryValidation.php',
 'DataValidator' => $baseDir . '/gateway_common/DataValidator.php',
 'DonationApi' => $baseDir . '/gateway_common/donation.api.php',
@@ -338,6 +338,7 @@
 'PHPQueue\\Runner' => $vendorDir . 
'/coderkungfu/php-queue/src/PHPQueue/Runner.php',
 'PHPQueue\\Worker' => $vendorDir . 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment

2017-12-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398905 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

69cf77b57 Localisation updates from https://translatewiki.net.
9b0cad45e Localisation updates from https://translatewiki.net.
71dd5080d Localisation updates from https://translatewiki.net.
581218772 Localisation updates from https://translatewiki.net.
bfa77be03 Localisation updates from https://translatewiki.net.
5cf8c40e2 Localisation updates from https://translatewiki.net.
6fd4e0196 Localisation updates from https://translatewiki.net.
903bcb8a5 Localisation updates from https://translatewiki.net.
a8f7a612e Tweak informationsharing message to be more upfront
3ff2f47f2 Redirect Adyen skin
434c25431 Localisation updates from https://translatewiki.net.
2c531f7fe Fix select arrow overlapping contents
c8bd74d2c Localisation updates from https://translatewiki.net.
972008bb9 Update Amazon SDK fork for logging retries

Change-Id: If9a81cd63cab1108f4cf694941e4e98ab4029cf7
---
D 
tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_Complete.testresponse
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git 
a/tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_Complete.testresponse
 
b/tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_Complete.testresponse
deleted file mode 100644
index 26468a4..000
--- 
a/tests/phpunit/includes/Responses/paypal_ec/GetExpressCheckoutDetails_Complete.testresponse
+++ /dev/null
@@ -1 +0,0 @@
-TOKEN=EC%2d4V987654XA123456V=0=PaymentActionCompleted=2017%2d02%2d01T20%3a07%3a14Z=d70c9a334455e=Success=204=28806785=donor%40generous%2enet=8R297FE87CD8S=unverified=Fezziwig=Fowl=US=Fezziwig%20Fowl=123%20Notta%20Way=Whoville=OR=97211=US=United%20States=PayPal=Confirmed=USD=1%2e55=1%2e55=0=0=0=45931210=Donation%20to%20the%20Wikimedia%20Foundation=45931210%2e1=http%3a%2f%2ffundraising%2ewikimedia%2eorg%2fIPNListener_Standalone%2ephp=0=0=false_QTY0=1_TAXAMT0=0_AMT0=1%2e55_DESC0=Donation%20to%20the%20Wikimedia%20Foundation_0_CURRENCYCODE=USD_0_AMT=1%2e55_0_ITEMAMT=1%2e55_0_SHIPPINGAMT=0_0_HANDLINGAMT=0_0_TAXAMT=0_0_CUSTOM=45931210_0_DESC=Donation%20to%20the%20Wikimedia%20Foundation_0_INVNUM=45931210%2e1_0_NOTIFYURL=http%3a%2f%2ffundraising%2ewikimedia%2eorg%2fIPNListener_Standalone%2ephp_0_INSURANCEAMT=0_0_SHIPDISCAMT=0_0_SELLERPAYPALACCOUNTID=receiver%40wikimedia%2eorg_0_INSURANCEOPTIONOFFERED=false_0_ADDRESSSTATUS=Confirmed_PAYMENTREQUEST_0_QTY0=1_PAYMENTREQUEST_0_TAXAMT0=0_PAYMENTREQUEST_0_AMT0=1%2e55_PAYMENTREQUEST_0_DESC0=Donation%20to%20the%20Wikimedia%20Foundation_0_ERRORCODE=0

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Set 2017 target to 51000000

2017-12-18 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398875 )

Change subject: Set 2017 target to 5100
..

Set 2017 target to 5100

Bug: T183157
Change-Id: I615766725e6ba1dc07971f5452df136bd0d3c5e8
---
M src/components/widgets/totals-earned-chart/totals-earned-chart.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/75/398875/1

diff --git a/src/components/widgets/totals-earned-chart/totals-earned-chart.js 
b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
index 286bd1e..3986c74 100644
--- a/src/components/widgets/totals-earned-chart/totals-earned-chart.js
+++ b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
@@ -41,7 +41,7 @@
name: '2017',
startDate: Date.UTC( 2017, 9, 2 ),
endDate: Date.UTC( 2018, 0, 1 ),
-   target: 5000
+   target: 5100
} ),
new Campaign( {
name: '2016',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I615766725e6ba1dc07971f5452df136bd0d3c5e8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Reset deploy branch to match production

2017-12-17 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398778 )

Change subject: Reset deploy branch to match production
..

Reset deploy branch to match production

Will need to redo commits between 798e2467 and this one next week

Change-Id: I5d830389ff5f2fa7ca76d01467adfd248dc784dd
---
M civicrm
M composer.json
M composer.lock
M sites/all/modules/queue2civicrm/DonationQueueConsumer.php
D sites/all/modules/queue2civicrm/DonationStats.php
M sites/all/modules/queue2civicrm/queue2civicrm.info
M sites/all/modules/queue2civicrm/queue2civicrm.module
D sites/all/modules/queue2civicrm/tests/phpunit/DonationStatsTest.php
M sites/all/modules/thank_you/make_thank_you.drush.inc
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
M vendor
11 files changed, 44 insertions(+), 521 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/78/398778/1

diff --git a/civicrm b/civicrm
index b2fab9d..a82f2e7 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit b2fab9d9d24b1187e845ec601f4165683278243c
+Subproject commit a82f2e7ea633af7477a2c8859b97dbe13ddda5d7
diff --git a/composer.json b/composer.json
index 81456c6..72a398e 100644
--- a/composer.json
+++ b/composer.json
@@ -25,8 +25,7 @@
 "phpseclib/phpseclib":  "~2.0",
 "predis/predis": "1.*",
 "twig/twig": "1.*",
-"wikimedia/composer-merge-plugin": "^1.4",
-"jackgleeson/stats-collector": "dev-master"
+"wikimedia/composer-merge-plugin": "^1.4"
 },
 "repositories": [
   {
diff --git a/composer.lock b/composer.lock
index 2ae68da..e06dee5 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"content-hash": "f5b1e547c9865d17802925641c804265",
+"content-hash": "32a4c6d1dba52d233ae8892c1908badf",
 "packages": [
 {
 "name": "addshore/psr-6-mediawiki-bagostuff-adapter",
@@ -353,65 +353,6 @@
 "time": "2017-06-30T14:54:48+00:00"
 },
 {
-"name": "dflydev/dot-access-data",
-"version": "v1.1.0",
-"source": {
-"type": "git",
-"url": 
"https://github.com/dflydev/dflydev-dot-access-data.git;,
-"reference": "3fbd874921ab2c041e899d044585a2ab9795df8a"
-},
-"dist": {
-"type": "zip",
-"url": 
"https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/3fbd874921ab2c041e899d044585a2ab9795df8a;,
-"reference": "3fbd874921ab2c041e899d044585a2ab9795df8a",
-"shasum": ""
-},
-"require": {
-"php": ">=5.3.2"
-},
-"type": "library",
-"extra": {
-"branch-alias": {
-"dev-master": "1.0-dev"
-}
-},
-"autoload": {
-"psr-0": {
-"Dflydev\\DotAccessData": "src"
-}
-},
-"notification-url": "https://packagist.org/downloads/;,
-"license": [
-"MIT"
-],
-"authors": [
-{
-"name": "Dragonfly Development Inc.",
-"email": "i...@dflydev.com",
-"homepage": "http://dflydev.com;
-},
-{
-"name": "Beau Simensen",
-"email": "b...@dflydev.com",
-"homepage": "http://beausimensen.com;
-},
-{
-"name": "Carlos Frutos",
-"email": "car...@kiwing.it",
-"homepage": "https://github.com/cfrutos;
-}
-],
-"description": "Given a deep data structure, access data by dot 
notation.",
-"homepage": "https://github.com/dflydev/dflydev-dot-access-data;,
-"keywords": [
-"access",
-"data",
-"dot",
-"notation"
-],
-"time": "2017-01-20T21:14:22+00:00"
-},
-{
 "name": "geoip2/geoip2",
 "version": "v2.6.0",
 "source": {
@@ -686,46 +627,6 @@
 "password"
 ],
 "time": "2014-11-20T16:49:30+00:00"
-},
-{
-"name": "jackgleeson/stats-collector",
-"version": "dev-master",
-"source": {
-"type": "git",
-"url": "https://github.com/jackgleeson/stats-collector.git;,
-"reference": "1c792bbeac77d4781fbb788f341b601636696df5"
-},
-"dist": {
-"type": 

[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Update Amazon SDK fork for logging retries

2017-12-15 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398500 )

Change subject: Update Amazon SDK fork for logging retries
..

Update Amazon SDK fork for logging retries

Awkwardly provide our logger to the constructor params

Bug: T182735
Change-Id: I5cc90e246f4436fd332117e2bb4c869247ca3584
---
M amazon_gateway/amazon.adapter.php
M composer.lock
2 files changed, 13 insertions(+), 3 deletions(-)


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

diff --git a/amazon_gateway/amazon.adapter.php 
b/amazon_gateway/amazon.adapter.php
index 30914d5..274fbd6 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -65,6 +65,15 @@
array( 'payment_method' => 'amazon' )
);
}
+   // Provide our logger instance to the SmashPig payments-client 
parameters.
+   // Dang, this is still really ugly.
+   Context::get()->getProviderConfiguration()->override(
+   [ 'payments-client' =>
+   [ 'constructor-parameters' =>
+   [ 0 => [ 'logger' => $this->logger ] ]
+   ]
+   ]
+   );
$this->session_addDonorData();
}
 
diff --git a/composer.lock b/composer.lock
index 81ca3e4..5d275a2 100644
--- a/composer.lock
+++ b/composer.lock
@@ -57,11 +57,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/ejegg/login-and-pay-with-amazon-sdk-php;,
-"reference": "855d642f85f14c76ca810013b0323ae4ac37f1c6"
+"reference": "198cc8ccab51e270909602cee38706b4d1f6bbba"
 },
 "require": {
 "ext-curl": "*",
-"php": ">=5.3.0"
+"php": ">=5.3.0",
+"psr/log": "^1.0"
 },
 "type": "library",
 "autoload": {
@@ -88,7 +89,7 @@
 "payment",
 "payments"
 ],
-"time": "2016-02-17 00:53:20"
+"time": "2017-12-15T15:03:21+00:00"
 },
 {
 "name": "clio/clio",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cc90e246f4436fd332117e2bb4c869247ca3584
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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

2017-12-14 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398336 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

Update CiviCRM submodule

Change-Id: I93f33f2ebdad62baf445e8b7177b612d4a280292
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/36/398336/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93f33f2ebdad62baf445e8b7177b612d4a280292
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update civicrm submodule

2017-12-14 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398335 )

Change subject: Update civicrm submodule
..

Update civicrm submodule

Change-Id: Icf273d14402885a4bb9547a41bbd0e5660799bba
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/35/398335/1

diff --git a/civicrm b/civicrm
index f903ec6..b2fab9d 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit f903ec6a46a6624990fc31733721afbe66068719
+Subproject commit b2fab9d9d24b1187e845ec601f4165683278243c

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf273d14402885a4bb9547a41bbd0e5660799bba
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: Remove email processor tests

2017-12-14 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398334 )

Change subject: Remove email processor tests
..

Remove email processor tests

We don't actually include tests in our civicrm submodule

Change-Id: Ie398f85279ce48c74c59faf67a044c69eb178796
---
D tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php
D tests/phpunit/CRM/Utils/Mail/data/bounces/test_nested_message.eml
2 files changed, 0 insertions(+), 460 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/34/398334/1

diff --git a/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php 
b/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php
deleted file mode 100644
index 59a1d0c..000
--- a/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php
+++ /dev/null
@@ -1,147 +0,0 @@
-callAPISuccess('MailSettings', 'get', array(
-  'api.MailSettings.create' => array(
-'name' => 'local',
-'protocol' => 'Localdir',
-'source' => __DIR__ . '/data/mail',
-'domain' => 'example.com',
-  ),
-));
-  }
-
-  public function tearDown() {
-CRM_Utils_File::cleanDir(__DIR__ . '/data/mail');
-parent::tearDown();
-$this->quickCleanup(array('civicrm_group', 'civicrm_group_contact', 
'civicrm_mailing', 'civicrm_mailing_job', 'civicrm_mailing_event_bounce', 
'civicrm_mailing_event_queue', 'civicrm_mailing_group', 
'civicrm_mailing_recipients', 'civicrm_contact', 'civicrm_email'));
-  }
-
-  /**
-   * Test the job processing function works and processes a bounce.
-   */
-  public function testBounceProcessing() {
-$this->setUpMailing();
-
-copy(__DIR__ . '/data/bounces/bounce_no_verp.txt', __DIR__ . 
'/data/mail/bounce_no_verp.txt');
-$this->assertTrue(file_exists(__DIR__ . '/data/mail/bounce_no_verp.txt'));
-$this->callAPISuccess('job', 'fetch_bounces', array());
-$this->assertFalse(file_exists(__DIR__ . '/data/mail/bounce_no_verp.txt'));
-$this->checkMailingBounces(1);
-  }
-
-  /**
-   * Tests that a multipart related email does not cause pain & misery & fatal 
errors.
-   *
-   * Sample taken from https://www.phpclasses.org/browse/file/14672.html
-   */
-  public function testProcessingMultipartRelatedEmail() {
-$this->setUpMailing();
-$mail = 'test_sample_message.eml';
-
-copy(__DIR__ . '/data/bounces/' . $mail, __DIR__ . '/data/mail/' .   
$mail);
-$this->callAPISuccess('job', 'fetch_bounces', array());
-$this->assertFalse(file_exists(__DIR__ . '/data/mail/' . $mail));
-$this->checkMailingBounces(1);
-  }
-
-  /**
-   * Tests that a nested multipart email does not cause pain & misery & fatal 
errors.
-   *
-   * Sample anonymized from an email that broke bounce processing at Wikimedia
-   */
-  public function testProcessingNestedMultipartEmail() {
-$this->setUpMailing();
-$mail = 'test_nested_message.eml';
-
-copy(__DIR__ . '/data/bounces/' . $mail, __DIR__ . '/data/mail/' . $mail);
-$this->callAPISuccess('job', 'fetch_bounces', array());
-$this->assertFalse(file_exists(__DIR__ . '/data/mail/' . $mail));
-$this->checkMailingBounces(1);
-  }
-
-  /**
-   * Test that a deleted email does not cause a hard fail.
-   *
-   * The civicrm_mailing_event_queue table tracks email ids to represent an
-   * email address. The id may not represent the same email by the time the 
bounce may
-   * come in - a weakness of storing the id not the email. Relevant here
-   * is that it might have been deleted altogether, in which case the bounce 
should be
-   * silently ignored. This ignoring is also at the expense of the contact
-   * having the same email address with a different id.
-   *
-   * Longer term it would make sense to track the email address & track 
bounces back to that
-   * rather than an id that may not reflect the email used. Issue logged 
CRM-20021.
-   *
-   * For not however, we are testing absence of mysql error in conjunction 
with CRM-20016.
-   */
-  public function testBounceProcessingDeletedEmail() {
-$this->setUpMailing();
-$this->callAPISuccess('Email', 'get', array(
-  'contact_id' => $this->contactID,
-  'api.email.delete' => 1,
-));
-
-copy(__DIR__ . '/data/bounces/bounce_no_verp.txt', __DIR__ . 
'/data/mail/bounce_no_verp.txt');
-$this->assertTrue(file_exists(__DIR__ . '/data/mail/bounce_no_verp.txt'));
-$this->callAPISuccess('job', 'fetch_bounces', array());
-$this->assertFalse(file_exists(__DIR__ . '/data/mail/bounce_no_verp.txt'));
-$this->checkMailingBounces(1);
-  }
-
-  /**
-   *
-   * Wrapper to check for mailing bounces.
-   *
-   * Normally we would call $this->callAPISuccessGetCount but there is not one 
& there is resistance to
-   * adding apis for 'convenience' so just adding a hacky function to get past 
the impasse.
-   *
-   * @param int $expectedCount
-   */
-  public function checkMailingBounces($expectedCount) {
-

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Add stripe payment instrument.

2017-12-13 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398132 )

Change subject: Add stripe payment instrument.
..

Add stripe payment instrument.

Bug: T172423
Change-Id: Ic648ad8bb4e3b13c8cb33c62221c1358bb128a14
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/32/398132/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 3e1509d..f739ff9 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -3429,3 +3429,11 @@
 )),
   ));
 }
+
+/**
+ * Add Stripe payment instrument
+ */
+function wmf_civicrm_update_7590() {
+  civicrm_initialize();
+  wmf_civicrm_create_option_values('payment_instrument', array('Stripe'));
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic648ad8bb4e3b13c8cb33c62221c1358bb128a14
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Eileen 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Add stripe to initial install

2017-12-13 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398133 )

Change subject: Add stripe to initial install
..

Add stripe to initial install

Bug T172423

Change-Id: If50f42af300518b8c180652f46d4608d824b96e7
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/33/398133/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index f739ff9..543b696 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -68,6 +68,7 @@
   wmf_civicrm_update_7525();
   wmf_civicrm_update_7526();
   wmf_civicrm_update_7530();
+  wmf_civicrm_update_7590();
 }
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If50f42af300518b8c180652f46d4608d824b96e7
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Eileen 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Debugging for mystery FK errors

2017-12-13 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398134 )

Change subject: Debugging for mystery FK errors
..

Debugging for mystery FK errors

Change-Id: I29da014cc25bac75540d84f94e68e5cbe19ea0c0
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
M sites/all/modules/wmf_common/WmfDatabase.php
2 files changed, 28 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/34/398134/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 746c901..184cedc 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1193,6 +1193,9 @@
 }
 }
 
+if (WmfDatabase::isNativeTxnRolledBack()) {
+  throw new WmfException("IMPORT_CONTACT", "Native txn rolled back before 
inserting contact");
+}
 // Attempt to insert the contact
 try {
 $contact_result = civicrm_api3( "Contact", "Create", $contact );
@@ -1201,6 +1204,10 @@
 } else {
 watchdog( 'wmf_civicrm', 'Result for updating contact: %contact', 
array( '%contact' => print_r( $contact_result, true )), WATCHDOG_DEBUG );
 }
+
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting contact");
+  }
 } catch ( CiviCRM_API3_Exception $ex ) {
 throw new WmfException(
 "IMPORT_CONTACT",
@@ -1297,7 +1304,9 @@
 throw new WmfException( 'IMPORT_CONTACT', $ex->getMessage() );
 }
 }
-
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting contact auxiliary fields");
+  }
 return $contact_result;
 }
 
@@ -1433,6 +1442,9 @@
  */
 function wmf_civicrm_message_location_insert( $msg, $contact ) {
 wmf_civicrm_message_email_insert( $msg, $contact[ 'id' ] );
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting email");
+  }
 wmf_civicrm_message_address_insert( $msg, $contact[ 'id' ] );
 }
 
@@ -1644,7 +1656,9 @@
 if (!wmf_civicrm_is_address_valid($address_params)) {
 return;
 }
-
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back before 
inserting address");
+  }
 try {
 civicrm_api3('Address', 'Create', $address_params);
 }
@@ -1655,6 +1669,10 @@
   $ex->getMessage()
 );
 }
+
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting address");
+  }
 }
 
 function wmf_civicrm_get_default_location_type_id() {
diff --git a/sites/all/modules/wmf_common/WmfDatabase.php 
b/sites/all/modules/wmf_common/WmfDatabase.php
index d52dddf..75aa028 100644
--- a/sites/all/modules/wmf_common/WmfDatabase.php
+++ b/sites/all/modules/wmf_common/WmfDatabase.php
@@ -1,6 +1,8 @@
 getFrame()->isRollbackOnly()) {
+if (self::isNativeTxnRolledBack()) {
throw new RuntimeException(
'Civi Transaction was marked for rollback and Exception 
was suppressed'
);
@@ -48,4 +50,9 @@
 unset( $drupal_transaction );
 return $result;
 }
+
+public static function isNativeTxnRolledBack() {
+  $frame = Manager::singleton()->getFrame();
+  return $frame && $frame->isRollbackOnly();
+}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29da014cc25bac75540d84f94e68e5cbe19ea0c0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21521: fix nested multipart handling

2017-12-13 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398107 )

Change subject: CRM-21521: fix nested multipart handling
..

CRM-21521: fix nested multipart handling

Update to latest version from core

Change-Id: I6e0d6e9e31b14cbfe65d3dfc1f8c607e7615d1f2
---
M CRM/Utils/Mail/EmailProcessor.php
A tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php
A tests/phpunit/CRM/Utils/Mail/data/bounces/test_nested_message.eml
3 files changed, 461 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/07/398107/1

diff --git a/CRM/Utils/Mail/EmailProcessor.php 
b/CRM/Utils/Mail/EmailProcessor.php
index 6ec7d65..84eb58e 100644
--- a/CRM/Utils/Mail/EmailProcessor.php
+++ b/CRM/Utils/Mail/EmailProcessor.php
@@ -452,7 +452,7 @@
   $text = $part->text;
 }
 elseif ($part instanceof ezcMailMultipart) {
-  $text = self::getTextFromMultipart($part);
+  $text = self::getTextFromMultipart($part, $recursionLevel);
 }
 if ($text) {
   break;
diff --git a/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php 
b/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php
new file mode 100644
index 000..59a1d0c
--- /dev/null
+++ b/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php
@@ -0,0 +1,147 @@
+callAPISuccess('MailSettings', 'get', array(
+  'api.MailSettings.create' => array(
+'name' => 'local',
+'protocol' => 'Localdir',
+'source' => __DIR__ . '/data/mail',
+'domain' => 'example.com',
+  ),
+));
+  }
+
+  public function tearDown() {
+CRM_Utils_File::cleanDir(__DIR__ . '/data/mail');
+parent::tearDown();
+$this->quickCleanup(array('civicrm_group', 'civicrm_group_contact', 
'civicrm_mailing', 'civicrm_mailing_job', 'civicrm_mailing_event_bounce', 
'civicrm_mailing_event_queue', 'civicrm_mailing_group', 
'civicrm_mailing_recipients', 'civicrm_contact', 'civicrm_email'));
+  }
+
+  /**
+   * Test the job processing function works and processes a bounce.
+   */
+  public function testBounceProcessing() {
+$this->setUpMailing();
+
+copy(__DIR__ . '/data/bounces/bounce_no_verp.txt', __DIR__ . 
'/data/mail/bounce_no_verp.txt');
+$this->assertTrue(file_exists(__DIR__ . '/data/mail/bounce_no_verp.txt'));
+$this->callAPISuccess('job', 'fetch_bounces', array());
+$this->assertFalse(file_exists(__DIR__ . '/data/mail/bounce_no_verp.txt'));
+$this->checkMailingBounces(1);
+  }
+
+  /**
+   * Tests that a multipart related email does not cause pain & misery & fatal 
errors.
+   *
+   * Sample taken from https://www.phpclasses.org/browse/file/14672.html
+   */
+  public function testProcessingMultipartRelatedEmail() {
+$this->setUpMailing();
+$mail = 'test_sample_message.eml';
+
+copy(__DIR__ . '/data/bounces/' . $mail, __DIR__ . '/data/mail/' .   
$mail);
+$this->callAPISuccess('job', 'fetch_bounces', array());
+$this->assertFalse(file_exists(__DIR__ . '/data/mail/' . $mail));
+$this->checkMailingBounces(1);
+  }
+
+  /**
+   * Tests that a nested multipart email does not cause pain & misery & fatal 
errors.
+   *
+   * Sample anonymized from an email that broke bounce processing at Wikimedia
+   */
+  public function testProcessingNestedMultipartEmail() {
+$this->setUpMailing();
+$mail = 'test_nested_message.eml';
+
+copy(__DIR__ . '/data/bounces/' . $mail, __DIR__ . '/data/mail/' . $mail);
+$this->callAPISuccess('job', 'fetch_bounces', array());
+$this->assertFalse(file_exists(__DIR__ . '/data/mail/' . $mail));
+$this->checkMailingBounces(1);
+  }
+
+  /**
+   * Test that a deleted email does not cause a hard fail.
+   *
+   * The civicrm_mailing_event_queue table tracks email ids to represent an
+   * email address. The id may not represent the same email by the time the 
bounce may
+   * come in - a weakness of storing the id not the email. Relevant here
+   * is that it might have been deleted altogether, in which case the bounce 
should be
+   * silently ignored. This ignoring is also at the expense of the contact
+   * having the same email address with a different id.
+   *
+   * Longer term it would make sense to track the email address & track 
bounces back to that
+   * rather than an id that may not reflect the email used. Issue logged 
CRM-20021.
+   *
+   * For not however, we are testing absence of mysql error in conjunction 
with CRM-20016.
+   */
+  public function testBounceProcessingDeletedEmail() {
+$this->setUpMailing();
+$this->callAPISuccess('Email', 'get', array(
+  'contact_id' => $this->contactID,
+  'api.email.delete' => 1,
+));
+
+copy(__DIR__ . '/data/bounces/bounce_no_verp.txt', __DIR__ . 
'/data/mail/bounce_no_verp.txt');
+$this->assertTrue(file_exists(__DIR__ . '/data/mail/bounce_no_verp.txt'));
+$this->callAPISuccess('job', 

[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Avoid closing connections prematurely

2017-12-12 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397904 )

Change subject: Avoid closing connections prematurely
..

Avoid closing connections prematurely

And make sure the results are returned
Also close in a few more places

Change-Id: I3e37b6f664f8893009d256b23dcde636dc03ea6b
---
M persistence.js
1 file changed, 20 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/04/397904/1

diff --git a/persistence.js b/persistence.js
index 6398d58..42b6d74 100644
--- a/persistence.js
+++ b/persistence.js
@@ -32,7 +32,12 @@
values.push( board.id );
values.push( i );
}
-   return connection.query( insertWidgets + placeholders, values ).then( 
connection.end() );
+   return connection.query( insertWidgets + placeholders, values ).then(
+   function( dbResult ) {
+   connection.end();
+   return dbResult;
+   }
+   );
 }
 
 module.exports = {
@@ -93,12 +98,17 @@
} )
.then( function ( dbResults ) {
if ( !dbResults ) {
+   connection.end();
return;
}
user.defaultBoard = dbResults[ 0 ][ 2 ][ 0 ].id;
-   var result = connection.query( 
insertBigEnglish, [ userId ] )
-   .then( connection.end() );
-   return result;
+   return connection.query( insertBigEnglish, [ 
userId ] )
+   .then(
+   function( dbResult ) {
+   connection.end();
+   return dbResult;
+   }
+   );
} );
},
/**
@@ -119,6 +129,7 @@
if ( instance.id ) {
return connection.query( update, updateParams )
.then( function ( dbResults ) {
+   connection.end();
if ( dbResults[ 0 ].affectedRows !== 1 
) {
// Either the instance doesn't 
exist or it's not ours
throw new Error( 'Instance ' + 
instance.id + ' with owner ' + instance.ownerId + ' not found' );
@@ -218,15 +229,16 @@
 
if ( board.id ) {
if ( board.addWidget ) {
-   return connection.query( addWidget, 
addWidgetParams );
+   return connection.query( addWidget, 
addWidgetParams ).then( connection.end );
}
if ( board.deleteWidget ) {
-   return connection.query( deleteWidget, 
deleteWidgetParams );
+   return connection.query( deleteWidget, 
deleteWidgetParams ).then( connection.end );
}
return connection.query( update, updateParams )
.then( function ( dbResults ) {
if ( dbResults[ 0 ].affectedRows !== 1 
) {
// Either the board doesn't 
exist or it's not ours
+   connection.end();
throw new Error( 'Board ' + 
board.id + ' with owner ' + board.ownerId + ' not found' );
}
} )
@@ -242,7 +254,7 @@
board.id = dbResults[ 0 ].insertId;
} )
.then( function () {
-   return insertWidgetList( board, connection 
).then( connection.end() );
+   return insertWidgetList( board, connection );
} );
},
/**
@@ -262,6 +274,7 @@
widgetSelect = 'SELECT wi.id, 
wi.widget_id, w.code, wi.owner_id, wi.display_name, wi.description, 
wi.is_shared, wi.configuration FROM dash_widget_instance wi INNER JOIN 
dash_widget w on w.id = wi.widget_id INNER JOIN dash_widget_instance_board wib 
ON wi.id = wib.instance_id WHERE wib.board_id = ? ORDER BY wib.widget_position';
 
if ( !result.owner_id ) {
+   connection.end();
throw new Error( 'Board ' + boardId + ' 

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Bad submodule SHA commit

2017-12-12 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397886 )

Change subject: Bad submodule SHA commit
..

Bad submodule SHA commit

Change-Id: I32250f86e25dc9cdfdd3e556fba017ac9a1f7756
---
M vendor
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/86/397886/1

diff --git a/vendor b/vendor
index 4a2f871..cf546a2 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit 4a2f871ce564adfa60c15eabb53ad7fc2f85dcd3
+Subproject commit cf546a287dc65ac8da8e3749d1a8835354f1d775

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32250f86e25dc9cdfdd3e556fba017ac9a1f7756
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...node_modules[master]: Go boom!

2017-12-12 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397885 )

Change subject: Go boom!
..

Go boom!

Change-Id: Ib5cd165d8aaed72ef0d3f49353ecbcfb3738643c
---
A boom/.npmignore
A boom/.travis.yml
A boom/CONTRIBUTING.md
A boom/LICENSE
A boom/README.md
A boom/images/boom.png
A boom/lib/index.js
A boom/package.json
A boom/test/index.js
9 files changed, 1,777 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash/node_modules 
refs/changes/85/397885/1

diff --git a/boom/.npmignore b/boom/.npmignore
new file mode 100644
index 000..77ba16c
--- /dev/null
+++ b/boom/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
diff --git a/boom/.travis.yml b/boom/.travis.yml
new file mode 100755
index 000..dd1b24f
--- /dev/null
+++ b/boom/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+
+node_js:
+  - 0.10
+  - 4.0
+
+sudo: false
+
diff --git a/boom/CONTRIBUTING.md b/boom/CONTRIBUTING.md
new file mode 100644
index 000..8928361
--- /dev/null
+++ b/boom/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please view our [hapijs contributing 
guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
diff --git a/boom/LICENSE b/boom/LICENSE
new file mode 100755
index 000..3946889
--- /dev/null
+++ b/boom/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2014, Walmart and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+* The names of any contributors may not be used to endorse or promote
+  products derived from this software without specific prior written
+  permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE 
FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+  *   *   *
+
+The complete list of contributors can be found at: 
https://github.com/hapijs/boom/graphs/contributors
\ No newline at end of file
diff --git a/boom/README.md b/boom/README.md
new file mode 100755
index 000..cbd91c9
--- /dev/null
+++ b/boom/README.md
@@ -0,0 +1,652 @@
+![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png)
+
+HTTP-friendly error objects
+
+[![Build 
Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom)
+[![Current 
Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom)
+
+Lead Maintainer: [Adam Bretz](https://github.com/arb)
+
+**boom** provides a set of utilities for returning HTTP errors. Each utility 
returns a `Boom` error response
+object (instance of `Error`) which includes the following properties:
+- `isBoom` - if `true`, indicates this is a `Boom` object instance.
+- `isServer` - convenience bool indicating status code >= 500.
+- `message` - the error message.
+- `output` - the formatted response. Can be directly manipulated after object 
construction to return a custom
+  error response. Allowed root keys:
+- `statusCode` - the HTTP status code (typically 4xx or 5xx).
+- `headers` - an object containing any HTTP headers where each key is a 
header name and value is the header content.
+- `payload` - the formatted object used as the response payload 
(stringified). Can be directly manipulated but any
+  changes will be lost
+  if `reformat()` is called. Any content allowed and by default includes 
the following content:
+- `statusCode` - the HTTP status code, derived from 
`error.output.statusCode`.
+- `error` - the HTTP status message (e.g. 'Bad Request', 'Internal 
Server Error') derived from `statusCode`.
+- `message` - the error message derived from `error.message`.
+- inherited 

[MediaWiki-commits] [Gerrit] wikimedia...dash[deployment]: Bad submodule pointer commit

2017-12-12 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397883 )

Change subject: Bad submodule pointer commit
..

Bad submodule pointer commit

Committing a pointer to a submodule SHA that I'm not going to push
to gerrit

Bug: T176283
Change-Id: I62b9ab963f63a40d0771ebde0bbca537f078e998
---
M node_modules
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/83/397883/1

diff --git a/node_modules b/node_modules
index ed68957..2aee0db 16
--- a/node_modules
+++ b/node_modules
@@ -1 +1 @@
-Subproject commit ed68957143bc677be857cdada068d92fbf81bd08
+Subproject commit 2aee0db5819080400791e03f377e95987ac5efc6

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62b9ab963f63a40d0771ebde0bbca537f078e998
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Fixed vendor commit

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397718 )

Change subject: Fixed vendor commit
..

Fixed vendor commit

Change-Id: I3e047d02721556c085991e48b919d3e9f02ddc98
---
M vendor
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/18/397718/1

diff --git a/vendor b/vendor
index bb6bb3f..4a2f871 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit bb6bb3f86f4bd0a098e28c842f2ababdef8b7e0a
+Subproject commit 4a2f871ce564adfa60c15eabb53ad7fc2f85dcd3

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e047d02721556c085991e48b919d3e9f02ddc98
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...vendor[master]: Oops, forgot installed.json!

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397717 )

Change subject: Oops, forgot installed.json!
..

Oops, forgot installed.json!

Change-Id: I305a8696ac0db23520637461dba6bd3ea55f9b00
---
M composer/installed.json
1 file changed, 65 insertions(+), 63 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/vendor 
refs/changes/17/397717/1

diff --git a/composer/installed.json b/composer/installed.json
index 196e534..abacab8 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -1815,69 +1815,6 @@
 ]
 },
 {
-"name": "wikimedia/smash-pig",
-"version": "0.5.0",
-"version_normalized": "0.5.0.0",
-"source": {
-"type": "git",
-"url": 
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;,
-"reference": "def9c6f3cfc8e3878aa74cf94ebb8287b08ac2cc"
-},
-"require": {
-"amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
-"coderkungfu/php-queue": "^1.0",
-"corneltek/getoptionkit": "^2.5",
-"php": ">=5.3.3",
-"phpmailer/phpmailer": "^5.2",
-"predis/predis": "^1.1",
-"psr/cache": "^1.0",
-"symfony/event-dispatcher": "^2.1",
-"symfony/http-foundation": "^2.1",
-"symfony/yaml": "^2.8"
-},
-"require-dev": {
-"jakub-onderka/php-parallel-lint": "^0.9",
-"mediawiki/mediawiki-codesniffer": "0.11.0",
-"phpunit/phpunit": "^4.8"
-},
-"time": "2017-09-11T13:31:06+00:00",
-"type": "library",
-"installation-source": "source",
-"autoload": {
-"psr-4": {
-"SmashPig\\": "./"
-}
-},
-"notification-url": "https://packagist.org/downloads/;,
-"license": [
-"GPL-2.0"
-],
-"authors": [
-{
-"name": "Katie Horn",
-"email": "kh...@wikimedia.org"
-},
-{
-"name": "Matthew Walker",
-"email": "mwal...@wikimedia.org"
-},
-{
-"name": "Adam Roses Wight",
-"email": "awi...@wikimedia.org"
-},
-{
-"name": "Elliott Eggleston",
-"email": "eeggles...@wikimedia.org"
-}
-],
-"description": "The open source PHP flexible payments library and 
frontend/backend mediator.",
-"homepage": "http://smashpig.org;,
-"keywords": [
-"donations",
-"payments"
-]
-},
-{
 "name": "maxmind-db/reader",
 "version": "v1.1.3",
 "version_normalized": "1.1.3.0",
@@ -2318,5 +2255,70 @@
 "GPL-2.0"
 ],
 "description": "Wikimedia Foundation payment processing library"
+},
+{
+"name": "wikimedia/smash-pig",
+"version": "v0.5.1",
+"version_normalized": "0.5.1.0",
+"source": {
+"type": "git",
+"url": 
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;,
+"reference": "268799f492e3548006e13d28ffe14df0124edd28"
+},
+"require": {
+"amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
+"coderkungfu/php-queue": "^1.0",
+"corneltek/getoptionkit": "^2.5",
+"php": ">=5.4",
+"phpmailer/phpmailer": "^5.2",
+"predis/predis": "^1.1",
+"psr/cache": "^1.0",
+"psr/log": "^1.0",
+"symfony/event-dispatcher": "^2.1",
+"symfony/http-foundation": "^2.1",
+"symfony/yaml": "^2.8"
+},
+"require-dev": {
+"ext-sqlite3": "*",
+"jakub-onderka/php-parallel-lint": "^0.9",
+"mediawiki/mediawiki-codesniffer": "0.11.0",
+"phpunit/phpunit": "^4.8"
+},
+"time": "2017-12-11T19:36:55+00:00",
+"type": "library",
+"installation-source": "source",
+"autoload": {
+"psr-4": {
+"SmashPig\\": "./"
+}
+},
+"notification-url": "https://packagist.org/downloads/;,
+"license": [
+"GPL-2.0"
+],
+"authors": [
+{
+"name": "Katie Horn",
+"email": "kh...@wikimedia.org"
+},
+{
+"name": "Matthew Walker",
+"email": "mwal...@wikimedia.org"
+},
+{
+"name": "Adam Roses Wight",
+"email": "awi...@wikimedia.org"
+},
+{
+"name": "Elliott Eggleston",
+"email": "eeggles...@wikimedia.org"
+}
+],
+ 

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Apply drupal formatting to offline2civicrm.module

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397715 )

Change subject: Apply drupal formatting to offline2civicrm.module
..

Apply drupal formatting to offline2civicrm.module

Re-formatted using drupal rules in IDE

Change-Id: If7940b90edb13ab46df2cebf336c99ab8289f556
---
M sites/all/modules/offline2civicrm/offline2civicrm.module
1 file changed, 90 insertions(+), 90 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/15/397715/1

diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.module 
b/sites/all/modules/offline2civicrm/offline2civicrm.module
index 18ff9fa..71cb137 100644
--- a/sites/all/modules/offline2civicrm/offline2civicrm.module
+++ b/sites/all/modules/offline2civicrm/offline2civicrm.module
@@ -70,59 +70,59 @@
 }
 
 function offline2civicrm_import_checks_form() {
-  $dir = drupal_get_path( 'module', 'offline2civicrm' );
-  drupal_add_js( $dir . '/upload_form.js' );
+  $dir = drupal_get_path('module', 'offline2civicrm');
+  drupal_add_js($dir . '/upload_form.js');
 
   $log_events = ChecksImportLog::recentEvents();
-  $headers = array( 'Time', 'Who', 'Done' );
+  $headers = array('Time', 'Who', 'Done');
   $rows = array();
-  foreach ( $log_events as $event ) {
+  foreach ($log_events as $event) {
 $rows[] = array(
   $event->time,
   $event->who,
   $event->done,
 );
   }
-  $log_html = theme_table( array(
-'header' => $headers,
-'rows' => $rows,
-'empty' => "No events yet.",
-'attributes' => array(),
-'caption' => t( 'Latest import events' ),
-'colgroups' => array(),
-'sticky' => true,
-  ) ).theme('pager');
+  $log_html = theme_table(array(
+  'header' => $headers,
+  'rows' => $rows,
+  'empty' => "No events yet.",
+  'attributes' => array(),
+  'caption' => t('Latest import events'),
+  'colgroups' => array(),
+  'sticky' => TRUE,
+)) . theme('pager');
 
   $form['import_upload_file'] = array(
-'#title' => t( 'Upload checks file' ),
+'#title' => t('Upload checks file'),
 '#type' => 'file',
   );
   $form['import_upload_submit'] = array(
 '#type' => 'submit',
-'#value' => t( 'Upload' ),
+'#value' => t('Upload'),
   );
   $form['import_upload_format'] = array(
-'#title' => t( 'File format' ),
+'#title' => t('File format'),
 '#type' => 'radios',
 '#default_value' => 'generic_ind',
 '#options' => array(
-'benevity' => t('Benevity'),
-'engage' => t( 'Engage' ),
-'coinbase' => t( 'Coinbase Merchant Orders' ),
-'foreign_checks' => t( 'Foreign Checks' ),
-'generic_ind' => t( 'Generic Individuals' ),
-'generic_org' => t( 'Generic Organizations' ),
-'jpmorgan' => t( 'JP Morgan' ),
-'paypal' => t( 'PayPal EFT' ),
-'square' => t( 'Square' ),
-'trilogy' => t( 'Trilogy' ),
+  'benevity' => t('Benevity'),
+  'engage' => t('Engage'),
+  'coinbase' => t('Coinbase Merchant Orders'),
+  'foreign_checks' => t('Foreign Checks'),
+  'generic_ind' => t('Generic Individuals'),
+  'generic_org' => t('Generic Organizations'),
+  'jpmorgan' => t('JP Morgan'),
+  'paypal' => t('PayPal EFT'),
+  'square' => t('Square'),
+  'trilogy' => t('Trilogy'),
 ),
   );
   $form['log'] = array(
 '#markup' => $log_html,
   );
 
-  $form['#attributes'] = array( 'enctype' => "multipart/form-data" );
+  $form['#attributes'] = array('enctype' => "multipart/form-data");
 
   return $form;
 }
@@ -133,88 +133,88 @@
  * @param $file_name
  */
 function offline2civicrm_download_csv($file_name) {
-global $user;
-if (!preg_match ('/\.' . $user->uid . '$/', $file_name)) {
-  return drupal_access_denied();
-}
-$fileURI = 'temporary://' . $file_name . '.csv';
-if ($file_name && file_exists($fileURI)) {
-  file_transfer($fileURI, array(
-'Content-Type' => 'text/csv',
-'Content-Disposition' => 'attachment; filename="' . $file_name . 
'.csv"',
-  ));
-}
-else {
-  return drupal_access_denied();
-}
+  global $user;
+  if (!preg_match('/\.' . $user->uid . '$/', $file_name)) {
+return drupal_access_denied();
+  }
+  $fileURI = 'temporary://' . $file_name . '.csv';
+  if ($file_name && file_exists($fileURI)) {
+file_transfer($fileURI, array(
+  'Content-Type' => 'text/csv',
+  'Content-Disposition' => 'attachment; filename="' . $file_name . '.csv"',
+));
+  }
+  else {
+return drupal_access_denied();
+  }
 }
 
-function offline2civicrm_import_checks_form_submit( $form, $form_state ) {
-  wmf_common_create_smashpig_context( 'offline2civicrm' );
-  if ( !empty( $form_state['values']['import_upload_submit'] ) ) {
+function offline2civicrm_import_checks_form_submit($form, $form_state) {
+  wmf_common_create_smashpig_context('offline2civicrm');
+  if 

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Add stripe import

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397716 )

Change subject: Add stripe import
..

Add stripe import

At this stage an exception is thrown if non-USD currencies are in use and 
utm_campaign column is respected
if set, ditto utm_medium with a default of MGEventEmail

There is a desire for currency support & I think that might be the case for 
another import too.
I also feel there is a desire for being able to set an import-wide default for 
a field. I've left these
out of this iteration.

Bug: T172423

Change-Id: I63a85f352caec1d695724a9b1dd1129f9a29781c
---
A sites/all/modules/offline2civicrm/StripeFile.php
M sites/all/modules/offline2civicrm/offline2civicrm.info
M sites/all/modules/offline2civicrm/offline2civicrm.module
A sites/all/modules/offline2civicrm/tests/StripeFileTest.php
A sites/all/modules/offline2civicrm/tests/data/stripe.csv
5 files changed, 184 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/16/397716/1

diff --git a/sites/all/modules/offline2civicrm/StripeFile.php 
b/sites/all/modules/offline2civicrm/StripeFile.php
new file mode 100644
index 000..49b9f03
--- /dev/null
+++ b/sites/all/modules/offline2civicrm/StripeFile.php
@@ -0,0 +1,119 @@
+ 'gateway_txn_id',
+  'utm_source' => 'utm_source',
+  'utm_campaign' => 'utm_campaign',
+  'utm_medium' => 'utm_medium',
+  'Card Address Line1' => 'street_address',
+  'Card Address Line2' => 'supplemental_address_1',
+  'Card Address City' => 'city',
+  'Converted Amount' => 'gross',
+  'Amount' => 'original_gross',
+  'Created (UTC)' => 'date',
+  'Customer Email' => 'email',
+  'Converted Currency' => 'currency',
+  'Currency' => 'original_currency',
+  'Card Name' => 'full_name',
+  'Card Address State' => 'state_province',
+  'Card Address Zip' => 'postal_code',
+  'Card Address Country' => 'country',
+
+
+  //id,
+  //Description,
+  //Amount ,,
+  //Amount Refunded,
+  //Currency,
+  //Converted Amount Refunded,Fee,
+  //Tax,
+  //Converted Currency,
+  //Mode,
+  //Status,
+  //Statement Descriptor,
+  //Customer ID,
+  //Customer Description,,
+  //Captured,Card ID,
+  //Card Last4,
+  //Card Brand,
+  //Card Funding,
+  //Card Exp Month,
+  //Card Exp Year,
+  //Card Issue Country,
+  //Card Fingerprint,
+  //Card CVC Status,
+  //Card AVS Zip Status,
+  //Card AVS Line1 Status,
+  //Card Tokenization Method,
+  //Disputed Amount,
+  //Dispute Status,
+  //Dispute Reason,
+  //Dispute Date (UTC),
+  //Dispute Evidence Due (UTC)
+  //Invoice ID,
+  //Payment Source Type,
+  //Destination,
+  //Transfer,
+  //Transfer Group,
+  //event_id (metadata),
+  //event_name (metadata),
+  //order_number (metadata)
+);
+  }
+
+  protected function getDefaultValues() {
+return array_merge(parent::getDefaultValues(), array(
+'gateway' => 'stripe',
+'no_thank_you' => 'stripe',
+'payment_instrument' => 'Stripe',
+'payment_method' => 'Stripe',
+'utm_medium' => 'MGEventEmail',
+'contact_source' => 'Stripe import',
+  )
+);
+  }
+
+  /**
+   * Read a row and transform into normalized queue message form
+   *
+   * @param $data
+   *
+   * @return array queue message format
+   *
+   * @throws \EmptyRowException
+   * @throws \WmfException
+   */
+  protected function parseRow($data) {
+if (!empty($data['Converted Amount Refunded'])) {
+  throw new WmfException(WmfException::INVALID_MESSAGE, 'Refunds not 
currently handled. Please log a Phab if required');
+}
+return parent::parseRow($data);
+  }
+
+}
diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.info 
b/sites/all/modules/offline2civicrm/offline2civicrm.info
index 4a49a4f..967c081 100644
--- a/sites/all/modules/offline2civicrm/offline2civicrm.info
+++ b/sites/all/modules/offline2civicrm/offline2civicrm.info
@@ -22,6 +22,7 @@
 files[] = PayPalChecksFile.php
 files[] = RefundFile.php
 files[] = SquareFile.php
+files[] = StripeFile.php
 files[] = TrilogyFile.php
 files[] = WmfImportFile.php
 files[] = WmfOrgImportFile.php
diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.module 
b/sites/all/modules/offline2civicrm/offline2civicrm.module
index 71cb137..ed491c3 100644
--- a/sites/all/modules/offline2civicrm/offline2civicrm.module
+++ b/sites/all/modules/offline2civicrm/offline2civicrm.module
@@ -115,6 +115,7 @@
   'jpmorgan' => t('JP Morgan'),
   'paypal' => t('PayPal EFT'),
   'square' => t('Square'),
+  'stripe' => t('Stripe'),
   'trilogy' => t('Trilogy'),
 ),
   );
@@ -194,6 +195,11 @@
 case 'square':
   $importer = new SquareFile($file->uri);
   break;
+
+

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update vendor

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397714 )

Change subject: Update vendor
..

Update vendor

Change-Id: Idc53d5ddfc75f21b0a365cfadb31ebc463bce178
---
M vendor
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/14/397714/1

diff --git a/vendor b/vendor
index bc7a828..bb6bb3f 16
--- a/vendor
+++ b/vendor
@@ -1 +1 @@
-Subproject commit bc7a8289659754c7fd06c2f2d0eb12fd87947a52
+Subproject commit bb6bb3f86f4bd0a098e28c842f2ababdef8b7e0a

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc53d5ddfc75f21b0a365cfadb31ebc463bce178
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update SmashPig lib

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397712 )

Change subject: Update SmashPig lib
..

Update SmashPig lib

Get the XML stream processing for Ingenico WX files

Change-Id: I78cf55536772b92e3e2c6e19495cec53c14a86b6
---
M composer.lock
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/12/397712/1

diff --git a/composer.lock b/composer.lock
index 9336700..e06dee5 100644
--- a/composer.lock
+++ b/composer.lock
@@ -2138,25 +2138,27 @@
 },
 {
 "name": "wikimedia/smash-pig",
-"version": "0.5.0",
+"version": "v0.5.1",
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;,
-"reference": "def9c6f3cfc8e3878aa74cf94ebb8287b08ac2cc"
+"reference": "268799f492e3548006e13d28ffe14df0124edd28"
 },
 "require": {
 "amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
 "coderkungfu/php-queue": "^1.0",
 "corneltek/getoptionkit": "^2.5",
-"php": ">=5.3.3",
+"php": ">=5.4",
 "phpmailer/phpmailer": "^5.2",
 "predis/predis": "^1.1",
 "psr/cache": "^1.0",
+"psr/log": "^1.0",
 "symfony/event-dispatcher": "^2.1",
 "symfony/http-foundation": "^2.1",
 "symfony/yaml": "^2.8"
 },
 "require-dev": {
+"ext-sqlite3": "*",
 "jakub-onderka/php-parallel-lint": "^0.9",
 "mediawiki/mediawiki-codesniffer": "0.11.0",
 "phpunit/phpunit": "^4.8"
@@ -2195,7 +2197,7 @@
 "donations",
 "payments"
 ],
-"time": "2017-09-11T13:31:06+00:00"
+"time": "2017-12-11T19:36:55+00:00"
 },
 {
 "name": "zordius/lightncandy",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78cf55536772b92e3e2c6e19495cec53c14a86b6
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update SmashPig lib

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397620 )

Change subject: Update SmashPig lib
..

Update SmashPig lib

Get the XML stream processing for Ingenico WX files

Change-Id: I78cf55536772b92e3e2c6e19495cec53c14a86b6
---
M composer.lock
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/20/397620/1

diff --git a/composer.lock b/composer.lock
index 09d405c..2ae68da 100644
--- a/composer.lock
+++ b/composer.lock
@@ -88,7 +88,7 @@
 "payment",
 "payments"
 ],
-"time": "2016-02-17T00:53:20+00:00"
+"time": "2016-02-17T00:44:20+00:00"
 },
 {
 "name": "clio/clio",
@@ -2237,25 +2237,27 @@
 },
 {
 "name": "wikimedia/smash-pig",
-"version": "0.5.0",
+"version": "v0.5.1",
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;,
-"reference": "def9c6f3cfc8e3878aa74cf94ebb8287b08ac2cc"
+"reference": "268799f492e3548006e13d28ffe14df0124edd28"
 },
 "require": {
 "amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
 "coderkungfu/php-queue": "^1.0",
 "corneltek/getoptionkit": "^2.5",
-"php": ">=5.3.3",
+"php": ">=5.4",
 "phpmailer/phpmailer": "^5.2",
 "predis/predis": "^1.1",
 "psr/cache": "^1.0",
+"psr/log": "^1.0",
 "symfony/event-dispatcher": "^2.1",
 "symfony/http-foundation": "^2.1",
 "symfony/yaml": "^2.8"
 },
 "require-dev": {
+"ext-sqlite3": "*",
 "jakub-onderka/php-parallel-lint": "^0.9",
 "mediawiki/mediawiki-codesniffer": "0.11.0",
 "phpunit/phpunit": "^4.8"
@@ -2294,7 +2296,7 @@
 "donations",
 "payments"
 ],
-"time": "2017-09-11T13:31:06+00:00"
+"time": "2017-12-11T19:36:55+00:00"
 },
 {
 "name": "zordius/lightncandy",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78cf55536772b92e3e2c6e19495cec53c14a86b6
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Use XMLReader for WX audit

2017-12-11 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/397608 )

Change subject: Use XMLReader for WX audit
..

Use XMLReader for WX audit

Bug: T182605
Change-Id: I423bc0b89dac4badc9a973ec38ae6acd2eb8324a
---
M PaymentProviders/Ingenico/Audit/IngenicoAudit.php
1 file changed, 11 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/08/397608/1

diff --git a/PaymentProviders/Ingenico/Audit/IngenicoAudit.php 
b/PaymentProviders/Ingenico/Audit/IngenicoAudit.php
index b6269c9..54b2a4f 100644
--- a/PaymentProviders/Ingenico/Audit/IngenicoAudit.php
+++ b/PaymentProviders/Ingenico/Audit/IngenicoAudit.php
@@ -1,12 +1,12 @@
 fileData = [];
$unzippedFullPath = $this->getUnzippedFile( $path );
 
-   // load the XML into a DOMDocument.
-   // Total Memory Hog Alert. Handle with care.
-   $domDoc = new DOMDocument( '1.0' );
-   Logger::info( "Loading XML from $unzippedFullPath" );
-   $domDoc->load( $unzippedFullPath );
-   unlink( $unzippedFullPath );
+   Logger::info( "Opening $unzippedFullPath with XMLReader" );
+   $reader = new XMLReader();
+   $reader->open( $unzippedFullPath );
Logger::info( "Processing" );
-
-   foreach ( $domDoc->getElementsByTagName( 'DataRecord' ) as 
$recordNode ) {
-   $this->parseRecord( $recordNode );
+   while ( $reader->read() ) {
+   if ( $reader->nodeType === XMLReader::ELEMENT && 
$reader->name == 'tns:DataRecord' ) {
+   $record = $reader->expand();
+   $this->parseRecord( $record );
+   }
}
+   $reader->close();
+   unlink( $unzippedFullPath );
 
return $this->fileData;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I423bc0b89dac4badc9a973ec38ae6acd2eb8324a
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Better requeue on db locks

2017-12-08 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396422 )

Change subject: Better requeue on db locks
..

Better requeue on db locks

Look in the whole 'extra' array, not just the trace.

Change-Id: Ia7d55d7451fd5d6064789c6f4205025aaa504eb5
---
M sites/all/modules/wmf_common/WmfException.php
1 file changed, 13 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/22/396422/1

diff --git a/sites/all/modules/wmf_common/WmfException.php 
b/sites/all/modules/wmf_common/WmfException.php
index 1ab193d..9cb6e4b 100644
--- a/sites/all/modules/wmf_common/WmfException.php
+++ b/sites/all/modules/wmf_common/WmfException.php
@@ -189,15 +189,19 @@
 
 function isRequeue()
 {
-   if ( $this->extra && !empty( $this->extra['trace'] ) ) {
-   // We want to retry later if the problem was a lock wait timeout
-   // or a deadlock. Unfortunately we have to do string 
parsing to
-   // figure that out.
-   if ( preg_match( '/\'12(05|13) \*\* /', $this->extra['trace'] ) 
) {
-   return TRUE;
-   }
-   }
-return $this->getErrorCharacteristic('requeue', FALSE);
+  if ($this->extra) {
+// We want to retry later if the problem was a lock wait timeout
+// or a deadlock. Unfortunately we have to do string parsing to
+// figure that out.
+$flattened = print_r($this->extra, TRUE);
+if (
+  preg_match('/\'12(05|13) \*\* /', $flattened) ||
+  preg_match('/Database lock encountered/', $flattened)
+) {
+  return TRUE;
+}
+  }
+  return $this->getErrorCharacteristic('requeue', FALSE);
 }
 
 function isFatal()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7d55d7451fd5d6064789c6f4205025aaa504eb5
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: Undo mailing debug logging

2017-12-07 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396278 )

Change subject: Undo mailing debug logging
..

Undo mailing debug logging

Reset EmailProcessor to upstream

Bug: T181934
Change-Id: I66f421d3015581fa7908ecde325694e4bd8d2f9c
---
M CRM/Utils/Mail/EmailProcessor.php
1 file changed, 0 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/78/396278/1

diff --git a/CRM/Utils/Mail/EmailProcessor.php 
b/CRM/Utils/Mail/EmailProcessor.php
index b602649..bb02bae 100644
--- a/CRM/Utils/Mail/EmailProcessor.php
+++ b/CRM/Utils/Mail/EmailProcessor.php
@@ -176,9 +176,6 @@
 // process fifty at a time, CRM-4002
 while ($mails = $store->fetchNext(MAIL_BATCH_SIZE)) {
   foreach ($mails as $key => $mail) {
-watchdog('EmailProcessor', "Processing email: $key", array(), 
WATCHDOG_DEBUG);
-$messageId = $mail->getHeader('Message-ID');
-watchdog('EmailProcessor', "With message ID: $messageId", array(), 
WATCHDOG_DEBUG);
 
 // for every addressee: match address elements if it's to CiviMail
 $matches = array();
@@ -186,7 +183,6 @@
 
 if ($usedfor == 1) {
   foreach ($mail->to as $address) {
-watchdog('EmailProcessor', "With address: $address", array(), 
WATCHDOG_DEBUG);
 if (preg_match($regex, $address->email, $matches)) {
   list($match, $action, $job, $queue, $hash) = $matches;
   break;
@@ -276,7 +272,6 @@
 // get $replyTo from either the Reply-To header or from From
 // FIXME: make sure it works with Reply-Tos containing non-email stuff
 $replyTo = $mail->getHeader('Reply-To') ? $mail->getHeader('Reply-To') 
: $mail->from->email;
-watchdog('EmailProcessor', "With Reply-To: $replyTo", array(), 
WATCHDOG_DEBUG);
 
 // handle the action by passing it to the proper API call
 // FIXME: leave only one-letter cases when dropping legacy support
@@ -291,11 +286,9 @@
 $text = $mail->body->text;
   }
   elseif ($mail->body instanceof ezcMailMultipart) {
-watchdog('EmailProcessor', "Body is multipart", array(), 
WATCHDOG_DEBUG);
 if ($mail->body instanceof ezcMailMultipartReport) {
   $part = $mail->body->getMachinePart();
   if ($part instanceof ezcMailDeliveryStatus) {
-watchdog('EmailProcessor', "Part is DeliveryStatus", 
array(), WATCHDOG_DEBUG);
 foreach ($part->recipients as $rec) {
   if (isset($rec["Diagnostic-Code"])) {
 $text = $rec["Diagnostic-Code"];
@@ -320,17 +313,14 @@
 }
   }
   elseif ($part != NULL and isset($part->text)) {
-watchdog('EmailProcessor', "Part is not DeliveryStatus but 
has text", array(), WATCHDOG_DEBUG);
 $text = $part->text;
   }
   elseif (($part = $mail->body->getReadablePart()) != NULL) {
-watchdog('EmailProcessor', "Part is not DeliveryStatus but 
supposedly has ReadablePart: " . print_r($part, true), array(), WATCHDOG_DEBUG);
 $text = $part->text;
   }
 }
 elseif ($mail->body instanceof ezcMailMultipartRelated) {
   foreach ($mail->body->getRelatedParts() as $part) {
-watchdog('EmailProcessor', "Looking at related part", 
array(), WATCHDOG_DEBUG);
 if (isset($part->subType) and $part->subType == 'plain') {
   $text = $part->text;
   break;
@@ -340,7 +330,6 @@
 else {
   foreach ($mail->body->getParts() as $part) {
 if (isset($part->subType) and $part->subType == 'plain') {
-  watchdog('EmailProcessor', "Part subtype is plain", 
array(), WATCHDOG_DEBUG);
   $text = $part->text;
   break;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66f421d3015581fa7908ecde325694e4bd8d2f9c
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: CRM-21521: read multipart-related inside report

2017-12-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395566 )

Change subject: CRM-21521: read multipart-related inside report
..

CRM-21521: read multipart-related inside report

When a multipart-report email body's first part is
multipart-related, extract the text correctly instead of crashing.

Bug: T181934
Change-Id: I736acde96885aa6f6dde87af8770de5f812ea3ad
---
M CRM/Utils/Mail/EmailProcessor.php
1 file changed, 22 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/66/395566/1

diff --git a/CRM/Utils/Mail/EmailProcessor.php 
b/CRM/Utils/Mail/EmailProcessor.php
index b602649..ee48d4c 100644
--- a/CRM/Utils/Mail/EmailProcessor.php
+++ b/CRM/Utils/Mail/EmailProcessor.php
@@ -325,17 +325,15 @@
   }
   elseif (($part = $mail->body->getReadablePart()) != NULL) {
 watchdog('EmailProcessor', "Part is not DeliveryStatus but 
supposedly has ReadablePart: " . print_r($part, true), array(), WATCHDOG_DEBUG);
-$text = $part->text;
+if (isset($part->text)) {
+  $text = $part->text;
+} elseif ($part instanceof ezcMailMultipartRelated) {
+  $text = self::getTextFromRelated($part);
+}
   }
 }
 elseif ($mail->body instanceof ezcMailMultipartRelated) {
-  foreach ($mail->body->getRelatedParts() as $part) {
-watchdog('EmailProcessor', "Looking at related part", 
array(), WATCHDOG_DEBUG);
-if (isset($part->subType) and $part->subType == 'plain') {
-  $text = $part->text;
-  break;
-}
-  }
+  $text = self::getTextFromRelated($mail->body);
 }
 else {
   foreach ($mail->body->getParts() as $part) {
@@ -486,4 +484,20 @@
 }
   }
 
+  /**
+   * @param \ezcMailMultipartRelated $related
+   *
+   * @return array
+   */
+  protected static function getTextFromRelated($related) {
+foreach ($related->getRelatedParts() as $part) {
+  watchdog('EmailProcessor', "Looking at related part", [], 
WATCHDOG_DEBUG);
+  if (isset($part->subType) and $part->subType == 'plain') {
+$text = $part->text;
+return $text;
+  }
+}
+return null;
+  }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I736acde96885aa6f6dde87af8770de5f812ea3ad
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Moar debug bounce

2017-12-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395562 )

Change subject: Moar debug bounce
..

Moar debug bounce

Change-Id: Ifc6f22688d3711459c43b07d2a34e3ba676d9c95
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/62/395562/1

diff --git a/civicrm b/civicrm
index 789bf0f..a82f2e7 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 789bf0f988718bdf244536118cb67bbaf9e24dcf
+Subproject commit a82f2e7ea633af7477a2c8859b97dbe13ddda5d7

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc6f22688d3711459c43b07d2a34e3ba676d9c95
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: Moar debug bounce

2017-12-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395561 )

Change subject: Moar debug bounce
..

Moar debug bounce

Change-Id: I9e3e66f822e4a82481bfe4869f5beb05abb4b6d8
---
M CRM/Utils/Mail/EmailProcessor.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/61/395561/1

diff --git a/CRM/Utils/Mail/EmailProcessor.php 
b/CRM/Utils/Mail/EmailProcessor.php
index ebe7736..b602649 100644
--- a/CRM/Utils/Mail/EmailProcessor.php
+++ b/CRM/Utils/Mail/EmailProcessor.php
@@ -177,6 +177,8 @@
 while ($mails = $store->fetchNext(MAIL_BATCH_SIZE)) {
   foreach ($mails as $key => $mail) {
 watchdog('EmailProcessor', "Processing email: $key", array(), 
WATCHDOG_DEBUG);
+$messageId = $mail->getHeader('Message-ID');
+watchdog('EmailProcessor', "With message ID: $messageId", array(), 
WATCHDOG_DEBUG);
 
 // for every addressee: match address elements if it's to CiviMail
 $matches = array();
@@ -322,7 +324,7 @@
 $text = $part->text;
   }
   elseif (($part = $mail->body->getReadablePart()) != NULL) {
-watchdog('EmailProcessor', "Part is not DeliveryStatus but 
supposedly has ReadablePart", array(), WATCHDOG_DEBUG);
+watchdog('EmailProcessor', "Part is not DeliveryStatus but 
supposedly has ReadablePart: " . print_r($part, true), array(), WATCHDOG_DEBUG);
 $text = $part->text;
   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e3e66f822e4a82481bfe4869f5beb05abb4b6d8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: More debugging for email

2017-12-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395548 )

Change subject: More debugging for email
..

More debugging for email

Change-Id: I446fa9dac7a742b4c9b71ea5641f28706c26e14f
---
M CRM/Utils/Mail/EmailProcessor.php
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/48/395548/1

diff --git a/CRM/Utils/Mail/EmailProcessor.php 
b/CRM/Utils/Mail/EmailProcessor.php
index 0e297f2..ebe7736 100644
--- a/CRM/Utils/Mail/EmailProcessor.php
+++ b/CRM/Utils/Mail/EmailProcessor.php
@@ -184,6 +184,7 @@
 
 if ($usedfor == 1) {
   foreach ($mail->to as $address) {
+watchdog('EmailProcessor', "With address: $address", array(), 
WATCHDOG_DEBUG);
 if (preg_match($regex, $address->email, $matches)) {
   list($match, $action, $job, $queue, $hash) = $matches;
   break;
@@ -273,6 +274,7 @@
 // get $replyTo from either the Reply-To header or from From
 // FIXME: make sure it works with Reply-Tos containing non-email stuff
 $replyTo = $mail->getHeader('Reply-To') ? $mail->getHeader('Reply-To') 
: $mail->from->email;
+watchdog('EmailProcessor', "With Reply-To: $replyTo", array(), 
WATCHDOG_DEBUG);
 
 // handle the action by passing it to the proper API call
 // FIXME: leave only one-letter cases when dropping legacy support
@@ -287,9 +289,11 @@
 $text = $mail->body->text;
   }
   elseif ($mail->body instanceof ezcMailMultipart) {
+watchdog('EmailProcessor', "Body is multipart", array(), 
WATCHDOG_DEBUG);
 if ($mail->body instanceof ezcMailMultipartReport) {
   $part = $mail->body->getMachinePart();
   if ($part instanceof ezcMailDeliveryStatus) {
+watchdog('EmailProcessor', "Part is DeliveryStatus", 
array(), WATCHDOG_DEBUG);
 foreach ($part->recipients as $rec) {
   if (isset($rec["Diagnostic-Code"])) {
 $text = $rec["Diagnostic-Code"];
@@ -314,14 +318,17 @@
 }
   }
   elseif ($part != NULL and isset($part->text)) {
+watchdog('EmailProcessor', "Part is not DeliveryStatus but 
has text", array(), WATCHDOG_DEBUG);
 $text = $part->text;
   }
   elseif (($part = $mail->body->getReadablePart()) != NULL) {
+watchdog('EmailProcessor', "Part is not DeliveryStatus but 
supposedly has ReadablePart", array(), WATCHDOG_DEBUG);
 $text = $part->text;
   }
 }
 elseif ($mail->body instanceof ezcMailMultipartRelated) {
   foreach ($mail->body->getRelatedParts() as $part) {
+watchdog('EmailProcessor', "Looking at related part", 
array(), WATCHDOG_DEBUG);
 if (isset($part->subType) and $part->subType == 'plain') {
   $text = $part->text;
   break;
@@ -331,6 +338,7 @@
 else {
   foreach ($mail->body->getParts() as $part) {
 if (isset($part->subType) and $part->subType == 'plain') {
+  watchdog('EmailProcessor', "Part subtype is plain", 
array(), WATCHDOG_DEBUG);
   $text = $part->text;
   break;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I446fa9dac7a742b4c9b71ea5641f28706c26e14f
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: more email bounce debug

2017-12-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395547 )

Change subject: more email bounce debug
..

more email bounce debug

Change-Id: I11746965af5e4095596a5bc8c98406981358c10f
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/47/395547/1

diff --git a/civicrm b/civicrm
index f903ec6..789bf0f 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit f903ec6a46a6624990fc31733721afbe66068719
+Subproject commit 789bf0f988718bdf244536118cb67bbaf9e24dcf

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11746965af5e4095596a5bc8c98406981358c10f
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update CiviCRM submodule

2017-12-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395542 )

Change subject: Update CiviCRM submodule
..

Update CiviCRM submodule

Change-Id: I9ba28176183587727d2c734a999cca60a064c092
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/42/395542/1

diff --git a/civicrm b/civicrm
index 7940fc7..f903ec6 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 7940fc71718d147382f56f706d95b1f49107da23
+Subproject commit f903ec6a46a6624990fc31733721afbe66068719

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ba28176183587727d2c734a999cca60a064c092
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update CiviCRM submodule

2017-12-05 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395541 )

Change subject: Update CiviCRM submodule
..

Update CiviCRM submodule

Change-Id: I9ba28176183587727d2c734a999cca60a064c092
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/41/395541/1

diff --git a/civicrm b/civicrm
index 7940fc7..f903ec6 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit 7940fc71718d147382f56f706d95b1f49107da23
+Subproject commit f903ec6a46a6624990fc31733721afbe66068719

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ba28176183587727d2c734a999cca60a064c092
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: Debug logging for bounce processor

2017-12-04 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395047 )

Change subject: Debug logging for bounce processor
..

Debug logging for bounce processor

Bug: T181934
Change-Id: Ic332aa534685954b246022567dd878cc910c0f6c
---
M CRM/Utils/Mail/EmailProcessor.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/47/395047/1

diff --git a/CRM/Utils/Mail/EmailProcessor.php 
b/CRM/Utils/Mail/EmailProcessor.php
index bb02bae..0e297f2 100644
--- a/CRM/Utils/Mail/EmailProcessor.php
+++ b/CRM/Utils/Mail/EmailProcessor.php
@@ -176,6 +176,7 @@
 // process fifty at a time, CRM-4002
 while ($mails = $store->fetchNext(MAIL_BATCH_SIZE)) {
   foreach ($mails as $key => $mail) {
+watchdog('EmailProcessor', "Processing email: $key", array(), 
WATCHDOG_DEBUG);
 
 // for every addressee: match address elements if it's to CiviMail
 $matches = array();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic332aa534685954b246022567dd878cc910c0f6c
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Update gateway list

2017-12-01 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394636 )

Change subject: Update gateway list
..

Update gateway list

Change-Id: If884f18cc8ee36c61edf07389da4d4f2d84f4d2d
---
M widgets/common-filters.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/36/394636/1

diff --git a/widgets/common-filters.js b/widgets/common-filters.js
index d2a9cc6..b035c65 100644
--- a/widgets/common-filters.js
+++ b/widgets/common-filters.js
@@ -146,7 +146,7 @@
column: 'gateway',
display: 'Gateway',
type: 'dropdown',
-   values: [ 'adyen', 'amazon', 'astropay', 
'globalcollect', 'paypal', 'worldpay' ],
+   values: [ 'adyen', 'amazon', 'astropay', 
'globalcollect', 'paypal', 'paypal_ec', 'worldpay' ],
canGroup: true
},
Amount: {
@@ -241,7 +241,7 @@
column: 'gateway',
display: 'Gateway',
type: 'dropdown',
-   values: [ 'adyen', 'astropay', 'globalcollect', 
'worldpay' ]
+   values: [ 'adyen', 'amazon', 'astropay', 
'globalcollect', 'paypal', 'paypal_ec', 'worldpay' ]
},
Score: {
table: 'pf',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If884f18cc8ee36c61edf07389da4d4f2d84f4d2d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Debugging for mystery FK errors

2017-12-01 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394629 )

Change subject: Debugging for mystery FK errors
..

Debugging for mystery FK errors

Change-Id: I29da014cc25bac75540d84f94e68e5cbe19ea0c0
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
M sites/all/modules/wmf_common/WmfDatabase.php
2 files changed, 27 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/29/394629/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 0f1961e..058c8a4 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1193,6 +1193,9 @@
 }
 }
 
+if (WmfDatabase::isNativeTxnRolledBack()) {
+  throw new WmfException("IMPORT_CONTACT", "Native txn rolled back before 
inserting contact");
+}
 // Attempt to insert the contact
 try {
 $contact_result = civicrm_api3( "Contact", "Create", $contact );
@@ -1201,6 +1204,10 @@
 } else {
 watchdog( 'wmf_civicrm', 'Result for updating contact: %contact', 
array( '%contact' => print_r( $contact_result, true )), WATCHDOG_DEBUG );
 }
+
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting contact");
+  }
 } catch ( CiviCRM_API3_Exception $ex ) {
 throw new WmfException(
 "IMPORT_CONTACT",
@@ -1297,7 +1304,9 @@
 throw new WmfException( 'IMPORT_CONTACT', $ex->getMessage() );
 }
 }
-
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting contact auxiliary fields");
+  }
 return $contact_result;
 }
 
@@ -1433,6 +1442,9 @@
  */
 function wmf_civicrm_message_location_insert( $msg, $contact ) {
 wmf_civicrm_message_email_insert( $msg, $contact[ 'id' ] );
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting email");
+  }
 wmf_civicrm_message_address_insert( $msg, $contact[ 'id' ] );
 }
 
@@ -1644,7 +1656,9 @@
 if (!wmf_civicrm_is_address_valid($address_params)) {
 return;
 }
-
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back before 
inserting address");
+  }
 try {
 civicrm_api3('Address', 'Create', $address_params);
 }
@@ -1655,6 +1669,10 @@
   $ex->getMessage()
 );
 }
+
+  if (WmfDatabase::isNativeTxnRolledBack()) {
+throw new WmfException("IMPORT_CONTACT", "Native txn rolled back after 
inserting address");
+  }
 }
 
 function wmf_civicrm_get_default_location_type_id() {
diff --git a/sites/all/modules/wmf_common/WmfDatabase.php 
b/sites/all/modules/wmf_common/WmfDatabase.php
index d52dddf..13e5783 100644
--- a/sites/all/modules/wmf_common/WmfDatabase.php
+++ b/sites/all/modules/wmf_common/WmfDatabase.php
@@ -1,6 +1,8 @@
 getFrame()->isRollbackOnly()) {
+if (self::isNativeTxnRolledBack()) {
throw new RuntimeException(
'Civi Transaction was marked for rollback and Exception 
was suppressed'
);
@@ -48,4 +50,8 @@
 unset( $drupal_transaction );
 return $result;
 }
+
+public static function isNativeTxnRolledBack() {
+  return Manager::singleton()->getFrame()->isRollbackOnly();
+}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29da014cc25bac75540d84f94e68e5cbe19ea0c0
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: WIP further refactor

2017-11-30 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394494 )

Change subject: WIP further refactor
..

WIP further refactor

Use a different intermediary table to generate the aggregate
statistics. This ensures that we're only considering valid
combinations of primary email and not-deleted contacts.

It also lets us do fewer joins when we're generating the stats.

Change-Id: Iddd44ac5ca4d4914dc9e156264c2447b11ab1f60
---
M silverpop_export/update_table.sql
1 file changed, 34 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/94/394494/1

diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 9e361e1..e598cd2 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -13,6 +13,7 @@
 DROP TABLE IF EXISTS silverpop_export_dedupe_email;
 DROP TABLE IF EXISTS silverpop_export_stat;
 DROP TABLE IF EXISTS silverpop_export_address;
+DROP TABLE IF EXISTS silverpop_email_contact_ids;
 
 CREATE TABLE IF NOT EXISTS silverpop_export_staging(
   -- General information about the contact
@@ -57,6 +58,23 @@
   latest_donation datetime
 ) COLLATE 'utf8_unicode_ci';
 
+-- This table maps all email addresses to all the associated,
+-- not-deleted contact IDs for whom they are the primary email
+CREATE TABLE silverpop_email_contact_ids (
+  contact_id int unsigned PRIMARY KEY,
+  email varchar(255),
+  on_hold tinyint,
+  INDEX seci_email(email)
+);
+
+INSERT INTO silverpop_email_contact_ids
+  SELECT e.contact_id, e.email, e.on_hold
+  FROM   civicrm.civicrm_email e
+  INNER JOIN civicrm.civicrm_contact c ON e.contact_id = c.id
+  WHERE  c.is_deleted = 0
+  ANDe.is_primary = 1
+  ANDe.email IS NOT NULL AND e.email != '';
+
 -- Populate, or append to, the storage table all contacts that
 -- have an email address.
 -- (15 minutes)
@@ -66,20 +84,22 @@
 e.contact_id, c.hash, e.email, c.first_name, c.last_name,
 REPLACE(c.preferred_language, '_', '-'),
 (c.is_opt_out OR c.do_not_email OR e.on_hold OR COALESCE(d.do_not_solicit, 
0))
-  FROM civicrm.civicrm_email e
+  FROM silverpop_email_contact_ids e
   INNER JOIN civicrm.civicrm_contact c ON e.contact_id = c.id
   LEFT JOIN civicrm.wmf_donor d ON d.entity_id = c.id
-  WHERE
-e.email IS NOT NULL AND e.email != ''
-AND c.is_deleted = 0
-AND e.is_primary = 1
-  ORDER BY e.id DESC
+  ORDER BY e.contact_id DESC
   ON DUPLICATE KEY UPDATE
  preferred_language = 
COALESCE(silverpop_export_staging.preferred_language, 
REPLACE(c.preferred_language, '_', '-')),
  opted_out = (opted_out OR c.is_opt_out OR c.do_not_email OR e.on_hold OR 
COALESCE(d.do_not_solicit, 0));
 
 ALTER TABLE silverpop_export_staging
 ADD INDEX spex_opted_out (opted_out);
+
+-- We only need stats for people who are opted in
+DELETE seci
+FROM   silverpop_email_contact_ids seci
+INNER JOIN silverpop_export_staging ex ON seci.email = ex.email
+WHERE  ex.opted_out = 1;
 
 -- Find the latest donation for each email address. Ordering by
 -- receive_date and total_amount descending should always insert
@@ -98,8 +118,7 @@
 ct.total_amount,
 ct.receive_date
   FROM
-civicrm.civicrm_email e FORCE INDEX(UI_email)
-INNER JOIN silverpop_export_staging exs ON e.email = exs.email
+silverpop_email_contact_ids e
 INNER JOIN civicrm.civicrm_contribution ct
   ON ct.contact_id = e.contact_id
 INNER JOIN civicrm.wmf_contribution_extra ex
@@ -109,8 +128,7 @@
   WHERE
 ct.receive_date IS NOT NULL AND
 ct.total_amount > 0 AND -- Refunds don't count
-ct.contribution_status_id = 1 AND -- 'Completed'
-exs.opted_out = 0
+ct.contribution_status_id = 1 -- 'Completed'
   ORDER BY
 ct.receive_date DESC,
 ct.total_amount DESC
@@ -132,15 +150,13 @@
 ct.total_amount,
 ct.receive_date
   FROM
-civicrm.civicrm_email e FORCE INDEX(UI_email)
-INNER JOIN silverpop_export_staging exs ON e.email = exs.email
+silverpop_email_contact_ids e
 INNER JOIN civicrm.civicrm_contribution ct ON ct.contact_id = e.contact_id
 INNER JOIN civicrm.wmf_contribution_extra ex ON ex.entity_id = ct.id
   WHERE
 ct.receive_date IS NOT NULL AND
 ct.total_amount > 0 AND -- Refunds don't count
-ct.contribution_status_id = 1 AND -- 'Completed'
-exs.opted_out = 0
+ct.contribution_status_id = 1 -- 'Completed'
   ORDER BY
 ct.total_amount DESC,
 ct.receive_date DESC
@@ -162,13 +178,11 @@
 e.email, SUM(ct.total_amount), COUNT(*),
 MAX(IF(SUBSTRING(ct.trxn_id, 1, 9) = 'RECURRING', 1, 0)),
 MIN(ct.receive_date)
-  FROM civicrm.civicrm_email e FORCE INDEX(UI_email)
-  JOIN silverpop_export_staging ex ON e.email = ex.email
+  FROM silverpop_email_contact_ids e
   JOIN civicrm.civicrm_contribution ct ON e.contact_id = ct.contact_id
   WHERE ct.receive_date IS NOT 

[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: WIP more Silverpop export refactor

2017-11-30 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394466 )

Change subject: WIP more Silverpop export refactor
..

WIP more Silverpop export refactor

Remove city, as it's not exported
Create indexes just before they're needed
Filter on opted_out for more stats
Set default language in same update as countrylang

One small issue: the fact that all the stats are generated by aggregating
on email now means we're potentially counting a latest donation by
someone whose non-primary email is a...@b.com for the person whose
primary email is a...@b.com

Change-Id: I42649cd9dce0431c3ad2d78521642376ca15ff30
---
M silverpop_export/update_table.sql
1 file changed, 25 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/66/394466/1

diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 4c83015..9e361e1 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -42,14 +42,10 @@
   highest_donation_date datetime null,
 
   -- Address information
-  city varchar(128),
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
-  timezone varchar(8),
-
-  INDEX spex_country (country),
-  INDEX spex_opted_out (opted_out)
+  timezone varchar(8)
 ) COLLATE 'utf8_unicode_ci';
 
 CREATE TABLE IF NOT EXISTS silverpop_export_latest(
@@ -71,7 +67,7 @@
 REPLACE(c.preferred_language, '_', '-'),
 (c.is_opt_out OR c.do_not_email OR e.on_hold OR COALESCE(d.do_not_solicit, 
0))
   FROM civicrm.civicrm_email e
-  LEFT JOIN civicrm.civicrm_contact c ON e.contact_id = c.id
+  INNER JOIN civicrm.civicrm_contact c ON e.contact_id = c.id
   LEFT JOIN civicrm.wmf_donor d ON d.entity_id = c.id
   WHERE
 e.email IS NOT NULL AND e.email != ''
@@ -81,6 +77,9 @@
   ON DUPLICATE KEY UPDATE
  preferred_language = 
COALESCE(silverpop_export_staging.preferred_language, 
REPLACE(c.preferred_language, '_', '-')),
  opted_out = (opted_out OR c.is_opt_out OR c.do_not_email OR e.on_hold OR 
COALESCE(d.do_not_solicit, 0));
+
+ALTER TABLE silverpop_export_staging
+ADD INDEX spex_opted_out (opted_out);
 
 -- Find the latest donation for each email address. Ordering by
 -- receive_date and total_amount descending should always insert
@@ -100,7 +99,7 @@
 ct.receive_date
   FROM
 civicrm.civicrm_email e FORCE INDEX(UI_email)
-INNER JOIN silverpop_export_staging exs ON e.email=exs.email
+INNER JOIN silverpop_export_staging exs ON e.email = exs.email
 INNER JOIN civicrm.civicrm_contribution ct
   ON ct.contact_id = e.contact_id
 INNER JOIN civicrm.wmf_contribution_extra ex
@@ -110,7 +109,8 @@
   WHERE
 ct.receive_date IS NOT NULL AND
 ct.total_amount > 0 AND -- Refunds don't count
-ct.contribution_status_id = 1 -- 'Completed'
+ct.contribution_status_id = 1 AND -- 'Completed'
+exs.opted_out = 0
   ORDER BY
 ct.receive_date DESC,
 ct.total_amount DESC
@@ -133,7 +133,7 @@
 ct.receive_date
   FROM
 civicrm.civicrm_email e FORCE INDEX(UI_email)
-INNER JOIN silverpop_export_staging exs ON e.email=exs.email
+INNER JOIN silverpop_export_staging exs ON e.email = exs.email
 INNER JOIN civicrm.civicrm_contribution ct ON ct.contact_id = e.contact_id
 INNER JOIN civicrm.wmf_contribution_extra ex ON ex.entity_id = ct.id
   WHERE
@@ -163,8 +163,8 @@
 MAX(IF(SUBSTRING(ct.trxn_id, 1, 9) = 'RECURRING', 1, 0)),
 MIN(ct.receive_date)
   FROM civicrm.civicrm_email e FORCE INDEX(UI_email)
-  JOIN silverpop_export_staging ex ON e.email=ex.email
-  JOIN civicrm.civicrm_contribution ct ON e.contact_id=ct.contact_id
+  JOIN silverpop_export_staging ex ON e.email = ex.email
+  JOIN civicrm.civicrm_contribution ct ON e.contact_id = ct.contact_id
   WHERE ct.receive_date IS NOT NULL AND
 ct.total_amount > 0 AND -- Refunds don't count
 ct.contribution_status_id = 1 AND -- Only completed status
@@ -174,7 +174,6 @@
 -- Postal addresses by email
 CREATE TABLE silverpop_export_address (
   email varchar(255) PRIMARY KEY,
-  city varchar(128),
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
@@ -184,7 +183,7 @@
 -- (16 minutes)
 -- Get latest address for each email.
 INSERT INTO silverpop_export_address
-SELECT  e.email, a.city, ctry.iso_code, st.name, a.postal_code, a.timezone
+SELECT  e.email, ctry.iso_code, st.name, a.postal_code, a.timezone
   FROM  civicrm.civicrm_email e
   JOIN  silverpop_export_staging ex
 ON  e.email = ex.email
@@ -234,24 +233,23 @@
 ex.highest_native_amount = hg.highest_native_amount,
 ex.highest_usd_amount = hg.highest_usd_amount,
 ex.highest_donation_date = hg.highest_donation_date,
-ex.city = addr.city,
 ex.country = addr.country,
 ex.postal_code = addr.postal_code,
 ex.state = addr.state,
 ex.timezone = addr.timezone;
 
--- 

[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: WIP refactor dedupe

2017-11-30 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394433 )

Change subject: WIP refactor dedupe
..

WIP refactor dedupe

Big changes here. Use our 'ON DUPLICATE KEY UPDATE' trick to avoid
putting duplicate email addresses in the staging table in the first
place.

This means we don't need the extra ID column and can use email as a
primary key, so we don't need a separate index. We do need to join
to civicrm_email more times while generating statistics, since we
don't have all of the contact IDs in the staging table.

Change-Id: I4a18013e68fc4517c257e670b9ff25365d275706
---
M silverpop_export/update_table.sql
1 file changed, 28 insertions(+), 77 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/33/394433/1

diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 5f9c12d..4c83015 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -15,15 +15,13 @@
 DROP TABLE IF EXISTS silverpop_export_address;
 
 CREATE TABLE IF NOT EXISTS silverpop_export_staging(
-  id int unsigned PRIMARY KEY,  -- This is actually civicrm_email.id
-
   -- General information about the contact
   contact_id int unsigned,
   contact_hash varchar(32),
   first_name varchar(128),
   last_name varchar(128),
   preferred_language varchar(12),
-  email varchar(255),
+  email varchar(255) PRIMARY KEY,
   opted_out tinyint(1),
 
   -- Lifetime contribution statistics
@@ -50,8 +48,6 @@
   postal_code varchar(128),
   timezone varchar(8),
 
-  INDEX spex_contact_id (contact_id),
-  INDEX spex_email (email),
   INDEX spex_country (country),
   INDEX spex_opted_out (opted_out)
 ) COLLATE 'utf8_unicode_ci';
@@ -66,12 +62,12 @@
 ) COLLATE 'utf8_unicode_ci';
 
 -- Populate, or append to, the storage table all contacts that
--- have an email address. ID is civicrm_email.id.
+-- have an email address.
 -- (15 minutes)
 INSERT INTO silverpop_export_staging
-  (id, contact_id, contact_hash, email, first_name, last_name, 
preferred_language, opted_out)
+  (contact_id, contact_hash, email, first_name, last_name, preferred_language, 
opted_out)
   SELECT
-e.id, e.contact_id, c.hash, e.email, c.first_name, c.last_name,
+e.contact_id, c.hash, e.email, c.first_name, c.last_name,
 REPLACE(c.preferred_language, '_', '-'),
 (c.is_opt_out OR c.do_not_email OR e.on_hold OR COALESCE(d.do_not_solicit, 
0))
   FROM civicrm.civicrm_email e
@@ -80,7 +76,11 @@
   WHERE
 e.email IS NOT NULL AND e.email != ''
 AND c.is_deleted = 0
-AND e.is_primary = 1;
+AND e.is_primary = 1
+  ORDER BY e.id DESC
+  ON DUPLICATE KEY UPDATE
+ preferred_language = 
COALESCE(silverpop_export_staging.preferred_language, 
REPLACE(c.preferred_language, '_', '-')),
+ opted_out = (opted_out OR c.is_opt_out OR c.do_not_email OR e.on_hold OR 
COALESCE(d.do_not_solicit, 0));
 
 -- Find the latest donation for each email address. Ordering by
 -- receive_date and total_amount descending should always insert
@@ -99,7 +99,8 @@
 ct.total_amount,
 ct.receive_date
   FROM
-silverpop_export_staging e
+civicrm.civicrm_email e FORCE INDEX(UI_email)
+INNER JOIN silverpop_export_staging exs ON e.email=exs.email
 INNER JOIN civicrm.civicrm_contribution ct
   ON ct.contact_id = e.contact_id
 INNER JOIN civicrm.wmf_contribution_extra ex
@@ -131,78 +132,34 @@
 ct.total_amount,
 ct.receive_date
   FROM
-silverpop_export_staging e,
-civicrm.civicrm_contribution ct,
-civicrm.wmf_contribution_extra ex
+civicrm.civicrm_email e FORCE INDEX(UI_email)
+INNER JOIN silverpop_export_staging exs ON e.email=exs.email
+INNER JOIN civicrm.civicrm_contribution ct ON ct.contact_id = e.contact_id
+INNER JOIN civicrm.wmf_contribution_extra ex ON ex.entity_id = ct.id
   WHERE
-e.contact_id = ct.contact_id AND
-ex.entity_id = ct.id AND
 ct.receive_date IS NOT NULL AND
 ct.total_amount > 0 AND -- Refunds don't count
-ct.contribution_status_id = 1 -- 'Completed'
+ct.contribution_status_id = 1 AND -- 'Completed'
+exs.opted_out = 0
   ORDER BY
 ct.total_amount DESC,
 ct.receive_date DESC
 ON DUPLICATE KEY UPDATE highest_native_currency = 
silverpop_export_highest.highest_native_currency;
 
--- Deduplicate rows that have the same email address, we will
--- have to merge in more data later, but this is ~1.5M rows we're
--- getting rid of here which is more better than taking them all the way
--- through.
-CREATE TABLE silverpop_export_dedupe_email (
-  id INT PRIMARY KEY AUTO_INCREMENT,
-  email varchar(255),
-  maxid int,
-  preferred_language varchar(12),
-  opted_out tinyint(1),
-
-  INDEX spexde_email (email)
-) COLLATE 'utf8_unicode_ci';
-
-INSERT INTO silverpop_export_dedupe_email (email, maxid, opted_out)
-   SELECT email, max(id) maxid, max(opted_out) opted_out
- FROM 

[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Better c_t country backfill

2017-11-30 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394406 )

Change subject: Better c_t country backfill
..

Better c_t country backfill

Filter out all the bad codes, then look in all c_t rows associated
with the email address newest to oldest.

Bug: T181424
Change-Id: I85542c92606aa26f9cb3ba52132d41d28f5802d8
---
M silverpop_export/tests/test_update.py
M silverpop_export/update_table.sql
2 files changed, 46 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/06/394406/1

diff --git a/silverpop_export/tests/test_update.py 
b/silverpop_export/tests/test_update.py
index 64033dc..7151394 100644
--- a/silverpop_export/tests/test_update.py
+++ b/silverpop_export/tests/test_update.py
@@ -301,6 +301,36 @@
 assert cursor.fetchone() == ('PE',)
 
 
+def test_good_ct_country():
+'''
+Test that we use the contribution_tracking country when no Civi address
+'''
+
+run_update_with_fixtures(fixture_queries=["""
+insert into civicrm_email (contact_id, email, is_primary, on_hold) values
+(1, 'person1@localhost', 1, 0);
+""", """
+insert into civicrm_contact (id) values
+(1);
+""", """
+insert into civicrm_contribution (id, contact_id, receive_date, 
total_amount, trxn_id, contribution_status_id) values
+(1, 1, '2015-01-03', 9.50, 'xyz123', 1);
+""", """
+insert into wmf_contribution_extra (entity_id, original_amount, 
original_currency) values
+(1, 1000, 'JPY');
+""", """
+insert into contribution_tracking (contribution_id, country) values
+(1, 'SE');
+""", """
+insert into civicrm_country (id, iso_code) values
+(1, 'SE');
+"""])
+
+cursor = conn.db_conn.cursor()
+cursor.execute("select country from silverpop_export")
+assert cursor.fetchone() == ('SE',)
+
+
 def run_update_with_fixtures(fixture_path=None, fixture_queries=None):
 with mock.patch("database.db.Connection") as MockConnection:
 
diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 3a9bf92..f6f8a20 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -240,6 +240,22 @@
   ORDER BY  a.id DESC
 ON DUPLICATE KEY UPDATE email = e.email;
 
+-- Fill in missing countries from contribution_tracking
+INSERT INTO silverpop_export_address (email, country)
+SELECT  e.email, ct.country
+  FROM  civicrm.civicrm_email e
+  JOIN  silverpop_export_staging ex
+ON  e.email = ex.email
+  JOIN  civicrm.civicrm_contribution cc
+ON  cc.contact_id = e.contact_id
+  JOIN  drupal.contribution_tracking ct
+ON  ct.contribution_id = cc.id
+  JOIN  civicrm.civicrm_country ctry
+ON  ct.country = ctry.iso_code # filter out invalid c_t countries
+  WHERE ex.opted_out = 0
+  ORDER BY ct.id DESC
+ON DUPLICATE KEY UPDATE email = e.email;
+
 -- Pull in address and latest/greatest/cumulative stats from intermediate 
tables
 UPDATE silverpop_export_staging ex
   LEFT JOIN silverpop_export_stat exs ON ex.id = exs.exid
@@ -265,21 +281,6 @@
 ex.postal_code = addr.postal_code,
 ex.state = addr.state,
 ex.timezone = addr.timezone;
-
--- Fill in missing addresses from contribution_tracking
--- (15 minutes)
-UPDATE
-silverpop_export_staging ex,
-civicrm.civicrm_contribution ct,
-drupal.contribution_tracking dct
-  SET
-ex.country = dct.country
-  WHERE
-ex.country IS NULL AND
-ex.contact_id = ct.contact_id AND
-dct.contribution_id = ct.id AND
-dct.country IS NOT NULL AND
-ex.opted_out = 0;
 
 -- Reconstruct the donors likely language from their country if it
 -- exists from a table of major language to country.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85542c92606aa26f9cb3ba52132d41d28f5802d8
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' into deploy

2017-11-30 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394396 )

Change subject: Merge branch 'master' into deploy
..

Merge branch 'master' into deploy

36d3440 Fix logging for duplicate subscr_cancel

Change-Id: I3721b1751e861c472b1feeabb9e017de126e99f5
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/96/394396/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3721b1751e861c472b1feeabb9e017de126e99f5
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: deploy
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Fix logging for duplicate subscr_cancel

2017-11-30 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394378 )

Change subject: Fix logging for duplicate subscr_cancel
..

Fix logging for duplicate subscr_cancel

Change-Id: I7828eda94dba5b79976f47fbbafc2c8cc5c95b29
---
M audit/paypal/SarFile.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/78/394378/1

diff --git a/audit/paypal/SarFile.py b/audit/paypal/SarFile.py
index fbe10bf..a33078f 100644
--- a/audit/paypal/SarFile.py
+++ b/audit/paypal/SarFile.py
@@ -113,7 +113,7 @@
 return
 elif row['Subscription Action Type'] == 'S0200':
 if not self.crm.subscription_exists(out['subscr_id']):
-
log.info("-Duplicate\t{id}\t{date}\tsubscr_cancel".format(id=out['subscr_id'], 
date=out['subscr_date']))
+
log.info("-Duplicate\t{id}\t{date}\tsubscr_cancel".format(**log_params))
 return
 out['txn_type'] = 'subscr_cancel'
 out['cancel_date'] = date

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7828eda94dba5b79976f47fbbafc2c8cc5c95b29
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Update readme with minify workaround

2017-11-30 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394371 )

Change subject: Update readme with minify workaround
..

Update readme with minify workaround

And copy r.js build script to master.

Bug: T181467
Change-Id: I1f021bab5583b6e66564fba48e7029c08b4f4fd3
---
M README.md
A app.build.js
2 files changed, 86 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/71/394371/1

diff --git a/README.md b/README.md
index 0a0cfd5..e2ad59a 100644
--- a/README.md
+++ b/README.md
@@ -139,3 +139,10 @@
 Don't worry about the lint errors :(
 
 Commit the dist/ output to the deployment branch and push for review.
+
+If you don't have that ancient version of node available and you just need to 
minify javascript and html templates, you can run the requirejs optimiser 
directly.
+
+```
+node node_modules/requirejs/bin/r.js -o app.build.js
+```
+Then copy the resulting scripts.js over the existing js file in the dist 
folder.
diff --git a/app.build.js b/app.build.js
new file mode 100644
index 000..2cdcbe9
--- /dev/null
+++ b/app.build.js
@@ -0,0 +1,79 @@
+/* jshint -W098 */
+({
+   baseUrl: 'src',
+   paths: {
+   bootstrap: 'bower_modules/bootstrap/dist/js/bootstrap',
+   crossroads: 'bower_modules/crossroads/dist/crossroads.min',
+   hasher: 'bower_modules/hasher/dist/js/hasher.min',
+   jquery: 'bower_modules/jquery/dist/jquery',
+   noUISlider: 
'bower_modules/nouislider/distribute/jquery.nouislider.all',
+   knockout: 'bower_modules/knockout/dist/knockout',
+   'knockout-projections': 
'bower_modules/knockout-projections/dist/knockout-projections',
+   d3: 'bower_modules/d3/d3',
+   text: 'bower_modules/requirejs-text/text',
+   chartjs: 'bower_modules/chartjs/Chart',
+   momentjs: 'bower_modules/moment/moment',
+   raphael: 'bower_modules/raphael/raphael',
+   gauge: 'bower_modules/gauge.js/dist/gauge',
+   'bootstrap-datepicker': 
'bower_modules/bootstrap-datepicker/js/bootstrap-datepicker',
+   'bootstrap-timepicker': 
'bower_modules/bootstrap-timepicker/js/bootstrap-timepicker',
+   select2: 'bower_modules/select2/select2',
+   signals: 'bower_modules/js-signals/dist/signals.min',
+   c3: 'bower_modules/c3/c3',
+   numeraljs: 'bower_modules/numeraljs/numeral',
+   WidgetBase: 'app/widgetBase',
+   Campaign: 'app/campaign',
+   operators: 'components/filters/operators',
+   requireLib: 'bower_modules/requirejs/require'
+   },
+   shim: {
+   bootstrap: {
+   deps: [
+   'jquery'
+   ]
+   },
+   c3: {
+   deps: [
+   'd3'
+   ]
+   },
+   momentjs: {
+   exports: 'moment'
+   },
+   noUISlider: {
+   deps: [
+   'jquery'
+   ]
+   }
+   },
+   out: 'scripts.js',
+   name: 'app/startup',
+   include: [
+   'requireLib',
+   'components/app-content/app-content',
+   'components/boards/generic-board/generic-board',
+   'components/filters/filters',
+   'components/filters/dropdown-filter/dropdown-filter',
+   'components/filters/number-filter/number-filter',
+   'components/filters/text-filter/text-filter',
+   'components/nav-bar/nav-bar',
+   'components/utils/date-pickers/date-pickers',
+   'components/widgets/ab-testing/ab-testing',
+   
'components/widgets/amt-per-second-chart/amt-per-second-chart',
+   'components/widgets/cat-trombone/cat-trombone',
+   
'components/widgets/distance-to-goal-chart/distance-to-goal-chart',
+   'components/widgets/donation-age/donation-age',
+   'components/widgets/fraud-gauge/fraud-gauge',
+   'components/widgets/top10/top10',
+   
'components/widgets/totals-earned-chart/totals-earned-chart',
+   'components/widgets/x-by-y/x-by-y'
+   ],
+   insertRequire: [ 'app/startup' ],
+   bundles: {
+   // If you want parts of the site to load on demand, 
remove them from the 'include' list
+   // above, and group them into bundles here.
+   

[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' into deploy

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394233 )

Change subject: Merge branch 'master' into deploy
..

Merge branch 'master' into deploy

d614cfd Check for duplicate subscr_cancel
584db6a Flake8 - do not use bare except
3f59aa4 Export civicrm_contact.hash to silverpop
f904c68 git.wikimedia.org -> phab
5eaa838 Prefer Civi address to contribution_tracking for country

Change-Id: I2265beffe4ea803e19b3fcf4986704cfdb1a56ec
---
D silverpop_export/tests/minimal_schema.sql
D silverpop_export/tests/test_update.py
2 files changed, 0 insertions(+), 479 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/33/394233/1

diff --git a/silverpop_export/tests/minimal_schema.sql 
b/silverpop_export/tests/minimal_schema.sql
deleted file mode 100644
index 4062e81..000
--- a/silverpop_export/tests/minimal_schema.sql
+++ /dev/null
@@ -1,134 +0,0 @@
-<<< HEAD   (6d4b6f Merge branch 'master' into deploy)
-===
--- TODO: Do something SQLy to make *sure* we're not in a real database.
-
-drop table if exists civicrm_email;
-create table civicrm_email (
-id int(10) unsigned auto_increment primary key,
-contact_id int(10) unsigned,
-email varchar(254) COLLATE utf8_unicode_ci,
-is_primary tinyint(4) default '1',
-on_hold tinyint(4) default '0',
-key UI_email (email)
-);
-
-drop table if exists civicrm_contact;
-create table civicrm_contact (
-id int(10) unsigned auto_increment primary key,
-do_not_email tinyint(4) default '0',
-do_not_phone tinyint(4) default '0',
-do_not_mail tinyint(4) default '0',
-do_not_sms tinyint(4) default '0',
-do_not_trade tinyint(4) default '1',
-is_opt_out tinyint(4) default '0',
-preferred_language varchar(32) COLLATE utf8_unicode_ci,
-hash varchar(32) COLLATE utf8_unicode_ci,
-first_name varchar(64) COLLATE utf8_unicode_ci,
-middle_name varchar(64) COLLATE utf8_unicode_ci,
-last_name varchar(64) COLLATE utf8_unicode_ci,
-is_deleted tinyint(4) default '0'
-);
-
-drop table if exists civicrm_currency;
-create table civicrm_currency (
-id int(10) unsigned auto_increment primary key,
-name varchar(64) COLLATE utf8_unicode_ci,
-symbol varchar(8) COLLATE utf8_unicode_ci,
-key UI_name (name)
-);
-insert into civicrm_currency (name, symbol)
-values
-('USD', '$'),
-('CAD', '$'),
-('GBP', '£'),
-('DZD', NULL);
-
-drop table if exists wmf_donor;
-create table wmf_donor (
-id int(10) unsigned,
-entity_id int(10) unsigned,
-do_not_solicit tinyint(4),
-is_2006_donor tinyint(4),
-is_2007_donor tinyint(4),
-is_2008_donor tinyint(4),
-is_2009_donor tinyint(4),
-is_2010_donor tinyint(4),
-is_2011_donor tinyint(4),
-is_2012_donor tinyint(4),
-is_2013_donor tinyint(4),
-is_2014_donor tinyint(4),
-is_2015_donor tinyint(4),
-is_2016_donor tinyint(4),
-is_2017_donor tinyint(4),
-is_2018_donor tinyint(4),
-is_2019_donor tinyint(4),
-is_2020_donor tinyint(4),
-is_2021_donor tinyint(4),
-is_2022_donor tinyint(4),
-is_2023_donor tinyint(4),
-is_2024_donor tinyint(4),
-is_2025_donor tinyint(4),
-last_donation_date datetime,
-last_donation_currency varchar(255) COLLATE utf8_unicode_ci,
-last_donation_amount decimal(20,2),
-last_donation_usd decimal(20,2),
-lifetime_usd_total decimal(20,2)
-);
-
-drop table if exists civicrm_contribution;
-create table civicrm_contribution (
-id int(10) unsigned,
-contact_id int(10) unsigned,
-receive_date datetime,
-total_amount decimal(20,2),
-trxn_id varchar(255) COLLATE utf8_unicode_ci,
-contribution_status_id int(10) unsigned
-);
-
-drop table if exists civicrm_address;
-create table civicrm_address (
-id int(10) unsigned auto_increment primary key,
-contact_id int(10) unsigned,
-is_primary tinyint(4),
-city varchar(64) COLLATE utf8_unicode_ci,
-postal_code varchar(64) COLLATE utf8_unicode_ci,
-country_id int(10) unsigned,
-state_province_id int(10) unsigned,
-timezone varchar(8) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_country;
-create table civicrm_country (
-id int(10) unsigned,
-iso_code char(2) COLLATE utf8_unicode_ci
-);
-
-drop table if exists civicrm_state_province;
-create table civicrm_state_province (
-  id int(10) unsigned,
-  name varchar(64) COLLATE utf8_unicode_ci
-);
-
-drop table if exists wmf_contribution_extra;
-create table wmf_contribution_extra (
-entity_id int(10) unsigned,
-original_amount decimal(20,2),
-original_currency varchar(255) COLLATE utf8_unicode_ci
-);
-
-drop table if exists contribution_tracking;
-create table contribution_tracking (
-contribution_id int(10) unsigned,
-country varchar(2)
-);
-
-drop table if exists log_civicrm_email;
-create table log_civicrm_email (
-email 

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Use api to insert address

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394231 )

Change subject: Use api to insert address
..

Use api to insert address

Change-Id: I9e84208407e88b1cf00364f639e3e9439ffdd7e9
---
M civicrm
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/31/394231/1

diff --git a/civicrm b/civicrm
index ece6660..7940fc7 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit ece6660f6df4bd10dedc2cc097a64e9bb6281ef3
+Subproject commit 7940fc71718d147382f56f706d95b1f49107da23
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index af0ed20..0f1961e 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1631,6 +1631,7 @@
 'postal_code' => $msg['postal_code'],
 'country_id' => $country_id,
 'country' => $msg[ 'country' ],
+'fix_address' => isset($msg['fix_address']) ? $msg['fix_address'] : 
FALSE,
 'is_billing' => 1,
 'version' => 3,
 );
@@ -1643,17 +1644,16 @@
 if (!wmf_civicrm_is_address_valid($address_params)) {
 return;
 }
-// FIXME: api does not offer control over fixAddress flag
-// UPDATE - the fixAddress function mostly backs out early based on params
-// checks so as long as things like 'country_id' are set it doesn't seem 
very
-// expensive (& those checks would be an easy fix). Bypassing the api
-// probably does not gain us much.
-//$result = civicrm_api( "Address", "Create", $address_params );
-//if ( array_key_exists( 'is_error', $result ) && $result['is_error'] != 0 
) {
 
-$result = CRM_Core_BAO_Address::add( $address_params, false );
-if ( !$result ) {
-throw new WmfException( 'IMPORT_CONTACT', "Couldn't store address for 
the contact.");
+try {
+civicrm_api3('Address', 'Create', $address_params);
+}
+catch(CiviCRM_API3_Exception $ex ) {
+throw new WmfException(
+  'IMPORT_CONTACT',
+  'Couldn\'t store address for the contact: ' .
+  $ex->getMessage()
+);
 }
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e84208407e88b1cf00364f639e3e9439ffdd7e9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[deployment]: Merge branch 'master' into deployment

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394230 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

and minify for deploy.

45fe0fc Fix last data point day

Change-Id: I8b24acb699d0d82e5b0560ed188c1f95b8838070
---
M dist/scripts-0875ff1e.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/30/394230/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b24acb699d0d82e5b0560ed188c1f95b8838070
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Use api to insert address

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394226 )

Change subject: Use api to insert address
..

Use api to insert address

Change-Id: I9e84208407e88b1cf00364f639e3e9439ffdd7e9
---
M civicrm
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/26/394226/1

diff --git a/civicrm b/civicrm
index ece6660..7940fc7 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit ece6660f6df4bd10dedc2cc097a64e9bb6281ef3
+Subproject commit 7940fc71718d147382f56f706d95b1f49107da23
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index af0ed20..0f1961e 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1631,6 +1631,7 @@
 'postal_code' => $msg['postal_code'],
 'country_id' => $country_id,
 'country' => $msg[ 'country' ],
+'fix_address' => isset($msg['fix_address']) ? $msg['fix_address'] : 
FALSE,
 'is_billing' => 1,
 'version' => 3,
 );
@@ -1643,17 +1644,16 @@
 if (!wmf_civicrm_is_address_valid($address_params)) {
 return;
 }
-// FIXME: api does not offer control over fixAddress flag
-// UPDATE - the fixAddress function mostly backs out early based on params
-// checks so as long as things like 'country_id' are set it doesn't seem 
very
-// expensive (& those checks would be an easy fix). Bypassing the api
-// probably does not gain us much.
-//$result = civicrm_api( "Address", "Create", $address_params );
-//if ( array_key_exists( 'is_error', $result ) && $result['is_error'] != 0 
) {
 
-$result = CRM_Core_BAO_Address::add( $address_params, false );
-if ( !$result ) {
-throw new WmfException( 'IMPORT_CONTACT', "Couldn't store address for 
the contact.");
+try {
+civicrm_api3('Address', 'Create', $address_params);
+}
+catch(CiviCRM_API3_Exception $ex ) {
+throw new WmfException(
+  'IMPORT_CONTACT',
+  'Couldn\'t store address for the contact: ' .
+  $ex->getMessage()
+);
 }
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e84208407e88b1cf00364f639e3e9439ffdd7e9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...civicrm[master]: Add API parameter for fix_address

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394223 )

Change subject: Add API parameter for fix_address
..

Add API parameter for fix_address

Change-Id: I4b59b1b1518b8f7ed24804a001d9d0fb31381b79
---
M api/v3/Address.php
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/23/394223/1

diff --git a/api/v3/Address.php b/api/v3/Address.php
index a7ec8cb..4a919c9 100644
--- a/api/v3/Address.php
+++ b/api/v3/Address.php
@@ -76,11 +76,15 @@
 $params['check_permissions'] = 0;
   }
 
+  if (!isset($params['fix_address'])) {
+$params['fix_address'] = TRUE;
+  }
+
   /**
* Create array for BAO (expects address params in as an
* element in array 'address'
*/
-  $addressBAO = CRM_Core_BAO_Address::add($params, TRUE);
+  $addressBAO = CRM_Core_BAO_Address::add($params, $params['fix_address']);
   if (empty($addressBAO)) {
 return civicrm_api3_create_error("Address is not created or updated ");
   }
@@ -110,6 +114,11 @@
   at once, the job \'Geocode and Parse Addresses\' can execute this task 
after the import)',
 'type' => CRM_Utils_Type::T_BOOLEAN,
   );
+  $params['fix_address'] = array(
+'title' => 'Fix address',
+'description' => 'When true, apply various fixes to the address before 
insert. Default true.',
+'type' => CRM_Utils_Type::T_BOOLEAN,
+  );
   $params['world_region'] = array(
 'title' => ts('World Region'),
 'name' => 'world_region',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b59b1b1518b8f7ed24804a001d9d0fb31381b79
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Fix last data point day

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394222 )

Change subject: Fix last data point day
..

Fix last data point day

Maybe the whole thing should live in amt/second chart?

Change-Id: I5998e5e1762a233e5f1cf63d8a71698e69f3dfbb
---
M src/components/widgets/totals-earned-chart/totals-earned-chart.js
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/22/394222/1

diff --git a/src/components/widgets/totals-earned-chart/totals-earned-chart.js 
b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
index 6ef43c5..ad453ac 100644
--- a/src/components/widgets/totals-earned-chart/totals-earned-chart.js
+++ b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
@@ -173,8 +173,10 @@
}
 
if ( self.isCurrentYear() ) {
-   // FIXME
-   lastData.day = currentDate.getUTCDate();
+   lastData.day = Math.floor(
+   ( currentDate.getTime() - 
self.campaign().getStartDate().getTime() )
+   / ( 24 * 60 * 60 * 1000 )
+   ) + 1;
lastData.hour = currentDate.getUTCHours();
} else if ( dataCount > 0 ) {
lastData.day = data[ dataCount - 1 ].day - 
offset;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5998e5e1762a233e5f1cf63d8a71698e69f3dfbb
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update civicrm submodule

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394082 )

Change subject: Update civicrm submodule
..

Update civicrm submodule

Pull in the deadlock retries

Change-Id: Ie989d592fe73ddc2e9f1f067aee062c637969741
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/82/394082/1

diff --git a/civicrm b/civicrm
index c07b083..ece6660 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit c07b083b5f7221febaba0133a2360869f1ef6022
+Subproject commit ece6660f6df4bd10dedc2cc097a64e9bb6281ef3

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie989d592fe73ddc2e9f1f067aee062c637969741
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update civicrm submodule

2017-11-29 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394081 )

Change subject: Update civicrm submodule
..

Update civicrm submodule

Pull in the deadlock retries

Change-Id: Ie989d592fe73ddc2e9f1f067aee062c637969741
---
M civicrm
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/81/394081/1

diff --git a/civicrm b/civicrm
index c07b083..ece6660 16
--- a/civicrm
+++ b/civicrm
@@ -1 +1 @@
-Subproject commit c07b083b5f7221febaba0133a2360869f1ef6022
+Subproject commit ece6660f6df4bd10dedc2cc097a64e9bb6281ef3

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie989d592fe73ddc2e9f1f067aee062c637969741
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[deployment]: Merge branch 'master' into deployment

2017-11-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393942 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

And minify for deployment

0350cc2 Fix labels on BE derivative charts, fix amt needed
6a511ab Tweak 2017 campaign config

Change-Id: Id40163f0f810e6d835073bd63c65fc5b65c3b223
---
M dist/scripts-0875ff1e.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/42/393942/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id40163f0f810e6d835073bd63c65fc5b65c3b223
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Tweak 2017 campaign config

2017-11-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393939 )

Change subject: Tweak 2017 campaign config
..

Tweak 2017 campaign config

Change-Id: Idb145f75c4bd63cd977282a5400516832630
---
M src/components/widgets/totals-earned-chart/totals-earned-chart.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/39/393939/1

diff --git a/src/components/widgets/totals-earned-chart/totals-earned-chart.js 
b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
index edb3276..6ef43c5 100644
--- a/src/components/widgets/totals-earned-chart/totals-earned-chart.js
+++ b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
@@ -41,7 +41,7 @@
name: '2017',
startDate: Date.UTC( 2017, 9, 2 ),
endDate: Date.UTC( 2018, 0, 1 ),
-   target: 5500
+   target: 5000
} ),
new Campaign( {
name: '2016',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb145f75c4bd63cd977282a5400516832630
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Fix labels on BE derivative charts, fix amt needed

2017-11-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393927 )

Change subject: Fix labels on BE derivative charts, fix amt needed
..

Fix labels on BE derivative charts, fix amt needed

Change-Id: Ie565c0d440d3c8dbf5c1ff1efbcd4d6f21087e5a
---
M src/components/widgets/amt-per-second-chart/amt-per-second-chart.js
M src/components/widgets/distance-to-goal-chart/distance-to-goal-chart.js
M src/components/widgets/totals-earned-chart/totals-earned-chart.js
3 files changed, 11 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/27/393927/1

diff --git 
a/src/components/widgets/amt-per-second-chart/amt-per-second-chart.js 
b/src/components/widgets/amt-per-second-chart/amt-per-second-chart.js
index b9fcae0..a1bd3b6 100644
--- a/src/components/widgets/amt-per-second-chart/amt-per-second-chart.js
+++ b/src/components/widgets/amt-per-second-chart/amt-per-second-chart.js
@@ -42,8 +42,7 @@
if ( remainingNeeded < 0 ) {
remainingNeeded = 0;
}
-   // FIXME: hardcoded 31 day campaign
-   hoursLeft = ( 31 - d ) * 24 + ( 24 - h 
);
+   hoursLeft = ( 
params.sharedContext.campaignLength - d ) * 24 + ( 24 - h );
xs[ index ] = index;
self.needPerSecond[ index ] = ( 
hoursLeft > 0 ) ?
( remainingNeeded / hoursLeft ) 
/ 3600
@@ -82,9 +81,9 @@
axis: {
x: {
tick: {
-   count: 31,
+   count: 
params.sharedContext.campaignLength,
format: function ( x ) {
-   return 'Day ' + 
( Math.floor( x / 24 ) + 1 );
+   return 
params.sharedContext.getDay( Math.floor( x / 24 ) );
}
}
},
@@ -99,9 +98,9 @@
tooltip: {
format: {
title: function ( x ) {
-   var day = Math.floor( x 
/ 24 ) + 1,
+   var day = 
params.sharedContext.getDay( Math.floor( x / 24 ) ),
hour = x % 24;
-   return 'Day ' + day + ' 
' + hour + ':00  ' + hour + ':59 UTC';
+   return day + ' ' + hour 
+ ':00  ' + hour + ':59 UTC';
}
}
}
diff --git 
a/src/components/widgets/distance-to-goal-chart/distance-to-goal-chart.js 
b/src/components/widgets/distance-to-goal-chart/distance-to-goal-chart.js
index 94ea10d..3fc3456 100644
--- a/src/components/widgets/distance-to-goal-chart/distance-to-goal-chart.js
+++ b/src/components/widgets/distance-to-goal-chart/distance-to-goal-chart.js
@@ -46,9 +46,7 @@
axis: {
x: {
tick: {
-   format: function ( x ) {
-   return 'Day ' + 
( x + 1 );
-   }
+   format: 
params.sharedContext.getDay
}
},
y: {
diff --git a/src/components/widgets/totals-earned-chart/totals-earned-chart.js 
b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
index 8a12dbf..edb3276 100644
--- a/src/components/widgets/totals-earned-chart/totals-earned-chart.js
+++ b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
@@ -22,7 +22,6 @@
 
var self = this,
timeFormat = ',  Do , h:mm:ss a',
-   getDay,
localUtcOffset = moment().utcOffset();
 
WidgetBase.call( this, params );
@@ -144,6 +143,7 @@
self.displayDate( moment( 

[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Don't use 'XX' country from contribution_tracking

2017-11-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393816 )

Change subject: Don't use 'XX' country from contribution_tracking
..

Don't use 'XX' country from contribution_tracking

Bug: T181424
Change-Id: Iec7d2d4f9cf575c379c952a3c10ebac4c5f8c2a3
---
M silverpop_export/tests/test_update.py
M silverpop_export/update_table.sql
2 files changed, 36 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/16/393816/1

diff --git a/silverpop_export/tests/test_update.py 
b/silverpop_export/tests/test_update.py
index 8db6bca..7e3fa72 100644
--- a/silverpop_export/tests/test_update.py
+++ b/silverpop_export/tests/test_update.py
@@ -18,7 +18,7 @@
 global db_name
 # FIXME: parameterize test configuration better
 db_host = "127.0.0.1"
-db_pass = None
+db_pass = "test"
 if 'EXECUTOR_NUMBER' in os.environ:
 # We're running under Jenkins.  Assume things.
 db_name = "test"
@@ -268,6 +268,39 @@
 assert cursor.fetchone() == ('abfe829234baa87s76d',)
 
 
+def test_bad_ct_country():
+'''
+Test that we use the Civi address in place of XX contribution_tracking
+'''
+
+run_update_with_fixtures(fixture_queries=["""
+insert into civicrm_email (contact_id, email, is_primary, on_hold) values
+(1, 'person1@localhost', 1, 0);
+""", """
+insert into civicrm_contact (id) values
+(1);
+""", """
+insert into civicrm_contribution (id, contact_id, receive_date, 
total_amount, trxn_id, contribution_status_id) values
+(1, 1, '2015-01-03', 9.50, 'xyz123', 1);
+""", """
+insert into wmf_contribution_extra (entity_id, original_amount, 
original_currency) values
+(1, 1000, 'JPY');
+""", """
+insert into contribution_tracking (contribution_id, country) values
+(1, 'XX');
+""", """
+insert into civicrm_country (id, iso_code) values
+(1, 'PE');
+""", """
+insert into civicrm_address (contact_id, is_primary, country_id) values
+(1, 1, 1);
+"""])
+
+cursor = conn.db_conn.cursor()
+cursor.execute("select country from silverpop_export")
+assert cursor.fetchone() == ('PE',)
+
+
 def run_update_with_fixtures(fixture_path=None, fixture_queries=None):
 with mock.patch("database.db.Connection") as MockConnection:
 
diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 4ca34ae..daaca4b 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -125,7 +125,8 @@
   WHERE
 ex.contact_id = ct.contact_id AND
 dct.contribution_id = ct.id AND
-dct.country IS NOT NULL;
+dct.country IS NOT NULL AND
+dct.country <> 'XX';
 
 CREATE TABLE silverpop_export_highest(
   email varchar(255) PRIMARY KEY,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec7d2d4f9cf575c379c952a3c10ebac4c5f8c2a3
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[deployment]: Bundle scripts for deployment

2017-11-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393793 )

Change subject: Bundle scripts for deployment
..

Bundle scripts for deployment

Change-Id: I89f14b8a531ee2e4a62781c37294a4e3b68d3158
---
M dist/scripts-0875ff1e.js
1 file changed, 203 insertions(+), 62 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/93/393793/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89f14b8a531ee2e4a62781c37294a4e3b68d3158
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[deployment]: Add app.build.js for running r.js directly

2017-11-28 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393792 )

Change subject: Add app.build.js for running r.js directly
..

Add app.build.js for running r.js directly

Something's funky with gulp, so to get around it, run
node node_modules/requirejs/bin/r.js -o app.build.js
and replace dist/scripts-???.js with the output scripts.js

Change-Id: I078dda880323eddc7c4b20d3f95abcc9b9c095fe
---
A app.build.js
1 file changed, 80 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/92/393792/1

diff --git a/app.build.js b/app.build.js
new file mode 100644
index 000..d440b22
--- /dev/null
+++ b/app.build.js
@@ -0,0 +1,80 @@
+/* jshint -W098 */
+
+({
+   baseUrl: 'src',
+   paths: {
+   bootstrap: 'bower_modules/bootstrap/dist/js/bootstrap',
+   crossroads: 'bower_modules/crossroads/dist/crossroads.min',
+   hasher: 'bower_modules/hasher/dist/js/hasher.min',
+   jquery: 'bower_modules/jquery/dist/jquery',
+   noUISlider: 
'bower_modules/nouislider/distribute/jquery.nouislider.all',
+   knockout: 'bower_modules/knockout/dist/knockout',
+   'knockout-projections': 
'bower_modules/knockout-projections/dist/knockout-projections',
+   d3: 'bower_modules/d3/d3',
+   text: 'bower_modules/requirejs-text/text',
+   chartjs: 'bower_modules/chartjs/Chart',
+   momentjs: 'bower_modules/moment/moment',
+   raphael: 'bower_modules/raphael/raphael',
+   gauge: 'bower_modules/gauge.js/dist/gauge',
+   'bootstrap-datepicker': 
'bower_modules/bootstrap-datepicker/js/bootstrap-datepicker',
+   'bootstrap-timepicker': 
'bower_modules/bootstrap-timepicker/js/bootstrap-timepicker',
+   select2: 'bower_modules/select2/select2',
+   signals: 'bower_modules/js-signals/dist/signals.min',
+   c3: 'bower_modules/c3/c3',
+   numeraljs: 'bower_modules/numeraljs/numeral',
+   WidgetBase: 'app/widgetBase',
+   Campaign: 'app/campaign',
+   operators: 'components/filters/operators',
+   requireLib: 'bower_modules/requirejs/require'
+   },
+   shim: {
+   bootstrap: {
+   deps: [
+   'jquery'
+   ]
+   },
+   c3: {
+   deps: [
+   'd3'
+   ]
+   },
+   momentjs: {
+   exports: 'moment'
+   },
+   noUISlider: {
+   deps: [
+   'jquery'
+   ]
+   }
+   },
+   out: 'scripts.js',
+   name: 'app/startup',
+   include: [
+   'requireLib',
+   'components/app-content/app-content',
+   'components/boards/generic-board/generic-board',
+   'components/filters/filters',
+   'components/filters/dropdown-filter/dropdown-filter',
+   'components/filters/number-filter/number-filter',
+   'components/filters/text-filter/text-filter',
+   'components/nav-bar/nav-bar',
+   'components/utils/date-pickers/date-pickers',
+   'components/widgets/ab-testing/ab-testing',
+   
'components/widgets/amt-per-second-chart/amt-per-second-chart',
+   'components/widgets/cat-trombone/cat-trombone',
+   
'components/widgets/distance-to-goal-chart/distance-to-goal-chart',
+   'components/widgets/donation-age/donation-age',
+   'components/widgets/fraud-gauge/fraud-gauge',
+   'components/widgets/top10/top10',
+   
'components/widgets/totals-earned-chart/totals-earned-chart',
+   'components/widgets/x-by-y/x-by-y'
+   ],
+   insertRequire: [ 'app/startup' ],
+   bundles: {
+   // If you want parts of the site to load on demand, 
remove them from the 'include' list
+   // above, and group them into bundles here.
+   'date-pickers': [ 
'components/utils/date-pickers/date-pickers' ]
+   // 'vega-timeseries': 
['components/visualizers/vega-timeseries/vega-timeseries']
+
+   }
+})

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I078dda880323eddc7c4b20d3f95abcc9b9c095fe
Gerrit-PatchSet: 1

[MediaWiki-commits] [Gerrit] wikimedia...dash[deployment]: Merge branch 'master' into deployment

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393686 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

4d49a59 git.wikimedia.org -> phab
8e62035 Label dates better in Big English chart
4cb44dc Change individual amount cutoff to $5000
130ec05 Configurable target per campaign

Change-Id: I7417e323146e160b5d48df8121789e284de1a636
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/86/393686/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7417e323146e160b5d48df8121789e284de1a636
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...dash[deployment]: Update bower_modules

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393685 )

Change subject: Update bower_modules
..

Update bower_modules

Change-Id: I8ae3c12dcccb60fb93864d94e5812d761ec7689b
---
M src/bower_modules
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/85/393685/1

diff --git a/src/bower_modules b/src/bower_modules
index 1db0504..f170ad9 16
--- a/src/bower_modules
+++ b/src/bower_modules
@@ -1 +1 @@
-Subproject commit 1db0504302c21003f6f5ad9a05d668ba929283d8
+Subproject commit f170ad9020b3b8a733fe8a6064fa119f34470244

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ae3c12dcccb60fb93864d94e5812d761ec7689b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...bower_modules[master]: Update momentjs

2017-11-27 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393684 )

Change subject: Update momentjs
..


Update momentjs

Change-Id: I8723b37f5f3667ab21ff72322bae1e53d5f277e2
---
M d3/.bower.json
M moment/.bower.json
A moment/CHANGELOG.md
M moment/LICENSE
A moment/README.md
M moment/bower.json
D moment/lang/ar-ma.js
D moment/lang/ar-sa.js
D moment/lang/ar.js
D moment/lang/az.js
D moment/lang/bg.js
D moment/lang/bn.js
D moment/lang/br.js
D moment/lang/bs.js
D moment/lang/ca.js
D moment/lang/cs.js
D moment/lang/cv.js
D moment/lang/cy.js
D moment/lang/da.js
D moment/lang/de-at.js
D moment/lang/de.js
D moment/lang/el.js
D moment/lang/en-au.js
D moment/lang/en-ca.js
D moment/lang/en-gb.js
D moment/lang/eo.js
D moment/lang/es.js
D moment/lang/et.js
D moment/lang/eu.js
D moment/lang/fa.js
D moment/lang/fi.js
D moment/lang/fo.js
D moment/lang/fr-ca.js
D moment/lang/fr.js
D moment/lang/gl.js
D moment/lang/he.js
D moment/lang/hi.js
D moment/lang/hr.js
D moment/lang/hu.js
D moment/lang/hy-am.js
D moment/lang/id.js
D moment/lang/is.js
D moment/lang/it.js
D moment/lang/ja.js
D moment/lang/ka.js
D moment/lang/km.js
D moment/lang/ko.js
D moment/lang/lb.js
D moment/lang/lt.js
D moment/lang/lv.js
D moment/lang/mk.js
D moment/lang/ml.js
D moment/lang/mr.js
D moment/lang/ms-my.js
D moment/lang/nb.js
D moment/lang/ne.js
D moment/lang/nl.js
D moment/lang/nn.js
D moment/lang/pl.js
D moment/lang/pt-br.js
D moment/lang/pt.js
D moment/lang/ro.js
D moment/lang/ru.js
D moment/lang/sk.js
D moment/lang/sl.js
D moment/lang/sq.js
D moment/lang/sr-cyrl.js
D moment/lang/sr.js
D moment/lang/sv.js
D moment/lang/ta.js
D moment/lang/th.js
D moment/lang/tl-ph.js
D moment/lang/tr.js
D moment/lang/tzm-latn.js
D moment/lang/tzm.js
D moment/lang/uk.js
D moment/lang/uz.js
D moment/lang/vi.js
D moment/lang/zh-cn.js
D moment/lang/zh-tw.js
A moment/locale/af.js
A moment/locale/ar-dz.js
A moment/locale/ar-kw.js
A moment/locale/ar-ly.js
A moment/locale/ar-ma.js
A moment/locale/ar-sa.js
A moment/locale/ar-tn.js
A moment/locale/ar.js
A moment/locale/az.js
A moment/locale/be.js
A moment/locale/bg.js
A moment/locale/bm.js
A moment/locale/bn.js
A moment/locale/bo.js
A moment/locale/br.js
A moment/locale/bs.js
A moment/locale/ca.js
A moment/locale/cs.js
A moment/locale/cv.js
A moment/locale/cy.js
A moment/locale/da.js
A moment/locale/de-at.js
A moment/locale/de-ch.js
A moment/locale/de.js
A moment/locale/dv.js
A moment/locale/el.js
A moment/locale/en-au.js
A moment/locale/en-ca.js
A moment/locale/en-gb.js
A moment/locale/en-ie.js
A moment/locale/en-nz.js
A moment/locale/eo.js
A moment/locale/es-do.js
A moment/locale/es-us.js
A moment/locale/es.js
A moment/locale/et.js
A moment/locale/eu.js
A moment/locale/fa.js
A moment/locale/fi.js
A moment/locale/fo.js
A moment/locale/fr-ca.js
A moment/locale/fr-ch.js
A moment/locale/fr.js
A moment/locale/fy.js
A moment/locale/gd.js
A moment/locale/gl.js
A moment/locale/gom-latn.js
A moment/locale/gu.js
A moment/locale/he.js
A moment/locale/hi.js
A moment/locale/hr.js
A moment/locale/hu.js
A moment/locale/hy-am.js
A moment/locale/id.js
A moment/locale/is.js
A moment/locale/it.js
A moment/locale/ja.js
A moment/locale/jv.js
A moment/locale/ka.js
A moment/locale/kk.js
A moment/locale/km.js
A moment/locale/kn.js
A moment/locale/ko.js
A moment/locale/ky.js
A moment/locale/lb.js
A moment/locale/lo.js
A moment/locale/lt.js
A moment/locale/lv.js
A moment/locale/me.js
A moment/locale/mi.js
A moment/locale/mk.js
A moment/locale/ml.js
A moment/locale/mr.js
A moment/locale/ms-my.js
A moment/locale/ms.js
A moment/locale/my.js
A moment/locale/nb.js
A moment/locale/ne.js
A moment/locale/nl-be.js
A moment/locale/nl.js
A moment/locale/nn.js
A moment/locale/pa-in.js
A moment/locale/pl.js
A moment/locale/pt-br.js
A moment/locale/pt.js
A moment/locale/ro.js
A moment/locale/ru.js
A moment/locale/sd.js
A moment/locale/se.js
A moment/locale/si.js
A moment/locale/sk.js
A moment/locale/sl.js
A moment/locale/sq.js
A moment/locale/sr-cyrl.js
A moment/locale/sr.js
A moment/locale/ss.js
A moment/locale/sv.js
A moment/locale/sw.js
A moment/locale/ta.js
A moment/locale/te.js
A moment/locale/tet.js
A moment/locale/th.js
A moment/locale/tl-ph.js
A moment/locale/tlh.js
A moment/locale/tr.js
A moment/locale/tzl.js
A moment/locale/tzm-latn.js
A moment/locale/tzm.js
A moment/locale/uk.js
A moment/locale/ur.js
A moment/locale/uz-latn.js
A moment/locale/uz.js
A moment/locale/vi.js
A moment/locale/x-pseudo.js
A moment/locale/yo.js
A moment/locale/zh-cn.js
A moment/locale/zh-hk.js
A moment/locale/zh-tw.js
D moment/min/langs.js
D moment/min/langs.min.js
A moment/min/locales.js
A moment/min/locales.min.js
D moment/min/moment-with-langs.js
D moment/min/moment-with-langs.min.js
A moment/min/moment-with-locales.js
A moment/min/moment-with-locales.min.js
M moment/min/moment.min.js
A moment/moment.d.ts
M moment/moment.js
D moment/readme.md
A 

[MediaWiki-commits] [Gerrit] wikimedia...bower_modules[master]: Update momentjs

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393684 )

Change subject: Update momentjs
..

Update momentjs

Change-Id: I8723b37f5f3667ab21ff72322bae1e53d5f277e2
---
M d3/.bower.json
M moment/.bower.json
A moment/CHANGELOG.md
M moment/LICENSE
A moment/README.md
M moment/bower.json
D moment/lang/ar-ma.js
D moment/lang/ar-sa.js
D moment/lang/ar.js
D moment/lang/az.js
D moment/lang/bg.js
D moment/lang/bn.js
D moment/lang/br.js
D moment/lang/bs.js
D moment/lang/ca.js
D moment/lang/cs.js
D moment/lang/cv.js
D moment/lang/cy.js
D moment/lang/da.js
D moment/lang/de-at.js
D moment/lang/de.js
D moment/lang/el.js
D moment/lang/en-au.js
D moment/lang/en-ca.js
D moment/lang/en-gb.js
D moment/lang/eo.js
D moment/lang/es.js
D moment/lang/et.js
D moment/lang/eu.js
D moment/lang/fa.js
D moment/lang/fi.js
D moment/lang/fo.js
D moment/lang/fr-ca.js
D moment/lang/fr.js
D moment/lang/gl.js
D moment/lang/he.js
D moment/lang/hi.js
D moment/lang/hr.js
D moment/lang/hu.js
D moment/lang/hy-am.js
D moment/lang/id.js
D moment/lang/is.js
D moment/lang/it.js
D moment/lang/ja.js
D moment/lang/ka.js
D moment/lang/km.js
D moment/lang/ko.js
D moment/lang/lb.js
D moment/lang/lt.js
D moment/lang/lv.js
D moment/lang/mk.js
D moment/lang/ml.js
D moment/lang/mr.js
D moment/lang/ms-my.js
D moment/lang/nb.js
D moment/lang/ne.js
D moment/lang/nl.js
D moment/lang/nn.js
D moment/lang/pl.js
D moment/lang/pt-br.js
D moment/lang/pt.js
D moment/lang/ro.js
D moment/lang/ru.js
D moment/lang/sk.js
D moment/lang/sl.js
D moment/lang/sq.js
D moment/lang/sr-cyrl.js
D moment/lang/sr.js
D moment/lang/sv.js
D moment/lang/ta.js
D moment/lang/th.js
D moment/lang/tl-ph.js
D moment/lang/tr.js
D moment/lang/tzm-latn.js
D moment/lang/tzm.js
D moment/lang/uk.js
D moment/lang/uz.js
D moment/lang/vi.js
D moment/lang/zh-cn.js
D moment/lang/zh-tw.js
A moment/locale/af.js
A moment/locale/ar-dz.js
A moment/locale/ar-kw.js
A moment/locale/ar-ly.js
A moment/locale/ar-ma.js
A moment/locale/ar-sa.js
A moment/locale/ar-tn.js
A moment/locale/ar.js
A moment/locale/az.js
A moment/locale/be.js
A moment/locale/bg.js
A moment/locale/bm.js
A moment/locale/bn.js
A moment/locale/bo.js
A moment/locale/br.js
A moment/locale/bs.js
A moment/locale/ca.js
A moment/locale/cs.js
A moment/locale/cv.js
A moment/locale/cy.js
A moment/locale/da.js
A moment/locale/de-at.js
A moment/locale/de-ch.js
A moment/locale/de.js
A moment/locale/dv.js
A moment/locale/el.js
A moment/locale/en-au.js
A moment/locale/en-ca.js
A moment/locale/en-gb.js
A moment/locale/en-ie.js
A moment/locale/en-nz.js
A moment/locale/eo.js
A moment/locale/es-do.js
A moment/locale/es-us.js
A moment/locale/es.js
A moment/locale/et.js
A moment/locale/eu.js
A moment/locale/fa.js
A moment/locale/fi.js
A moment/locale/fo.js
A moment/locale/fr-ca.js
A moment/locale/fr-ch.js
A moment/locale/fr.js
A moment/locale/fy.js
A moment/locale/gd.js
A moment/locale/gl.js
A moment/locale/gom-latn.js
A moment/locale/gu.js
A moment/locale/he.js
A moment/locale/hi.js
A moment/locale/hr.js
A moment/locale/hu.js
A moment/locale/hy-am.js
A moment/locale/id.js
A moment/locale/is.js
A moment/locale/it.js
A moment/locale/ja.js
A moment/locale/jv.js
A moment/locale/ka.js
A moment/locale/kk.js
A moment/locale/km.js
A moment/locale/kn.js
A moment/locale/ko.js
A moment/locale/ky.js
A moment/locale/lb.js
A moment/locale/lo.js
A moment/locale/lt.js
A moment/locale/lv.js
A moment/locale/me.js
A moment/locale/mi.js
A moment/locale/mk.js
A moment/locale/ml.js
A moment/locale/mr.js
A moment/locale/ms-my.js
A moment/locale/ms.js
A moment/locale/my.js
A moment/locale/nb.js
A moment/locale/ne.js
A moment/locale/nl-be.js
A moment/locale/nl.js
A moment/locale/nn.js
A moment/locale/pa-in.js
A moment/locale/pl.js
A moment/locale/pt-br.js
A moment/locale/pt.js
A moment/locale/ro.js
A moment/locale/ru.js
A moment/locale/sd.js
A moment/locale/se.js
A moment/locale/si.js
A moment/locale/sk.js
A moment/locale/sl.js
A moment/locale/sq.js
A moment/locale/sr-cyrl.js
A moment/locale/sr.js
A moment/locale/ss.js
A moment/locale/sv.js
A moment/locale/sw.js
A moment/locale/ta.js
A moment/locale/te.js
A moment/locale/tet.js
A moment/locale/th.js
A moment/locale/tl-ph.js
A moment/locale/tlh.js
A moment/locale/tr.js
A moment/locale/tzl.js
A moment/locale/tzm-latn.js
A moment/locale/tzm.js
A moment/locale/uk.js
A moment/locale/ur.js
A moment/locale/uz-latn.js
A moment/locale/uz.js
A moment/locale/vi.js
A moment/locale/x-pseudo.js
A moment/locale/yo.js
A moment/locale/zh-cn.js
A moment/locale/zh-hk.js
A moment/locale/zh-tw.js
D moment/min/langs.js
D moment/min/langs.min.js
A moment/min/locales.js
A moment/min/locales.min.js
D moment/min/moment-with-langs.js
D moment/min/moment-with-langs.min.js
A moment/min/moment-with-locales.js
A moment/min/moment-with-locales.min.js
M moment/min/moment.min.js
A moment/moment.d.ts
M moment/moment.js
D moment/readme.md
A moment/src/lib/create/check-overflow.js
A 

[MediaWiki-commits] [Gerrit] wikimedia...dash[master]: Configurable target per campaign

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393681 )

Change subject: Configurable target per campaign
..

Configurable target per campaign

Change-Id: I88f005eec9aa0a324270149130c73459f7a9d24c
---
M src/app/campaign.js
M src/components/widgets/totals-earned-chart/totals-earned-chart.js
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/81/393681/1

diff --git a/src/app/campaign.js b/src/app/campaign.js
index cd350cd..5f3f68e 100644
--- a/src/app/campaign.js
+++ b/src/app/campaign.js
@@ -12,6 +12,7 @@
this.endDate = new Date( params.endDate ||
Date.UTC( currentYear + 1, 0, 1 ) );
this.name = params.name || currentYear.toString();
+   this.target = params.target || 2500;
}
 
Campaign.prototype.getDayOfYearOffset = function () {
diff --git a/src/components/widgets/totals-earned-chart/totals-earned-chart.js 
b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
index c2c2277..8a12dbf 100644
--- a/src/components/widgets/totals-earned-chart/totals-earned-chart.js
+++ b/src/components/widgets/totals-earned-chart/totals-earned-chart.js
@@ -35,14 +35,14 @@
self.hourlyChart = ko.observable( false );
self.dailyChart = ko.observable( false );
 
-   self.goal = params.sharedContext.goal = ko.observable( 
self.config.goal || 2500 );
self.majorDonationCutoff = ko.observable( 
self.config.majorDonationCutoff || 1000 ).extend( { throttle: 500 } );
 
self.campaigns = [
new Campaign( {
name: '2017',
startDate: Date.UTC( 2017, 9, 2 ),
-   endDate: Date.UTC( 2018, 0, 1 )
+   endDate: Date.UTC( 2018, 0, 1 ),
+   target: 5500
} ),
new Campaign( {
name: '2016',
@@ -76,6 +76,7 @@
} )
];
self.campaign = ko.observable( self.campaigns[ 0 ] );
+   self.goal = params.sharedContext.goal = ko.observable( 
self.config.goal || self.campaign().target );
 
self.isCurrentYear = ko.computed( function () {
return self.campaign() === self.campaigns[ 0 ];
@@ -94,6 +95,7 @@
} ) );
 
self.disposables.push( self.campaign.subscribe( function () {
+   self.goal( self.campaign().target );
self.logStateChange();
self.reloadData();
} ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88f005eec9aa0a324270149130c73459f7a9d24c
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393647 )

Change subject: Update DonationInterface submodule
..

Update DonationInterface submodule

Change-Id: Ie79b1884d01c00ca6a9022b32463486bf20fad6c
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/393647/1

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 47ba475..07d5efb 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 47ba475a1e2e5e4ccb0be5e6a166dcaac29f015f
+Subproject commit 07d5efbc9c811094bbd5647705e84f04c6f32769

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie79b1884d01c00ca6a9022b32463486bf20fad6c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393645 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

6a1a8f558 Restyle payments forms

Change-Id: I2b5459b5182ebc92367d81e8b67e96c1d2a59161
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface submodule

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393625 )

Change subject: Update DonationInterface submodule
..

Update DonationInterface submodule

Change-Id: I2e6ee4940945fc1a5c1523f9de57382d13f8ed44
---
M extensions/DonationInterface
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/393625/1

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 2f3e864..47ba475 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
@@ -1 +1 @@
-Subproject commit 2f3e8644f0b64ecdd2df9a9fd694e8c193882bee
+Subproject commit 47ba475a1e2e5e4ccb0be5e6a166dcaac29f015f

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e6ee4940945fc1a5c1523f9de57382d13f8ed44
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_27
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment

2017-11-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393624 )

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

f22b0852b Localisation updates from https://translatewiki.net.
a500b4a36 Localisation updates from https://translatewiki.net.
b861643f9 Localisation updates from https://translatewiki.net.
45d851eb1 Localisation updates from https://translatewiki.net.
ab2321bb4 Show 'enable cookies' error message

Change-Id: Id1c3bca91ad5ef34c123d123c7b30db628681301
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Show 'enable cookies' error message

2017-11-22 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392985 )

Change subject: Show 'enable cookies' error message
..

Show 'enable cookies' error message

Was deleted by mistake

Bug: T180975
Change-Id: I05f9967e4397f63633c3d325e6d17cf4de3fbdbe
---
M gateway_forms/mustache/index.html.mustache
M modules/validate_input.js
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/gateway_forms/mustache/index.html.mustache 
b/gateway_forms/mustache/index.html.mustache
index e27d074..758ab80 100644
--- a/gateway_forms/mustache/index.html.mustache
+++ b/gateway_forms/mustache/index.html.mustache
@@ -9,6 +9,7 @@

{{> no_script }}
{{# errors/general }}{{{ message 
}}}{{/ errors/general }}
+   

 {{# order_id }}{{! Use the full order id as reference if we 
have one }}
 {{ l10n "donate_interface-error-reference" . }}
diff --git a/modules/validate_input.js b/modules/validate_input.js
index 1f48ea3..9bfa8c8 100644
--- a/modules/validate_input.js
+++ b/modules/validate_input.js
@@ -187,11 +187,10 @@
document.cookie = 'wmf_test=1;';
if ( document.cookie.indexOf( 'wmf_test=1' ) !== -1 ) {
document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 
GMT;'; // unset the cookie
-   $( '#cookieMsg' ).addClass( 'errorMsgHide' );
+   clearError( 'cookie' );
} else {
errorsPresent = true; // display error
-   $( '#cookieMsg' ).addClass( 'errorMsg' );
-   $( '#cookieMsg' ).text( mediaWiki.msg( 
'donate_interface-error-msg-cookies' ) );
+   setError( 'cookie', mediaWiki.msg( 
'donate_interface-error-msg-cookies' ) );
}
 
return !errorsPresent;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05f9967e4397f63633c3d325e6d17cf4de3fbdbe
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


  1   2   3   4   5   6   7   8   9   10   >