Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/306811
Change subject: Update libs
......................................................................
Update libs
Change-Id: Ifd190c0980ef8c23cd2a4c095783e8e088a1411d
---
M composer/autoload_classmap.php
M composer/installed.json
M wikimedia/donation-interface/README.txt
M wikimedia/donation-interface/adyen_gateway/adyen.adapter.php
M wikimedia/donation-interface/amazon_gateway/amazon.adapter.php
M wikimedia/donation-interface/astropay_gateway/astropay.adapter.php
M wikimedia/donation-interface/composer.json
M wikimedia/donation-interface/extension.json
M
wikimedia/donation-interface/extras/banner_history/BannerHistoryLogIdProcessor.php
M wikimedia/donation-interface/extras/conversion_log/conversion_log.body.php
M wikimedia/donation-interface/extras/custom_filters/custom_filters.body.php
M
wikimedia/donation-interface/extras/custom_filters/filters/functions/functions.body.php
M
wikimedia/donation-interface/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
M
wikimedia/donation-interface/extras/custom_filters/filters/minfraud/minfraud.body.php
M
wikimedia/donation-interface/extras/custom_filters/filters/referrer/referrer.body.php
M
wikimedia/donation-interface/extras/custom_filters/filters/source/source.body.php
M wikimedia/donation-interface/extras/session_velocity/session_velocity.body.php
M wikimedia/donation-interface/gateway_common/GatewayType.php
M wikimedia/donation-interface/gateway_common/WmfFramework.drupal.php
M wikimedia/donation-interface/gateway_common/WmfFramework.mediawiki.php
M wikimedia/donation-interface/gateway_common/gateway.adapter.php
M wikimedia/donation-interface/gateway_common/i18n/interface/ast.json
M wikimedia/donation-interface/gateway_common/i18n/interface/jv.json
M wikimedia/donation-interface/gateway_common/i18n/interface/oc.json
M wikimedia/donation-interface/gateway_common/i18n/interface/vi.json
M wikimedia/donation-interface/globalcollect_gateway/globalcollect.adapter.php
M
wikimedia/donation-interface/globalcollect_gateway/globalcollect_resultswitcher.body.php
M wikimedia/donation-interface/globalcollect_gateway/i18n/oc.json
M wikimedia/donation-interface/globalcollect_gateway/orphan.adapter.php
M wikimedia/donation-interface/modules/CurrencyRatesModule.php
M
wikimedia/donation-interface/paypal_gateway/express_checkout/paypal_express.adapter.php
M wikimedia/donation-interface/tests/phpunit/Adapter/AstroPay/AstroPayTest.php
M wikimedia/donation-interface/tests/phpunit/Adapter/GatewayAdapterTest.php
M wikimedia/donation-interface/tests/phpunit/DonationInterfaceTestCase.php
M wikimedia/donation-interface/tests/phpunit/FraudFiltersTest.php
M
wikimedia/donation-interface/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php
M wikimedia/smash-pig/Core/DataStores/DamagedDatabase.php
M wikimedia/smash-pig/Core/DataStores/PendingDatabase.php
A wikimedia/smash-pig/Core/DataStores/SmashPigDatabase.php
M wikimedia/smash-pig/Core/QueueConsumers/BaseQueueConsumer.php
M wikimedia/smash-pig/CrmLink/Messages/DonationInterfaceMessage.php
M wikimedia/smash-pig/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
M wikimedia/smash-pig/PaymentProviders/Adyen/Tests/Data/pending.json
R wikimedia/smash-pig/Schema/mysql/001_CreatePendingTable.sql
R wikimedia/smash-pig/Schema/mysql/002_CreateDamagedTable.sql
R wikimedia/smash-pig/Schema/sqlite/001_CreatePendingTable.sql
R wikimedia/smash-pig/Schema/sqlite/002_CreateDamagedTable.sql
M wikimedia/smash-pig/SmashPig.yaml
M wikimedia/smash-pig/Tests/DamagedDatabaseTest.php
M wikimedia/smash-pig/Tests/PendingDatabaseTest.php
D wikimedia/smash-pig/Tests/PendingDatabaseTestConfiguration.php
M wikimedia/smash-pig/Tests/QueueConsumerTest.php
A wikimedia/smash-pig/Tests/SmashPigDatabaseTestConfiguration.php
R wikimedia/smash-pig/Tests/data/config_smashpig_db.yaml
M wikimedia/smash-pig/composer.json
M wikimedia/smash-pig/composer.lock
56 files changed, 368 insertions(+), 403 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/vendor
refs/changes/11/306811/1
diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php
index 6cbcce3..62d3f76 100644
--- a/composer/autoload_classmap.php
+++ b/composer/autoload_classmap.php
@@ -17,10 +17,19 @@
'AmountInCents' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/AmountInCents.php',
'AmountInMinorUnits' => $vendorDir .
'/wikimedia/donation-interface/adyen_gateway/AmountInMinorUnits.php',
'ArrayHelper' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/ArrayHelper.php',
+ 'AstroPayAdapter' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/astropay.adapter.php',
+ 'AstroPayFinancialNumbers' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/AstroPayFinancialNumbers.php',
+ 'AstroPayGateway' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/astropay_gateway.body.php',
+ 'AstroPayGatewayResult' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/astropay_resultswitcher.body.php',
+ 'AstroPayMethodCodec' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/AstroPayMethodCodec.php',
+ 'AstroPaySignature' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/AstroPaySignature.php',
+ 'AstroPayStatusQuery' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/scripts/status.php',
+ 'BannerHistoryLogIdProcessor' => $vendorDir .
'/wikimedia/donation-interface/extras/banner_history/BannerHistoryLogIdProcessor.php',
'CallbackFilterIterator' => $vendorDir .
'/symfony/polyfill-php54/Resources/stubs/CallbackFilterIterator.php',
'CleanupRecurringLength' => $vendorDir .
'/wikimedia/donation-interface/paypal_gateway/CleanupRecurringLength.php',
'ClientSideValidationHelper' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/ClientSideValidationHelper.php',
'ContributionTrackingPlusUnique' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/ContributionTrackingPlusUnique.php',
+ 'CountryCodes' => $vendorDir .
'/wikimedia/donation-interface/gateway_forms/includes/CountryCodes.php',
'CurrencyRates' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/CurrencyRates.php',
'CyclicalArray' => $vendorDir .
'/wikimedia/donation-interface/globalcollect_gateway/CyclicalArray.php',
'DataValidator' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/DataValidator.php',
@@ -35,14 +44,27 @@
'DonorFullName' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/DonorFullName.php',
'DonorLanguage' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/DonorLanguage.php',
'DonorLocale' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/DonorLocale.php',
+ 'DummyFiscalNumber' => $vendorDir .
'/wikimedia/donation-interface/astropay_gateway/DummyFiscalNumber.php',
'EncodingMangler' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/EncodingMangler.php',
'FallbackLogPrefixer' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/FallbackLogPrefixer.php',
'FinalStatus' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/FinalStatus.php',
'FiscalNumber' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/FiscalNumber.php',
+ 'FraudFilter' => $vendorDir .
'/wikimedia/donation-interface/extras/FraudFilter.php',
'FullNameWithExceptions' => $vendorDir .
'/wikimedia/donation-interface/adyen_gateway/FullNameWithExceptions.php',
'GatewayAdapter' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/gateway.adapter.php',
'GatewayPage' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/GatewayPage.php',
'GatewayType' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/GatewayType.php',
+ 'Gateway_Extras' => $vendorDir .
'/wikimedia/donation-interface/extras/extras.body.php',
+ 'Gateway_Extras_ConversionLog' => $vendorDir .
'/wikimedia/donation-interface/extras/conversion_log/conversion_log.body.php',
+ 'Gateway_Extras_CustomFilters' => $vendorDir .
'/wikimedia/donation-interface/extras/custom_filters/custom_filters.body.php',
+ 'Gateway_Extras_CustomFilters_Functions' => $vendorDir .
'/wikimedia/donation-interface/extras/custom_filters/filters/functions/functions.body.php',
+ 'Gateway_Extras_CustomFilters_IP_Velocity' => $vendorDir .
'/wikimedia/donation-interface/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php',
+ 'Gateway_Extras_CustomFilters_MinFraud' => $vendorDir .
'/wikimedia/donation-interface/extras/custom_filters/filters/minfraud/minfraud.body.php',
+ 'Gateway_Extras_CustomFilters_Referrer' => $vendorDir .
'/wikimedia/donation-interface/extras/custom_filters/filters/referrer/referrer.body.php',
+ 'Gateway_Extras_CustomFilters_Source' => $vendorDir .
'/wikimedia/donation-interface/extras/custom_filters/filters/source/source.body.php',
+ 'Gateway_Extras_SessionVelocityFilter' => $vendorDir .
'/wikimedia/donation-interface/extras/session_velocity/session_velocity.body.php',
+ 'Gateway_Form' => $vendorDir .
'/wikimedia/donation-interface/gateway_forms/Form.php',
+ 'Gateway_Form_Mustache' => $vendorDir .
'/wikimedia/donation-interface/gateway_forms/Mustache.php',
'GlobalCollectAdapter' => $vendorDir .
'/wikimedia/donation-interface/globalcollect_gateway/globalcollect.adapter.php',
'GlobalCollectGateway' => $vendorDir .
'/wikimedia/donation-interface/globalcollect_gateway/globalcollect_gateway.body.php',
'GlobalCollectGatewayResult' => $vendorDir .
'/wikimedia/donation-interface/globalcollect_gateway/globalcollect_resultswitcher.body.php',
@@ -60,6 +82,7 @@
'LightnCandy' => $vendorDir . '/zordius/lightncandy/src/lightncandy.php',
'LogPrefixProvider' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/LogPrefixProvider.php',
'MessageUtils' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/MessageUtils.php',
+ 'MustacheErrorForm' => $vendorDir .
'/wikimedia/donation-interface/gateway_forms/MustacheErrorForm.php',
'NationalCurrencies' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/NationalCurrencies.php',
'OrphanMaintenance' => $vendorDir .
'/wikimedia/donation-interface/globalcollect_gateway/scripts/orphans.php',
'PHPMailer' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php',
@@ -83,6 +106,7 @@
'SessionHandlerInterface' => $vendorDir .
'/symfony/polyfill-php54/Resources/stubs/SessionHandlerInterface.php',
'StagingHelper' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/StagingHelper.php',
'StreetAddress' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/StreetAddress.php',
+ 'Subdivisions' => $vendorDir .
'/wikimedia/donation-interface/gateway_forms/includes/Subdivisions.php',
'UnstagingHelper' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/UnstagingHelper.php',
'ValidationHelper' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/ValidationHelper.php',
'WmfFrameworkLogHandler' => $vendorDir .
'/wikimedia/donation-interface/gateway_common/WmfFrameworkLogHandler.php',
diff --git a/composer/installed.json b/composer/installed.json
index 5dbb9e3..341defb 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -1107,67 +1107,6 @@
]
},
{
- "name": "wikimedia/smash-pig",
- "version": "dev-master",
- "version_normalized": "9999999-dev",
- "source": {
- "type": "git",
- "url":
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git",
- "reference": "29866633d165747dbf8be1d2ec482886dd31a2dd"
- },
- "require": {
- "amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
- "coderkungfu/php-queue": "dev-master",
- "fusesource/stomp-php": "^2.1.1",
- "php": "^5.3.3",
- "phpmailer/phpmailer": "^5.2",
- "predis/predis": "^1.1",
- "symfony/event-dispatcher": "^2.1",
- "symfony/http-foundation": "^2.1",
- "symfony/yaml": "^2.8"
- },
- "require-dev": {
- "jakub-onderka/php-parallel-lint": "^0.9",
- "phpunit/phpunit": "^4.8"
- },
- "time": "2016-08-09 18:59:16",
- "type": "library",
- "installation-source": "source",
- "autoload": {
- "psr-4": {
- "SmashPig\\": "./"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "GPL-2.0"
- ],
- "authors": [
- {
- "name": "Katie Horn",
- "email": "[email protected]"
- },
- {
- "name": "Matthew Walker",
- "email": "[email protected]"
- },
- {
- "name": "Adam Roses Wight",
- "email": "[email protected]"
- },
- {
- "name": "Elliott Eggleston",
- "email": "[email protected]"
- }
- ],
- "description": "The open source PHP flexible payments library and
frontend/backend mediator.",
- "homepage": "http://smashpig.org",
- "keywords": [
- "donations",
- "payments"
- ]
- },
- {
"name": "symfony/polyfill-php54",
"version": "v1.2.0",
"version_normalized": "1.2.0.0",
@@ -1228,13 +1167,74 @@
]
},
{
+ "name": "wikimedia/smash-pig",
+ "version": "dev-master",
+ "version_normalized": "9999999-dev",
+ "source": {
+ "type": "git",
+ "url":
"https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git",
+ "reference": "fd570e4ad72ae5b35f317346e53d753855957835"
+ },
+ "require": {
+ "amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
+ "coderkungfu/php-queue": "dev-master",
+ "fusesource/stomp-php": "^2.1.1",
+ "php": ">=5.3.3",
+ "phpmailer/phpmailer": "^5.2",
+ "predis/predis": "^1.1",
+ "symfony/event-dispatcher": "^2.1",
+ "symfony/http-foundation": "^2.1",
+ "symfony/yaml": "^2.8"
+ },
+ "require-dev": {
+ "jakub-onderka/php-parallel-lint": "^0.9",
+ "phpunit/phpunit": "^4.8"
+ },
+ "time": "2016-08-22 16:47:05",
+ "type": "library",
+ "installation-source": "source",
+ "autoload": {
+ "psr-4": {
+ "SmashPig\\": "./"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPL-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Katie Horn",
+ "email": "[email protected]"
+ },
+ {
+ "name": "Matthew Walker",
+ "email": "[email protected]"
+ },
+ {
+ "name": "Adam Roses Wight",
+ "email": "[email protected]"
+ },
+ {
+ "name": "Elliott Eggleston",
+ "email": "[email protected]"
+ }
+ ],
+ "description": "The open source PHP flexible payments library and
frontend/backend mediator.",
+ "homepage": "http://smashpig.org",
+ "keywords": [
+ "donations",
+ "payments"
+ ]
+ },
+ {
"name": "wikimedia/donation-interface",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url":
"https://gerrit.wikimedia.org/r/mediawiki/extensions/DonationInterface.git",
- "reference": "dffabc362b09b002d7e55280e7aa24b249d52874"
+ "reference": "1e2fd3deade07d4663999496dd0aa79c27eb9d2d"
},
"require": {
"amzn/login-and-pay-with-amazon-sdk-php": "dev-master",
@@ -1249,14 +1249,17 @@
"wikimedia/smash-pig": "dev-master",
"zordius/lightncandy": "0.23"
},
- "time": "2016-08-18 00:03:36",
+ "time": "2016-08-25 21:28:41",
"type": "library",
"installation-source": "source",
"autoload": {
"classmap": [
"adyen_gateway",
"amazon_gateway",
+ "astropay_gateway",
+ "extras",
"gateway_common",
+ "gateway_forms",
"globalcollect_gateway",
"paypal_gateway",
"DonationInterface.class.php"
diff --git a/wikimedia/donation-interface/README.txt
b/wikimedia/donation-interface/README.txt
index 8077da6..e7b1d48 100644
--- a/wikimedia/donation-interface/README.txt
+++ b/wikimedia/donation-interface/README.txt
@@ -471,7 +471,7 @@
$wgDonationInterfaceCustomFiltersSrcRules = array()
//Functions Filter globals
-//These functions fire when we trigger the antifraud hook.
+//These functions fire when we trigger the antifraud filters.
//Anything that needs access to API call results goes here.
//FIXME: you need to copy all the initial functions here because
//individual function scores don't persist like filter scores.
diff --git a/wikimedia/donation-interface/adyen_gateway/adyen.adapter.php
b/wikimedia/donation-interface/adyen_gateway/adyen.adapter.php
index c70bd4d..7c12752 100644
--- a/wikimedia/donation-interface/adyen_gateway/adyen.adapter.php
+++ b/wikimedia/donation-interface/adyen_gateway/adyen.adapter.php
@@ -168,9 +168,10 @@
switch ( $transaction ) {
case 'donate':
$formaction = $this->getProcessorUrl()
. '/hpp/pay.shtml';
- // Run API call hooks here because we
don't cURL anything
- $this->runApiCallHooks();
- $this->runAntifraudHooks();
+ // Run Session Velocity here because we
don't cURL anything
+ $this->runSessionVelocityFilter();
+ // FIXME: should skip next step if
session velocity rejected
+ $this->runAntifraudFilters();
// Add the risk score to our data. This
will also trigger
// staging, placing the risk score in
the constructed URL
// as 'offset' for use in
processor-side fraud filters.
@@ -272,13 +273,13 @@
$this->finalizeInternalStatus( FinalStatus::FAILED );
$this->logger->info( "Negative response from gateway.
Full response: " . print_r( $response, TRUE ) );
}
- $this->runPostProcessHooks();
+ $this->postProcessDonation();
}
/**
* Overriding this function because we're queueing our pending message
* before we redirect the user, so we don't need to send another one
- * when doStompTransaction is called from runPostProcessHooks.
+ * when doStompTransaction is called from postProcessDonation.
*/
protected function doStompTransaction() {}
diff --git a/wikimedia/donation-interface/amazon_gateway/amazon.adapter.php
b/wikimedia/donation-interface/amazon_gateway/amazon.adapter.php
index 25eb149..3615702 100644
--- a/wikimedia/donation-interface/amazon_gateway/amazon.adapter.php
+++ b/wikimedia/donation-interface/amazon_gateway/amazon.adapter.php
@@ -250,7 +250,7 @@
$this->transaction_response->setTxnMessage( $captureState );
$this->finalizeInternalStatus(
$this->capture_status_map[$captureState] );
- $this->runPostProcessHooks();
+ $this->postProcessDonation();
$this->deleteLimboMessage( 'pending' );
}
diff --git a/wikimedia/donation-interface/astropay_gateway/astropay.adapter.php
b/wikimedia/donation-interface/astropay_gateway/astropay.adapter.php
index 1b7221c..7b971bd 100644
--- a/wikimedia/donation-interface/astropay_gateway/astropay.adapter.php
+++ b/wikimedia/donation-interface/astropay_gateway/astropay.adapter.php
@@ -205,7 +205,7 @@
}
$transaction_result = $this->do_transaction( 'NewInvoice' );
- $this->runAntifraudHooks();
+ $this->runAntifraudFilters();
if ( $this->getValidationAction() !== 'process' ) {
$this->finalizeInternalStatus( FinalStatus::FAILED );
}
@@ -288,7 +288,7 @@
$status = $this->findCodeAction( 'PaymentStatus',
'result', $response['result'] );
$this->logger->info( "Payment status $status coming
back to ResultSwitcher" );
$this->finalizeInternalStatus( $status );
- $this->runPostProcessHooks();
+ $this->postProcessDonation();
$this->deleteLimboMessage( 'pending' );
break;
case 'NewInvoice':
diff --git a/wikimedia/donation-interface/composer.json
b/wikimedia/donation-interface/composer.json
index 096e08d..53cce13 100644
--- a/wikimedia/donation-interface/composer.json
+++ b/wikimedia/donation-interface/composer.json
@@ -9,7 +9,10 @@
"classmap": [
"adyen_gateway",
"amazon_gateway",
+ "astropay_gateway",
+ "extras",
"gateway_common",
+ "gateway_forms",
"globalcollect_gateway",
"paypal_gateway",
"DonationInterface.class.php"
diff --git a/wikimedia/donation-interface/extension.json
b/wikimedia/donation-interface/extension.json
index 72cd065..9ee40cd 100644
--- a/wikimedia/donation-interface/extension.json
+++ b/wikimedia/donation-interface/extension.json
@@ -274,31 +274,6 @@
"remoteExtPath": "DonationInterface"
},
"Hooks": {
- "GatewayReady": [
- "BannerHistoryLogIdProcessor::onGatewayReady",
- "Gateway_Extras_CustomFilters::onGatewayReady"
- ],
- "GatewayValidate": [
- "Gateway_Extras_CustomFilters::onValidate"
- ],
- "GatewayCustomFilter": [
- "Gateway_Extras_CustomFilters_Functions::onFilter",
- "Gateway_Extras_CustomFilters_MinFraud::onFilter",
- "Gateway_Extras_CustomFilters_IP_Velocity::onFilter"
- ],
- "GatewayInitialFilter": [
-
"Gateway_Extras_CustomFilters_Referrer::onInitialFilter",
- "Gateway_Extras_CustomFilters_Source::onInitialFilter",
-
"Gateway_Extras_CustomFilters_Functions::onInitialFilter",
-
"Gateway_Extras_CustomFilters_IP_Velocity::onInitialFilter"
- ],
- "GatewayPostProcess": [
-
"Gateway_Extras_CustomFilters_IP_Velocity::onPostProcess",
- "Gateway_Extras_ConversionLog::onPostProcess"
- ],
- "DonationInterfaceProcessorApiCall": [
-
"Gateway_Extras_SessionVelocityFilter::onProcessorApiCall"
- ],
"UnitTestsList": [
"DonationInterface::onDonationInterfaceUnitTests"
]
@@ -477,6 +452,7 @@
"DonationInterfaceEnableQueue": false,
"DonationInterfaceEnableConversionLog": false,
"DonationInterfaceEnableMinfraud": false,
+ "DonationInterfaceEnableBannerHistoryLog": false,
"GlobalCollectGatewayEnabled": false,
"AmazonGatewayEnabled": false,
"AdyenGatewayEnabled": false,
diff --git
a/wikimedia/donation-interface/extras/banner_history/BannerHistoryLogIdProcessor.php
b/wikimedia/donation-interface/extras/banner_history/BannerHistoryLogIdProcessor.php
index 592639f..ecc7206 100644
---
a/wikimedia/donation-interface/extras/banner_history/BannerHistoryLogIdProcessor.php
+++
b/wikimedia/donation-interface/extras/banner_history/BannerHistoryLogIdProcessor.php
@@ -1,8 +1,8 @@
<?php
/**
- * Processor for banner history log ID. Handles the GatewayReady hook. (See
- * below.)
+ * Processor for banner history log ID. Runs when gateway is constructed,
+ * if DonationInterface global EnableBannerHistoryLog is true.
*/
class BannerHistoryLogIdProcessor {
@@ -77,16 +77,13 @@
}
/**
- * Handler for the GatewayReady hook. This is the class's entry point.
+ * This is the class's entry point.
*
* @param GatewayType $gatewayAdapter
- * @return bool always true
*/
public static function onGatewayReady( GatewayType $gatewayAdapter ) {
-
- self::singleton( $gatewayAdapter )
- ->queueAssociationOfIds();
-
- return true;
+ if ( $gatewayAdapter->getGlobal( 'EnableBannerHistoryLog' ) ) {
+ self::singleton( $gatewayAdapter
)->queueAssociationOfIds();
+ }
}
}
diff --git
a/wikimedia/donation-interface/extras/conversion_log/conversion_log.body.php
b/wikimedia/donation-interface/extras/conversion_log/conversion_log.body.php
index 1a97ab4..07e19ba 100644
--- a/wikimedia/donation-interface/extras/conversion_log/conversion_log.body.php
+++ b/wikimedia/donation-interface/extras/conversion_log/conversion_log.body.php
@@ -37,7 +37,7 @@
if ( !$gateway_adapter->getGlobal( 'EnableConversionLog' ) ) {
return true;
}
- $gateway_adapter->debugarray[] = 'conversion log onPostProcess
hook!';
+ $gateway_adapter->debugarray[] = 'conversion log
onPostProcess!';
return self::singleton( $gateway_adapter )->post_process();
}
diff --git
a/wikimedia/donation-interface/extras/custom_filters/custom_filters.body.php
b/wikimedia/donation-interface/extras/custom_filters/custom_filters.body.php
index 9e08424..ba3a89c 100644
--- a/wikimedia/donation-interface/extras/custom_filters/custom_filters.body.php
+++ b/wikimedia/donation-interface/extras/custom_filters/custom_filters.body.php
@@ -2,11 +2,11 @@
class Gateway_Extras_CustomFilters extends FraudFilter {
- // filter list hook to run on GatewayReady
- const HOOK_INITIAL = 'GatewayInitialFilter';
+ // filter list to run on adapter construction
+ const PHASE_INITIAL = 'GatewayInitialFilter';
- // filter list hook to run on GatewayValidate
- const HOOK_VALIDATE = 'GatewayCustomFilter';
+ // filter list to run before making processor API calls
+ const PHASE_VALIDATE = 'GatewayCustomFilter';
/**
* A value for tracking the 'riskiness' of a transaction
@@ -117,12 +117,11 @@
/**
* Run the transaction through the custom filters
- * @param string $hook Run custom filters attached to a hook with this
name
+ * @param string $phase Run custom filters attached for this phase
* @return bool
*/
- protected function validate( $hook ) {
- // expose a hook for custom filters
- WmfFramework::runHooks( $hook, array( $this->gateway_adapter,
$this ) );
+ protected function validate( $phase ) {
+ $this->runFilters( $phase );
$score = $this->getRiskScore();
$this->gateway_adapter->setRiskScore( $score );
$localAction = $this->determineAction();
@@ -145,7 +144,7 @@
// Always send a message if we're about to charge or redirect
the donor
// Only send a message on initial validation if things look
fishy
- if ( $hook === self::HOOK_VALIDATE || $localAction !==
'process' ) {
+ if ( $phase === self::PHASE_VALIDATE || $localAction !==
'process' ) {
$this->sendAntifraudMessage( $localAction, $score,
$this->risk_score );
}
@@ -159,16 +158,16 @@
if ( !$gateway_adapter->getGlobal( 'EnableCustomFilters' ) ){
return true;
}
- $gateway_adapter->debugarray[] = 'custom filters onValidate
hook!';
- return self::singleton( $gateway_adapter )->validate(
self::HOOK_VALIDATE );
+ $gateway_adapter->debugarray[] = 'custom filters onValidate!';
+ return self::singleton( $gateway_adapter )->validate(
self::PHASE_VALIDATE );
}
public static function onGatewayReady( GatewayType $gateway_adapter ) {
if ( !$gateway_adapter->getGlobal( 'EnableCustomFilters' ) ){
return true;
}
- $gateway_adapter->debugarray[] = 'custom filters onGatewayReady
hook!';
- return self::singleton( $gateway_adapter )->validate(
self::HOOK_INITIAL );
+ $gateway_adapter->debugarray[] = 'custom filters
onGatewayReady!';
+ return self::singleton( $gateway_adapter )->validate(
self::PHASE_INITIAL );
}
public static function singleton( GatewayType $gateway_adapter ) {
@@ -194,4 +193,20 @@
}
return self::singleton( $gateway_adapter )->determineAction();
}
+
+ protected function runFilters( $phase ) {
+ switch( $phase ) {
+ case self::PHASE_INITIAL:
+
Gateway_Extras_CustomFilters_Referrer::onInitialFilter( $this->gateway_adapter,
$this );
+
Gateway_Extras_CustomFilters_Source::onInitialFilter( $this->gateway_adapter,
$this );
+
Gateway_Extras_CustomFilters_Functions::onInitialFilter(
$this->gateway_adapter, $this );
+
Gateway_Extras_CustomFilters_IP_Velocity::onInitialFilter(
$this->gateway_adapter, $this );
+ break;
+ case self::PHASE_VALIDATE:
+
Gateway_Extras_CustomFilters_Functions::onFilter( $this->gateway_adapter, $this
);
+
Gateway_Extras_CustomFilters_MinFraud::onFilter( $this->gateway_adapter, $this
);
+
Gateway_Extras_CustomFilters_IP_Velocity::onFilter( $this->gateway_adapter,
$this );
+ break;
+ }
+ }
}
diff --git
a/wikimedia/donation-interface/extras/custom_filters/filters/functions/functions.body.php
b/wikimedia/donation-interface/extras/custom_filters/filters/functions/functions.body.php
index e316d78..34e775b 100644
---
a/wikimedia/donation-interface/extras/custom_filters/filters/functions/functions.body.php
+++
b/wikimedia/donation-interface/extras/custom_filters/filters/functions/functions.body.php
@@ -64,7 +64,7 @@
GatewayType $gateway_adapter,
Gateway_Extras_CustomFilters $custom_filter_object
) {
- $gateway_adapter->debugarray[] = 'functions onFilter hook!';
+ $gateway_adapter->debugarray[] = 'functions onFilter!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter(
'CustomFiltersFunctions'
);
@@ -74,7 +74,7 @@
GatewayType $gateway_adapter,
Gateway_Extras_CustomFilters $custom_filter_object
) {
- $gateway_adapter->debugarray[] = 'functions onInitialFilter
hook!';
+ $gateway_adapter->debugarray[] = 'functions onInitialFilter!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter(
'CustomFiltersInitialFunctions'
);
diff --git
a/wikimedia/donation-interface/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
b/wikimedia/donation-interface/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
index baa9362..58b24ca 100644
---
a/wikimedia/donation-interface/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
+++
b/wikimedia/donation-interface/extras/custom_filters/filters/ip_velocity/ip_velocity.body.php
@@ -177,7 +177,7 @@
// We're on the first attempt, already counted in
onInitialFilter
return true;
}
- $gateway_adapter->debugarray[] = 'IP Velocity onFilter hook!';
+ $gateway_adapter->debugarray[] = 'IP Velocity onFilter!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter();
}
@@ -196,7 +196,7 @@
}
WmfFramework::setSessionValue( self::RAN_INITIAL, true );
- $gateway_adapter->debugarray[] = 'IP Velocity onFilter hook!';
+ $gateway_adapter->debugarray[] = 'IP Velocity onFilter!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter();
}
@@ -204,7 +204,7 @@
if ( !$gateway_adapter->getGlobal( 'EnableIPVelocityFilter' ) ){
return true;
}
- $gateway_adapter->debugarray[] = 'IP Velocity onPostProcess
hook!';
+ $gateway_adapter->debugarray[] = 'IP Velocity onPostProcess!';
return self::singleton( $gateway_adapter )->postProcess();
}
diff --git
a/wikimedia/donation-interface/extras/custom_filters/filters/minfraud/minfraud.body.php
b/wikimedia/donation-interface/extras/custom_filters/filters/minfraud/minfraud.body.php
index d364933..0d1bbbc 100644
---
a/wikimedia/donation-interface/extras/custom_filters/filters/minfraud/minfraud.body.php
+++
b/wikimedia/donation-interface/extras/custom_filters/filters/minfraud/minfraud.body.php
@@ -352,7 +352,7 @@
if ( !$gateway_adapter->getGlobal( 'EnableMinfraud' ) ){
return true;
}
- $gateway_adapter->debugarray[] = 'minfraud onFilter hook!';
+ $gateway_adapter->debugarray[] = 'minfraud onFilter!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter();
}
diff --git
a/wikimedia/donation-interface/extras/custom_filters/filters/referrer/referrer.body.php
b/wikimedia/donation-interface/extras/custom_filters/filters/referrer/referrer.body.php
index 0c62ad4..1745979 100644
---
a/wikimedia/donation-interface/extras/custom_filters/filters/referrer/referrer.body.php
+++
b/wikimedia/donation-interface/extras/custom_filters/filters/referrer/referrer.body.php
@@ -60,7 +60,7 @@
!count( $gateway_adapter->getGlobal(
'CustomFiltersRefRules' ) ) ){
return true;
}
- $gateway_adapter->debugarray[] = 'referrer onFilter hook!';
+ $gateway_adapter->debugarray[] = 'referrer onFilter!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter();
}
diff --git
a/wikimedia/donation-interface/extras/custom_filters/filters/source/source.body.php
b/wikimedia/donation-interface/extras/custom_filters/filters/source/source.body.php
index c53d3d8..705d687 100644
---
a/wikimedia/donation-interface/extras/custom_filters/filters/source/source.body.php
+++
b/wikimedia/donation-interface/extras/custom_filters/filters/source/source.body.php
@@ -59,7 +59,7 @@
!count( $gateway_adapter->getGlobal(
'CustomFiltersSrcRules' ) ) ){
return true;
}
- $gateway_adapter->debugarray[] = 'source onFilter hook!';
+ $gateway_adapter->debugarray[] = 'source onFilter!';
return self::singleton( $gateway_adapter, $custom_filter_object
)->filter();
}
diff --git
a/wikimedia/donation-interface/extras/session_velocity/session_velocity.body.php
b/wikimedia/donation-interface/extras/session_velocity/session_velocity.body.php
index 6ab5e17..597b771 100644
---
a/wikimedia/donation-interface/extras/session_velocity/session_velocity.body.php
+++
b/wikimedia/donation-interface/extras/session_velocity/session_velocity.body.php
@@ -48,8 +48,6 @@
}
/**
- * @static Filter hook chain gateway function
- *
* @param GatewayType $gateway_adapter The adapter context to log under
*
* @return bool Filter chain termination on FALSE. Also indicates that
the cURL transaction
@@ -67,7 +65,7 @@
* Although this function actually does the filtering, as this is a
singleton pattern
* we only want one instance actually using it.
*
- * @return bool Hook return, false stops processing of the hook chain
+ * @return bool false if we should stop processing
*/
private function filter() {
diff --git a/wikimedia/donation-interface/gateway_common/GatewayType.php
b/wikimedia/donation-interface/gateway_common/GatewayType.php
index d292af3..35d7bce 100644
--- a/wikimedia/donation-interface/gateway_common/GatewayType.php
+++ b/wikimedia/donation-interface/gateway_common/GatewayType.php
@@ -284,7 +284,7 @@
/**
* Returns the current validation action.
- * This will typically get set and altered by the various enabled
process hooks.
+ * This will typically get set and altered by the fraud filters.
*
* @return string the current process action.
*/
@@ -300,7 +300,7 @@
/**
* Sets the current validation action. This is meant to be used by the
- * process hooks, and as such, by default, only worse news than was
already
+ * fraud filters, and as such, by default, only worse news than was
already
* being stored will be retained for the final result.
* @param string $action the value you want to set as the action.
* @param bool $reset set to true to do a hard set on the action value.
@@ -311,7 +311,7 @@
public function setValidationAction( $action, $reset = false );
/**
- * Lets the outside world (particularly hooks that accumulate points
scores)
+ * Lets the outside world (particularly filters that accumulate points
scores)
* know if we are a batch processor.
* @return bool
*/
diff --git
a/wikimedia/donation-interface/gateway_common/WmfFramework.drupal.php
b/wikimedia/donation-interface/gateway_common/WmfFramework.drupal.php
index f465ae7..67ddadd 100644
--- a/wikimedia/donation-interface/gateway_common/WmfFramework.drupal.php
+++ b/wikimedia/donation-interface/gateway_common/WmfFramework.drupal.php
@@ -38,10 +38,6 @@
return $message_identifier;
}
- static function runHooks( $func, $args ) {
- return true;
- }
-
/**
* Do not guess.
*/
diff --git
a/wikimedia/donation-interface/gateway_common/WmfFramework.mediawiki.php
b/wikimedia/donation-interface/gateway_common/WmfFramework.mediawiki.php
index cb8a6fc..37ecf9b 100644
--- a/wikimedia/donation-interface/gateway_common/WmfFramework.mediawiki.php
+++ b/wikimedia/donation-interface/gateway_common/WmfFramework.mediawiki.php
@@ -35,10 +35,6 @@
return call_user_func_array( 'wfMessage', func_get_args()
)->text();
}
- static function runHooks( $func, $args ) {
- return Hooks::run( $func, $args );
- }
-
static function getLanguageCode() {
$lang = RequestContext::getMain()->getLanguage();
return $lang->getCode();
diff --git a/wikimedia/donation-interface/gateway_common/gateway.adapter.php
b/wikimedia/donation-interface/gateway_common/gateway.adapter.php
index b5aaaaa..4273bc2 100644
--- a/wikimedia/donation-interface/gateway_common/gateway.adapter.php
+++ b/wikimedia/donation-interface/gateway_common/gateway.adapter.php
@@ -271,7 +271,9 @@
$this->setGatewayDefaults( $options );
$this->stageData();
- WmfFramework::runHooks( 'GatewayReady', array( $this ) );
+ BannerHistoryLogIdProcessor::onGatewayReady( $this );
+ Gateway_Extras_CustomFilters::onGatewayReady( $this );
+
if ( $this->getValidationAction() !== 'process' ) {
$this->finalizeInternalStatus( FinalStatus::FAILED );
$error = array( 'general' => array( 'internal-0001' =>
@@ -965,10 +967,7 @@
* * pre_process_<strtolower($transaction)>
* Called before the transaction is processed; intended to call
setValidationAction()
* if the transaction should not be performed. Anti-fraud can be
performed in this
- * hook by calling $this->runAntifraudHooks().
- *
- * * MediaWiki hook GatewayHandoff
- * Called if the gateway tranaction type is 'redirect'
+ * hook by calling $this->runAntifraudFilters().
*
* * post_process_<strtolower($transaction)>
*
@@ -1014,7 +1013,6 @@
$commType = $this->getCommunicationType();
if ( $commType === 'redirect' ) {
- WmfFramework::runHooks( 'GatewayHandoff', array
( $this ) );
//in the event that we have a redirect
transaction that never displays the form,
//save this most recent one before we leave.
@@ -1126,7 +1124,7 @@
// If we have any special post-process instructions for this
// transaction, do 'em.
// NOTE: If you want your transaction to fire off the
post-process
- // hooks, you need to run $this->runPostProcessHooks in a
function
+ // logic, you need to run $this->postProcessDonation in a
function
// called
// 'post_process' . strtolower($transaction)
// in the appropriate gateway object.
@@ -1287,11 +1285,11 @@
*/
$this->logger->info( "Initiating cURL for donor $email" );
- // Initialize cURL and construct operation (also run hook)
+ // Initialize cURL and construct operation (also run filter)
$ch = curl_init();
- $hookResult = $this->runApiCallHooks();
- if ( $hookResult == false ) {
+ $filterResult = $this->runSessionVelocityFilter();
+ if ( $filterResult == false ) {
return false;
}
@@ -1697,7 +1695,7 @@
* false, unless it's new data about a new transaction. In that case,
the
* outcome will be assigned and the proper queue selected.
*
- * Probably called in runPostProcessHooks(), which is itself most
likely to
+ * Probably called in postProcessDonation(), which is itself most
likely to
* be called through executeFunctionIfExists, later on in
do_transaction.
*/
protected function doStompTransaction() {
@@ -2214,55 +2212,34 @@
}
/**
- * Runs all the pre-process hooks that have been enabled and configured
in
+ * Runs all the fraud filters that have been enabled and configured in
* donationdata.php and/or LocalSettings.php
* This function is most likely to be called through
* executeFunctionIfExists, early on in do_transaction.
*/
- function runAntifraudHooks() {
+ function runAntifraudFilters() {
//extra layer of Stop Doing This.
$errors = $this->getTransactionErrors();
if ( !empty( $errors ) ) {
- $this->logger->info( 'Skipping antifraud hooks:
Transaction is already in error' );
+ $this->logger->info( 'Skipping antifraud filters:
Transaction is already in error' );
return;
}
// allow any external validators to have their way with the data
$this->logger->info( 'Preparing to run custom filters' );
- WmfFramework::runHooks( 'GatewayValidate', array( $this ) );
+ Gateway_Extras_CustomFilters::onValidate( $this );
$this->logger->info( 'Finished running custom filters' );
-
- //DO NOT set some variable as getValidationAction() here, and
keep
- //checking that. getValidationAction could change with each one
of these
- //hooks, and this ought to cascade.
- // if the transaction was flagged for review
- if ( $this->getValidationAction() == 'review' ) {
- // expose a hook for external handling of trxns flagged
for review
- WmfFramework::runHooks( 'GatewayReview', array( $this )
);
- }
-
- // if the transaction was flagged to be 'challenged'
- if ( $this->getValidationAction() == 'challenge' ) {
- // expose a hook for external handling of trxns flagged
for challenge (eg captcha)
- WmfFramework::runHooks( 'GatewayChallenge', array(
$this ) );
- }
-
- // if the transaction was flagged for rejection
- if ( $this->getValidationAction() == 'reject' ) {
- // expose a hook for external handling of trxns flagged
for rejection
- WmfFramework::runHooks( 'GatewayReject', array( $this )
);
- }
}
/**
- * Runs all the post-process hooks that have been enabled and
configured in
+ * Runs all the post-process logic that has been enabled and configured
in
* donationdata.php and/or LocalSettings.php, including the
ActiveMQ/Stomp
- * hooks.
+ * queue message.
* This function is most likely to be called through
* executeFunctionIfExists, later on in do_transaction.
*/
- protected function runPostProcessHooks() {
- // expose a hook for any post processing
- WmfFramework::runHooks( 'GatewayPostProcess', array( $this ) );
+ protected function postProcessDonation() {
+ Gateway_Extras_CustomFilters_IP_Velocity::onPostProcess( $this
);
+ Gateway_Extras_ConversionLog::onPostProcess( $this );
try {
$this->doStompTransaction();
@@ -3613,13 +3590,14 @@
}
}
- protected function runApiCallHooks() {
- $hookResult = WmfFramework::runHooks(
'DonationInterfaceProcessorApiCall', array( $this ) );
- if ( $hookResult == false ) {
- $this->logger->info( 'Processor API call aborted on
hook DonationInterfaceProcessorApiCall' );
+ protected function runSessionVelocityFilter() {
+ $result =
Gateway_Extras_SessionVelocityFilter::onProcessorApiCall( $this );
+
+ if ( $result == false ) {
+ $this->logger->info( 'Processor API call aborted on
Session Velocity filter' );
$this->setValidationAction( 'reject' );
}
- return $hookResult;
+ return $result;
}
/**
diff --git
a/wikimedia/donation-interface/gateway_common/i18n/interface/ast.json
b/wikimedia/donation-interface/gateway_common/i18n/interface/ast.json
index 123111d..d48803a 100644
--- a/wikimedia/donation-interface/gateway_common/i18n/interface/ast.json
+++ b/wikimedia/donation-interface/gateway_common/i18n/interface/ast.json
@@ -193,6 +193,7 @@
"donate_interface-error-msg-genaricrequired": "Esti campu ye
obligatoriu",
"donate_interface-error-msg-country-calc": "Error - Nun podemos aceutar
la so donación nesti momentu.",
"donate_interface-error-msg-fiscal_number": "NIF",
+ "donate_interface-error-msg-issuer_id": "bancu",
"donate_interface-donate-error-try-a-different-card": "Por favor, [$1
pruebe con otra tarxeta] o con otra de les [$2 maneres de donar] o comuníquese
con nós en $3",
"donate_interface-donate-error-try-a-different-card-html": "Inténtalo
con otra tarxeta o con una de les <a href=\"$1\">otres maneres de donar</a>, o
comunícate con nós en <a href=\"mailto:$2\">$2</a>",
"donate_interface-donate-error-try-again-html": "Por favor <a
href=\"$1\">vuelva a intentalo</a>, pruebe <a href=\"$2\">otres maneres de
facer un donativu</a> o comuníquese con nós en <a href=\"mailto:$3\">$3</a>",
@@ -283,6 +284,7 @@
"donate_interface-cvv-number": "Númberu CVV",
"donate_interface-verification-number": "Númberu de verificación",
"donate_interface-what-is-this": "¿Qué ye esto?",
+ "donate_interface-did-you-mean": "¿Quixisti dicir <a href=\"#\"
class=\"correction\">$1</a>?",
"donate_interface-debit": "débitu",
"donate_interface-do-not-include-dashes": "Nun incluyas guiones",
"donate_interface-please-donate-today": "Fai una donación güei",
@@ -399,7 +401,7 @@
"apihelp-donate-param-payment_submethod": "Submétodu de pagu a usar.",
"apihelp-donate-param-language": "Códigu de llingua.",
"apihelp-donate-param-order_id": "ID de la orde (si una donación yá
s'empecipió).",
- "apihelp-donate-param-contribution_tracking_id": "ID de la tabla de
siguimientu de contribuciones.",
+ "apihelp-donate-param-wmf_token": "Editar token.",
"apihelp-donate-param-utm_source": "Variable de siguimientu.",
"apihelp-donate-param-utm_campaign": "Variable de siguimientu.",
"apihelp-donate-param-utm_medium": "Variable de siguimientu.",
diff --git a/wikimedia/donation-interface/gateway_common/i18n/interface/jv.json
b/wikimedia/donation-interface/gateway_common/i18n/interface/jv.json
index e6a9133..6f111a3 100644
--- a/wikimedia/donation-interface/gateway_common/i18n/interface/jv.json
+++ b/wikimedia/donation-interface/gateway_common/i18n/interface/jv.json
@@ -249,7 +249,7 @@
"donate_interface-credit-card-number-abbreviated": "Kertu krèdit #",
"donate_interface-credit-card-expiration": "Kedaluwarsa kertu krèdit",
"donate_interface-card-expiration": "Kedaluwarsa kertu",
- "donate_interface-select-month-of-expiration": "Pilih sasi kedaluwarsa",
+ "donate_interface-select-month-of-expiration": "Pilih wulan
kedaluwarsa",
"donate_interface-select-year-of-expiration": "Pilih taun kedaluwarsa",
"donate_interface-expires-question": "Kedaluwarsa?",
"donate_interface-expires": "Kedaluwarsa",
@@ -280,7 +280,7 @@
"donate_interface-description": "Katrangan",
"donate_interface-donation": "Sumbangan",
"donate_interface-email-receipt": "Kirim tandha tampa nèng layang
èlèktronik",
- "donate_interface-monthly-donation": "Nyumbang pendhak sasi",
+ "donate_interface-monthly-donation": "Nyumbang wulanan",
"donate_interface-via-paypal": "(liwat PayPal)",
"donate_interface-select": "Pilih",
"donate_interface-donation-must-equal": "Sumbangan kudu padha $1 utawa
luwih gedhé.",
@@ -323,15 +323,15 @@
"donate_interface-email-unsub-success": "Sampéyan wis sukses dibusak
saka milis awak dhéwé",
"donate_interface-faqs": "Pitakon paling sering",
"donate_interface-tax-info": "Informasi pangurangan pajak",
- "donate_interface-monthlybox-title": "Dadèkaké saben sasi?",
- "donate_interface-monthlybox-content": "Sumbangan saben sasi diprosès
saben tanggal 2 ing sasi kuwi. Sampéyan bisa mbatalaké kapan waé.",
- "donate_interface-monthlybox-amount": "Cacahé sumbangan saben sasi",
- "donate_interface-monthlybox-yes": "Tenan, sumbang saben sasi",
+ "donate_interface-monthlybox-title": "Dadèkaké wulanan?",
+ "donate_interface-monthlybox-content": "Sumbangan wulanan diprosès
saben tanggal 2 wulan iku. Sampéyan bisa murungaké kapan waé.",
+ "donate_interface-monthlybox-amount": "Gunggung sumbangan wulanan",
+ "donate_interface-monthlybox-yes": "Iya, dadèkaké wulanan",
"donate_interface-monthlybox-no": "Ora, sumbang sepisan waé",
"donate_interface-monthlybox-bottom": "Sumbangan Sampéyan bakal
diproses kanthi aman.",
"donate_interface-monthly-cancel": "Pambayaran saben sasi bakal
didébitaké déning Yayasan Wikimedia nganti Sampéyan ngersakaké mandeg.",
"donate_interface-onetime": "Nyumbang sepisan",
- "donate_interface-monthly-short": "Saben sasi",
+ "donate_interface-monthly-short": "Wulanan",
"donate_interface-onetime-short": "Sepisan",
"donate_interface-securelogo-title": "Klik kanggo Vèrifikasi - Situs
iki nganggo SSL VeriSign kanggo ''e-commerce'' lan komunikasi kapitayan sing
aman.",
"donate_interface-secureLogo-text": "Bab Sèrtifikat SSL",
diff --git a/wikimedia/donation-interface/gateway_common/i18n/interface/oc.json
b/wikimedia/donation-interface/gateway_common/i18n/interface/oc.json
index 8846742..33f478d 100644
--- a/wikimedia/donation-interface/gateway_common/i18n/interface/oc.json
+++ b/wikimedia/donation-interface/gateway_common/i18n/interface/oc.json
@@ -302,5 +302,6 @@
"donate_interface-translate-bluelink": "Melhorar aquesta traduccion",
"donate_interface-translate-redlink1": "Ajudatz a traduire aquesta
pagina.",
"donate_interface-translate-redlink2": "O mandatz vòstra traduccion a
[email protected]",
- "donate_interface-email-unsub-button": "Se desabonar"
+ "donate_interface-email-unsub-button": "Se desabonar",
+ "apihelp-donate-param-language": "Còdi de lenga."
}
diff --git a/wikimedia/donation-interface/gateway_common/i18n/interface/vi.json
b/wikimedia/donation-interface/gateway_common/i18n/interface/vi.json
index 1f7f92f..2e01d3a 100644
--- a/wikimedia/donation-interface/gateway_common/i18n/interface/vi.json
+++ b/wikimedia/donation-interface/gateway_common/i18n/interface/vi.json
@@ -200,6 +200,7 @@
"donate_interface-error-msg-genaricrequired": "Thông tin này là bắt
buộc",
"donate_interface-error-msg-country-calc": "Lỗi – Chúng tôi không thể
chấp nhận khoản góp của bạn vào lúc bây giờ.",
"donate_interface-error-msg-fiscal_number": "mã số tài chính",
+ "donate_interface-error-msg-issuer_id": "ngân hàng",
"donate_interface-donate-error-try-a-different-card": "Xin vui lòng [$1
thử dùng một thẻ tín dụng khác], sử dụng một [$2 cách quyên góp khác], hoặc
liên lạc với chúng tôi tại $3.",
"donate_interface-donate-error-try-a-different-card-html": "Xin vui
lòng thử quyên góp qua một thẻ khác hoặc <a href=\"$1\">một phương tiện
khác</a>, hoặc liên lạc với chúng tôi tại <a href=\"mailto:$2\">$2</a>",
"donate_interface-donate-error-try-again-html": "Xin vui lòng <a
href=\"$1\">thử lại</a> hay thử <a href=\"$2\">quyên góp qua một phương tiện
khác</a>, hoặc liên lạc với chúng tôi tại <a href=\"mailto:$3\">$3</a>",
@@ -407,7 +408,6 @@
"apihelp-donate-param-payment_submethod": "Phương pháp thanh toán dứt
khoát.",
"apihelp-donate-param-language": "Mã ngôn ngữ.",
"apihelp-donate-param-order_id": "ID đặt hàng (nếu đã bắt đầu khoản
quyên góp).",
- "apihelp-donate-param-contribution_tracking_id": "ID cho bảng theo dõi
khoản quyên góp.",
"apihelp-donate-param-wmf_token": "Dấu hiệu sửa đổi.",
"apihelp-donate-param-utm_source": "Biến theo dõi.",
"apihelp-donate-param-utm_campaign": "Biến theo dõi.",
diff --git
a/wikimedia/donation-interface/globalcollect_gateway/globalcollect.adapter.php
b/wikimedia/donation-interface/globalcollect_gateway/globalcollect.adapter.php
index 5bc580e..99b2d49 100644
---
a/wikimedia/donation-interface/globalcollect_gateway/globalcollect.adapter.php
+++
b/wikimedia/donation-interface/globalcollect_gateway/globalcollect.adapter.php
@@ -824,7 +824,7 @@
$this->finalizeInternalStatus(
FinalStatus::COMPLETE );
//get the old status from the first
txn, and add in the part where we set the payment.
$this->transaction_response->setTxnMessage( "Original Response Status
(pre-SET_PAYMENT): " . $original_status_code );
- $this->runPostProcessHooks(); //
Queueing is in here.
+ $this->postProcessDonation(); //
Queueing is in here.
} else {
$this->finalizeInternalStatus(
FinalStatus::FAILED );
$problemflag = true;
@@ -1730,7 +1730,7 @@
static $checked = array();
$oid = $this->getData_Unstaged_Escaped('order_id');
if ( $this->getData_Unstaged_Escaped( 'payment_method' ) ===
'cc' && !in_array( $oid, $checked ) ){
- $this->runAntifraudHooks();
+ $this->runAntifraudFilters();
$checked[] = $oid;
}
}
diff --git
a/wikimedia/donation-interface/globalcollect_gateway/globalcollect_resultswitcher.body.php
b/wikimedia/donation-interface/globalcollect_gateway/globalcollect_resultswitcher.body.php
index 7376e4e..bc9218d 100644
---
a/wikimedia/donation-interface/globalcollect_gateway/globalcollect_resultswitcher.body.php
+++
b/wikimedia/donation-interface/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -8,8 +8,6 @@
* 'review', 'reject'. These values can be set during
* data processing validation, for instance.
*
- * Hooks are exposed to handle the different actions.
- *
* Defaults to 'process'.
* @var string
*/
diff --git a/wikimedia/donation-interface/globalcollect_gateway/i18n/oc.json
b/wikimedia/donation-interface/globalcollect_gateway/i18n/oc.json
index 3acba38..d95efb1 100644
--- a/wikimedia/donation-interface/globalcollect_gateway/i18n/oc.json
+++ b/wikimedia/donation-interface/globalcollect_gateway/i18n/oc.json
@@ -4,5 +4,6 @@
"Cedric31"
]
},
+ "globalcollect_gateway-response-9150": "Lenga invalida.",
"globalcollect_gateway-response-21000155": "Còdi bancari invalid."
}
diff --git
a/wikimedia/donation-interface/globalcollect_gateway/orphan.adapter.php
b/wikimedia/donation-interface/globalcollect_gateway/orphan.adapter.php
index 5808317..482ff29 100644
--- a/wikimedia/donation-interface/globalcollect_gateway/orphan.adapter.php
+++ b/wikimedia/donation-interface/globalcollect_gateway/orphan.adapter.php
@@ -206,7 +206,7 @@
$action = $this->findCodeAction( 'GET_ORDERSTATUS', 'STATUSID',
$status_response['STATUSID'] );
if ( $action === FinalStatus::PENDING_POKE ) {
- $this->runAntifraudHooks();
+ $this->runAntifraudFilters();
}
}
}
diff --git a/wikimedia/donation-interface/modules/CurrencyRatesModule.php
b/wikimedia/donation-interface/modules/CurrencyRatesModule.php
index d7a9af2..18e9c12 100644
--- a/wikimedia/donation-interface/modules/CurrencyRatesModule.php
+++ b/wikimedia/donation-interface/modules/CurrencyRatesModule.php
@@ -15,9 +15,9 @@
}
/**
- * @see ResourceLoaderModule::getModifiedTime()
+ * @see ResourceLoaderModule::enableModuleContentVersion()
*/
- public function getModifiedTime( ResourceLoaderContext $context ) {
- return strtotime( CurrencyRates::$lastUpdated );
+ public function enableModuleContentVersion() {
+ return true;
}
-}
+}
\ No newline at end of file
diff --git
a/wikimedia/donation-interface/paypal_gateway/express_checkout/paypal_express.adapter.php
b/wikimedia/donation-interface/paypal_gateway/express_checkout/paypal_express.adapter.php
index 319d49d..306ebb7 100644
---
a/wikimedia/donation-interface/paypal_gateway/express_checkout/paypal_express.adapter.php
+++
b/wikimedia/donation-interface/paypal_gateway/express_checkout/paypal_express.adapter.php
@@ -405,7 +405,7 @@
// FIXME: Not a satisfying ending. Parse the
PROFILESTATUS
// response and sort it into complete or
pending.
$this->finalizeInternalStatus(
FinalStatus::COMPLETE );
- $this->runPostProcessHooks();
+ $this->postProcessDonation();
// FIXME: deprecated
$this->deleteLimboMessage( 'pending' );
break;
@@ -459,7 +459,7 @@
// blacklist of protected fields.
$this->addResponseData( $this->unstageKeys(
$response ) );
- $this->runAntifraudHooks();
+ $this->runAntifraudFilters();
if ( $this->getValidationAction() !== 'process'
) {
$this->finalizeInternalStatus(
FinalStatus::FAILED );
}
@@ -475,7 +475,7 @@
'PAYMENTINFO_0_ERRORCODE',
$response['PAYMENTINFO_0_ERRORCODE'] );
// TODO: Can we do this from do_transaction
instead, or at least protect with !recurring...
$this->finalizeInternalStatus( $status );
- $this->runPostProcessHooks();
+ $this->postProcessDonation();
// FIXME: deprecated
$this->deleteLimboMessage( 'pending' );
break;
diff --git
a/wikimedia/donation-interface/tests/phpunit/Adapter/AstroPay/AstroPayTest.php
b/wikimedia/donation-interface/tests/phpunit/Adapter/AstroPay/AstroPayTest.php
index 8031326..a172ab6 100644
---
a/wikimedia/donation-interface/tests/phpunit/Adapter/AstroPay/AstroPayTest.php
+++
b/wikimedia/donation-interface/tests/phpunit/Adapter/AstroPay/AstroPayTest.php
@@ -442,9 +442,9 @@
}
/**
- * Test that we run the AntiFraud hooks before redirecting
+ * Test that we run the AntiFraud filters before redirecting
*/
- function testAntiFraudHooks() {
+ function testAntiFraudFilters() {
DonationInterface_FraudFiltersTest::setupFraudMaps( $this );
$init = $this->getDonorTestData( 'BR' );
$init['payment_method'] = 'cc';
diff --git
a/wikimedia/donation-interface/tests/phpunit/Adapter/GatewayAdapterTest.php
b/wikimedia/donation-interface/tests/phpunit/Adapter/GatewayAdapterTest.php
index b038362..b1b9231 100644
--- a/wikimedia/donation-interface/tests/phpunit/Adapter/GatewayAdapterTest.php
+++ b/wikimedia/donation-interface/tests/phpunit/Adapter/GatewayAdapterTest.php
@@ -19,8 +19,8 @@
/**
* TODO: Test everything.
* Make sure all the basic functions in the gateway_adapter are tested here.
- * Also, the extras and their hooks firing properly and... that the fail score
- * they give back is acted upon in the way we think it does.
+ * Also, the filters firing properly and... that the fail score they give
+ * back is acted upon in the way we think it does.
* Hint: For that mess, use GatewayAdapter's $debugarray
*
* Also, note that it barely makes sense to test the functions that need to be
diff --git
a/wikimedia/donation-interface/tests/phpunit/DonationInterfaceTestCase.php
b/wikimedia/donation-interface/tests/phpunit/DonationInterfaceTestCase.php
index 7548e2b..64a635e 100644
--- a/wikimedia/donation-interface/tests/phpunit/DonationInterfaceTestCase.php
+++ b/wikimedia/donation-interface/tests/phpunit/DonationInterfaceTestCase.php
@@ -27,9 +27,6 @@
* @package Fundraising_QueueHandling
*/
abstract class DonationInterfaceTestCase extends MediaWikiTestCase {
- protected $backupGlobalsBlacklist = array(
- 'wgHooks',
- );
/**
* An array of the vars we expect to be set before people hit payments.
diff --git a/wikimedia/donation-interface/tests/phpunit/FraudFiltersTest.php
b/wikimedia/donation-interface/tests/phpunit/FraudFiltersTest.php
index 894f190..e0c35fc 100644
--- a/wikimedia/donation-interface/tests/phpunit/FraudFiltersTest.php
+++ b/wikimedia/donation-interface/tests/phpunit/FraudFiltersTest.php
@@ -106,7 +106,7 @@
$gateway = $this->getFreshGatewayObject( $options );
- $gateway->runAntifraudHooks();
+ $gateway->runAntifraudFilters();
$this->assertEquals( 'reject', $gateway->getValidationAction(),
'Validation action is not as expected' );
$exposed = TestingAccessWrapper::newFromObject( $gateway );
diff --git
a/wikimedia/donation-interface/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php
b/wikimedia/donation-interface/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php
index e1b65c3..e8daca4 100644
---
a/wikimedia/donation-interface/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php
+++
b/wikimedia/donation-interface/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php
@@ -6,12 +6,12 @@
class TestingAdyenAdapter extends AdyenAdapter {
//@TODO: That minfraud jerk needs its own isolated tests.
- function runAntifraudHooks() {
+ function runAntifraudFilters() {
//now screw around with the batch settings to trick the fraud
filters into triggering
$is_batch = $this->isBatchProcessor();
$this->batch = true;
- parent::runAntifraudHooks();
+ parent::runAntifraudFilters();
$this->batch = $is_batch;
}
diff --git a/wikimedia/smash-pig/Core/DataStores/DamagedDatabase.php
b/wikimedia/smash-pig/Core/DataStores/DamagedDatabase.php
index 312ffa6..fb85a16 100644
--- a/wikimedia/smash-pig/Core/DataStores/DamagedDatabase.php
+++ b/wikimedia/smash-pig/Core/DataStores/DamagedDatabase.php
@@ -2,48 +2,13 @@
namespace SmashPig\Core\DataStores;
use PDO;
-use SmashPig\Core\Context;
use SmashPig\Core\SmashPigException;
use SmashPig\Core\UtcDate;
/**
* Data store containing messages which were not successfully processed
*/
-class DamagedDatabase {
-
- /**
- * @var PDO
- * We do the silly singleton thing for convenient testing with in-memory
- * databases that would otherwise not be shared between components.
- */
- protected static $db;
-
- protected function __construct() {
- if ( !self::$db ) {
- $config = Context::get()->getConfiguration();
- self::$db = $config->object( 'data-store/damaged-db' );
- }
- }
-
- /**
- * @return PDO
- */
- public function getDatabase() {
- return self::$db;
- }
-
- public static function get() {
- return new DamagedDatabase();
- }
-
- protected function validateMessage( $message ) {
- if (
- empty( $message['date'] ) ||
- empty( $message['gateway'] )
- ) {
- throw new SmashPigException( 'Message missing required
fields' );
- }
- }
+class DamagedDatabase extends SmashPigDatabase {
/**
* Build and insert a database record from a queue message
@@ -51,23 +16,29 @@
* @param array $message Unprocessable message
* @param string $originalQueue Queue the message was first sent to
* @param string $error Information about why this message is damaged
+ * @param string $trace Full stack trace
* @param int|null $retryDate When provided, re-process message after
* this timestamp
* @return int ID of message in damaged database
* @throws SmashPigException if insert fails
*/
public function storeMessage(
- $message, $originalQueue, $error = '', $retryDate = null
+ $message,
+ $originalQueue,
+ $error = '',
+ $trace = '',
+ $retryDate = null
) {
- $this->validateMessage( $message );
+ $originalDate = empty( $message['date'] )
+ ? UtcDate::getUtcDatabaseString()
+ : UtcDate::getUtcDatabaseString( $message['date'] );
$dbRecord = array(
- 'original_date' => UtcDate::getUtcDatabaseString(
- $message['date']
- ),
+ 'original_date' => $originalDate,
'damaged_date' => UtcDate::getUtcDatabaseString(),
'original_queue' => $originalQueue,
'error' => $error,
+ 'trace' => $trace,
'message' => json_encode( $message ),
);
if ( $retryDate ) {
@@ -95,6 +66,7 @@
$insert = "INSERT INTO damaged ( $fieldList )
VALUES ( $paramList );";
+
$prepared = self::$db->prepare( $insert );
foreach ( $dbRecord as $field => $value ) {
@@ -117,14 +89,17 @@
* @return array|null Records with retry_date prior to now
*/
public function fetchRetryMessages( $limit ) {
- $prepared = self::$db->prepare( '
+ $prepared = self::$db->prepare(
+ '
SELECT * FROM damaged
WHERE retry_date < :now
ORDER BY retry_date ASC
LIMIT ' . $limit
);
$prepared->bindValue(
- ':now', UtcDate::getUtcDatabaseString(), PDO::PARAM_STR
+ ':now',
+ UtcDate::getUtcDatabaseString(),
+ PDO::PARAM_STR
);
$prepared->execute();
$rows = $prepared->fetchAll( PDO::FETCH_ASSOC );
@@ -140,7 +115,8 @@
* @param array $message
*/
public function deleteMessage( $message ) {
- $prepared = self::$db->prepare( '
+ $prepared = self::$db->prepare(
+ '
DELETE FROM damaged
WHERE id = :id'
);
@@ -182,4 +158,12 @@
$message['original_queue'] = $row['original_queue'];
return $message;
}
+
+ protected function getConfigKey() {
+ return 'data-store/damaged-db';
+ }
+
+ protected function getTableScriptFile() {
+ return '002_CreateDamagedTable.sql';
+ }
}
diff --git a/wikimedia/smash-pig/Core/DataStores/PendingDatabase.php
b/wikimedia/smash-pig/Core/DataStores/PendingDatabase.php
index 598499b..8d6d3c8 100644
--- a/wikimedia/smash-pig/Core/DataStores/PendingDatabase.php
+++ b/wikimedia/smash-pig/Core/DataStores/PendingDatabase.php
@@ -3,7 +3,6 @@
use PDO;
use RuntimeException;
-use SmashPig\Core\Context;
use SmashPig\Core\Logging\Logger;
use SmashPig\Core\SmashPigException;
use SmashPig\Core\UtcDate;
@@ -12,37 +11,7 @@
/**
* Data store containing messages waiting to be finalized.
*/
-class PendingDatabase {
-
- /**
- * @var PDO
- * We do the silly singleton thing for convenient testing with in-memory
- * databases that would otherwise not be shared between components.
- */
- protected static $db;
-
- protected function __construct() {
- $config = Context::get()->getConfiguration();
- if ( !self::$db ) {
- self::$db = $config->object( 'data-store/pending-db' );
- }
- }
-
- /**
- * @return PDO
- */
- public function getDatabase() {
- return self::$db;
- }
-
- public static function get() {
- $config = Context::get()->getConfiguration();
- if ( $config->nodeExists( 'data-store/pending-db' ) ) {
- // TODO: remove after transition to new pending queue
- return new PendingDatabase();
- }
- return null;
- }
+class PendingDatabase extends SmashPigDatabase {
protected function validateMessage( $message ) {
if (
@@ -288,4 +257,12 @@
' WHERE id = :id';
return $update;
}
+
+ protected function getConfigKey() {
+ return 'data-store/pending-db';
+ }
+
+ protected function getTableScriptFile() {
+ return '001_CreatePendingTable.sql';
+ }
}
diff --git a/wikimedia/smash-pig/Core/DataStores/SmashPigDatabase.php
b/wikimedia/smash-pig/Core/DataStores/SmashPigDatabase.php
new file mode 100644
index 0000000..d27d5bc
--- /dev/null
+++ b/wikimedia/smash-pig/Core/DataStores/SmashPigDatabase.php
@@ -0,0 +1,49 @@
+<?php namespace SmashPig\Core\DataStores;
+
+use PDO;
+use SmashPig\Core\Context;
+
+abstract class SmashPigDatabase {
+
+ /**
+ * @var PDO
+ * We do the silly singleton thing for convenient testing with in-memory
+ * databases that would otherwise not be shared between components.
+ */
+ protected static $db;
+
+ protected function __construct() {
+ $config = Context::get()->getConfiguration();
+ if ( !self::$db ) {
+ self::$db = $config->object( $this->getConfigKey() );
+ }
+ }
+
+ public static function get() {
+ return new static();
+ }
+
+ /**
+ * @return PDO
+ */
+ public function getDatabase() {
+ return self::$db;
+ }
+
+ public function createTable() {
+ $driver = $this->getDatabase()->getAttribute(
PDO::ATTR_DRIVER_NAME );
+ $path = __DIR__ . '/../../Schema/'
+ . $driver . '/' . $this->getTableScriptFile();
+ $this->getDatabase()->exec( file_get_contents( $path ) );
+ }
+
+ /**
+ * @return string Key in configuration pointing to backing PDO object
+ */
+ abstract protected function getConfigKey();
+
+ /**
+ * @return string Name of file (no directory) containing table creation
SQL
+ */
+ abstract protected function getTableScriptFile();
+}
diff --git a/wikimedia/smash-pig/Core/QueueConsumers/BaseQueueConsumer.php
b/wikimedia/smash-pig/Core/QueueConsumers/BaseQueueConsumer.php
index 21c2498..5550e04 100644
--- a/wikimedia/smash-pig/Core/QueueConsumers/BaseQueueConsumer.php
+++ b/wikimedia/smash-pig/Core/QueueConsumers/BaseQueueConsumer.php
@@ -145,7 +145,8 @@
return $this->damagedDb->storeMessage(
$message,
$this->queueName,
- $ex->getMessage() . "\n" . $ex->getTraceAsString(),
+ $ex->getMessage(),
+ $ex->getTraceAsString(),
$retryDate
);
}
diff --git a/wikimedia/smash-pig/CrmLink/Messages/DonationInterfaceMessage.php
b/wikimedia/smash-pig/CrmLink/Messages/DonationInterfaceMessage.php
index a707bbc..2d3239d 100644
--- a/wikimedia/smash-pig/CrmLink/Messages/DonationInterfaceMessage.php
+++ b/wikimedia/smash-pig/CrmLink/Messages/DonationInterfaceMessage.php
@@ -8,42 +8,31 @@
class DonationInterfaceMessage extends KeyedOpaqueStorableObject {
public $captured = '';
public $city = '';
- public $city_2 = '';
- public $comment = '';
public $contribution_tracking_id = '';
public $country = '';
- public $country_2 = '';
public $currency = '';
public $date = '';
public $email = '';
public $fee = '';
public $first_name = '';
- public $first_name_2 = '';
public $gateway = '';
public $gateway_account = '';
public $gateway_txn_id = '';
public $gross = '';
public $language = '';
public $last_name = '';
- public $last_name_2 = '';
public $middle_name = '';
public $net = '';
public $order_id = '';
public $payment_method = '';
public $payment_submethod = '';
public $postal_code = '';
- public $postal_code_2 = '';
- public $premium_language = '';
public $recurring = '';
public $response = '';
public $risk_score = '';
- public $size = '';
public $state_province = '';
- public $state_province_2 = '';
public $street_address = '';
- public $street_address_2 = '';
public $supplemental_address_1 = '';
- public $supplemental_address_2 = '';
public $user_ip = '';
public $utm_campaign = '';
public $utm_medium = '';
diff --git
a/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
b/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
index 652e6ad..e87a310 100644
---
a/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
+++
b/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php
@@ -25,12 +25,7 @@
);
$config->override( $override );
- // Create sqlite schema
- $sql = file_get_contents( __DIR__ .
'/../../../Schema/sqlite/001_CreatePendingTable.sqlite.sql' );
- $db = PendingDatabase::get();
- if ( $db ) {
- $db->getDatabase()->exec( $sql );
- }
+ PendingDatabase::get()->createTable();
return $config;
}
diff --git a/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/Data/pending.json
b/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/Data/pending.json
index 3f86e18..7b57f33 100644
--- a/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/Data/pending.json
+++ b/wikimedia/smash-pig/PaymentProviders/Adyen/Tests/Data/pending.json
@@ -1,40 +1,29 @@
{
"city": "Columbus",
- "city_2": "",
- "comment": "",
"contribution_tracking_id": "119223",
"country": "US",
- "country_2": "",
"currency": "USD",
"date": 1458060070,
"email": "[email protected]",
"fee": "0",
"first_name": "Testy119223",
- "first_name_2": "",
"gateway": "adyen",
"gateway_account": "WikimediaCOM",
"gateway_txn_id": false,
"gross": "10.00",
"language": "en",
"last_name": "Testerson119223",
- "last_name_2": "",
"middle_name": "",
"net": "",
"payment_method": "cc",
"payment_submethod": "amex",
"postal_code": "12345",
- "postal_code_2": "",
- "premium_language": "",
"recurring": "",
"response": false,
"risk_score": 10,
- "size": "",
"state_province": "OH",
- "state_province_2": "",
"street_address": "123 Fake St",
- "street_address_2": "",
"supplemental_address_1": "",
- "supplemental_address_2": "",
"user_ip": "127.0.0.1",
"utm_campaign": "",
"utm_medium": "",
diff --git a/wikimedia/smash-pig/Schema/001_CreatePendingTable.sql
b/wikimedia/smash-pig/Schema/mysql/001_CreatePendingTable.sql
similarity index 100%
rename from wikimedia/smash-pig/Schema/001_CreatePendingTable.sql
rename to wikimedia/smash-pig/Schema/mysql/001_CreatePendingTable.sql
diff --git a/wikimedia/smash-pig/Schema/002_CreateDamagedTable.sql
b/wikimedia/smash-pig/Schema/mysql/002_CreateDamagedTable.sql
similarity index 93%
rename from wikimedia/smash-pig/Schema/002_CreateDamagedTable.sql
rename to wikimedia/smash-pig/Schema/mysql/002_CreateDamagedTable.sql
index 1376d90..138966b 100644
--- a/wikimedia/smash-pig/Schema/002_CreateDamagedTable.sql
+++ b/wikimedia/smash-pig/Schema/mysql/002_CreateDamagedTable.sql
@@ -4,10 +4,11 @@
`damaged_date` datetime NOT NULL,
`retry_date` datetime NULL,
`original_queue` varchar(255) NOT NULL,
- `gateway` varchar(255) NOT NULL,
+ `gateway` varchar(255) NULL,
`order_id` varchar(255) NULL,
`gateway_txn_id` varchar(255) NULL,
`error` text NULL,
+ `trace` text NULL,
`message` text NOT NULL,
INDEX `idx_damaged_original_date` (`original_date`),
INDEX `idx_damaged_original_date_original_queue` (`original_date`,
`original_queue`),
diff --git
a/wikimedia/smash-pig/Schema/sqlite/001_CreatePendingTable.sqlite.sql
b/wikimedia/smash-pig/Schema/sqlite/001_CreatePendingTable.sql
similarity index 100%
rename from wikimedia/smash-pig/Schema/sqlite/001_CreatePendingTable.sqlite.sql
rename to wikimedia/smash-pig/Schema/sqlite/001_CreatePendingTable.sql
diff --git
a/wikimedia/smash-pig/Schema/sqlite/002_CreateDamagedTable.sqlite.sql
b/wikimedia/smash-pig/Schema/sqlite/002_CreateDamagedTable.sql
similarity index 85%
rename from wikimedia/smash-pig/Schema/sqlite/002_CreateDamagedTable.sqlite.sql
rename to wikimedia/smash-pig/Schema/sqlite/002_CreateDamagedTable.sql
index 53deea0..64eb97f 100644
--- a/wikimedia/smash-pig/Schema/sqlite/002_CreateDamagedTable.sqlite.sql
+++ b/wikimedia/smash-pig/Schema/sqlite/002_CreateDamagedTable.sql
@@ -4,9 +4,10 @@
`damaged_date` datetime NOT NULL,
`retry_date` datetime NULL,
`original_queue` varchar(255) NOT NULL,
- `gateway` varchar(255) NOT NULL,
+ `gateway` varchar(255) NULL,
`order_id` varchar(255) NULL,
`gateway_txn_id` varchar(255) NULL,
`error` text NULL,
+ `trace` text NULL,
`message` text NOT NULL
);
diff --git a/wikimedia/smash-pig/SmashPig.yaml
b/wikimedia/smash-pig/SmashPig.yaml
index 0fcfc34..5b1656a 100644
--- a/wikimedia/smash-pig/SmashPig.yaml
+++ b/wikimedia/smash-pig/SmashPig.yaml
@@ -44,12 +44,12 @@
pending-db:
class: PDO
inst-args:
- - 'mysql:host=127.0.0.1;dbname=pending'
+ - 'mysql:host=127.0.0.1;dbname=smashpig'
damaged-db:
class: PDO
inst-args:
- - 'mysql:host=127.0.0.1;dbname=pending'
+ - 'mysql:host=127.0.0.1;dbname=smashpig'
refund:
class: SmashPig\Core\DataStores\MultiQueueWriter
diff --git a/wikimedia/smash-pig/Tests/DamagedDatabaseTest.php
b/wikimedia/smash-pig/Tests/DamagedDatabaseTest.php
index 856325d..c911928 100644
--- a/wikimedia/smash-pig/Tests/DamagedDatabaseTest.php
+++ b/wikimedia/smash-pig/Tests/DamagedDatabaseTest.php
@@ -15,12 +15,10 @@
public function setUp() {
parent::setUp();
- Context::initWithLogger( new PendingDatabaseTestConfiguration()
);
+ $config = new SmashPigDatabaseTestConfiguration();
+ Context::initWithLogger( $config );
$this->db = DamagedDatabase::get();
-
- // Create sqlite schema
- $sql = file_get_contents( __DIR__ .
'/../Schema/sqlite/002_CreateDamagedTable.sqlite.sql' );
- $this->db->getDatabase()->exec( $sql );
+ $this->db->createTable();
}
public function tearDown() {
@@ -52,7 +50,9 @@
$message = self::getTestMessage();
$queue = 'test_queue';
$err = 'ERROR MESSAGE';
- $this->db->storeMessage( $message, $queue, $err );
+ $trace = "Foo.php line 25\nBar.php line 99";
+
+ $this->db->storeMessage( $message, $queue, $err, $trace );
// Confirm work without using the API.
$pdo = $this->db->getDatabase();
@@ -74,6 +74,7 @@
'message' => json_encode( $message ),
'original_queue' => $queue,
'error' => $err,
+ 'trace' => $trace,
'retry_date' => null,
);
unset( $rows[0]['damaged_date'] );
@@ -83,7 +84,7 @@
public function testFetchRetryMessages() {
$message = self::getTestMessage();
- $this->db->storeMessage( $message, 'test_queue', '', time() - 1
);
+ $this->db->storeMessage( $message, 'test_queue', '', '', time()
- 1 );
$fetched = $this->db->fetchRetryMessages( 10 );
diff --git a/wikimedia/smash-pig/Tests/PendingDatabaseTest.php
b/wikimedia/smash-pig/Tests/PendingDatabaseTest.php
index bd87277..0d87f77 100644
--- a/wikimedia/smash-pig/Tests/PendingDatabaseTest.php
+++ b/wikimedia/smash-pig/Tests/PendingDatabaseTest.php
@@ -15,12 +15,10 @@
public function setUp() {
parent::setUp();
- Context::initWithLogger( new PendingDatabaseTestConfiguration()
);
+ $config = new SmashPigDatabaseTestConfiguration();
+ Context::initWithLogger( $config );
$this->db = PendingDatabase::get();
-
- // Create sqlite schema
- $sql = file_get_contents( __DIR__ .
'/../Schema/sqlite/001_CreatePendingTable.sqlite.sql' );
- $this->db->getDatabase()->exec( $sql );
+ $this->db->createTable();
}
public function tearDown() {
diff --git a/wikimedia/smash-pig/Tests/PendingDatabaseTestConfiguration.php
b/wikimedia/smash-pig/Tests/PendingDatabaseTestConfiguration.php
deleted file mode 100644
index c4c14d0..0000000
--- a/wikimedia/smash-pig/Tests/PendingDatabaseTestConfiguration.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-namespace SmashPig\Tests;
-
-use SmashPig\Core\Configuration;
-
-class PendingDatabaseTestConfiguration extends Configuration {
- public function __construct() {
- parent::__construct(
- 'default',
- __DIR__ . '/data/config_pending_db.yaml'
- );
- }
-}
diff --git a/wikimedia/smash-pig/Tests/QueueConsumerTest.php
b/wikimedia/smash-pig/Tests/QueueConsumerTest.php
index 871b2ed..bcd78b5 100644
--- a/wikimedia/smash-pig/Tests/QueueConsumerTest.php
+++ b/wikimedia/smash-pig/Tests/QueueConsumerTest.php
@@ -25,13 +25,9 @@
Context::initWithLogger( new QueueTestConfiguration() );
$this->queue = BaseQueueConsumer::getQueue( 'test' );
$this->queue->createTable( 'test' );
- $this->damaged = DamagedDatabase::get()->getDatabase();
-
- // Create sqlite schema
- $sql = file_get_contents(
- __DIR__ .
'/../Schema/sqlite/002_CreateDamagedTable.sqlite.sql'
- );
- $this->damaged->exec( $sql );
+ $damagedDb = DamagedDatabase::get();
+ $damagedDb->createTable();
+ $this->damaged = $damagedDb->getDatabase();
}
public function testEmptyQueue() {
diff --git a/wikimedia/smash-pig/Tests/SmashPigDatabaseTestConfiguration.php
b/wikimedia/smash-pig/Tests/SmashPigDatabaseTestConfiguration.php
new file mode 100644
index 0000000..d064fc1
--- /dev/null
+++ b/wikimedia/smash-pig/Tests/SmashPigDatabaseTestConfiguration.php
@@ -0,0 +1,12 @@
+<?php namespace SmashPig\Tests;
+
+use SmashPig\Core\Configuration;
+
+class SmashPigDatabaseTestConfiguration extends Configuration {
+ public function __construct() {
+ parent::__construct(
+ 'default',
+ __DIR__ . '/data/config_smashpig_db.yaml'
+ );
+ }
+}
diff --git a/wikimedia/smash-pig/Tests/data/config_pending_db.yaml
b/wikimedia/smash-pig/Tests/data/config_smashpig_db.yaml
similarity index 100%
rename from wikimedia/smash-pig/Tests/data/config_pending_db.yaml
rename to wikimedia/smash-pig/Tests/data/config_smashpig_db.yaml
diff --git a/wikimedia/smash-pig/composer.json
b/wikimedia/smash-pig/composer.json
index 4bbfc33..94a90c2 100644
--- a/wikimedia/smash-pig/composer.json
+++ b/wikimedia/smash-pig/composer.json
@@ -25,7 +25,7 @@
"require": {
"coderkungfu/php-queue": "dev-master",
"fusesource/stomp-php": "^2.1.1",
- "php": "^5.3.3",
+ "php": ">=5.3.3",
"phpmailer/phpmailer": "^5.2",
"predis/predis": "^1.1",
"symfony/event-dispatcher": "^2.1",
diff --git a/wikimedia/smash-pig/composer.lock
b/wikimedia/smash-pig/composer.lock
index 9ca8857..d93db56 100644
--- a/wikimedia/smash-pig/composer.lock
+++ b/wikimedia/smash-pig/composer.lock
@@ -4,8 +4,8 @@
"Read more about it at
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "cdfe21508d705b5308daf5f705fb4a46",
- "content-hash": "e855a7665eddea0b0f30f74833a2453a",
+ "hash": "dff59f168d145674604d93452ae96038",
+ "content-hash": "72818ec1b403ee3282de2647c26d1686",
"packages": [
{
"name": "amzn/login-and-pay-with-amazon-sdk-php",
@@ -44,7 +44,7 @@
"payment",
"payments"
],
- "time": "2016-02-17 00:44:20"
+ "time": "2016-02-17 00:53:20"
},
{
"name": "clio/clio",
@@ -93,7 +93,7 @@
"source": {
"type": "git",
"url":
"https://gerrit.wikimedia.org/r/p/wikimedia/fundraising/php-queue.git",
- "reference": "72dd99b732e387e40ac24c3ec870503bc93f14ad"
+ "reference": "14198ba1f7d4868933649a85621a3955965e83cd"
},
"require": {
"clio/clio": "0.1.*",
@@ -149,7 +149,7 @@
"queue",
"transaction"
],
- "time": "2016-08-04 21:36:21"
+ "time": "2016-08-05 19:16:32"
},
{
"name": "fusesource/stomp-php",
@@ -198,7 +198,6 @@
"messaging",
"stomp"
],
- "abandoned": "stomp-php/stomp-php",
"time": "2013-02-23 17:34:44"
},
{
@@ -245,16 +244,16 @@
},
{
"name": "monolog/monolog",
- "version": "1.20.0",
+ "version": "1.21.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037"
+ "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/Seldaek/monolog/zipball/55841909e2bcde01b5318c35f2b74f8ecc86e037",
- "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037",
+ "url":
"https://api.github.com/repos/Seldaek/monolog/zipball/f42fbdfd53e306bda545845e4dbfd3e72edb4952",
+ "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952",
"shasum": ""
},
"require": {
@@ -319,7 +318,7 @@
"logging",
"psr-3"
],
- "time": "2016-07-02 14:02:10"
+ "time": "2016-07-29 03:23:52"
},
{
"name": "phpmailer/phpmailer",
@@ -471,16 +470,16 @@
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.8.8",
+ "version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9"
+ "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/symfony/event-dispatcher/zipball/b180b70439dca70049b6b9b7e21d75e6e5d7aca9",
- "reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9",
+ "url":
"https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8",
+ "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8",
"shasum": ""
},
"require": {
@@ -527,20 +526,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2016-07-28 16:56:28"
},
{
"name": "symfony/http-foundation",
- "version": "v2.8.8",
+ "version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "7a55440a2bebd37b8bd06f99f5def1ddf0aa9249"
+ "reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/symfony/http-foundation/zipball/7a55440a2bebd37b8bd06f99f5def1ddf0aa9249",
- "reference": "7a55440a2bebd37b8bd06f99f5def1ddf0aa9249",
+ "url":
"https://api.github.com/repos/symfony/http-foundation/zipball/f20bea598906c990eebe3c70a63ca5ed18cdbc11",
+ "reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11",
"shasum": ""
},
"require": {
@@ -582,7 +581,7 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 07:02:14"
+ "time": "2016-07-30 07:20:35"
},
{
"name": "symfony/polyfill-mbstring",
@@ -759,16 +758,16 @@
},
{
"name": "symfony/yaml",
- "version": "v2.8.8",
+ "version": "v2.8.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8"
+ "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/symfony/yaml/zipball/dba4bb5846798cd12f32e2d8f3f35d77045773c8",
- "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8",
+ "url":
"https://api.github.com/repos/symfony/yaml/zipball/0ceab136f43ed9d3e97b3eea32a7855dc50c121d",
+ "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d",
"shasum": ""
},
"require": {
@@ -804,7 +803,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2016-06-29 05:29:29"
+ "time": "2016-07-17 09:06:15"
}
],
"packages-dev": [
@@ -1362,16 +1361,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "4.8.26",
+ "version": "4.8.27",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74"
+ "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74",
- "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74",
+ "url":
"https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90",
+ "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90",
"shasum": ""
},
"require": {
@@ -1430,7 +1429,7 @@
"testing",
"xunit"
],
- "time": "2016-05-17 03:09:28"
+ "time": "2016-07-21 06:48:14"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -1862,28 +1861,29 @@
},
{
"name": "webmozart/assert",
- "version": "1.0.2",
+ "version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
- "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde"
+ "reference": "bb2d123231c095735130cc8f6d31385a44c7b308"
},
"dist": {
"type": "zip",
- "url":
"https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
- "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
+ "url":
"https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308",
+ "reference": "bb2d123231c095735130cc8f6d31385a44c7b308",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": "^5.3.3|^7.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.6"
+ "phpunit/phpunit": "^4.6",
+ "sebastian/version": "^1.0.1"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "1.2-dev"
}
},
"autoload": {
@@ -1907,7 +1907,7 @@
"check",
"validate"
],
- "time": "2015-08-24 13:29:44"
+ "time": "2016-08-09 15:02:57"
}
],
"aliases": [],
@@ -1919,7 +1919,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": "^5.3.3"
+ "php": ">=5.3.3"
},
"platform-dev": []
}
--
To view, visit https://gerrit.wikimedia.org/r/306811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd190c0980ef8c23cd2a4c095783e8e088a1411d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/vendor
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits