[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Do per-field client side validdation.
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/388651 ) Change subject: Do per-field client side validdation. .. Do per-field client side validdation. Do validation on a per-field basis to allow clearing of errors on blur for a better user experience. Bug:T176501 Change-Id: If02020506d6c2d6040de758e6dc20e0da490c5c0 --- M modules/js/ext.donationInterface.forms.js M modules/js/ext.donationInterface.validation.js 2 files changed, 167 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/51/388651/1 diff --git a/modules/js/ext.donationInterface.forms.js b/modules/js/ext.donationInterface.forms.js index c8fa554..86f73f9 100644 --- a/modules/js/ext.donationInterface.forms.js +++ b/modules/js/ext.donationInterface.forms.js @@ -149,6 +149,36 @@ } } ); + $( '#first_name' ).on( 'blur', function () { + di.validation.validate_first_name(); + } ); + $( '#last_name' ).on( 'blur', function () { + di.validation.validate_last_name(); + } ); + $( '#street_address' ).on( 'blur', function () { + di.validation.validate_street_address(); + } ); + + $( '#city' ).on( 'blur', function () { + di.validation.validate_city(); + } ); + $( '#state_province' ).on( 'blur', function () { + di.validation.validate_state(); + } ); + $( '#postal_code' ).on( 'blur', function () { + di.validation.validate_postal_code(); + } ); + $( '#fiscal_number' ).on( 'blur', function () { + di.validation.validate_fiscal_number(); + } ); + $( '#email' ).on( 'blur', function () { + di.validation.validate_email(); + } ); + $( '#country' ).on( 'blur', function () { + di.validation.validate_country(); + } ); + + // Magic to hopefully disable the spinner in case we are returned to this // page via the Back button. $( window ).on( diff --git a/modules/js/ext.donationInterface.validation.js b/modules/js/ext.donationInterface.validation.js index aea1f0e..b51f3c5 100644 --- a/modules/js/ext.donationInterface.validation.js +++ b/modules/js/ext.donationInterface.validation.js @@ -44,6 +44,59 @@ return $( '.errorMsg' ).length > 0; } + function clearError( field ) { + $( '#' + field ).removeClass( 'errorHighlight' ); + $( '#' + field + 'Msg' ) + .removeClass( 'errorMsg' ) + .addClass( 'errorMsgHide' ); + } + + function setError( field, message ) { + errorsPresent = true; + $( '#' + field ).addClass( 'errorHighlight' ); + $( '#' + field + 'Msg' ) + .removeClass( 'errorMsgHide' ) + .addClass( 'errorMsg' ) + .text( message ); + } + + function isEmpty( field, value ) { + return !$.trim( value ) || + value === mediaWiki.msg( 'donate_interface-donor-' + field ); + } + + function validateField( field ) { + var rules = mediaWiki.config.get( 'wgDonationInterfaceValidationRules' ) || []; + + if( $.inArray( field, rules ) ) { + clearError( field ); + + var ruleList = rules[field]; + + $.each( ruleList, function ( i, rule ) { + var failed = false; + $formField = $( '#' + field ); + if ( $formField.length === 0 ) { + return; + } + value = $formField.val(); + if ( rule.required ) { + if ( isEmpty( field, value ) ) { + failed = true; + } + } + if ( rule.pattern && !isEmpty( field, value ) ) { + if ( !value.match( new RegExp( rule.pattern ) ) ) { + failed = true; + } + } + if ( failed ) { + setError( field, rule.message ); + } + } ); +
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into deployment
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/386019 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 1b34555 Add .editorconfig 1c12a5b Add sqlite3 to requre-dev be10b92 Handle additional type of failed recurrance. Change-Id: I6de3786fe314a708617ecbb6d7da5af7ca4aee7c --- D PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json D PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 3 files changed, 0 insertions(+), 238 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/19/386019/1 diff --git a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json deleted file mode 100644 index 845fc4e..000 --- a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "payment_cycle": "Monthly", - "txn_type": "recurring_payment_suspended_due_to_max_failed_payment", - "last_name": "Public", - "next_payment_date": "N/A", - "residence_country": "US", - "initial_payment_amount": "0.00", - "rp_invoice_id": "49006681", - "currency_code": "USD", - "time_created": "06:14:38 Aug 02, 2017 PDT", - "verify_sign": "AjCMMDabnuh7zx7wI4NpWflSS.lHAqA5jlFVAAuXLAx61931ulA3ylnl", - "period_type": " Regular", - "payer_status": "verified", - "tax": "0.00", - "payer_email": "j...@public.com", - "first_name": "John", - "receiver_email": "nob...@wikimedia.org", - "payer_id": "WK4ADPUHGWN6U", - "product_type": "1", - "shipping": "0.00", - "amount_per_cycle": "5.00", - "profile_status": "Suspended", - "charset": "UTF-8", - "notify_version": "3.8", - "amount": "5.00", - "outstanding_balance": "15.00", - "recurring_payment_id": "I-WCJA1MBC3CWY", - "product_name": "Monthly donation to the Wikimedia Foundation", - "ipn_track_id": "4b8cbe1a39fec" -} \ No newline at end of file diff --git a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json deleted file mode 100644 index 3f5bcce..000 --- a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "subscr_id": "I-WCJA1MBC3CWY", - "txn_type": "subscr_failed", - "contribution_tracking_id": "49006681", - "order_id": "49006681", - "email": "j...@public.com", - "first_name": "John", - "last_name": "Public", - "country": "US", - "gateway": "paypal_ec", - "recurring": "1", - "gross": "5.00", - "currency": "USD", - "date": "1501679678" -} diff --git a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php deleted file mode 100644 index 28ecaca..000 --- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php +++ /dev/null @@ -1,193 +0,0 @@ -<<< HEAD (d056a1 Merge branch 'master' into deployment 77a7ef7 Short array sy) -=== - 'donations', - 'express_checkout.json' => 'donations', - 'recurring_payment_profile_created.json' => 'recurring', - 'subscr_signup.json' => 'recurring', - 'subscr_payment.json' => 'recurring', - 'recurring_payment.json' => 'recurring', - 'refund.json' => 'refund', - 'refund_ec.json' => 'refund', - 'refund_recurring_ec.json' => 'refund', - 'chargeback_settlement.json' => 'refund', - 'chargeback_settlement_ec.json' => 'refund', - 'buyer_complaint.json' => 'refund', - 'refund_other.json' => 'refund', - 'refund_unauthorized_spoof.json' => 'refund', - 'refund_admin_fraud_reversal.json' => 'refund', - 'recurring_payment_suspended_due_to_max_failed_payment.json' => 'recurring', - // this should not actually get written to - // TODO 'new_case.json' => 'no-op', - ]; - - public function setUp() { - parent::setUp(); - $this->config = Context::get()->getGlobalConfiguration(); - $this->providerConfig = $this->setProviderConfiguration( 'paypal' ); - } - - public function tearDown() { - $this->providerConfig->overrideObjectInstance( 'curl/wrapper', null ); - parent::tearDown(); - } - - public function messageProvider() { - $messages = []; - foreach (
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Handle additional type of failed recurrance.
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383949 ) Change subject: Handle additional type of failed recurrance. .. Handle additional type of failed recurrance. Sort transaction type 'recurring_payment_suspended_due_to_max_failed_payment' into it's proper slot. Bug: T178086 Change-Id: I3b63ced8c957ff97c071846ad72873b5e2b56bbd --- M PaymentProviders/PayPal/RecurringMessage.php A PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json A PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php M config/paypal/main.yaml 5 files changed, 48 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/49/383949/1 diff --git a/PaymentProviders/PayPal/RecurringMessage.php b/PaymentProviders/PayPal/RecurringMessage.php index e840fc2..8fe1644 100644 --- a/PaymentProviders/PayPal/RecurringMessage.php +++ b/PaymentProviders/PayPal/RecurringMessage.php @@ -55,6 +55,7 @@ case 'recurring_payment_failed': case 'recurring_payment_skipped': case 'recurring_payment_suspended': + case 'recurring_payment_suspended_due_to_max_failed_payment': $message['txn_type'] = 'subscr_failed'; break; diff --git a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json new file mode 100644 index 000..845fc4e --- /dev/null +++ b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json @@ -0,0 +1,30 @@ +{ + "payment_cycle": "Monthly", + "txn_type": "recurring_payment_suspended_due_to_max_failed_payment", + "last_name": "Public", + "next_payment_date": "N/A", + "residence_country": "US", + "initial_payment_amount": "0.00", + "rp_invoice_id": "49006681", + "currency_code": "USD", + "time_created": "06:14:38 Aug 02, 2017 PDT", + "verify_sign": "AjCMMDabnuh7zx7wI4NpWflSS.lHAqA5jlFVAAuXLAx61931ulA3ylnl", + "period_type": " Regular", + "payer_status": "verified", + "tax": "0.00", + "payer_email": "j...@public.com", + "first_name": "John", + "receiver_email": "nob...@wikimedia.org", + "payer_id": "WK4ADPUHGWN6U", + "product_type": "1", + "shipping": "0.00", + "amount_per_cycle": "5.00", + "profile_status": "Suspended", + "charset": "UTF-8", + "notify_version": "3.8", + "amount": "5.00", + "outstanding_balance": "15.00", + "recurring_payment_id": "I-WCJA1MBC3CWY", + "product_name": "Monthly donation to the Wikimedia Foundation", + "ipn_track_id": "4b8cbe1a39fec" +} \ No newline at end of file diff --git a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json new file mode 100644 index 000..3f5bcce --- /dev/null +++ b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json @@ -0,0 +1,15 @@ +{ + "subscr_id": "I-WCJA1MBC3CWY", + "txn_type": "subscr_failed", + "contribution_tracking_id": "49006681", + "order_id": "49006681", + "email": "j...@public.com", + "first_name": "John", + "last_name": "Public", + "country": "US", + "gateway": "paypal_ec", + "recurring": "1", + "gross": "5.00", + "currency": "USD", + "date": "1501679678" +} diff --git a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php index ea0cb1e..3cb6fc7 100644 --- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php +++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php @@ -48,6 +48,7 @@ 'refund_other.json' => 'refund', 'refund_unauthorized_spoof.json' => 'refund', 'refund_admin_fraud_reversal.json' => 'refund', + 'recurring_payment_suspended_due_to_max_failed_payment.json' => 'recurring', // this should not actually get written to // TODO 'new_case.json' => 'no-op', ]; diff --git a/config/paypal/main.yaml b/config/paypal/main.yaml index c95ebe1..94b61ad 100644 --- a/config/paypal/main.yaml +++ b/config/paypal/main.yaml @@ -17,6 +17,7 @@ # TODO: merge this with DonationInterface style var_map var_map: +time_created: date payment_date: date # needs strtotime(payment_date) # FIXME Recurring messages use non-normalized field names, for example: txn_type: txn_type -- To view, visit https://gerrit.wikimedia.org/r/383949 To
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into deployment 77a7ef7 Short array sy...
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381353 ) Change subject: Merge branch 'master' into deployment 77a7ef7 Short array syntax 1e695c9 Handle additional paypal refund reason codes. .. Merge branch 'master' into deployment 77a7ef7 Short array syntax 1e695c9 Handle additional paypal refund reason codes. Change-Id: Ieb77ee391e3731cfffe5439af72f9e609890976a --- D PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php D PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php D PaymentProviders/Adyen/Tests/phpunit/AuditTest.php D PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php D PaymentProviders/Adyen/Tests/phpunit/CaptureResponseActionTest.php D PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php D PaymentProviders/Adyen/Tests/phpunit/ReportAvailableTest.php D PaymentProviders/Amazon/Tests/AmazonTestCase.php D PaymentProviders/Amazon/Tests/phpunit/AuditTest.php D PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php D PaymentProviders/AstroPay/Tests/phpunit/AuditTest.php D PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php D PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php D PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php D PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/HostedCheckoutProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/IngenicoPaymentProviderTest.php D PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal.json D PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal_transformed.json D PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof.json D PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof_transformed.json D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php D Tests/BaseSmashPigUnitTestCase.php D Tests/ConfigurationTest.php D Tests/DamagedDatabaseTest.php D Tests/FileDumperTest.php D Tests/MessageTest.php D Tests/PaymentsInitialDatabaseTest.php D Tests/PendingDatabaseTest.php D Tests/PendingQueueConsumerTest.php D Tests/QueueConsumerTest.php D Tests/TestingDatabase.php D Tests/TestingGlobalConfiguration.php D Tests/TestingProviderConfiguration.php D Tests/TestingQueueConsumer.php 36 files changed, 0 insertions(+), 2,790 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/53/381353/1 diff --git a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php b/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php deleted file mode 100644 index f430842..000 --- a/PaymentProviders/Adyen/Tests/AdyenTestConfiguration.php +++ /dev/null @@ -1,41 +0,0 @@ -<<< HEAD (dc6220 Merge branch 'master' into deployment) -=== -override( $overrides ); - - return $config; - } - - public static function createWithSuccessfulApi( GlobalConfiguration $globalConfig ) { - $override = [ 'api' => - [ - 'class' => 'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI', - 'constructor-parameters' => - [ 'Success!' ] - ] - ]; - return self::instance( $override, $globalConfig ); - } - - public static function createWithUnsuccessfulApi( GlobalConfiguration $globalConfig ) { - $override = [ 'api' => - [ - 'class' => 'SmashPig\PaymentProviders\Adyen\Tests\MockAdyenPaymentsAPI', - 'constructor-parameters' => - // FIXME: Really? or boolean `false` as it would be if - // we parsed "false" from yaml? - [ 'false' ] - ] - ]; - return self::instance( $override, $globalConfig ); - } -} ->>> BRANCH (1e695c Handle additional paypal refund reason codes.) diff --git a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php b/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php deleted file mode 100644 index d150bae..000 --- a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php +++ /dev/null @@ -1,53 +0,0 @@ -<<< HEAD (dc6220 Merge branch 'master' into deployment) -=== -returnCode = $returnCode; - } - - public function setAccount( $account ) { - $this->account = $account; - } - - /** -* Fakes a Capture modification to a given Adyen transaction. -* -* @param string $currency Original currency of the request -* @param int $amount Amount to be captured. Less than or equal to the original request -* @param string $pspReference Original pspReference of
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Handle additional paypal refund reason codes.
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381141 ) Change subject: Handle additional paypal refund reason codes. .. Handle additional paypal refund reason codes. Handle 'unauthorized_spoof' and 'admin_fraud_reversal' reason codes. Bug: T176225 Change-Id: Iad0a51dadb8b205e4e77a6b1749f7f1efeb6e1a5 --- M PaymentProviders/PayPal/RefundMessage.php A PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal.json A PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal_transformed.json A PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof.json A PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof_transformed.json M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 6 files changed, 113 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/41/381141/1 diff --git a/PaymentProviders/PayPal/RefundMessage.php b/PaymentProviders/PayPal/RefundMessage.php index bc99a77..eb81075 100644 --- a/PaymentProviders/PayPal/RefundMessage.php +++ b/PaymentProviders/PayPal/RefundMessage.php @@ -5,12 +5,22 @@ class RefundMessage extends Message { public static function normalizeMessage( &$message, $ipnMessage ) { + + $reasonCodes = array ( + 'refund', + 'buyer_complaint', + 'other', + 'unauthorized_spoof', + 'admin_fraud_reversal' + ); + $message['gateway_refund_id'] = $ipnMessage['txn_id']; $message['gross_currency'] = $ipnMessage['mc_currency']; + if ( isset( $message['txn_type'] ) && $message['txn_type'] === 'adjustment' ) { $message['type'] = 'chargeback'; - } elseif ( isset( $ipnMessage['reason_code'] ) && in_array( $ipnMessage['reason_code'], [ 'refund', 'buyer_complaint', 'other' ] ) ) { + } elseif ( isset( $ipnMessage['reason_code'] ) && in_array( $ipnMessage['reason_code'], $reasonCodes ) ) { $message['type'] = 'refund'; } diff --git a/PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal.json b/PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal.json new file mode 100644 index 000..aa4aa4b --- /dev/null +++ b/PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal.json @@ -0,0 +1,32 @@ +{ + "transaction_subject": "49123019", + "payment_date": "21:44:10 Sep 25, 2017 PDT", + "last_name": "Binks", + "residence_country": "US", + "item_name": "Donation to the Wikimedia Foundation", + "payment_gross": "-2.00", + "mc_currency": "USD", + "business": "some...@wikimedia.org", + "payment_type": "instant", + "protection_eligibility": "Ineligible", + "verify_sign": "AxE4TrrxMNhqKiFhwnvr8h7Z1h2CARJqs8-8lTKbgpFWtNqJknF-ZjvM", + "payer_email": "bi...@naboo.gov", + "txn_id": "41C736991R055474F", + "receiver_email": "some...@wikimedia.org", + "first_name": "JarJar", + "parent_txn_id": "3BR53982VX768520D", + "payer_id": "N5D6L2B4ZLFJC", + "receiver_id": "EZ782AXEUJUW8", + "reason_code": "admin_fraud_reversal", + "item_number": "DONATE", + "handling_amount": "0.00", + "payment_status": "Reversed", + "payment_fee": "-0.28", + "mc_fee": "-0.28", + "shipping": "0.00", + "mc_gross": "-2.00", + "custom": "49123019", + "charset": "UTF-8", + "notify_version": "3.8", + "ipn_track_id": "a605cc7b1e5a6" +} \ No newline at end of file diff --git a/PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal_transformed.json b/PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal_transformed.json new file mode 100644 index 000..d4a2793 --- /dev/null +++ b/PaymentProviders/PayPal/Tests/Data/refund_admin_fraud_reversal_transformed.json @@ -0,0 +1,18 @@ +{ + "date": "1506401050"", + "gateway_parent_id": "3BR53982VX768520D", + "gateway_txn_id": "41C736991R055474F", + "currency": "USD", + "type": "refund", + "contribution_tracking_id": "49123019", + "email": "bi...@naboo.gov", + "first_name": "JarJar", + "last_name": "Binks", + "gross": "-2.00", + "fee": "-0.28", + "order_id": "49123019", + "gateway_refund_id": "41C736991R055474F", + "gross_currency": "USD", + "country": "US", + "gateway": "paypal" +} \ No newline at end of file diff --git a/PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof.json b/PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof.json new file mode 100644 index 000..a20d6c7 --- /dev/null +++ b/PaymentProviders/PayPal/Tests/Data/refund_unauthorized_spoof.json @@ -0,0 +1,32 @@ +{ + "transaction_subject": "48295084", + "payment_date": "15:44:06 Sep 06, 2017 PDT", + "last_name": "McFakeperson", + "residence_country": "US", + "item_name": "Donation to the Wikimedia Foundation", + "payment_gross": "-5.00",
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into HEAD
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/376643 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD 3fb7292 Enable PHPCS, but only with rules phpcbf could fix b3ec09a Fix PayPal Gateway Tagging ca24a80 Only run phpunit when the config file is present Change-Id: I22eab3eb0939183294f36c4d65d92bdf0c34fc9d --- D PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php D PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php D PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php D PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php D PaymentProviders/Adyen/Tests/phpunit/RequeueMessageTest.php D PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php D PaymentProviders/Ingenico/Tests/phpunit/HostedCheckoutProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/IngenicoPaymentProviderTest.php D PaymentProviders/PayPal/Tests/Data/buyer_complaint.json D PaymentProviders/PayPal/Tests/Data/buyer_complaint_transformed.json D PaymentProviders/PayPal/Tests/Data/refund_other.json D PaymentProviders/PayPal/Tests/Data/refund_other_transformed.json D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php D Tests/BaseSmashPigUnitTestCase.php D Tests/FileDumperTest.php D Tests/PaymentsInitialDatabaseTest.php D Tests/PendingDatabaseTest.php D Tests/PendingQueueConsumerTest.php D Tests/SmashPigDatabaseTest.php D Tests/bootstrap-phpunit.php M composer.json 22 files changed, 0 insertions(+), 1,620 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/43/376643/1 diff --git a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php b/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php deleted file mode 100644 index 6d0eecd..000 --- a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php +++ /dev/null @@ -1,53 +0,0 @@ -<<< HEAD (8eb98c Merge branch 'master' into deployment) -=== -returnCode = $returnCode; - } - - public function setAccount( $account ) { - $this->account = $account; - } - - /** -* Fakes a Capture modification to a given Adyen transaction. -* -* @param string $currency Original currency of the request -* @param int $amount Amount to be captured. Less than or equal to the original request -* @param string $pspReference Original pspReference of the request -* -* @returns bool|string The return code set in the constructor. -*/ - public function capture( $currency, $amount, $pspReference ) { - $this->captured[] = array( - 'currency' => $currency, - 'amount' => $amount, - 'pspReference' => $pspReference, - ); - return $this->returnCode; - } - - /** -* Pretends to cancel an Adyen authorization -* -* @param string $pspReference Original pspReference of the request -* -* @returns bool|string The return code set in the constructor. -*/ - public function cancel( $pspReference ) { - $this->cancelled[] = $pspReference; - return $this->returnCode; - } -} ->>> BRANCH (ca24a8 Only run phpunit when the config file is present) diff --git a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php b/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php deleted file mode 100644 index 1ba8a0b..000 --- a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php +++ /dev/null @@ -1,235 +0,0 @@ -<<< HEAD (8eb98c Merge branch 'master' into deployment) -=== -pendingDatabase = PendingDatabase::get(); - $this->pendingMessage = json_decode( - file_get_contents( __DIR__ . '/../Data/pending.json' ), true - ); - $this->pendingDatabase->storeMessage( $this->pendingMessage ); - $this->antifraudQueue = QueueWrapper::getQueue( 'payments-antifraud' ); - } - - public function tearDown() { - $this->pendingDatabase->deleteMessage( $this->pendingMessage ); - parent::tearDown(); - } - - /** -* For a legit donation, ProcessCaptureJob should leave donor data -* in the pending database, add an antifraud message, and return true. -*/ - public function testSuccessfulCapture() { - $api = $this->config->object( 'api', true ); - - $auth = JsonSerializableObject::fromJsonProxy( - 'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation', - file_get_contents( __DIR__ . '/../Data/auth.json' ) - ); - - $job = ProcessCaptureRequestJob::factory( $auth ); -
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into HEAD
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/376637 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD 3fb7292 Enable PHPCS, but only with rules phpcbf could fix b3ec09a Fix PayPal Gateway Tagging Change-Id: I2a0361beb6bc08f64a59a5cb5492bd0468cf8d01 --- D PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php D PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php D PaymentProviders/Adyen/Tests/phpunit/PaymentCaptureActionTest.php D PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php D PaymentProviders/Adyen/Tests/phpunit/RequeueMessageTest.php D PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php D PaymentProviders/Ingenico/Tests/phpunit/HostedCheckoutProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/IngenicoPaymentProviderTest.php D PaymentProviders/PayPal/Tests/Data/buyer_complaint.json D PaymentProviders/PayPal/Tests/Data/buyer_complaint_transformed.json D PaymentProviders/PayPal/Tests/Data/refund_other.json D PaymentProviders/PayPal/Tests/Data/refund_other_transformed.json D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php D Tests/BaseSmashPigUnitTestCase.php D Tests/FileDumperTest.php D Tests/PaymentsInitialDatabaseTest.php D Tests/PendingDatabaseTest.php D Tests/PendingQueueConsumerTest.php D Tests/SmashPigDatabaseTest.php D Tests/bootstrap-phpunit.php M composer.json 22 files changed, 0 insertions(+), 1,620 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/37/376637/1 diff --git a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php b/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php deleted file mode 100644 index b338c51..000 --- a/PaymentProviders/Adyen/Tests/MockAdyenPaymentsAPI.php +++ /dev/null @@ -1,53 +0,0 @@ -<<< HEAD (8eb98c Merge branch 'master' into deployment) -=== -returnCode = $returnCode; - } - - public function setAccount( $account ) { - $this->account = $account; - } - - /** -* Fakes a Capture modification to a given Adyen transaction. -* -* @param string $currency Original currency of the request -* @param int $amount Amount to be captured. Less than or equal to the original request -* @param string $pspReference Original pspReference of the request -* -* @returns bool|string The return code set in the constructor. -*/ - public function capture( $currency, $amount, $pspReference ) { - $this->captured[] = array( - 'currency' => $currency, - 'amount' => $amount, - 'pspReference' => $pspReference, - ); - return $this->returnCode; - } - - /** -* Pretends to cancel an Adyen authorization -* -* @param string $pspReference Original pspReference of the request -* -* @returns bool|string The return code set in the constructor. -*/ - public function cancel( $pspReference ) { - $this->cancelled[] = $pspReference; - return $this->returnCode; - } -} ->>> BRANCH (b3ec09 Fix PayPal Gateway Tagging) diff --git a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php b/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php deleted file mode 100644 index 7e91e2c..000 --- a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php +++ /dev/null @@ -1,235 +0,0 @@ -<<< HEAD (8eb98c Merge branch 'master' into deployment) -=== -pendingDatabase = PendingDatabase::get(); - $this->pendingMessage = json_decode( - file_get_contents( __DIR__ . '/../Data/pending.json' ), true - ); - $this->pendingDatabase->storeMessage( $this->pendingMessage ); - $this->antifraudQueue = QueueWrapper::getQueue( 'payments-antifraud' ); - } - - public function tearDown() { - $this->pendingDatabase->deleteMessage( $this->pendingMessage ); - parent::tearDown(); - } - - /** -* For a legit donation, ProcessCaptureJob should leave donor data -* in the pending database, add an antifraud message, and return true. -*/ - public function testSuccessfulCapture() { - $api = $this->config->object( 'api', true ); - - $auth = JsonSerializableObject::fromJsonProxy( - 'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation', - file_get_contents( __DIR__ . '/../Data/auth.json' ) - ); - - $job = ProcessCaptureRequestJob::factory( $auth ); - $this->assertTrue( $job->execute() ); - - $donorData =
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: WIP Fix PayPal Gateway Tagging
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/374913 ) Change subject: WIP Fix PayPal Gateway Tagging .. WIP Fix PayPal Gateway Tagging Former assumptions are no longer true, fixing that. Also allow for more reason_codes that mean 'refund'. WIP while I figure out if the new assumption about legacy is always true. Bug: T1713351 Change-Id: If555903aac93ad8e58da3d2d9e8ea7cb4608b790 --- M PaymentProviders/PayPal/RefundMessage.php M PaymentProviders/PayPal/Tests/Data/refund.json M PaymentProviders/PayPal/Tests/Data/refund_transformed.json 3 files changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/13/374913/1 diff --git a/PaymentProviders/PayPal/RefundMessage.php b/PaymentProviders/PayPal/RefundMessage.php index 1520594..0afd0ee 100644 --- a/PaymentProviders/PayPal/RefundMessage.php +++ b/PaymentProviders/PayPal/RefundMessage.php @@ -16,15 +16,14 @@ } else { $message['gateway'] = 'paypal'; } - } elseif ( isset( $ipnMessage['reason_code'] ) && $ipnMessage['reason_code'] === 'refund' ) { + } elseif ( isset( $ipnMessage['reason_code'] ) && in_array( $ipnMessage['reason_code'], array( 'refund', 'buyer_complaint', 'other' ) ) ) { $message['type'] = 'refund'; - // For refunds, express checkout puts a description in transaction_subject, - // but legacy puts a contribution tracking ID there. - if ( isset( $ipnMessage['transaction_subject'] ) && !is_numeric( $ipnMessage['transaction_subject'] ) ) { - $message['gateway'] = 'paypal_ec'; - } else { + // Legacy sets subscr_id, EC does not. + if ( isset( $ipnMessage['subscr_id'] ) ) { $message['gateway'] = 'paypal'; + } else { + $message['gateway'] = 'paypal_ec'; } } } diff --git a/PaymentProviders/PayPal/Tests/Data/refund.json b/PaymentProviders/PayPal/Tests/Data/refund.json index ed3f61b..b82ff44 100644 --- a/PaymentProviders/PayPal/Tests/Data/refund.json +++ b/PaymentProviders/PayPal/Tests/Data/refund.json @@ -13,6 +13,7 @@ "address_name":"Clyde Barrow", "notify_version":"3.8", "reason_code":"refund", +"subscr_id":"S-2L576314R8742400A", "custom":"93731212", "business":"gimmedoll...@wikimedia.org", "address_country":"United States", diff --git a/PaymentProviders/PayPal/Tests/Data/refund_transformed.json b/PaymentProviders/PayPal/Tests/Data/refund_transformed.json index ace9db6..fce95a0 100644 --- a/PaymentProviders/PayPal/Tests/Data/refund_transformed.json +++ b/PaymentProviders/PayPal/Tests/Data/refund_transformed.json @@ -18,5 +18,6 @@ "order_id": "93731212", "gateway_refund_id": "99E56789RR1234222", "gross_currency": "USD", - "gateway": "paypal" + "gateway": "paypal", + "subscr_id": "S-2L576314R8742400A" } -- To view, visit https://gerrit.wikimedia.org/r/374913 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If555903aac93ad8e58da3d2d9e8ea7cb4608b790 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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 HEAD
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/374603 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD f7b8b3b WX parser: set gateway_txn_id on refunds b182237 Oops, I meant 'gateway_refund_id' ff83fc5 Return inserted IDs for pending and payments_init 7dca9f2 PayPal verification uses OutboundRequest b440ff4 Fix and note for Amazon manual IPN test harness cb1f969 Tag refunds and chargebacks with correct paypal gateway cd2e8d2 WX audit files: get at least date from sparse refunds Change-Id: Ia94c5bd6a35fbeaf46019d7d37f0e8c95f9ed74e --- D PaymentProviders/Amazon/Tests/manual/amznipnfake.js D PaymentProviders/Amazon/Tests/manual/index.html D PaymentProviders/Ingenico/Tests/Data/sparseRefund.xml.gz D PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php D PaymentProviders/PayPal/Tests/Data/chargeback_settlement.json D PaymentProviders/PayPal/Tests/Data/chargeback_settlement_ec.json D PaymentProviders/PayPal/Tests/Data/chargeback_settlement_ec_transformed.json D PaymentProviders/PayPal/Tests/Data/chargeback_settlement_transformed.json D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php D Tests/PendingDatabaseTest.php 10 files changed, 0 insertions(+), 602 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/03/374603/1 diff --git a/PaymentProviders/Amazon/Tests/manual/amznipnfake.js b/PaymentProviders/Amazon/Tests/manual/amznipnfake.js deleted file mode 100644 index 3f5aa11..000 --- a/PaymentProviders/Amazon/Tests/manual/amznipnfake.js +++ /dev/null @@ -1,41 +0,0 @@ -<<< HEAD (98c551 Merge branch 'master' into deployment) -=== -var listenerUrl = $.cookie( 'AmazonListenerUrl' ); -if ( !listenerUrl || listenerUrl === '' ) { - listenerUrl = '/listener/?p=amazon/listener'; -} -$( "#listener_url" ).val( listenerUrl ); - -function fakeIpnPost( notificationType ) { - listenerUrl = $( "#listener_url" ).val(); - $.cookie( 'AmazonListenerUrl', listenerUrl, { expires: 365, path: location.pathName } ); - $.getJSON( 'RawPosts/' + notificationType + '.json', - function( postJson ) { - $.ajax({ - method: 'POST', - url: listenerUrl, - contentType: 'application/json; charset=utf-8', - headers: postJson.headers, - data: JSON.stringify( postJson.body ), - dataType: 'json' - }); - } - ); -} - -$("#capture_completed").click(function() { - fakeIpnPost( "CaptureCompleted" ); -}); - -$("#capture_declined").click(function() { - fakeIpnPost( "CaptureDeclined" ); -}); - -$("#refund_completed").click(function() { - fakeIpnPost( "RefundCompleted" ); -}); - -$("#refund_declined").click(function() { - fakeIpnPost( "RefundDeclined" ); -}); ->>> BRANCH (cd2e8d WX audit files: get at least date from sparse refunds) diff --git a/PaymentProviders/Amazon/Tests/manual/index.html b/PaymentProviders/Amazon/Tests/manual/index.html deleted file mode 100644 index 45dec50..000 --- a/PaymentProviders/Amazon/Tests/manual/index.html +++ /dev/null @@ -1,19 +0,0 @@ -<<< HEAD (98c551 Merge branch 'master' into deployment) -=== - - - - - - - Amazon listener test posts - Send some convincing-looking posts (including valid signatures) to your listener - If you have an externally-accessible https URL and an Amazon merchant account, you can test more varieties at https://sellercentral.amazon.com/hz/me/hmi/ipn/main;>https://sellercentral.amazon.com/hz/me/hmi/ipn/main -Listener URL (must be on the same domain as this page): -Capture completed -Refund completed -Capture declined -Refund declined - - ->>> BRANCH (cd2e8d WX audit files: get at least date from sparse refunds) diff --git a/PaymentProviders/Ingenico/Tests/Data/sparseRefund.xml.gz b/PaymentProviders/Ingenico/Tests/Data/sparseRefund.xml.gz deleted file mode 100644 index 0b29176..000 --- a/PaymentProviders/Ingenico/Tests/Data/sparseRefund.xml.gz +++ /dev/null Binary files differ diff --git a/PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php b/PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php deleted file mode 100644 index 0cdfd27..000 --- a/PaymentProviders/Ingenico/Tests/phpunit/AuditTest.php +++ /dev/null @@ -1,143 +0,0 @@ -<<< HEAD (98c551 Merge branch 'master' into deployment) -=== -parseFile( __DIR__ . '/../Data/donation.xml.gz' ); - $this->assertEquals( 1, count( $output ), 'Should have found one donation' ); - $actual = $output[0]; - $expected = array( - 'gateway' => 'globalcollect', // TODO: switch to ingenico for Connect -
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Add tox.ini with flake8 config
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/373937 ) Change subject: Add tox.ini with flake8 config .. Add tox.ini with flake8 config Ignoring long line warnings Bug: T121723 Change-Id: Iab0aa776ceae8f3cfa4abf755c7aab4e66e732a4 --- M .gitignore A tox.ini 2 files changed, 17 insertions(+), 1 deletion(-) Approvals: Mepps: Looks good to me, approved XenoRyet: Verified diff --git a/.gitignore b/.gitignore index 3675fba..9b171d1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ *.pot *.pyc local_settings.py -.idea/* \ No newline at end of file +.idea/* +.tox diff --git a/tox.ini b/tox.ini new file mode 100644 index 000..81612a2 --- /dev/null +++ b/tox.ini @@ -0,0 +1,15 @@ +[tox] +skipsdist = True +envlist = flake8 + +[testenv:flake8] +commands = flake8 {posargs} +deps = flake8 + +[flake8] +# E501 line too long (X > 79 characters) +ignore=E501 +exclude = + .tox, + fundraiser/settings.py +builtins = unicode -- To view, visit https://gerrit.wikimedia.org/r/373937 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab0aa776ceae8f3cfa4abf755c7aab4e66e732a4 Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/tools/DjangoBannerStats Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Mepps Gerrit-Reviewer: XenoRyet ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Be explicit with imports
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/373936 ) Change subject: Be explicit with imports .. Be explicit with imports Not using the full namespace as might be desired, but avoiding import * Will help pass flake8 Bug: T121723 Change-Id: I73fbb1781150715f78216aaec5a61d4fcac21bda --- M fundraiser/analytics/management/commands/AggregateBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py M fundraiser/analytics/management/commands/LoadLPImpressions.py 4 files changed, 10 insertions(+), 14 deletions(-) Approvals: Mepps: Looks good to me, approved XenoRyet: Verified diff --git a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py index 3895efa..352741e 100644 --- a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py +++ b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py @@ -9,9 +9,7 @@ import _mysql_exceptions from optparse import make_option -from fundraiser.analytics.functions import * -from fundraiser.analytics.models import * -from fundraiser.analytics.regex import * +from fundraiser.analytics.functions import get_language, get_project, roundtime, lookup_project, lookup_language class Command(BaseCommand): diff --git a/fundraiser/analytics/management/commands/LoadBannerImpressions.py b/fundraiser/analytics/management/commands/LoadBannerImpressions.py index 11d0752..2aaf679 100644 --- a/fundraiser/analytics/management/commands/LoadBannerImpressions.py +++ b/fundraiser/analytics/management/commands/LoadBannerImpressions.py @@ -13,9 +13,9 @@ import os import urlparse -from fundraiser.analytics.functions import * -from fundraiser.analytics.models import * -from fundraiser.analytics.regex import * +from fundraiser.analytics.functions import lookup_country, lookup_language, lookup_project, lookup_squidhost +from fundraiser.analytics.models import SquidLog +from fundraiser.analytics.regex import ignore_uas, phantomJS, sampled, squidline from django.conf import settings diff --git a/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py b/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py index f3d2204..c643207 100644 --- a/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py +++ b/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py @@ -1,6 +1,5 @@ from django.core.management.base import BaseCommand from django.db import connections, transaction, reset_queries -from django.db.utils import IntegrityError import gc from datetime import datetime, timedelta @@ -14,10 +13,9 @@ import os import urlparse -# TODO: import NAME instead, so usage includes the full namespace. -from fundraiser.analytics.functions import * -from fundraiser.analytics.models import * -from fundraiser.analytics.regex import * +from fundraiser.analytics.functions import lookup_country, lookup_project, lookup_language, roundtime +from fundraiser.analytics.models import SquidLog +from fundraiser.analytics.regex import ignore_uas, phantomJS, sampled, squidline from django.conf import settings diff --git a/fundraiser/analytics/management/commands/LoadLPImpressions.py b/fundraiser/analytics/management/commands/LoadLPImpressions.py index ee25633..1c116c3 100644 --- a/fundraiser/analytics/management/commands/LoadLPImpressions.py +++ b/fundraiser/analytics/management/commands/LoadLPImpressions.py @@ -14,9 +14,9 @@ from urllib import unquote import urlparse -from fundraiser.analytics.functions import * -from fundraiser.analytics.models import * -from fundraiser.analytics.regex import * +from fundraiser.analytics.functions import lookup_country, lookup_language, lookup_project, lookup_squidhost +from fundraiser.analytics.models import LandingPageImpression, SquidLog +from fundraiser.analytics.regex import ignore_uas, landingpages, squidline from django.conf import settings -- To view, visit https://gerrit.wikimedia.org/r/373936 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73fbb1781150715f78216aaec5a61d4fcac21bda Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/tools/DjangoBannerStats Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Mepps Gerrit-Reviewer: XenoRyet ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Fix whitespace and 'not' order
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/373931 ) Change subject: Fix whitespace and 'not' order .. Fix whitespace and 'not' order Readability! Also, help pass pyflakes (later) Bug: T121723 Change-Id: I759219ff39a9b436586ad013feaf6514ffa2a45b --- M fundraiser/analytics/cache.py M fundraiser/analytics/functions.py M fundraiser/analytics/management/commands/AggregateBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py M fundraiser/analytics/management/commands/LoadLPImpressions.py M fundraiser/analytics/models.py M fundraiser/lists/countries.py M fundraiser/lists/languages.py M fundraiser/monitoring/models.py M fundraiser/settings.py 11 files changed, 859 insertions(+), 851 deletions(-) Approvals: Mepps: Looks good to me, approved XenoRyet: Verified diff --git a/fundraiser/analytics/cache.py b/fundraiser/analytics/cache.py index 76592c4..ca5f335 100644 --- a/fundraiser/analytics/cache.py +++ b/fundraiser/analytics/cache.py @@ -1,6 +1,7 @@ import functools import cPickle + def cache(func): stored_results = {} @@ -16,4 +17,4 @@ del key return result -return cached \ No newline at end of file +return cached diff --git a/fundraiser/analytics/functions.py b/fundraiser/analytics/functions.py index dbcf6b9..7e1e033 100644 --- a/fundraiser/analytics/functions.py +++ b/fundraiser/analytics/functions.py @@ -5,6 +5,7 @@ from fundraiser.analytics.cache import cache from fundraiser.analytics.models import Country, Language, Project, SquidHost + @cache def lookup_country(country=None, default="XX", create=True, verbose=False): """ @@ -25,7 +26,7 @@ """ # check for bad input values and try to return a default if not country or country is None: -if not default is False: +if default is not False: if verbose: print("** INVALID COUNTRY, returning default (%s)" % default) return lookup_country(default, False, create, verbose) @@ -51,11 +52,12 @@ else: return None except Warning: -#TODO: use the default +# TODO: use the default pass except Warning: -#TODO: use the default +# TODO: use the default pass + @cache def lookup_language(language=None, default="en", create=True, verbose=False): @@ -77,7 +79,7 @@ """ # check for bad input values and try to return a default if not language or language is None: -if not default is False: +if default is not False: if verbose: print("** INVALID LANGUAGE, returning default (%s)" % default) return lookup_language(default, False, create, verbose) @@ -103,11 +105,12 @@ else: return None except Warning: -#TODO: use the default +# TODO: use the default pass except Warning: -#TODO: use the default +# TODO: use the default pass + @cache def lookup_project(project=None, default="donatewiki", create=True, verbose=False): @@ -129,7 +132,7 @@ """ # check for bad input values and try to return a default if not project or project is None: -if not default is False: +if default is not False: if verbose: print("** INVALID PROJECT, returning default (%s)" % default) return lookup_project(default, False, create, verbose) @@ -155,11 +158,12 @@ else: return None except Warning: -#TODO: use the default +# TODO: use the default pass except Warning: -#TODO: use the default +# TODO: use the default pass + @cache def lookup_squidhost(hostname=None, default="unknown", create=True, verbose=False): @@ -181,7 +185,7 @@ """ # check for bad input values and try to return a default if not hostname or hostname is None: -if not default is False: +if default is not False: if verbose: print("** INVALID SQUID HOSTNAME, returning default (%s)" % default) return lookup_squidhost(default, False, create, verbose) @@ -207,10 +211,10 @@ else: return None except Warning: -#TODO: use the default +# TODO: use the default pass except Warning: -#TODO: use the default +# TODO: use the default pass @@ -223,6 +227,7 @@ return Project.objects.get(id=id) + @cache def get_language(id=None): if id is None: @@ -231,6 +236,7 @@ id = int(id) return Language.objects.get(id=id) + @cache def
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Update option parsing for Django 1.10+
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/373924 ) Change subject: Update option parsing for Django 1.10+ .. Update option parsing for Django 1.10+ Django now uses standard argparse, see https://docs.djangoproject.com/en/1.11/howto/custom-management-commands/ Preserve back-compat by wrapping the old code in a hasattr check Change-Id: I9ab1ea04c1bab9805a5ca10d25e2675e5561036b --- M fundraiser/analytics/management/commands/AggregateBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py M fundraiser/analytics/management/commands/LoadLPImpressions.py 4 files changed, 263 insertions(+), 111 deletions(-) Approvals: Mepps: Looks good to me, approved XenoRyet: Verified diff --git a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py index 96a34f4..6e55159 100644 --- a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py +++ b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py @@ -15,38 +15,41 @@ logger = logging.getLogger("fundraiser.analytics.load_banners") -option_list = BaseCommand.option_list + ( -make_option('', '--verbose', -dest='verbose', -action='store_true', -default=False, -help='Provides more verbose output.'), -make_option('', '--debug', -dest='debug', -action='store_true', -default=False, -help='Do not save. Parse only.'), -make_option('', '--newest', -dest='newest', -action='store_true', -default=False, -help='Do not save. Parse only.'), -make_option('', '--top', -dest='top', -action='store_true', -default=False, -help='Only separate out top languages and projects'), -make_option('', '--batch', -dest='batch', -type='int', -default=1000, -help='Batch size to be used for query operations.'), -make_option('', '--rounds', -dest='rounds', -type='int', -default=1, -help='Number of rounds of the batch size to be run.'), -) +if hasattr(BaseCommand, 'option_list'): +# DEPRECATED, removed in Django 1.10 +# replaced by add_arguments below +option_list = BaseCommand.option_list + ( +make_option('', '--verbose', +dest='verbose', +action='store_true', +default=False, +help='Provides more verbose output.'), +make_option('', '--debug', +dest='debug', +action='store_true', +default=False, +help='Do not save. Parse only.'), +make_option('', '--newest', +dest='newest', +action='store_true', +default=False, +help='Do not save. Parse only.'), +make_option('', '--top', +dest='top', +action='store_true', +default=False, +help='Only separate out top languages and projects'), +make_option('', '--batch', +dest='batch', +type='int', +default=1000, +help='Batch size to be used for query operations.'), +make_option('', '--rounds', +dest='rounds', +type='int', +default=1, +help='Number of rounds of the batch size to be run.'), +) help = '' @@ -63,6 +66,45 @@ ] +def add_arguments(self, parser): +parser.add_argument( +'--verbose', +dest='verbose', +action='store_true', +default=False, +help='Provides more verbose output.') +parser.add_argument( +'--debug', +dest='debug', +action='store_true', +default=False, +help='Do not save. Parse only.') +parser.add_argument( +'--newest', +dest='newest', +action='store_true', +default=False, +help='Do not save. Parse only.') +parser.add_argument( +'--top', +dest='top', +action='store_true', +default=False, +help='Only separate out top languages and projects') +parser.add_argument( +'--batch', +dest='batch', +type='int', +default=1000, +help='Batch size to be used for query operations.') +parser.add_argument( +
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Use print function from __future__
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/373930 ) Change subject: Use print function from __future__ .. Use print function from __future__ To pass pyflakes in a future patch Bug: T121723 Change-Id: I13dec388d70dacd623c41923cc5e76018c081949 --- M fundraiser/analytics/functions.py M fundraiser/analytics/management/commands/AggregateBannerImpressions.py 2 files changed, 17 insertions(+), 13 deletions(-) Approvals: Mepps: Looks good to me, approved XenoRyet: Verified diff --git a/fundraiser/analytics/functions.py b/fundraiser/analytics/functions.py index fab03e3..dbcf6b9 100644 --- a/fundraiser/analytics/functions.py +++ b/fundraiser/analytics/functions.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from datetime import timedelta from fundraiser.analytics.cache import cache @@ -25,13 +27,13 @@ if not country or country is None: if not default is False: if verbose: -print "** INVALID COUNTRY, returning default (%s)" % default +print("** INVALID COUNTRY, returning default (%s)" % default) return lookup_country(default, False, create, verbose) else: return None if len(country) > 2: if verbose: -print "** INVALID COUNTRY ISO_CODE %s --- USING DEFAULT" % country +print("** INVALID COUNTRY ISO_CODE %s --- USING DEFAULT" % country) country = default try: country = Country.objects.get(iso_code=country) @@ -44,7 +46,7 @@ Country.objects.create(iso_code=country) country = Country.objects.get(iso_code=country) if verbose and country: -print "** CREATED COUNTRY FOR: %s (id:%d)" % (country.iso_code, country.id) +print("** CREATED COUNTRY FOR: %s (id:%d)" % (country.iso_code, country.id)) return country else: return None @@ -77,13 +79,13 @@ if not language or language is None: if not default is False: if verbose: -print "** INVALID LANGUAGE, returning default (%s)" % default +print("** INVALID LANGUAGE, returning default (%s)" % default) return lookup_language(default, False, create, verbose) else: return None if len(language) > 24: if verbose: -print "** TRUNCATING LANGUAGE ISO_CODE %s to %s" % (language, language[:24]) +print("** TRUNCATING LANGUAGE ISO_CODE %s to %s" % (language, language[:24])) language = language[:24] try: language = Language.objects.get(iso_code=language) @@ -96,7 +98,7 @@ Language.objects.create(iso_code=language) language = Language.objects.get(iso_code=language) if verbose and language: -print "** CREATED LANGUAGE FOR: %s (id:%d)" % (language.iso_code, language.id) +print("** CREATED LANGUAGE FOR: %s (id:%d)" % (language.iso_code, language.id)) return language else: return None @@ -129,13 +131,13 @@ if not project or project is None: if not default is False: if verbose: -print "** INVALID PROJECT, returning default (%s)" % default +print("** INVALID PROJECT, returning default (%s)" % default) return lookup_project(default, False, create, verbose) else: return None if len(project) > 128: if verbose: -print "** TRUNCATING PROJECT %s to %s" % (project, project[:128]) +print("** TRUNCATING PROJECT %s to %s" % (project, project[:128])) project = project[:128] try: project = Project.objects.get(project=project) @@ -148,7 +150,7 @@ Project.objects.create(project=project) project = Project.objects.get(project=project) if verbose and project: -print "** CREATED PROJECT FOR: %s (id:%d)" % (project.project, project.id) +print("** CREATED PROJECT FOR: %s (id:%d)" % (project.project, project.id)) return project else: return None @@ -181,13 +183,13 @@ if not hostname or hostname is None: if not default is False: if verbose: -print "** INVALID SQUID HOSTNAME, returning default (%s)" % default +print("** INVALID SQUID HOSTNAME, returning default (%s)" % default) return lookup_squidhost(default, False, create, verbose) else: return None if len(hostname) > 128: if verbose: -print "** TRUNCATING SQUID HOSTNAME %s to %s" % (hostname, hostname[:128]) +print("** TRUNCATING
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Remove web app bits of DjangoBannerStats
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/358424 ) Change subject: Remove web app bits of DjangoBannerStats .. Remove web app bits of DjangoBannerStats Not actually used, and preventing the app from running on newer versions of Django Change-Id: I5389a26266c4a24a6ed76733cc0dc72d41ea277d --- D fundraiser/analytics/admin.py D fundraiser/analytics/forms.py D fundraiser/analytics/urls.py D fundraiser/analytics/views.py D fundraiser/monitoring/views.py M fundraiser/settings.py D fundraiser/templates/analytics/campaign_ecom.html D fundraiser/templates/wmf_base.html D fundraiser/urls.py D fundraiser/wsgi.py 10 files changed, 0 insertions(+), 236 deletions(-) Approvals: Mepps: Looks good to me, approved XenoRyet: Verified diff --git a/fundraiser/analytics/admin.py b/fundraiser/analytics/admin.py deleted file mode 100644 index 2c26d9d..000 --- a/fundraiser/analytics/admin.py +++ /dev/null @@ -1,11 +0,0 @@ -from django.contrib import admin - -from fundraiser.analytics.models import * - -class LanguageAdmin(admin.ModelAdmin): -list_display = ('iso_code', 'language') - -admin.site.register(BannerImpression) -admin.site.register(Language, LanguageAdmin) -admin.site.register(Country) -admin.site.register(Project) diff --git a/fundraiser/analytics/forms.py b/fundraiser/analytics/forms.py deleted file mode 100644 index caa1a60..000 --- a/fundraiser/analytics/forms.py +++ /dev/null @@ -1,13 +0,0 @@ -from django import forms - -class CampaignForm(forms.Form): -campaign = forms.CharField(required=True) - -def clean_campaign(self): -import re -campaign = self.cleaned_data['campaign'] -if re.match(r"^([0-9a-zA-Z_-]+)$", campaign): -return campaign -else: -raise forms.ValidationError("Invalid campaign name") - diff --git a/fundraiser/analytics/urls.py b/fundraiser/analytics/urls.py deleted file mode 100644 index a6946a9..000 --- a/fundraiser/analytics/urls.py +++ /dev/null @@ -1,14 +0,0 @@ -from django.conf.urls import patterns, include, url - -# Uncomment the next two lines to enable the admin: -from django.contrib import admin -admin.autodiscover() - -urlpatterns = patterns('fundraiser.analytics', -# Examples: -# url(r'^$', 'fundraiser.views.home', name='home'), - -url(r'^$', 'views.hello_world', name='hello_world'), -url(u'campaign_ecom/$', 'views.campaign_ecom', name='fundraiser.analytics.campaign_ecom'), - -) diff --git a/fundraiser/analytics/views.py b/fundraiser/analytics/views.py deleted file mode 100644 index ea9d1a6..000 --- a/fundraiser/analytics/views.py +++ /dev/null @@ -1,36 +0,0 @@ -from django.http import HttpResponse -from django.shortcuts import render_to_response -from django.template import RequestContext - -import fundraiser.analytics.forms as forms - -# Create your views here. - -def hello_world(request): - -#return HttpResponse("Hello World") -return render_to_response( -"wmf_base.html", -{'text':"Hello World"}, -context_instance=RequestContext(request) -) - -def campaign_ecom(request): -if request.method == 'POST': # If the form has been submitted... -form = forms.CampaignForm(request.POST) # A form bound to the POST data -if form.is_valid(): # All validation rules pass -return render_to_response( -"analytics/campaign_ecom.html", -{ 'form' : form, - 'campaign' : form.cleaned_data['campaign'] -}, -context_instance=RequestContext(request) -) -else: -form = forms.CampaignForm() # An unbound form - -return render_to_response( -"analytics/campaign_ecom.html", -{ 'form' : form }, -context_instance=RequestContext(request) -) \ No newline at end of file diff --git a/fundraiser/monitoring/views.py b/fundraiser/monitoring/views.py deleted file mode 100644 index 60f00ef..000 --- a/fundraiser/monitoring/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/fundraiser/settings.py b/fundraiser/settings.py index 338644f..47de14b 100644 --- a/fundraiser/settings.py +++ b/fundraiser/settings.py @@ -3,12 +3,6 @@ DEBUG = True TEMPLATE_DEBUG = DEBUG -ADMINS = ( -# ('Your Name', 'your_em...@example.com'), -) - -MANAGERS = ADMINS - DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. @@ -46,84 +40,11 @@ # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = False -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/home/media/media.lawrence.com/media/" -MEDIA_ROOT = '' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash. -# Examples:
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355569 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 0715cc0 Audit processors can read normalized fields in logs a23b082 Unique-ify invoice ID for recurring c974314 Payments-init consumer can handle 'currency' message field. Change-Id: I694d02c19ea58a6e56d96fe000c4d7cfe4c7d2b0 --- D sites/all/modules/queue2civicrm/tests/data/payments-init.json D sites/all/modules/queue2civicrm/tests/phpunit/PaymentsInitQueueTest.php D sites/all/modules/wmf_audit/tests/AdyenAuditTest.php D sites/all/modules/wmf_audit/tests/data/Adyen/donation_new/settlement_detail_report_batch_2.csv D sites/all/modules/wmf_audit/tests/data/logs/payments-adyen-20170218.gz 5 files changed, 0 insertions(+), 350 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/69/355569/1 diff --git a/sites/all/modules/queue2civicrm/tests/data/payments-init.json b/sites/all/modules/queue2civicrm/tests/data/payments-init.json deleted file mode 100644 index 7ddcc1b..000 --- a/sites/all/modules/queue2civicrm/tests/data/payments-init.json +++ /dev/null @@ -1,18 +0,0 @@ -<<< HEAD (9b7a74 Merge branch 'master' into deployment) -=== -{ - "contribution_tracking_id": "12345", - "gateway": "testgateway", - "order_id": "", - "gateway_txn_id": "", - "validation_action": "process", - "payments_final_status": "complete", - "payment_method": "paypal", - "payment_submethod": "", - "country": "IT", - "amount": "2.00", - "currency": "EUR", - "server": "testpayments1002", - "date": "1445990999" -} ->>> BRANCH (c97431 Payments-init consumer can handle 'currency' message field.) diff --git a/sites/all/modules/queue2civicrm/tests/phpunit/PaymentsInitQueueTest.php b/sites/all/modules/queue2civicrm/tests/phpunit/PaymentsInitQueueTest.php deleted file mode 100644 index c727d87..000 --- a/sites/all/modules/queue2civicrm/tests/phpunit/PaymentsInitQueueTest.php +++ /dev/null @@ -1,120 +0,0 @@ -<<< HEAD (9b7a74 Merge branch 'master' into deployment) -=== -createTable( 'test' ); - $this->consumer = new PaymentsInitQueueConsumer( - 'test' - ); - } - - public function testValidMessage() { - $message = $this->getMessage(); - $this->consumer->processMessage( $message ); - - $this->compareMessageWithDb( $message ); - } - - /** -* The first message for a ct_id / order_id pair needs to be complete -* -* @expectedException FredgeDataValidationException -*/ - public function testIncompleteMessage() { - $message = $this->getMessage(); - unset( $message['payment_method'] ); - $this->consumer->processMessage( $message ); - } - - /** -* After one complete message has been inserted, a second message -* with the same ct_id / order_id can update only selected fields -*/ - public function testUpdatedMessage() { - $message1 = $this->getMessage(); - $message2 = $this->getMessage(); - $message2['contribution_tracking_id'] = $message1['contribution_tracking_id']; - $message2['order_id'] = $message1['order_id']; - - $message1['payments_final_status'] = 'pending'; - $message2['payments_final_status'] = 'pending'; - unset( $message2['payment_method'] ); - - $this->consumer->processMessage( $message1 ); - $this->compareMessageWithDb( $message1 ); - - $this->consumer->processMessage( $message2 ); - $updated = array_merge( - $message1, $message2 - ); - $this->compareMessageWithDb( $updated ); - } - - protected function compareMessageWithDb( $message ) { - $dbEntries = $this->getDbEntries( - $message['contribution_tracking_id'], $message['order_id'] - ); - $this->assertEquals( 1, count( $dbEntries ) ); - $fields = array( - 'gateway', 'gateway_txn_id', 'validation_action', - 'payments_final_status', 'payment_method', 'payment_submethod', - 'country', 'amount', 'server' - ); - foreach ( $fields as $field ) { - $this->assertEquals( $message[$field], $dbEntries[0][$field] ); - } - $this->assertEquals( $message['currency'], $dbEntries[0]['currency_code'] ); - $this->assertEquals( - $message['date'], wmf_common_date_civicrm_to_unix( $dbEntries[0]['date']
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Rename 'fname' to normalized 'first_name'
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355141 ) Change subject: Rename 'fname' to normalized 'first_name' .. Rename 'fname' to normalized 'first_name' Bug: T165818 Change-Id: I8c68dfd464dd5befdd3ed42348986791411b60f6 --- A .idea/DonationInterface.iml A .idea/modules.xml A .idea/vcs.xml A .idea/workspace.xml M amazon_gateway/amazon.adapter.php M extension.json M gateway_common/DataValidator.php M gateway_common/DonationData.php M gateway_common/DonationQueue.php M gateway_common/DonorFullName.php M gateway_common/donation.api.php M gateway_common/gateway.adapter.php M gateway_common/i18n/country-specific/en.json M gateway_common/i18n/country-specific/fr.json M gateway_common/i18n/country-specific/pt.json M gateway_common/i18n/country-specific/qqq.json M gateway_common/i18n/interface/af.json M gateway_common/i18n/interface/aln.json M gateway_common/i18n/interface/ar.json M gateway_common/i18n/interface/arc.json M gateway_common/i18n/interface/arz.json M gateway_common/i18n/interface/ast.json M gateway_common/i18n/interface/az.json M gateway_common/i18n/interface/ba.json M gateway_common/i18n/interface/be-tarask.json M gateway_common/i18n/interface/be.json M gateway_common/i18n/interface/bg.json M gateway_common/i18n/interface/bn.json M gateway_common/i18n/interface/br.json M gateway_common/i18n/interface/bs.json M gateway_common/i18n/interface/ca.json M gateway_common/i18n/interface/cs.json M gateway_common/i18n/interface/cv.json M gateway_common/i18n/interface/cy.json M gateway_common/i18n/interface/da.json M gateway_common/i18n/interface/de.json M gateway_common/i18n/interface/diq.json M gateway_common/i18n/interface/dsb.json M gateway_common/i18n/interface/el.json M gateway_common/i18n/interface/en.json M gateway_common/i18n/interface/eo.json M gateway_common/i18n/interface/es.json M gateway_common/i18n/interface/et.json M gateway_common/i18n/interface/eu.json M gateway_common/i18n/interface/fa.json M gateway_common/i18n/interface/fi.json M gateway_common/i18n/interface/fr.json M gateway_common/i18n/interface/frp.json M gateway_common/i18n/interface/gl.json M gateway_common/i18n/interface/gsw.json M gateway_common/i18n/interface/he.json M gateway_common/i18n/interface/hi.json M gateway_common/i18n/interface/hr.json M gateway_common/i18n/interface/hsb.json M gateway_common/i18n/interface/hu.json M gateway_common/i18n/interface/hy.json M gateway_common/i18n/interface/ia.json M gateway_common/i18n/interface/id.json M gateway_common/i18n/interface/is.json M gateway_common/i18n/interface/it.json M gateway_common/i18n/interface/ja.json M gateway_common/i18n/interface/jv.json M gateway_common/i18n/interface/ka.json M gateway_common/i18n/interface/kk-cyrl.json M gateway_common/i18n/interface/km.json M gateway_common/i18n/interface/ko.json M gateway_common/i18n/interface/ksh.json M gateway_common/i18n/interface/ku-latn.json M gateway_common/i18n/interface/lb.json M gateway_common/i18n/interface/li.json M gateway_common/i18n/interface/lij.json M gateway_common/i18n/interface/lt.json M gateway_common/i18n/interface/lus.json M gateway_common/i18n/interface/lv.json M gateway_common/i18n/interface/map-bms.json M gateway_common/i18n/interface/mk.json M gateway_common/i18n/interface/ml.json M gateway_common/i18n/interface/mr.json M gateway_common/i18n/interface/ms.json M gateway_common/i18n/interface/mt.json M gateway_common/i18n/interface/nb.json M gateway_common/i18n/interface/nds-nl.json M gateway_common/i18n/interface/nds.json M gateway_common/i18n/interface/ne.json M gateway_common/i18n/interface/nl.json M gateway_common/i18n/interface/nn.json M gateway_common/i18n/interface/oc.json M gateway_common/i18n/interface/or.json M gateway_common/i18n/interface/pl.json M gateway_common/i18n/interface/pms.json M gateway_common/i18n/interface/ps.json M gateway_common/i18n/interface/pt-br.json M gateway_common/i18n/interface/pt.json M gateway_common/i18n/interface/qqq.json M gateway_common/i18n/interface/qu.json M gateway_common/i18n/interface/ro.json M gateway_common/i18n/interface/roa-tara.json M gateway_common/i18n/interface/ru.json M gateway_common/i18n/interface/rue.json M gateway_common/i18n/interface/sa.json M gateway_common/i18n/interface/sah.json M gateway_common/i18n/interface/sh.json M gateway_common/i18n/interface/si.json M gateway_common/i18n/interface/sk.json M gateway_common/i18n/interface/sl.json M gateway_common/i18n/interface/sq.json M gateway_common/i18n/interface/sr-ec.json M gateway_common/i18n/interface/sr-el.json M gateway_common/i18n/interface/sv.json M gateway_common/i18n/interface/sw.json M gateway_common/i18n/interface/ta.json M gateway_common/i18n/interface/te.json M gateway_common/i18n/interface/th.json M gateway_common/i18n/interface/tk.json M gateway_common/i18n/interface/tl.json M gateway_common/i18n/interface/tr.json M gateway_common/i18n/interface/tt-cyrl.json M
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface Submodule
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350640 ) Change subject: Update DonationInterface Submodule .. Update DonationInterface Submodule Change-Id: Iae9b7dbbab86989bf20094c2db40421c235931a3 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/350640/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 9177ae6..3969dd4 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 9177ae69a843e3139ff6d204cc23b1a741dcb57b +Subproject commit 3969dd4029d936429e84af540621b70292e35c39 -- To view, visit https://gerrit.wikimedia.org/r/350640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae9b7dbbab86989bf20094c2db40421c235931a3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ 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 b9c3d5e Fix paypal for...
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350639 ) Change subject: Merge branch 'master' into deployment b9c3d5e Fix paypal form settings .. Merge branch 'master' into deployment b9c3d5e Fix paypal form settings Change-Id: I95e91e6df50426caac989c06a65df1fd12cb948f --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/39/350639/1 -- To view, visit https://gerrit.wikimedia.org/r/350639 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95e91e6df50426caac989c06a65df1fd12cb948f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350606 ) Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: I9fa494f5afbeff491fcee2d60d9931ca95f43a0d --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/06/350606/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 5eeb709..9177ae6 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 5eeb709a71cf77cd0e0f45948fd5c23377c546b1 +Subproject commit 9177ae69a843e3139ff6d204cc23b1a741dcb57b -- To view, visit https://gerrit.wikimedia.org/r/350606 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fa494f5afbeff491fcee2d60d9931ca95f43a0d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ 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 3ea71cd Integration te...
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350601 ) Change subject: Merge branch 'master' into deployment 3ea71cd Integration test that the PayPal legacy gateway shows an error form rather than redirect. 9b27304 Remove deprecated function c80fbb1 Comments and todos 67453c2 Add paypal_ec to form settings 8405d8b Ingenico s .. Merge branch 'master' into deployment 3ea71cd Integration test that the PayPal legacy gateway shows an error form rather than redirect. 9b27304 Remove deprecated function c80fbb1 Comments and todos 67453c2 Add paypal_ec to form settings 8405d8b Ingenico server timeout fix Change-Id: I5cfb51bf480153b3f0f2ad16c27111dde487b937 --- D tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php D tests/phpunit/Adapter/PayPal/PayPalLegacyTest.php D tests/phpunit/includes/Responses/globalcollect/SET_PAYMENT_11000400.testresponse 3 files changed, 0 insertions(+), 969 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/01/350601/1 diff --git a/tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php b/tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php deleted file mode 100644 index 6b2b1ee..000 --- a/tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php +++ /dev/null @@ -1,602 +0,0 @@ -<<< HEAD (5eeb70 Update vendor) -=== -setMwGlobals( array( - 'wgGlobalCollectGatewayEnabled' => true, - 'wgDonationInterfaceAllowedHtmlForms' => array( - 'cc-vmad' => array( - 'gateway' => 'globalcollect', - 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), - 'countries' => array( - '+' => array( 'US', ), - ), - ), - ), - ) ); - } - - /** -* @param $name string The name of the test case -* @param $data array Any parameters read from a dataProvider -* @param $dataName string|int The name or index of the data set -*/ - function __construct( $name = null, array $data = array(), $dataName = '' ) { - parent::__construct( $name, $data, $dataName ); - $this->testAdapterClass = 'TestingGlobalCollectAdapter'; - } - - /** -* testnormalizeOrderID -* Non-exhaustive integration tests to verify that order_id -* normalization works as expected with different settings and -* conditions in theGlobalCollect adapter -* @covers GatewayAdapter::normalizeOrderID -*/ - public function testNormalizeOrderID() { - $request = $this->getDonorTestData(); - $externalData = $this->getDonorTestData(); - $session = array( 'Donor' => $this->getDonorTestData() ); - - //no order_id from anywhere, explicit no generate - $gateway = $this->getFreshGatewayObject( $externalData, array ( 'order_id_meta' => array ( 'generate' => FALSE ) ) ); - $this->assertFalse( $gateway->getOrderIDMeta( 'generate' ), 'The order_id meta generate setting override is not working properly. Deferred order_id generation may be broken.' ); - $this->assertNull( $gateway->getData_Unstaged_Escaped( 'order_id' ), 'Failed asserting that an absent order id is left as null, when not generating our own' ); - - //no order_id from anywhere, explicit generate - $gateway = $this->getFreshGatewayObject( $externalData, array ( 'order_id_meta' => array ( 'generate' => TRUE ) ) ); - $this->assertTrue( $gateway->getOrderIDMeta( 'generate' ), 'The order_id meta generate setting override is not working properly. Self order_id generation may be broken.' ); - $this->assertInternalType( 'numeric', $gateway->getData_Unstaged_Escaped( 'order_id' ), 'Generated order_id is not numeric, which it should be for GlobalCollect' ); - - // conflicting order_id in request and session, default GC generation - $request['order_id'] = '5'; - $session['Donor']['order_id'] = '4'; - $this->setUpRequest( $request, $session ); - $gateway = new TestingGlobalCollectAdapter(); - $this->assertEquals( '5', $gateway->getData_Unstaged_Escaped( 'order_id' ), 'GlobalCollect gateway is preferring session data over the request. Session should be secondary.' ); - - // conflicting order_id in request and session, garbage data in request, default GC generation - $request['order_id'] = 'nonsense!'; - $this->setUpRequest( $request,
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Merge branch 'master' into HEAD
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350599 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD 3ea71cd Integration test that the PayPal legacy gateway shows an error form rather than redirect. 9b27304 Remove deprecated function c80fbb1 Comments and todos 67453c2 Add paypal_ec to form settings 8405d8b Ingenico server timeout fix Change-Id: Ia23c9bd50e0ed221397d50c9bb990fe87d0891ad --- D tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php D tests/phpunit/Adapter/PayPal/PayPalLegacyTest.php D tests/phpunit/includes/Responses/globalcollect/SET_PAYMENT_11000400.testresponse 3 files changed, 0 insertions(+), 969 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/99/350599/1 diff --git a/tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php b/tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php deleted file mode 100644 index 6b2b1ee..000 --- a/tests/phpunit/Adapter/GlobalCollect/GlobalCollectTest.php +++ /dev/null @@ -1,602 +0,0 @@ -<<< HEAD (5eeb70 Update vendor) -=== -setMwGlobals( array( - 'wgGlobalCollectGatewayEnabled' => true, - 'wgDonationInterfaceAllowedHtmlForms' => array( - 'cc-vmad' => array( - 'gateway' => 'globalcollect', - 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), - 'countries' => array( - '+' => array( 'US', ), - ), - ), - ), - ) ); - } - - /** -* @param $name string The name of the test case -* @param $data array Any parameters read from a dataProvider -* @param $dataName string|int The name or index of the data set -*/ - function __construct( $name = null, array $data = array(), $dataName = '' ) { - parent::__construct( $name, $data, $dataName ); - $this->testAdapterClass = 'TestingGlobalCollectAdapter'; - } - - /** -* testnormalizeOrderID -* Non-exhaustive integration tests to verify that order_id -* normalization works as expected with different settings and -* conditions in theGlobalCollect adapter -* @covers GatewayAdapter::normalizeOrderID -*/ - public function testNormalizeOrderID() { - $request = $this->getDonorTestData(); - $externalData = $this->getDonorTestData(); - $session = array( 'Donor' => $this->getDonorTestData() ); - - //no order_id from anywhere, explicit no generate - $gateway = $this->getFreshGatewayObject( $externalData, array ( 'order_id_meta' => array ( 'generate' => FALSE ) ) ); - $this->assertFalse( $gateway->getOrderIDMeta( 'generate' ), 'The order_id meta generate setting override is not working properly. Deferred order_id generation may be broken.' ); - $this->assertNull( $gateway->getData_Unstaged_Escaped( 'order_id' ), 'Failed asserting that an absent order id is left as null, when not generating our own' ); - - //no order_id from anywhere, explicit generate - $gateway = $this->getFreshGatewayObject( $externalData, array ( 'order_id_meta' => array ( 'generate' => TRUE ) ) ); - $this->assertTrue( $gateway->getOrderIDMeta( 'generate' ), 'The order_id meta generate setting override is not working properly. Self order_id generation may be broken.' ); - $this->assertInternalType( 'numeric', $gateway->getData_Unstaged_Escaped( 'order_id' ), 'Generated order_id is not numeric, which it should be for GlobalCollect' ); - - // conflicting order_id in request and session, default GC generation - $request['order_id'] = '5'; - $session['Donor']['order_id'] = '4'; - $this->setUpRequest( $request, $session ); - $gateway = new TestingGlobalCollectAdapter(); - $this->assertEquals( '5', $gateway->getData_Unstaged_Escaped( 'order_id' ), 'GlobalCollect gateway is preferring session data over the request. Session should be secondary.' ); - - // conflicting order_id in request and session, garbage data in request, default GC generation - $request['order_id'] = 'nonsense!'; - $this->setUpRequest( $request, $session ); - $gateway = new TestingGlobalCollectAdapter(); - $this->assertEquals( '4', $gateway->getData_Unstaged_Escaped( 'order_id' ), 'GlobalCollect gateway is not ignoring nonsensical order_id
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: WIP Ingenico server timeout fix
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350277 ) Change subject: WIP Ingenico server timeout fix .. WIP Ingenico server timeout fix Recognize the error code and just try again. Bug: T157832 Change-Id: I4f496ca1655a09f0f6be4a405b0a8dbf93a4364b --- M gateway_common/gateway.adapter.php M globalcollect_gateway/globalcollect.adapter.php 2 files changed, 25 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/77/350277/1 diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index c65e6f3..59c0633 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -920,18 +920,27 @@ $retval = $this->do_transaction_internal( $transaction, $retryVars ); if ( !empty( $retryVars ) ) { - // TODO: Add more intelligence here. Right now we just assume it's the order_id + // TODO: Add more intelligence here. Right now timeout is the only one specifically + // handled, all other cases we just assume it's the order_id // and that it is totally OK to just reset it and reroll. + switch( $retryVars ) { + case 'timeout' : + // Just retry without changing anything. + $this->logger->info( "Repeating transaction for timeout" ); + break; - $this->logger->info( "Repeating transaction on request for vars: " . implode( ',', $retryVars ) ); + default : + $this->logger->info( "Repeating transaction on request for vars: " . implode( ',', $retryVars ) ); - // Force regen of the order_id - $this->regenerateOrderID(); + // Force regen of the order_id + $this->regenerateOrderID(); - // Pull anything changed from dataObj - $this->unstaged_data = $this->dataObj->getDataEscaped(); - $this->staged_data = $this->unstaged_data; - $this->stageData(); + // Pull anything changed from dataObj + $this->unstaged_data = $this->dataObj->getDataEscaped(); + $this->staged_data = $this->unstaged_data; + $this->stageData(); + break; + } } } while ( ( !empty( $retryVars ) ) && ( ++$retryCount < $loopCount ) ); diff --git a/globalcollect_gateway/globalcollect.adapter.php b/globalcollect_gateway/globalcollect.adapter.php index 3527c96..b253c79 100644 --- a/globalcollect_gateway/globalcollect.adapter.php +++ b/globalcollect_gateway/globalcollect.adapter.php @@ -1427,6 +1427,14 @@ //say something painful here. $errMsg = 'Blocking validation problems with this payment. Investigation required! ' . "Original error: '$messageFromProcessor'. Our data: " . $this->getLogDebugJSON(); + + case 11000400 : //Ingenico internal timeout, just try again as-is. + $retryVars[] = 'timeout'; + $this->logger->error( 'Server Timeout, retrying.' ); + $retErrCode = $errCode; + $retErrMsg = $errMsg; + break; + default: $this->logger->error( __FUNCTION__ . " Error $errCode : $errMsg" ); break; -- To view, visit https://gerrit.wikimedia.org/r/350277 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f496ca1655a09f0f6be4a405b0a8dbf93a4364b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into HEAD 8c1ab63 Fix EC recurring pro...
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348983 ) Change subject: Merge branch 'master' into HEAD 8c1ab63 Fix EC recurring profile creation .. Merge branch 'master' into HEAD 8c1ab63 Fix EC recurring profile creation Change-Id: I2fb8cd48d745f7930bfb88359dc156304958696f --- D PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created.json D PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created_transformed.json D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 3 files changed, 0 insertions(+), 227 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/83/348983/1 diff --git a/PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created.json b/PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created.json deleted file mode 100644 index 1cd1c71..000 --- a/PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "payment_cycle": "Monthly", - "txn_type": "recurring_payment_profile_created", - "last_name": "Fowl", - "next_payment_date": "03:00:00 May 18, 2017 PDT", - "residence_country": "US", - "initial_payment_amount": "0", - "rp_invoice_id": "47017286", - "currency_code": "JPY", - "time_created": "09:45:28 Apr 18, 2017 PDT", - "verify_sign": "ATZo1sTL1YpCR8SD-CzFolXviWIiAYV78oZbytx6QLNuI3z-KS8wKLqC", - "period_type": " Regular", - "payer_status": "unverified", - "tax": "0", - "payer_email": "do...@generous.net", - "first_name": "Fezziwig", - "receiver_email": "recei...@organization.org", - "payer_id": "8R297FE87CD8S", - "product_type": "1", - "shipping": "0", - "amount_per_cycle": "140", - "profile_status": "Active", - "charset": "UTF-8", - "notify_version": "3.8", - "amount": "140", - "outstanding_balance": "0", - "recurring_payment_id": "I-88J1M3DLSF0", - "product_name": "Monthly donation to the Wikimedia Foundation", - "ipn_track_id": "8999c084zz0f2" -} diff --git a/PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created_transformed.json b/PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created_transformed.json deleted file mode 100644 index 890f7dd..000 --- a/PaymentProviders/PayPal/Tests/Data/recurring_payment_profile_created_transformed.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "subscr_id": "I-88J1M3DLSF0", - "txn_type": "subscr_signup", - "contribution_tracking_id": "47017286", - "order_id": "47017286", - "email": "do...@generous.net", - "first_name": "Fezziwig", - "middle_name": "", - "last_name": "Fowl", - "frequency_interval": "1", - "frequency_unit": "month", - "installments": 0, - "create_date": 1492533928, - "start_date": 1492533928, - "date": 1492533928, - "gateway": "paypal_ec", - "recurring": "1", - "source_name": "SmashPig", - "source_type": "listener", - "source_version": "unknown" -} diff --git a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php deleted file mode 100644 index 64b7e2c..000 --- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php +++ /dev/null @@ -1,176 +0,0 @@ -<<< HEAD (3db064 Merge branch 'master' into deployment) -=== - 'donations', - 'express_checkout.json' => 'donations', - 'recurring_payment_profile_created.json' => 'recurring', - 'subscr_signup.json' => 'recurring', - 'subscr_payment.json' => 'recurring', - 'recurring_payment.json' => 'recurring', - 'refund.json' => 'refund', - 'refund_ec.json' => 'refund', - 'refund_recurring_ec.json' => 'refund', - 'chargeback_settlement.json' => 'refund', - // this should not actually get written to - // TODO 'new_case.json' => 'no-op', - ); - - public function setUp() { - parent::setUp(); - $this->config = PayPalTestConfiguration::get(); - - // php-queue\PDO complains about pop() from non-existent table - $this->config->object( 'data-store/jobs-paypal' ) - ->createTable( 'jobs-paypal' ); - - Context::initWithLogger( $this->config ); - } - - public function tearDown() { - self::$fail_verification = false; - self::$paypal_is_broken = false; - parent::tearDown(); - } - - public function messageProvider() { - $messages = array(); - foreach ( self::$message_data as $file => $type ) { - $payloadFile = __DIR__ . '/../Data/' . $file; - $messageData = array( - 'type' => $type, - 'payload' => json_decode( -
[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' into HEAD 8b6cd72 Pretend stomp never ...
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348767 ) Change subject: Merge branch 'master' into HEAD 8b6cd72 Pretend stomp never happened. d1f40e4 Test PP audit with CSV files 9c88317 Fix missing subscr id for ec recurring .. Merge branch 'master' into HEAD 8b6cd72 Pretend stomp never happened. d1f40e4 Test PP audit with CSV files 9c88317 Fix missing subscr id for ec recurring Change-Id: If6be58a5bcc3d75fdf74dcc572e081ff9b199ff3 --- D audit/paypal/tests/data/express_checkout_donation.csv D audit/paypal/tests/data/express_checkout_recurring_donation.csv D audit/paypal/tests/data/express_checkout_recurring_refund.csv D audit/paypal/tests/data/express_checkout_refund.csv D audit/paypal/tests/test_trr_file.py 5 files changed, 0 insertions(+), 292 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/67/348767/1 diff --git a/audit/paypal/tests/data/express_checkout_donation.csv b/audit/paypal/tests/data/express_checkout_donation.csv deleted file mode 100644 index 1c9add6..000 --- a/audit/paypal/tests/data/express_checkout_donation.csv +++ /dev/null @@ -1,2 +0,0 @@ -"CH","Transaction ID","Invoice ID","PayPal Reference ID","PayPal Reference ID Type","Transaction Event Code","Transaction Initiation Date","Transaction Completion Date","Transaction Debit or Credit","Gross Transaction Amount","Gross Transaction Currency","Fee Debit or Credit","Fee Amount","Fee Currency","Transactional Status","Insurance Amount","Sales Tax Amount","Shipping Amount","Transaction Subject","Transaction Note","Payer's Account ID","Payer Address Status","Item Name","Item ID","Option 1 Name","Option 1 Value","Option 2 Name","Option 2 Value","Auction Site","Auction Buyer ID","Auction Closing Date","Shipping Address Line1","Shipping Address Line2","Shipping Address City","Shipping Address State","Shipping Address Zip","Shipping Address Country","Shipping Method","Custom Field","Billing Address Line1","Billing Address Line2","Billing Address City","Billing Address State","Billing Address Zip","Billing Address Country","Consumer ID","First Name","Last Name","Consumer Business Name","Card Type","Payment Source","Shipping Name","Authorization Review Status","Protection Eligibility","Payment Tracking ID" -"SB","1V551844CE5526421","46239229.0","","","T0006",2017/03/02 09:59:55 -0800,2017/03/02 09:59:55 -0800,"CR",15000,"JPY","DR",4300,"JPY","S",,0,0,"Donation to the Wikimedia Foundation","","do...@generous.net","N","Donation to the Wikimedia Foundation","","","","","","","",,"","","","","","","","46239229","321 Notta Boulevard","","Whoville","OR","97211","US","RTWSDJI4S8DWK","Cindy Lou","Who","Cindy Lou Who","","Express Checkout","Cindy Lou, Who","01","02","" diff --git a/audit/paypal/tests/data/express_checkout_recurring_donation.csv b/audit/paypal/tests/data/express_checkout_recurring_donation.csv deleted file mode 100644 index 4232a33..000 --- a/audit/paypal/tests/data/express_checkout_recurring_donation.csv +++ /dev/null @@ -1,3 +0,0 @@ -"CH","Transaction ID","Invoice ID","PayPal Reference ID","PayPal Reference ID Type","Transaction Event Code","Transaction Initiation Date","Transaction Completion Date","Transaction Debit or Credit","Gross Transaction Amount","Gross Transaction Currency","Fee Debit or Credit","Fee Amount","Fee Currency","Transactional Status","Insurance Amount","Sales Tax Amount","Shipping Amount","Transaction Subject","Transaction Note","Payer's Account ID","Payer Address Status","Item Name","Item ID","Option 1 Name","Option 1 Value","Option 2 Name","Option 2 Value","Auction Site","Auction Buyer ID","Auction Closing Date","Shipping Address Line1","Shipping Address Line2","Shipping Address City","Shipping Address State","Shipping Address Zip","Shipping Address Country","Shipping Method","Custom Field","Billing Address Line1","Billing Address Line2","Billing Address City","Billing Address State","Billing Address Zip","Billing Address Country","Consumer ID","First Name","Last Name","Consumer Business Name","Card Type","Payment Source","Shipping Name","Authorization Review Status","Protection Eligibility","Payment Tracking ID" -"SB","4JH2438EE9876546W","45931681","I-SS5RD7POSD46","","T0002",2017/03/04 05:36:05 -0800,2017/03/04 05:36:05 -0800,"CR",15000,"JPY","DR",4300,"JPY","S",,,0,"Monthly donation to the Wikimedia Foundation","","do...@generous.net","N","Monthly donation to the Wikimedia Foundation","","","","","","","",,"","","","","","","","","","","","","","","RTWSDJI4S8DWK","Cindy Lou","Who","Cindy Lou Who","","Others","Cindy Lou, Who","01","02","" - diff --git a/audit/paypal/tests/data/express_checkout_recurring_refund.csv b/audit/paypal/tests/data/express_checkout_recurring_refund.csv deleted file mode 100644 index b8286f5..000 --- a/audit/paypal/tests/data/express_checkout_recurring_refund.csv +++ /dev/null
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into HEAD
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347882 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD 25ed2e0 Override configuration with specific instances 47791b0 Add source fields to arrays, not just objects ec158e5 Message normalization tests 6cd4d5b Shake up message normalization in PayPal job 426036b Add missing method visibility a7475f5 Add cURL wrapper 166c490 Base class for Ingenico payments without SDK c38daa7 Look up iDEAL banks without Ingenico SDK 66a2d08 Cache bank lookups via PSR-6 60ce15e View 'globalcollect' is just an alias for 'ingenico' d581a34 Factory for payment providers 41e7503 Get some static Config access out of Authenticator 945ad2c Reduce Configuration use in BankPaymentProvider cfa4c25 Make static method not abstract db153cb Throw a descendent of SmashPig exception on cURL fail 1fe70c8 Move Ingenico base API wrapper functions to own class 01a28b3 Ingenico API decodes JSON, throws exception on errors 4f6a141 Split error check into own function e1c653b PayPal subscription message normalization 5865960 Work around Memcache not expiring some things 4b293a3 Recurring Message Normalization. 6b74333 Hack to get availability straight from iDEAL 5abbd06 Headers default to empty array, not null 4053977 Use https endpoint for iDEAL availability d3270a9 Break out unofficial iDEAL status lookup f732d85 Cache directory lookup 404s ec6ea51 Use constants for HTTP status codes Change-Id: I3b1a786d877d77741de5029305d25fef3300a6d2 --- D PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php D PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php D PaymentProviders/Ingenico/Tests/Data/availability.response D PaymentProviders/Ingenico/Tests/Data/emptyDirectory.response D PaymentProviders/Ingenico/Tests/Data/productDirectory.response D PaymentProviders/Ingenico/Tests/phpunit/ApiTest.php D PaymentProviders/Ingenico/Tests/phpunit/AuthenticatorTest.php D PaymentProviders/Ingenico/Tests/phpunit/BankPaymentProviderTest.php D PaymentProviders/Ingenico/Tests/phpunit/IdealStatusProviderTest.php D PaymentProviders/PayPal/Tests/Data/express_checkout.json D PaymentProviders/PayPal/Tests/Data/express_checkout_transformed.json D PaymentProviders/PayPal/Tests/Data/recurring_payment.json D PaymentProviders/PayPal/Tests/Data/recurring_payment_transformed.json D PaymentProviders/PayPal/Tests/Data/refund_transformed.json D PaymentProviders/PayPal/Tests/Data/subscr_payment.json D PaymentProviders/PayPal/Tests/Data/subscr_payment_transformed.json D PaymentProviders/PayPal/Tests/Data/subscr_signup.json D PaymentProviders/PayPal/Tests/Data/subscr_signup_transformed.json D PaymentProviders/PayPal/Tests/Data/web_accept_transformed.json D PaymentProviders/PayPal/Tests/config_test.yaml D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php D Tests/BaseSmashPigUnitTestCase.php D Tests/ConfigurationTest.php D phpunit.xml 24 files changed, 0 insertions(+), 1,198 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/82/347882/1 diff --git a/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php b/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php deleted file mode 100644 index 4b576c1..000 --- a/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<<< HEAD (ab52db Merge branch 'master' into deployment) -=== -captureCompleted = $this->loadJson( __DIR__ . "/../Data/IPN/CaptureCompleted.json" ); - $this->captureDeclined = $this->loadJson( __DIR__ . "/../Data/IPN/CaptureDeclined.json" ); - $this->refundCompleted = $this->loadJson( __DIR__ . "/../Data/IPN/RefundCompleted.json" ); - $this->refundDeclined = $this->loadJson( __DIR__ . "/../Data/IPN/RefundDeclined.json" ); - } - - protected function normalizedToArray( $message ) { - return json_decode( $message->toJson(), true ); - } - - public function testNormalizeCaptureCompleted() { - $expected = array( - 'completion_message_id' => 'amazon-98765432-1', - 'contribution_tracking_id' => '98765432', - 'correlationId' => 'amazon-P01-000-000-00', - 'currency' => 'USD', - 'date' => 1357002061, - 'fee' => '0.0', - 'gateway' => 'amazon', - 'gateway_status' => 'Completed', - 'gateway_txn_id' => 'P01-000-000-00', - 'gross' => '10.0', - 'order_id' => '98765432-1', - 'payment_method' => 'amazon', - ); - $stripFields = array( - 'propertiesExportedAsKeys', -
[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Don't crash on missing ct_id
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347787 ) Change subject: Don't crash on missing ct_id .. Don't crash on missing ct_id Some records we'll ignore have none, let's not send failmail Change-Id: I1ab2e4d3485cd18839dfaed1f0aed17786005714 --- M audit/paypal/TrrFile.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: XenoRyet: Verified; Looks good to me, approved diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py index 25eab2c..d4a01eb 100644 --- a/audit/paypal/TrrFile.py +++ b/audit/paypal/TrrFile.py @@ -145,7 +145,7 @@ # Here it can be the ct_id.attempt format out['contribution_tracking_id'] = row['Invoice ID'].split('.')[0] -if out['contribution_tracking_id']: +if 'contribution_tracking_id' in out: out['order_id'] = out['contribution_tracking_id'] event_type = row['Transaction Event Code'][0:3] -- To view, visit https://gerrit.wikimedia.org/r/347787 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ab2e4d3485cd18839dfaed1f0aed17786005714 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: XenoRyet ___ 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 HEAD
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347687 ) Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD 7042a8f Stop denormalizing paypal recurring messages in audit 62234f2 Cast a wider net when searching for ct_id 45a7d5b Fix dictionary comparison 95c633e Mark express checkout refunds with correct gateway Change-Id: Ia969f70dac03ba30a2d3140bcbb5cfadb6d9d73b --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/87/347687/1 -- To view, visit https://gerrit.wikimedia.org/r/347687 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia969f70dac03ba30a2d3140bcbb5cfadb6d9d73b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: deploy Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Use correct UDP_LOG_PATH
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347131 ) Change subject: Use correct UDP_LOG_PATH .. Use correct UDP_LOG_PATH From django.conf.settings, not default fundraiser.settings Change-Id: I6b9e1b1f74a78a985724cd2dee0cf853d8c796ea --- M fundraiser/analytics/management/commands/AggregateBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions.py M fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py M fundraiser/analytics/management/commands/LoadLPImpressions.py 4 files changed, 10 insertions(+), 11 deletions(-) Approvals: XenoRyet: Verified; Looks good to me, approved diff --git a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py index 2b7a010..8edb4a6 100644 --- a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py +++ b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py @@ -10,7 +10,6 @@ from fundraiser.analytics.functions import * from fundraiser.analytics.models import * from fundraiser.analytics.regex import * -from fundraiser.settings import UDP_LOG_PATH class Command(BaseCommand): @@ -147,4 +146,4 @@ except Exception as e: transaction.rollback('default') -raise e \ No newline at end of file +raise e diff --git a/fundraiser/analytics/management/commands/LoadBannerImpressions.py b/fundraiser/analytics/management/commands/LoadBannerImpressions.py index 0e748e9..fa92580 100644 --- a/fundraiser/analytics/management/commands/LoadBannerImpressions.py +++ b/fundraiser/analytics/management/commands/LoadBannerImpressions.py @@ -16,7 +16,7 @@ from fundraiser.analytics.functions import * from fundraiser.analytics.models import * from fundraiser.analytics.regex import * -from fundraiser.settings import UDP_LOG_PATH +from django.conf import settings class Command(BaseCommand): @@ -87,8 +87,8 @@ now = "beaconImpressions-sampled*.tsv-%s*" % time_now.strftime("%Y%m%d-%H") pasthour = "beaconImpressions-sampled*.tsv-%s*" % time_minus1hr.strftime("%Y%m%d-%H") -now_glob = os.path.join(UDP_LOG_PATH, time_now.strftime("%Y"), now) -pasthour_glob = os.path.join(UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour) +now_glob = os.path.join(settings.UDP_LOG_PATH, time_now.strftime("%Y"), now) +pasthour_glob = os.path.join(settings.UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour) self.logger.info("Checking for files matching '{now}' or '{pasthour}'".format(now=now_glob, pasthour=pasthour_glob)) diff --git a/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py b/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py index e86e267..ee83ede 100644 --- a/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py +++ b/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py @@ -18,7 +18,7 @@ from fundraiser.analytics.functions import * from fundraiser.analytics.models import * from fundraiser.analytics.regex import * -from fundraiser.settings import UDP_LOG_PATH +from django.conf import settings class Command(BaseCommand): @@ -85,8 +85,8 @@ now = "beaconImpressions-sampled*.tsv-%s*" % time_now.strftime("%Y%m%d-%H") pasthour = "beaconImpressions-sampled*.tsv-%s*" % time_minus1hr.strftime("%Y%m%d-%H") -files.extend(glob.glob(os.path.join(UDP_LOG_PATH, time_now.strftime("%Y"), now))) -files.extend(glob.glob(os.path.join(UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour))) +files.extend(glob.glob(os.path.join(settings.UDP_LOG_PATH, time_now.strftime("%Y"), now))) +files.extend(glob.glob(os.path.join(settings.UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour))) else: if os.path.isdir(filename): self.logger.info("Processing directory") diff --git a/fundraiser/analytics/management/commands/LoadLPImpressions.py b/fundraiser/analytics/management/commands/LoadLPImpressions.py index 43eca31..3ee30d6 100644 --- a/fundraiser/analytics/management/commands/LoadLPImpressions.py +++ b/fundraiser/analytics/management/commands/LoadLPImpressions.py @@ -17,7 +17,7 @@ from fundraiser.analytics.functions import * from fundraiser.analytics.models import * from fundraiser.analytics.regex import * -from fundraiser.settings import UDP_LOG_PATH +from django.conf import settings class Command(BaseCommand): @@ -94,8 +94,8 @@ now = "landingpages.tsv-%s*" % time_now.strftime("%Y%m%d-%H") pasthour = "landingpages.tsv-%s*" % time_minus1hr.strftime("%Y%m%d-%H") -
[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Add debugging output to recent file parsing
XenoRyet has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347125 ) Change subject: Add debugging output to recent file parsing .. Add debugging output to recent file parsing FIXME: DRY Change-Id: I8ae01cf3eb93b3d68867fff43a5675af43c91387 --- M fundraiser/analytics/management/commands/LoadBannerImpressions.py M fundraiser/analytics/management/commands/LoadLPImpressions.py 2 files changed, 19 insertions(+), 4 deletions(-) Approvals: XenoRyet: Verified; Looks good to me, approved diff --git a/fundraiser/analytics/management/commands/LoadBannerImpressions.py b/fundraiser/analytics/management/commands/LoadBannerImpressions.py index dfc6026..0e748e9 100644 --- a/fundraiser/analytics/management/commands/LoadBannerImpressions.py +++ b/fundraiser/analytics/management/commands/LoadBannerImpressions.py @@ -81,14 +81,20 @@ files = [] if recent: +self.logger.info("Processing recent files") time_now = datetime.now() time_minus1hr = time_now - timedelta(hours=1) now = "beaconImpressions-sampled*.tsv-%s*" % time_now.strftime("%Y%m%d-%H") pasthour = "beaconImpressions-sampled*.tsv-%s*" % time_minus1hr.strftime("%Y%m%d-%H") +now_glob = os.path.join(UDP_LOG_PATH, time_now.strftime("%Y"), now) +pasthour_glob = os.path.join(UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour) -files.extend(glob.glob(os.path.join(UDP_LOG_PATH, time_now.strftime("%Y"), now))) -files.extend(glob.glob(os.path.join(UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour))) +self.logger.info("Checking for files matching '{now}' or '{pasthour}'".format(now=now_glob, pasthour=pasthour_glob)) + +files.extend(glob.glob(now_glob)) +files.extend(glob.glob(pasthour_glob)) + else: if os.path.isdir(filename): self.logger.info("Processing directory") @@ -98,6 +104,8 @@ self.logger.info("Processing files matching %s" % filename) files = glob.glob(filename) +self.logger.info("Examining {num} files".format(num=len(files))) + for f in sorted(files): path, filename_only = f.rsplit('/', 1) if not os.path.isdir(f): diff --git a/fundraiser/analytics/management/commands/LoadLPImpressions.py b/fundraiser/analytics/management/commands/LoadLPImpressions.py index fcb32eb..43eca31 100644 --- a/fundraiser/analytics/management/commands/LoadLPImpressions.py +++ b/fundraiser/analytics/management/commands/LoadLPImpressions.py @@ -88,14 +88,19 @@ files = [] if self.recent: +self.logger.info("Processing recent files") time_now = datetime.now() time_minus1hr = time_now - timedelta(hours=1) now = "landingpages.tsv-%s*" % time_now.strftime("%Y%m%d-%H") pasthour = "landingpages.tsv-%s*" % time_minus1hr.strftime("%Y%m%d-%H") +now_glob = os.path.join(UDP_LOG_PATH, time_now.strftime("%Y"), now) +pasthour_glob = os.path.join(UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour) -files.extend(glob.glob(os.path.join(UDP_LOG_PATH, time_now.strftime("%Y"), now))) -files.extend(glob.glob(os.path.join(UDP_LOG_PATH, time_minus1hr.strftime("%Y"), pasthour))) +self.logger.info("Checking for files matching '{now}' or '{pasthour}'".format(now=now_glob, pasthour=pasthour_glob)) + +files.extend(glob.glob(now_glob)) +files.extend(glob.glob(pasthour_glob)) else: if os.path.isdir(filename): self.logger.info("Processing directory") @@ -105,6 +110,8 @@ self.logger.info("Processing files matching %s" % filename) files = glob.glob(filename) +self.logger.info("Examining {num} files".format(num=len(files))) + for f in files: path, filename_only = f.rsplit('/', 1) if not os.path.isdir(f): -- To view, visit https://gerrit.wikimedia.org/r/347125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ae01cf3eb93b3d68867fff43a5675af43c91387 Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/tools/DjangoBannerStats Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: XenoRyet ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Mark refunds with correct gateway
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345189 ) Change subject: Mark refunds with correct gateway .. Mark refunds with correct gateway Express checkout sets the transaction_subject field to an explicit description Legacy puts a tracking number in that field, we can use that to distinguish the proper gateway. Bug: T161121 Change-Id: Ibf14e1083b92d3caa50066315256b6614e77af9c --- M PaymentProviders/PayPal/RefundMessage.php 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/89/345189/1 diff --git a/PaymentProviders/PayPal/RefundMessage.php b/PaymentProviders/PayPal/RefundMessage.php index cbac123..530f132 100644 --- a/PaymentProviders/PayPal/RefundMessage.php +++ b/PaymentProviders/PayPal/RefundMessage.php @@ -13,6 +13,14 @@ } else { $message['type'] = 'refund'; } - $message['gateway'] = 'paypal'; + + // Express checkout puts a description in transaction_subject, Legacy puts a contribution + // tracking ID there. Chargebacks don't set the field at all. + if ( isset( $ipnMessage['transaction_subject'] ) && stripos( $ipnMessage['transaction_subject'], 'donation' ) ) { + $message['gateway'] = 'paypal_ec'; + } else { + $message['gateway'] = 'paypal'; + } + } } -- To view, visit https://gerrit.wikimedia.org/r/345189 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf14e1083b92d3caa50066315256b6614e77af9c Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: WIP recurring Message Normalization.
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/343324 ) Change subject: WIP recurring Message Normalization. .. WIP recurring Message Normalization. Bug: T157074 Change-Id: I983e4010eebaf499f334a0f0ebb6d12e76a2ad18 --- M PaymentProviders/PayPal/RecurringMessage.php A PaymentProviders/PayPal/Tests/Data/recurring_payment.json A PaymentProviders/PayPal/Tests/Data/recurring_payment_transformed.json M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 4 files changed, 149 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/24/343324/1 diff --git a/PaymentProviders/PayPal/RecurringMessage.php b/PaymentProviders/PayPal/RecurringMessage.php index d19c778..10930bd 100644 --- a/PaymentProviders/PayPal/RecurringMessage.php +++ b/PaymentProviders/PayPal/RecurringMessage.php @@ -5,6 +5,83 @@ class RecurringMessage extends Message { public static function normalizeMessage( &$message, $ipnMessage ) { - // TODO: Implement normalizeMessage() method. + $message['recurring'] = "1"; + + if ( isset( $ipnMessage['payment_date'] ) ) { + $message['date'] = strtotime( $ipnMessage['payment_date'] ); + } + + // the subscription id + $message['subscr_id'] = $ipnMessage['recurring_payment_id']; + $message['txn_type'] = $ipnMessage['txn_type']; + $message['email'] = $ipnMessage['payer_email']; + + // Contact info + if ( $ipnMessage['txn_type'] === 'recurring_payment_profile_created' || $ipnMessage['txn_type'] === 'recurring_payment' ) { + $message['first_name'] = $ipnMessage['first_name']; + $message['middle_name'] = ''; + $message['last_name'] = $ipnMessage['last_name']; + + if ( isset( $ipnMessage['address_street'] ) ) { + $split = explode("\n", str_replace("\r", '', $ipnMessage['address_street'])); + $message['street_address'] = $split[0]; + if ( count( $split ) > 1 ) { + $message['supplemental_address_1'] = $split[1]; + } + $message['city'] = $ipnMessage['address_city']; + $message['state_province'] = $ipnMessage['address_state']; + $message['country'] = $ipnMessage['address_country_code']; + $message['postal_code'] = $ipnMessage['address_zip']; + + } elseif ( isset( $ipnMessage['residence_country'] ) ) { + $message['country'] = $ipnMessage['residence_country']; + } + } + + // payment-specific message handling + if ( $ipnMessage['txn_type'] == 'recurring_payment' ) { + + $message['gateway_txn_id'] = $ipnMessage['txn_id']; + $message['currency'] = $ipnMessage['mc_currency']; + $message['gross'] = $ipnMessage['mc_gross']; + $message['fee'] = $ipnMessage['mc_fee']; + } else { + + // break the period out for civicrm + if( $ipnMessage['payment_cycle'] == 'Monthly' ) { + + $message['frequency_interval'] = '1'; + $message['frequency_unit'] = 'month'; + } + + $message['installments'] = 0; + + + if ( isset( $ipnMessage['amount_per_cycle'] ) ) { + $message['gross'] = $ipnMessage['amount_per_cycle']; + } + + if ( isset( $ipnMessage['currency_code'] ) ) { + $message['currency'] = $ipnMessage['currency_code']; + } + + if ( isset( $ipnMessage['time_created'] ) ) { + if ( $ipnMessage['txn_type'] == 'time_created' ) { + $message['create_date'] = strtotime( $ipnMessage['time_created'] ); + $message['start_date'] = strtotime( $ipnMessage['time_created'] ); + } + if ( !isset( $message['date'] ) ) { + $message['date'] = strtotime( $ipnMessage['time_created'] ); + } + } + + } + + $message['gateway'] = 'paypal'; + + if ( !isset( $message['date'] ) ) { + $message['date'] = time();
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: PayPal subscription message normalization
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/341595 ) Change subject: PayPal subscription message normalization .. PayPal subscription message normalization Normalize subscr_ messages in SmashPig instead of the consumer. Bug: T107372 Change-Id: I03c0124b05988370f66ce2464a7fe77864c0f16d --- M PaymentProviders/PayPal/SubscriptionMessage.php M PaymentProviders/PayPal/Tests/Data/subscr_payment.json M PaymentProviders/PayPal/Tests/Data/subscr_payment_transformed.json M PaymentProviders/PayPal/Tests/Data/subscr_signup.json M PaymentProviders/PayPal/Tests/Data/subscr_signup_transformed.json 5 files changed, 168 insertions(+), 80 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/95/341595/1 diff --git a/PaymentProviders/PayPal/SubscriptionMessage.php b/PaymentProviders/PayPal/SubscriptionMessage.php index c825baf..ddaac7a 100644 --- a/PaymentProviders/PayPal/SubscriptionMessage.php +++ b/PaymentProviders/PayPal/SubscriptionMessage.php @@ -5,7 +5,126 @@ class SubscriptionMessage extends Message { public static function normalizeMessage( &$message, $ipnMessage ) { - // Preserve existing logic for now - $message = $ipnMessage; + + $message[ 'recurring' ] = true; + + if ( isset( $ipnMessage['payment_date'] ) ) { + $message['date'] = strtotime( $ipnMessage['payment_date'] ); + } + + // the subscription id + $message[ 'subscr_id' ] = $ipnMessage[ 'subscr_id' ]; + $message[ 'txn_type' ] = $ipnMessage[ 'txn_type' ]; + $message[ 'email' ] = $ipnMessage[ 'payer_email' ]; + + // Premium info + if ( isset( $ipnMessage[ 'option_selection1' ] ) && !is_numeric( $ipnMessage[ 'option_selection1' ] ) ) { + $message[ 'size' ] = $ipnMessage[ 'option_selection1' ]; + $message[ 'premium_language' ] = $ipnMessage[ 'option_selection2' ]; + } + + // Contact info + if ( $ipnMessage[ 'txn_type' ] == 'subscr_signup' || $ipnMessage[ 'txn_type' ] == 'subscr_payment' || $ipnMessage[ 'txn_type' ] == 'subscr_modify' ) { + $message[ 'first_name' ] = $ipnMessage[ 'first_name' ]; + $message[ 'middle_name' ] = ''; + $message[ 'last_name' ] = $ipnMessage[ 'last_name' ]; + + if ( isset( $ipnMessage['address_street'] ) ) { + $split = explode("\n", str_replace("\r", '', $ipnMessage[ 'address_street' ])); + $message[ 'street_address' ] = $split[0]; + if ( count( $split ) > 1 ) { + $message[ 'supplemental_address_1' ] = $split[1]; + } + $message[ 'city' ] = $ipnMessage[ 'address_city' ]; + $message[ 'state_province' ] = $ipnMessage[ 'address_state' ]; + $message[ 'country' ] = $ipnMessage[ 'address_country_code' ]; + $message[ 'postal_code' ] = $ipnMessage[ 'address_zip' ]; + + } elseif ( isset( $ipnMessage['residence_country'] ) ) { + $message['country'] = $ipnMessage['residence_country']; + } + } + + // payment-specific message handling + if ( $ipnMessage[ 'txn_type' ] == 'subscr_payment' ) { + + $message[ 'gateway_txn_id' ] = $ipnMessage[ 'txn_id' ]; + $message[ 'currency' ] = $ipnMessage[ 'mc_currency' ]; + $message[ 'gross' ] = $ipnMessage[ 'mc_gross' ]; + $message[ 'fee' ] = $ipnMessage[ 'mc_fee' ]; + $message[ 'gross' ] = $ipnMessage[ 'mc_gross' ]; + $message[ 'net' ] = $message[ 'gross' ] - $message[ 'fee' ]; + } else { + + // break the period out for civicrm + if( isset( $ipnMessage[ 'period3' ] ) ) { + // map paypal period unit to civicrm period units + $period_map = array( + 'm' => 'month', + 'd' => 'day', + 'w' => 'week', + 'y' => 'year', + ); + + $period = explode( " ", $ipnMessage[ 'period3' ] ); + $message[ 'frequency_interval' ] = $period[0]; + $message[ 'frequency_unit' ] = $period_map[ strtolower( $period[1]
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface Submodule
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/338155 ) Change subject: Update DonationInterface Submodule .. Update DonationInterface Submodule Change-Id: I187d1a7adc6c3a15a4c118eb54e4dc97473b24f2 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/55/338155/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 8f77a9a..2ed2936 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 8f77a9a000e14f8cb2ee02cc260641d8566e5a37 +Subproject commit 2ed29366478323d5ad22506b87d550284e728c47 -- To view, visit https://gerrit.wikimedia.org/r/338155 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I187d1a7adc6c3a15a4c118eb54e4dc97473b24f2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/338147 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 9a00562 Use mediawiki cache for IP Velocity 3996eb5 Add recurring flag to PayPal Return URL 761f3ee Add argument to setGatewayDefaults base function 70d1a1a Add payment method to PayPal EC 3104b69 Update exchange rates b2eb6b6 Fix a couple comments Change-Id: I413405481974bc6907b0e114791222d2b5ecf4b9 --- D tests/phpunit/includes/test_gateway/TestingGenericAdapter.php 1 file changed, 0 insertions(+), 117 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/47/338147/1 diff --git a/tests/phpunit/includes/test_gateway/TestingGenericAdapter.php b/tests/phpunit/includes/test_gateway/TestingGenericAdapter.php deleted file mode 100644 index 7b5ba45..000 --- a/tests/phpunit/includes/test_gateway/TestingGenericAdapter.php +++ /dev/null @@ -1,117 +0,0 @@ -<<< HEAD (8f77a9 Merge branch 'master' into deployment) -=== -errorsForRevalidate ) ) { - $fakeErrors = $this->errorsForRevalidate[$this->revalidateCount]; - if ( $fakeErrors !== null ) { - $this->revalidateCount++; - $this->setValidationErrors( $fakeErrors ); - return empty( $fakeErrors ); - } - } - return parent::revalidate($check_not_empty); - } - - public function normalizeOrderID( $override = null, $dataObj = null ) { - return '12345'; - } - - public static function getGlobal( $name ) { - if ( array_key_exists( $name, TestingGenericAdapter::$fakeGlobals ) ) { - return TestingGenericAdapter::$fakeGlobals[$name]; - } - return parent::getGlobal( $name ); - } - - public static function getIdentifier() { - if ( self::$fakeIdentifier ) { - return self::$fakeIdentifier; - } - return GatewayAdapter::getIdentifier(); - } - - public function loadConfig() { - } - - public function defineAccountInfo() { - } - - public function defineDataConstraints() { - } - - public function defineErrorMap() { - } - - public function defineOrderIDMeta() { - } - - public function definePaymentMethods() { - } - - public function defineReturnValueMap() { - } - - public function defineTransactions() { - } - - public function defineDataTransformers() { - $this->data_transformers = parent::getCoreDataTransformers(); - } - - public function defineVarMap() { - } - - public function setGatewayDefaults( $options = array() ) { - } - - public function getCurrencies( $options = array() ) { - return TestingGenericAdapter::$acceptedCurrencies; - } - - public function doPayment() { - } - - protected function getBasedir() { - return __DIR__; - } -} ->>> BRANCH (b2eb6b Fix a couple comments) -- To view, visit https://gerrit.wikimedia.org/r/338147 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I413405481974bc6907b0e114791222d2b5ecf4b9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Merge branch 'master' into deployment
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/338144 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 9a00562 Use mediawiki cache for IP Velocity 3996eb5 Add recurring flag to PayPal Return URL 761f3ee Add argument to setGatewayDefaults base function 70d1a1a Add payment method to PayPal EC 3104b69 Update exchange rates b2eb6b6 Fix a couple comments Change-Id: I413405481974bc6907b0e114791222d2b5ecf4b9 --- D tests/phpunit/includes/test_gateway/TestingGenericAdapter.php 1 file changed, 0 insertions(+), 117 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/44/338144/1 diff --git a/tests/phpunit/includes/test_gateway/TestingGenericAdapter.php b/tests/phpunit/includes/test_gateway/TestingGenericAdapter.php deleted file mode 100644 index 7b5ba45..000 --- a/tests/phpunit/includes/test_gateway/TestingGenericAdapter.php +++ /dev/null @@ -1,117 +0,0 @@ -<<< HEAD (8f77a9 Merge branch 'master' into deployment) -=== -errorsForRevalidate ) ) { - $fakeErrors = $this->errorsForRevalidate[$this->revalidateCount]; - if ( $fakeErrors !== null ) { - $this->revalidateCount++; - $this->setValidationErrors( $fakeErrors ); - return empty( $fakeErrors ); - } - } - return parent::revalidate($check_not_empty); - } - - public function normalizeOrderID( $override = null, $dataObj = null ) { - return '12345'; - } - - public static function getGlobal( $name ) { - if ( array_key_exists( $name, TestingGenericAdapter::$fakeGlobals ) ) { - return TestingGenericAdapter::$fakeGlobals[$name]; - } - return parent::getGlobal( $name ); - } - - public static function getIdentifier() { - if ( self::$fakeIdentifier ) { - return self::$fakeIdentifier; - } - return GatewayAdapter::getIdentifier(); - } - - public function loadConfig() { - } - - public function defineAccountInfo() { - } - - public function defineDataConstraints() { - } - - public function defineErrorMap() { - } - - public function defineOrderIDMeta() { - } - - public function definePaymentMethods() { - } - - public function defineReturnValueMap() { - } - - public function defineTransactions() { - } - - public function defineDataTransformers() { - $this->data_transformers = parent::getCoreDataTransformers(); - } - - public function defineVarMap() { - } - - public function setGatewayDefaults( $options = array() ) { - } - - public function getCurrencies( $options = array() ) { - return TestingGenericAdapter::$acceptedCurrencies; - } - - public function doPayment() { - } - - protected function getBasedir() { - return __DIR__; - } -} ->>> BRANCH (b2eb6b Fix a couple comments) -- To view, visit https://gerrit.wikimedia.org/r/338144 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I413405481974bc6907b0e114791222d2b5ecf4b9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Add payment method to PayPal EC
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/336888 ) Change subject: Add payment method to PayPal EC .. Add payment method to PayPal EC Bug: T157618 Change-Id: I6e07389e9f2dcab292b436d9b9ebd90ab4777adb --- M paypal_gateway/express_checkout/paypal_express.adapter.php 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/88/336888/1 diff --git a/paypal_gateway/express_checkout/paypal_express.adapter.php b/paypal_gateway/express_checkout/paypal_express.adapter.php index 8573b72..b12472c 100644 --- a/paypal_gateway/express_checkout/paypal_express.adapter.php +++ b/paypal_gateway/express_checkout/paypal_express.adapter.php @@ -79,6 +79,14 @@ ); } + function setGatewayDefaults( $options = array ( ) ) { + if ( $this->getData_Unstaged_Escaped( 'payment_method' ) == null ) { + $this->addRequestData( + array( 'payment_method' => 'paypal' ) + ); + } + } + public function getCurlBaseOpts() { $opts = parent::getCurlBaseOpts(); -- To view, visit https://gerrit.wikimedia.org/r/336888 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e07389e9f2dcab292b436d9b9ebd90ab4777adb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Add argument to setGatewayDefaults base function
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/336683 ) Change subject: Add argument to setGatewayDefaults base function .. Add argument to setGatewayDefaults base function Adapters are using an argument, but the base interface didn't have one. Fixing that. Bug: T157618 Change-Id: Ic7de71c48a91587a6eb2b06959d08e6a76867ab4 --- M gateway_common/GatewayType.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/83/336683/1 diff --git a/gateway_common/GatewayType.php b/gateway_common/GatewayType.php index c31e840..f6d66d8 100644 --- a/gateway_common/GatewayType.php +++ b/gateway_common/GatewayType.php @@ -163,7 +163,7 @@ * DO NOT set default payment information here (or anywhere, really). * That would be naughty. */ - function setGatewayDefaults(); + function setGatewayDefaults( $options = array() ); /** * @param array $options If given, try to filter supported currencies by: -- To view, visit https://gerrit.wikimedia.org/r/336683 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7de71c48a91587a6eb2b06959d08e6a76867ab4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Add recurring flag to PayPal Return URL
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/33 ) Change subject: Add recurring flag to PayPal Return URL .. Add recurring flag to PayPal Return URL Bug: T153720 Change-Id: Ibe3ac758230d6600bc289c863abc21981197e76b --- M paypal_gateway/express_checkout/PaypalExpressReturnUrl.php 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/66/33/1 diff --git a/paypal_gateway/express_checkout/PaypalExpressReturnUrl.php b/paypal_gateway/express_checkout/PaypalExpressReturnUrl.php index dbd1985..314c19e 100644 --- a/paypal_gateway/express_checkout/PaypalExpressReturnUrl.php +++ b/paypal_gateway/express_checkout/PaypalExpressReturnUrl.php @@ -3,9 +3,15 @@ class PaypalExpressReturnUrl implements StagingHelper { public function stage( GatewayType $adapter, $normalized, &$staged ) { $returnTitle = Title::newFromText( 'Special:PaypalExpressGatewayResult' ); - $staged['returnto'] = $returnTitle->getFullURL( array( + + $querySringParams = array( 'order_id' => $normalized['order_id'], 'wmf_token' => $adapter->token_getSaltedSessionToken(), - ), false, PROTO_CURRENT ); + ); + if ( $normalized['recurring'] ){ + $querySringParams['recurring'] = 1; + } + + $staged['returnto'] = $returnTitle->getFullURL( $querySringParams, false, PROTO_CURRENT ); } } -- To view, visit https://gerrit.wikimedia.org/r/33 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe3ac758230d6600bc289c863abc21981197e76b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/326542 ) Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: I811ea7939ff14840763d0c4adf7aaf948679a8f7 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/42/326542/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 8640b41..ea03d94 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 8640b41c1b4f40c20e194b3fa3f1595aada70f0c +Subproject commit ea03d946fec317ab4e382db1854d826633e909e8 -- To view, visit https://gerrit.wikimedia.org/r/326542 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I811ea7939ff14840763d0c4adf7aaf948679a8f7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/326541 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 36e0d6d Adyen form for Canada Change-Id: I2dee95f6b31c607ba4e87c42a6b2a6f525377a33 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/41/326541/1 -- To view, visit https://gerrit.wikimedia.org/r/326541 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dee95f6b31c607ba4e87c42a6b2a6f525377a33 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Merge branch 'master' into deployment
XenoRyet has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/326537 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 36e0d6d Adyen form for Canada Change-Id: I2dee95f6b31c607ba4e87c42a6b2a6f525377a33 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/37/326537/1 -- To view, visit https://gerrit.wikimedia.org/r/326537 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dee95f6b31c607ba4e87c42a6b2a6f525377a33 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Adyen form for Canada
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/325604 Change subject: Adyen form for Canada .. Adyen form for Canada Sets up the Adyen form for Canada with city and province fields removed. Requires a civi patch to backfill that data, similar to the US Adyen form. Bug: T152122 Change-Id: I3e827b30f8a8d580fd56d081bfad9ab29e361bbd --- M adyen_gateway/config/country_fields.yaml M adyen_gateway/config/payment_submethods.yaml 2 files changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/04/325604/1 diff --git a/adyen_gateway/config/country_fields.yaml b/adyen_gateway/config/country_fields.yaml index 4f89f1b..04bbae0 100644 --- a/adyen_gateway/config/country_fields.yaml +++ b/adyen_gateway/config/country_fields.yaml @@ -1,9 +1,12 @@ AU: state: true CA: -address: true +street: true +zip: true GB: address: true US: street: true zip: true + + diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index 704ab97..2a980f7 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -5,6 +5,7 @@ logo: card-cb-lg.png visa: countries: +CA: true FR: true GB: true IL: true @@ -21,6 +22,7 @@ logo: card-jcb-lg.png mc: countries: +CA: true FR: true GB: true IL: true @@ -31,6 +33,7 @@ logo: card-mc-lg.png amex: countries: +CA: true FR: true GB: true IL: true -- To view, visit https://gerrit.wikimedia.org/r/325604 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e827b30f8a8d580fd56d081bfad9ab29e361bbd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/323237 Change subject: Update DonationInterface Submodule .. Update DonationInterface Submodule Change-Id: I7c582a03fd3ec1d82a2183adda7bb17bd3008bcd --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/37/323237/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 28faacb..44e4a8a 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 28faacbbd565e68eed5e221a376acdac1e130f44 +Subproject commit 44e4a8a9ca5ebadf26ccefe4daf0eb022078e15b -- To view, visit https://gerrit.wikimedia.org/r/323237 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c582a03fd3ec1d82a2183adda7bb17bd3008bcd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/323235 Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 100afb1 Crappy workaround for zip / postal_code mismatch Change-Id: I6bcc3635750ddadff7ee7592d0f9b31f78f55bc7 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/35/323235/1 -- To view, visit https://gerrit.wikimedia.org/r/323235 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6bcc3635750ddadff7ee7592d0f9b31f78f55bc7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Adyen US form without address fields
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/319414 Change subject: Adyen US form without address fields .. Adyen US form without address fields Change-Id: I338ec025cac4772a9be620513eb14b77b07ae56e --- M adyen_gateway/config/country_fields.yaml 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/14/319414/1 diff --git a/adyen_gateway/config/country_fields.yaml b/adyen_gateway/config/country_fields.yaml index 4d1d3a4..bce49bf 100644 --- a/adyen_gateway/config/country_fields.yaml +++ b/adyen_gateway/config/country_fields.yaml @@ -4,5 +4,4 @@ address: true GB: address: true -US: -address: true + -- To view, visit https://gerrit.wikimedia.org/r/319414 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I338ec025cac4772a9be620513eb14b77b07ae56e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/319379 Change subject: Update DonationInterface Submodule .. Update DonationInterface Submodule Change-Id: Ic9f5e334ba920334d639bb33abd7e56c501b4d33 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/79/319379/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index fee120f..760b9ae 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit fee120fe6f5169ac48e150f0f18e590dd7458fd2 +Subproject commit 760b9aee3f4e9828f3973a09e51fca42b39c0f62 -- To view, visit https://gerrit.wikimedia.org/r/319379 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9f5e334ba920334d639bb33abd7e56c501b4d33 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/319377 Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment c44cb30 Fix class name 3c49d8b Localisation updates from https://translatewiki.net. 6d26a42 Adyen GB fix d2d1073 Fit mailcheck domain list to our donor population def3fc9 Better card logos for Adyen and Ingenico 55643b0 Use order id as error reference when possible Change-Id: I2ac3d7d6225112681db9e082e36a1491a20a2b78 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/77/319377/1 -- To view, visit https://gerrit.wikimedia.org/r/319377 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ac3d7d6225112681db9e082e36a1491a20a2b78 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Merge branch 'master' into deployment
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/319372 Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment c44cb30 Fix class name 3c49d8b Localisation updates from https://translatewiki.net. 6d26a42 Adyen GB fix d2d1073 Fit mailcheck domain list to our donor population def3fc9 Better card logos for Adyen and Ingenico 55643b0 Use order id as error reference when possible Change-Id: I9d06cbc0f886a5fe2bc564078ccf45f7af5087ed --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/72/319372/1 -- To view, visit https://gerrit.wikimedia.org/r/319372 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d06cbc0f886a5fe2bc564078ccf45f7af5087ed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Merge branch 'master' into HEAD
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/319370 Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD c44cb30 Fix class name 3c49d8b Localisation updates from https://translatewiki.net. 6d26a42 Adyen GB fix d2d1073 Fit mailcheck domain list to our donor population def3fc9 Better card logos for Adyen and Ingenico 55643b0 Use order id as error reference when possible Change-Id: I60f65652f0124035d6e2e62eeea0bf729da06527 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/70/319370/1 -- To view, visit https://gerrit.wikimedia.org/r/319370 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60f65652f0124035d6e2e62eeea0bf729da06527 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Merge branch 'master' into HEAD
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/319366 Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD c44cb30 Fix class name 3c49d8b Localisation updates from https://translatewiki.net. 6d26a42 Adyen GB fix d2d1073 Fit mailcheck domain list to our donor population def3fc9 Better card logos for Adyen and Ingenico 55643b0 Use order id as error reference when possible Change-Id: I4a445bd3668c8476e52930f6acbdd500375efa20 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/66/319366/1 -- To view, visit https://gerrit.wikimedia.org/r/319366 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a445bd3668c8476e52930f6acbdd500375efa20 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Adyen GB fix
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/319235 Change subject: Adyen GB fix .. Adyen GB fix Prevent billing address incomplete error by sending value 'NA' for the unused 'houseNumberorName' field, as per Adyen's suggestion. Bug: T147475 Change-Id: I3cdafc3ee9478491324e4749c0242009ebeed9d2 --- M adyen_gateway/adyen.adapter.php M adyen_gateway/config/var_map.yaml 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/35/319235/1 diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php index ae047e3..cb23081 100644 --- a/adyen_gateway/adyen.adapter.php +++ b/adyen_gateway/adyen.adapter.php @@ -108,11 +108,14 @@ 'billingAddress.stateOrProvince', 'billingAddress.country', 'billingAddressType', + 'billingAddress.houseNumberOrName', ); if ( in_array( 'street', $this->getRequiredFields() ) ) { $requestFields = array_merge( $requestFields, $addressFields ); } + + $this->transactions[ 'donate' ] = array( 'request' => $requestFields, @@ -125,8 +128,14 @@ 'skinCode' => $this->accountInfo[ 'skinCode' ], //'shopperLocale' => language _ country ), + 'iframe' => TRUE, ); + // Hack to get required but unused field into GB form + if ( $this->getData_Unstaged_Escaped( 'country' ) == 'GB' ) + { + $this->transactions[ 'donate' ]['values'][ 'billingAddress.houseNumberOrName' ] = 'NA'; + } } protected function getAllowedPaymentMethods() { diff --git a/adyen_gateway/config/var_map.yaml b/adyen_gateway/config/var_map.yaml index ce01b4a..5321ada 100644 --- a/adyen_gateway/config/var_map.yaml +++ b/adyen_gateway/config/var_map.yaml @@ -4,6 +4,7 @@ billingAddress.postalCode: zip billingAddress.stateOrProvince: state billingAddress.street: street +billingAddress.houseNumberOrName: street_supplemental billingAddressType: billing_address_type blockedMethods: blocked_methods card.cardHolderName: full_name -- To view, visit https://gerrit.wikimedia.org/r/319235 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3cdafc3ee9478491324e4749c0242009ebeed9d2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/316994 Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: Iaaacbd1057d0b1b490e926d584dcee0d469e2f87 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/94/316994/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index f8a15a4..e4dad72 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit f8a15a437f4f6e8d12eaa9906f75e7e415752458 +Subproject commit e4dad72d9a64a4d1e1861953099542a8557f11c4 -- To view, visit https://gerrit.wikimedia.org/r/316994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaaacbd1057d0b1b490e926d584dcee0d469e2f87 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ 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 HEAD
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/316993 Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD 050f916 Expand list of domains for mailcheck Change-Id: Iae55103988833f0de4412b7434cef89026074b1e --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/93/316993/1 -- To view, visit https://gerrit.wikimedia.org/r/316993 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae55103988833f0de4412b7434cef89026074b1e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix Drush wrapper
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/314053 Change subject: Fix Drush wrapper .. Fix Drush wrapper Initalize SmashPig context and config Change-Id: I44c1903aabebe5cd23f07261bf082a14563d4a93 --- M sites/all/modules/queue2civicrm/refund/wmf_refund_qc.module 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/53/314053/1 diff --git a/sites/all/modules/queue2civicrm/refund/wmf_refund_qc.module b/sites/all/modules/queue2civicrm/refund/wmf_refund_qc.module index 6ac46ad..e9d53f4 100644 --- a/sites/all/modules/queue2civicrm/refund/wmf_refund_qc.module +++ b/sites/all/modules/queue2civicrm/refund/wmf_refund_qc.module @@ -1,6 +1,8 @@ https://gerrit.wikimedia.org/r/314053 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44c1903aabebe5cd23f07261bf082a14563d4a93 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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 HEAD
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/313319 Change subject: Merge branch 'master' into HEAD .. Merge branch 'master' into HEAD Conflicts: PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php Tests/PendingQueueConsumerTest.php Tests/QueueConsumerTest.php Change-Id: If0c014c53a763dac8b89b8d806dafa37361cb607 --- D PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php D PaymentProviders/Adyen/Tests/phpunit/RecordCaptureJobTest.php D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php D Tests/PendingQueueConsumerTest.php D Tests/QueueConsumerTest.php 5 files changed, 0 insertions(+), 822 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/19/313319/1 diff --git a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php b/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php deleted file mode 100644 index 5fadd77..000 --- a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php +++ /dev/null @@ -1,238 +0,0 @@ -<<< HEAD (4b930a Merge branch 'master' into deployment) -=== -config = AdyenTestConfiguration::createWithSuccessfulApi(); - Context::initWithLogger( $this->config ); - $this->pendingDatabase = PendingDatabase::get(); - $this->pendingMessage = json_decode( - file_get_contents( __DIR__ . '/../Data/pending.json' ) , true - ); - $this->pendingDatabase->storeMessage( $this->pendingMessage ); - $this->antifraudQueue = QueueFactory::getQueue( 'payments-antifraud' ); - } - - public function tearDown() { - $this->pendingDatabase->deleteMessage( $this->pendingMessage ); - parent::tearDown(); - } - - /** -* For a legit donation, ProcessCaptureJob should leave donor data -* in the pending database, add an antifraud message, and return true. -*/ - public function testSuccessfulCapture() { - $api = $this->config->object( 'payment-provider/adyen/api', true ); - - $auth = KeyedOpaqueStorableObject::fromJsonProxy( - 'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation', - file_get_contents( __DIR__ . '/../Data/auth.json' ) - ); - - $job = ProcessCaptureRequestJob::factory( $auth ); - $this->assertTrue( $job->execute() ); - - $donorData = $this->pendingDatabase->fetchMessageByGatewayOrderId( - 'adyen', $auth->merchantReference - ); - - $this->assertNotNull( - $donorData, - 'RequestCaptureJob did not leave donor data on pending queue' - ); - $this->assertTrue( - $donorData['captured'], - 'RequestCaptureJob did not mark donor data as captured' - ); - - $this->assertEquals( - array( - 'currency' => 'USD', - 'amount' => 10, - 'pspReference' => '762895314225', - ), - $api->captured[0], - 'RequestCaptureJob did not make the right capture call' - ); - - $antifraudMessage = $this->antifraudQueue->pop(); - $this->assertNotNull( - $antifraudMessage, - 'RequestCaptureJob did not send antifraud message' - ); - $this->assertEquals( - 'process', - $antifraudMessage['validation_action'], - 'Successful capture should get "process" validation action' - ); - } - - /** -* When AVS and CVV scores push the donation over the review threshold, -* we should not capture the payment, but leave the donor details. -*/ - public function testReviewThreshold() { - $api = $this->config->object( 'payment-provider/adyen/api', true ); - - $auth = KeyedOpaqueStorableObject::fromJsonProxy( - 'SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation', - file_get_contents( __DIR__ . '/../Data/auth.json' ) - ); - - $auth->avsResult = '1'; // Bad zip code pushes us over review - - $job = ProcessCaptureRequestJob::factory( $auth ); - $this->assertTrue( $job->execute() ); - - $donorData =
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Get all queues with QueueFactory::getQueue
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/313317 Change subject: Get all queues with QueueFactory::getQueue .. Get all queues with QueueFactory::getQueue Make the 'queue' key default work everywhere Change-Id: I1c619da04c08cf2470b9f04231fbeed50b1489ce --- M Core/Actions/IncomingMessage.php M Core/DataStores/MultiQueueWriter.php A Core/DataStores/QueueFactory.php M Core/QueueConsumers/BaseQueueConsumer.php M Maintenance/RequeueDelayedMessages.php M PaymentProviders/Adyen/Actions/CaptureResponseAction.php M PaymentProviders/Adyen/Actions/PaymentCaptureAction.php M PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php M PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php M PaymentProviders/Adyen/Jobs/RecordCaptureJob.php M PaymentProviders/Amazon/Actions/AddMessageToQueue.php M PaymentProviders/PayPal/Job.php M PaymentProviders/PayPal/Listener.php M SmashPig.yaml 14 files changed, 64 insertions(+), 44 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/17/313317/1 diff --git a/Core/Actions/IncomingMessage.php b/Core/Actions/IncomingMessage.php index 61adc23..bb2b790 100644 --- a/Core/Actions/IncomingMessage.php +++ b/Core/Actions/IncomingMessage.php @@ -1,6 +1,6 @@ getDestinationQueue(); if ( $destinationQueue ) { - $queue = Context::get()->getConfiguration()->object( "data-store/{$destinationQueue}" ); + $queue = QueueFactory::getQueue( $destinationQueue ); $queueMsg = $msg->normalizeForQueue(); $queue->push( $queueMsg ); diff --git a/Core/DataStores/MultiQueueWriter.php b/Core/DataStores/MultiQueueWriter.php index af90ef0..1cae76d 100644 --- a/Core/DataStores/MultiQueueWriter.php +++ b/Core/DataStores/MultiQueueWriter.php @@ -1,7 +1,6 @@ queues[] = $config->object( $path ); + $this->queues[] = QueueFactory::getQueue( $configKey ); } } diff --git a/Core/DataStores/QueueFactory.php b/Core/DataStores/QueueFactory.php new file mode 100644 index 000..b1d9899 --- /dev/null +++ b/Core/DataStores/QueueFactory.php @@ -0,0 +1,41 @@ +getConfiguration(); + $key = "data-store/$queueName"; + + // Examine the config node for a queue name + $node = $config->val( $key, true ); + if ( + empty( $node['constructor-parameters'] ) || + empty( $node['constructor-parameters'][0]['queue'] ) + ) { + $nameParam = array( + 'data-store' => array( + $queueName => array( + 'constructor-parameters' => array( + array( + 'queue' => $queueName + ) + ) + ) + ) + ); + $config->override( $nameParam ); + } + + return $config->object( $key ); + } +} diff --git a/Core/QueueConsumers/BaseQueueConsumer.php b/Core/QueueConsumers/BaseQueueConsumer.php index f13a588..352896d 100644 --- a/Core/QueueConsumers/BaseQueueConsumer.php +++ b/Core/QueueConsumers/BaseQueueConsumer.php @@ -7,6 +7,7 @@ use SmashPig\Core\Context; use SmashPig\Core\DataStores\DamagedDatabase; +use SmashPig\Core\DataStores\QueueFactory; use SmashPig\Core\Logging\Logger; /** @@ -70,7 +71,7 @@ $this->timeLimit = intval( $timeLimit ); $this->messageLimit = intval( $messageLimit ); - $this->backend = self::getQueue( $queueName ); + $this->backend = QueueFactory::getQueue( $queueName ); if ( !$this->backend instanceof AtomicReadBuffer ) { throw new InvalidArgumentException( @@ -151,19 +152,4 @@ ); } - public static function getQueue( $queueName ) { - $config = Context::get()->getConfiguration(); - $key = "data-store/$queueName"; - - // Get a reference to the config node so we can mess with it - $node =& $config->val( $key, true ); - if ( - empty( $node['constructor-parameters'] ) || - empty( $node['constructor-parameters'][0]['queue'] ) - ) { - $node['constructor-parameters'][0]['queue'] = $queueName; - } - - return $config->object( $key, true ); - } } diff --git a/Maintenance/RequeueDelayedMessages.php
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Move Unsubscribe Queue Consumer off ActiveMQ
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/312084 Change subject: Move Unsubscribe Queue Consumer off ActiveMQ .. Move Unsubscribe Queue Consumer off ActiveMQ Move existing functionality over to the new queue. Bug: T145419 Change-Id: I17946ad6974c2e5dc1cd3a960d87a6af7f9383f8 --- A sites/all/modules/queue2civicrm/unsubscribe/UnsubscribeQueueConsumer.php M sites/all/modules/queue2civicrm/unsubscribe/wmf_unsubscribe_qc.info M sites/all/modules/queue2civicrm/unsubscribe/wmf_unsubscribe_qc.module 3 files changed, 128 insertions(+), 116 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/84/312084/1 diff --git a/sites/all/modules/queue2civicrm/unsubscribe/UnsubscribeQueueConsumer.php b/sites/all/modules/queue2civicrm/unsubscribe/UnsubscribeQueueConsumer.php new file mode 100644 index 000..2505c69 --- /dev/null +++ b/sites/all/modules/queue2civicrm/unsubscribe/UnsubscribeQueueConsumer.php @@ -0,0 +1,118 @@ +headers['correlation-id']; + watchdog('unsubscribe', "Beginning processing of message $txnid: " . json_encode($message), array(), WATCHDOG_INFO); + + // Sanity checking :) + $body = json_decode($message->body, TRUE); + if ( empty($body['email']) or empty( $body['contribution-id'] ) ) { + $error = "$txnid: Required field not present! Dropping message on floor."; + throw new WmfException( 'UNSUBSCRIBE', $error ); + } + + $emails = array(strtolower($body['email'])); + $contribId = $body['contribution-id']; + watchdog('unsubscribe', "$txnid: Acting on contribution ID '$contribId'", array(), WATCHDOG_INFO); + + // Find the contact from the contribution ID and check opt out status + $contacts = unsubscribe_get_emails_from_contribution($contribId); + + if (count($contacts) === 0) { + watchdog('unsubscribe', "$txnid: No contacts returned for contribution ID $contribId. Acking frame and returning.", WATCHDOG_NOTICE); + } elseif ($contacts[0]['is_opt_out'] == TRUE) { + watchdog('unsubscribe', "$txnid: Contact already opted out with this contribution ID.", WATCHDOG_NOTICE); + } else { + // Excellent -- we have a collection of emails to unsubscribe now! :) Add them to the array + foreach ($contacts as $contact) { + $email = strtolower($contact['email']); + if (!in_array($email, $emails)) { + $emails[] = $email; + } + } + + // And opt them out + $count = unsubscribe_opt_out_emails($emails); + watchdog('unsubscribe', "$txnid: Successfully updated $count rows."); + } + } +} + +/** + * Obtains a list of arrays of (contact ID, is opt out, email address) for + * the contact specified by the given contribution. + * + * @param int $ctid The Civi contribution ID + * + * @return array + */ +function unsubscribe_get_emails_from_contribution($ctid) { + $query = " + SELECT con.id, con.is_opt_out, e.email + FROM civicrm_contribution ct, civicrm_contact con + LEFT JOIN civicrm_email e + ON con.id = e.contact_id + WHERE ct.id = %1 AND ct.contact_id = con.id"; + + $dao = CRM_Core_DAO::executeQuery( $query, array( + 1 => array( $ctid, 'Integer' ), + ) ); + + $out = array(); + while ( $dao->fetch() ) { + $out[] = array( + 'contact_id' => (int)$dao->id, + 'is_opt_out' => (bool)$dao->is_opt_out, + 'email' => $dao->email, + ); + } + return $out; +} + +/** + * Updates the Civi database with an opt out record for the specified email address + * + * @param array $emails Email addresses to unsubscribe + * + * @returns Number of effected rows + */ +function unsubscribe_opt_out_emails($emails) { + $escaped = array(); + foreach ($emails as $email) { + $escaped[] = "'" . addslashes( $email ) . "'"; + } + $email_condition = 'e.email IN (' . implode(', ', $escaped) . ')'; + + $query = <rowCount(); +} diff --git a/sites/all/modules/queue2civicrm/unsubscribe/wmf_unsubscribe_qc.info b/sites/all/modules/queue2civicrm/unsubscribe/wmf_unsubscribe_qc.info index f9daace..6d1de24 100644 --- a/sites/all/modules/queue2civicrm/unsubscribe/wmf_unsubscribe_qc.info
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Move refund queue consumer off ActiveMQ
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/309603 Change subject: Move refund queue consumer off ActiveMQ .. Move refund queue consumer off ActiveMQ Placeholder commit for now. Change-Id: I0417025205199e7def08c292da6f04d32c4d6c4c --- A sites/all/modules/queue2civicrm/RefundQueueConsumer.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/03/309603/1 diff --git a/sites/all/modules/queue2civicrm/RefundQueueConsumer.php b/sites/all/modules/queue2civicrm/RefundQueueConsumer.php new file mode 100644 index 000..2d19569 --- /dev/null +++ b/sites/all/modules/queue2civicrm/RefundQueueConsumer.php @@ -0,0 +1,5 @@ +https://gerrit.wikimedia.org/r/309603 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0417025205199e7def08c292da6f04d32c4d6c4c Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/308090 Change subject: Update DonationInterface Submodule .. Update DonationInterface Submodule Change-Id: I45bafc8a7f3fb462b4f5481d124ceca3e2af6602 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/90/308090/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 40f0c02..d4dd810 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 40f0c0231fdde5c9e7067d7f81ce972857f60b0a +Subproject commit d4dd81003d1c54e747f06d0cfbf855185d8a4de6 -- To view, visit https://gerrit.wikimedia.org/r/308090 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45bafc8a7f3fb462b4f5481d124ceca3e2af6602 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Reenable AmEx on Adyen form for France.
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/308089 Change subject: Reenable AmEx on Adyen form for France. .. Reenable AmEx on Adyen form for France. Bug:T144236 Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 --- M adyen_gateway/config/payment_submethods.yaml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/89/308089/1 diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index d2d4a12..c540c24 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -32,6 +32,7 @@ US: true IL: true UA: true +FR: true group: cc logo: card-amex.png discover: -- To view, visit https://gerrit.wikimedia.org/r/308089 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Reenable AmEx on Adyen form for France.
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/307990 Change subject: Reenable AmEx on Adyen form for France. .. Reenable AmEx on Adyen form for France. Bug:T144236 Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 --- M adyen_gateway/config/payment_submethods.yaml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/90/307990/1 diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index d2d4a12..c540c24 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -32,6 +32,7 @@ US: true IL: true UA: true +FR: true group: cc logo: card-amex.png discover: -- To view, visit https://gerrit.wikimedia.org/r/307990 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Make PayPal audit mirror to Redis
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/307632 Change subject: Make PayPal audit mirror to Redis .. Make PayPal audit mirror to Redis Add a new wrapper for talking to redis, and have the paypal parser push to redis as well as stomp. Bug: T130308 Change-Id: Ie51f237ee0c8d034fb47ea328ca9ea3312e78f87 --- M audit/paypal/SarFile.py M audit/paypal/TrrFile.py A queue/redis_wrap.py A requirements.txt 4 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/32/307632/1 diff --git a/audit/paypal/SarFile.py b/audit/paypal/SarFile.py index f5f77ef..0c97753 100644 --- a/audit/paypal/SarFile.py +++ b/audit/paypal/SarFile.py @@ -6,6 +6,7 @@ from process.logging import Logger as log from process.globals import config from queue.stomp_wrap import Stomp +from queue.redis_wrap import Redis import ppreport from civicrm.civicrm import Civicrm @@ -116,3 +117,8 @@ self.stomp = Stomp() self.stomp.send('recurring', msg) + +if not self.redis: +self.redis = Redis() + +self.redis.send('recurring', msg) diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py index 42db7f8..8527116 100644 --- a/audit/paypal/TrrFile.py +++ b/audit/paypal/TrrFile.py @@ -8,6 +8,7 @@ from process.logging import Logger as log from process.globals import config from queue.stomp_wrap import Stomp +from queue.redis_wrap import Redis import ppreport from civicrm.civicrm import Civicrm @@ -16,6 +17,7 @@ class TrrFile(object): VERSION = [4, 8] stomp = None +redis = None # FIXME: these are version 8 headers, we would fail on multi-part v4 files... column_headers = [ "Column Type", @@ -193,6 +195,11 @@ self.stomp.send(queue, msg) +if not self.redis: +self.redis = Redis() + +self.redis.send(queue, msg) + def normalize_recurring(self, msg): 'Synthesize a raw PayPal message' diff --git a/queue/redis_wrap.py b/queue/redis_wrap.py new file mode 100644 index 000..1ff63f1 --- /dev/null +++ b/queue/redis_wrap.py @@ -0,0 +1,22 @@ +from process.globals import config +from process.logging import Logger as log +import process.version_stamp + +import json +import redis + +class Redis(object): + +conn = None + +def __init__(self): +if not config.no_effect: +self.conn = redis.Redis(config.redis.server, config.redis.password, config.redis.port) + +def send(self, queue, msg): + +if config.no_effect: +log.info("not queueing message. " + json.dumps(msg)) +return + +self.conn.rpush(config.redis.queues[queue], msg) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000..74b362f --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +redis \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/307632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie51f237ee0c8d034fb47ea328ca9ea3312e78f87 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Make Paypal audit mirror to Redis
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/307433 Change subject: Make Paypal audit mirror to Redis .. Make Paypal audit mirror to Redis Add a new wrapper for talking to redis, and have the paypal parser push to redis as well as stomp. Bug: T130308 Change-Id: I6f16814234ac1a492d8cbdbe236d8d936f8122e3 --- M audit/paypal/SarFile.py M audit/paypal/TrrFile.py A queue/redis_wrap.py 3 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/33/307433/1 diff --git a/audit/paypal/SarFile.py b/audit/paypal/SarFile.py index f5f77ef..0c97753 100644 --- a/audit/paypal/SarFile.py +++ b/audit/paypal/SarFile.py @@ -6,6 +6,7 @@ from process.logging import Logger as log from process.globals import config from queue.stomp_wrap import Stomp +from queue.redis_wrap import Redis import ppreport from civicrm.civicrm import Civicrm @@ -116,3 +117,8 @@ self.stomp = Stomp() self.stomp.send('recurring', msg) + +if not self.redis: +self.redis = Redis() + +self.redis.send('recurring', msg) diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py index 42db7f8..8527116 100644 --- a/audit/paypal/TrrFile.py +++ b/audit/paypal/TrrFile.py @@ -8,6 +8,7 @@ from process.logging import Logger as log from process.globals import config from queue.stomp_wrap import Stomp +from queue.redis_wrap import Redis import ppreport from civicrm.civicrm import Civicrm @@ -16,6 +17,7 @@ class TrrFile(object): VERSION = [4, 8] stomp = None +redis = None # FIXME: these are version 8 headers, we would fail on multi-part v4 files... column_headers = [ "Column Type", @@ -193,6 +195,11 @@ self.stomp.send(queue, msg) +if not self.redis: +self.redis = Redis() + +self.redis.send(queue, msg) + def normalize_recurring(self, msg): 'Synthesize a raw PayPal message' diff --git a/queue/redis_wrap.py b/queue/redis_wrap.py new file mode 100644 index 000..319851c --- /dev/null +++ b/queue/redis_wrap.py @@ -0,0 +1,23 @@ +from process.globals import config +from process.logging import Logger as log +import process.version_stamp + +import json +import redis + +class Redis(object): + +conn = None + +def __init__(self): +if not config.no_effect: +self.conn = redis.Redis(config.redis.server, config.redis.port) + + +def send(self, queue, msg): + +if config.no_effect: +log.info("not queueing message. " + json.dumps(msg)) +return + +self.conn.rpush(queue, msg) \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/307433 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f16814234ac1a492d8cbdbe236d8d936f8122e3 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/305406 Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: Ieda1c722f4373de6501f3ae9c4412968cebb3e6a --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/06/305406/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 8de7409..f830e81 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 8de740959e26a1d45b11b7201e95595b0e13682a +Subproject commit f830e813690b918513e0cc7f33ef5a149be64388 -- To view, visit https://gerrit.wikimedia.org/r/305406 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieda1c722f4373de6501f3ae9c4412968cebb3e6a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Prevent multiple Ingenico iFrames
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/305404 Change subject: Prevent multiple Ingenico iFrames .. Prevent multiple Ingenico iFrames Reselecting or changing card types was creating and displaying multiple Ingenico iFrames. This stops that happening by removing preexiting iFrames before creating the new one. Bug: T142059 Change-Id: Ib57651c13ceac694cd45e028de96b6981046df06 --- M globalcollect_gateway/forms/js/ingenico.js 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/04/305404/1 diff --git a/globalcollect_gateway/forms/js/ingenico.js b/globalcollect_gateway/forms/js/ingenico.js index 2669ba4..4c1d2e3 100644 --- a/globalcollect_gateway/forms/js/ingenico.js +++ b/globalcollect_gateway/forms/js/ingenico.js @@ -2,12 +2,17 @@ var di = mw.donationInterface; function showIframe( result ) { + // Remove any preexisting iFrames + $( '#ingenico-iFrame' ).remove(); + var $form = $( '' ) .attr( { src: result.formaction, width: 318, height: 314, - frameborder: 0 + frameborder: 0, + name: 'ingenico-iFrame', + id: 'ingenico-iFrame' } ); $( '#payment-form' ).append( $form ); } -- To view, visit https://gerrit.wikimedia.org/r/305404 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib57651c13ceac694cd45e028de96b6981046df06 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Prevent multiple Ingenico iFrames
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/305173 Change subject: Prevent multiple Ingenico iFrames .. Prevent multiple Ingenico iFrames Reselecting or changing card types was creating and displaying multiple Ingenico iFrames. This stops that happening by removing preexiting iFrames before creating the new one. Bug: T142059 Change-Id: Ib57651c13ceac694cd45e028de96b6981046df06 --- M globalcollect_gateway/forms/js/ingenico.js 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/73/305173/1 diff --git a/globalcollect_gateway/forms/js/ingenico.js b/globalcollect_gateway/forms/js/ingenico.js index 2669ba4..dee84de 100644 --- a/globalcollect_gateway/forms/js/ingenico.js +++ b/globalcollect_gateway/forms/js/ingenico.js @@ -2,12 +2,17 @@ var di = mw.donationInterface; function showIframe( result ) { + // Remove any preexisting iFrames + $( '#ingenico-iFrame').remove(); + var $form = $( '' ) .attr( { src: result.formaction, width: 318, height: 314, - frameborder: 0 + frameborder: 0, + name: 'ingenico-iFrame', + id: 'ingenico-iFrame' } ); $( '#payment-form' ).append( $form ); } -- To view, visit https://gerrit.wikimedia.org/r/305173 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib57651c13ceac694cd45e028de96b6981046df06 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adyen: Add American Express option for Israel and Ukraine - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/298556 Change subject: Adyen: Add American Express option for Israel and Ukraine .. Adyen: Add American Express option for Israel and Ukraine Now that T139523 has resolved, reenable AmEx. Bug: T140146 Change-Id: I27c1ae56c9841da7b2e23f0e4404455aa98c0842 --- M adyen_gateway/config/payment_submethods.yaml 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/56/298556/1 diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index 7610abb..5674cc7 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -29,6 +29,8 @@ amex: countries: US: true +IL: true +UA: true group: cc logo: card-amex.png discover: -- To view, visit https://gerrit.wikimedia.org/r/298556 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27c1ae56c9841da7b2e23f0e4404455aa98c0842 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Disable AmEx payment submethod outside USA - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/298053 Change subject: Disable AmEx payment submethod outside USA .. Disable AmEx payment submethod outside USA AmEx validation is failing for all currencies other than USD, so disable that payment submethod outside the USA pending a fix for that issue. Bug: T139796 Change-Id: Iacc47155aeacecfcd5731149b06341ef4af1a360 --- M adyen_gateway/config/payment_submethods.yaml 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/53/298053/1 diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index 6e008b7..7610abb 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -28,10 +28,6 @@ logo: card-mc.png amex: countries: -FR: true -IL: true -JP: true -UA: true US: true group: cc logo: card-amex.png -- To view, visit https://gerrit.wikimedia.org/r/298053 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iacc47155aeacecfcd5731149b06341ef4af1a360 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Handling of Curriencies Without Minor Units. - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/297106 Change subject: Fix Handling of Curriencies Without Minor Units. .. Fix Handling of Curriencies Without Minor Units. Adyen documentation specifies that amounts in currencies lacking minor units are to be passed as-is, rather than being converted to minor units as happens with other currencies. Example: USD 10.50 converts to 1050, JPY 150 should remain 150. Bug: T137607 Change-Id: I081cafb728fb50e6056a37e532a096587debc2a9 --- A adyen_gateway/AmountInMinorUnits.php M adyen_gateway/config/transformers.yaml M extension.json 3 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/06/297106/1 diff --git a/adyen_gateway/AmountInMinorUnits.php b/adyen_gateway/AmountInMinorUnits.php new file mode 100644 index 000..2e2c6bf --- /dev/null +++ b/adyen_gateway/AmountInMinorUnits.php @@ -0,0 +1,37 @@ +https://gerrit.wikimedia.org/r/297106 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I081cafb728fb50e6056a37e532a096587debc2a9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Carte Bleu for Adyen - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/288631 Change subject: Carte Bleu for Adyen .. Carte Bleu for Adyen Add Carte Bleu payment submethod for Adyen in France. Bug: T128812 Change-Id: I7ae8160accfedbd015717bd7f07e8f81bbe75701 --- M DonationInterfaceFormSettings.php M adyen_gateway/config/payment_submethods.yaml 2 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/31/288631/1 diff --git a/DonationInterfaceFormSettings.php b/DonationInterfaceFormSettings.php index 69cdf36..312e71b 100644 --- a/DonationInterfaceFormSettings.php +++ b/DonationInterfaceFormSettings.php @@ -602,7 +602,7 @@ 'gateway' => 'adyen', 'countries' => array( '+' => 'US', 'IL', 'FR' ), 'currencies' => array( '+' => 'USD', 'ILS', 'EUR' ), - 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), + 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover', 'cb' )), 'selection_weight' => 0 ); diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index 62ecff8..cfa8bbe 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -1,3 +1,12 @@ +cb: +countries: +FR: true +group: cc +validation: +name: true +email: true +amount: true +logo: card-cb.png visa: countries: US: true @@ -42,3 +51,4 @@ amount: true logo: card-discover.png + -- To view, visit https://gerrit.wikimedia.org/r/288631 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ae8160accfedbd015717bd7f07e8f81bbe75701 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adyen in France - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/288547 Change subject: Adyen in France .. Adyen in France Configure Adyen for France. Change-Id: I628ae415ffd3f3cc011302fb96494e5d13a3bd9f --- M DonationInterfaceFormSettings.php M adyen_gateway/config/payment_submethods.yaml 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/47/288547/1 diff --git a/DonationInterfaceFormSettings.php b/DonationInterfaceFormSettings.php index df130a5..49c30ec 100644 --- a/DonationInterfaceFormSettings.php +++ b/DonationInterfaceFormSettings.php @@ -600,8 +600,8 @@ $forms_whitelist['adyen'] = array( 'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache', 'gateway' => 'adyen', - 'countries' => array( '+' => 'US', 'IL' ), - 'currencies' => array( '+' => 'USD', 'ILS' ), + 'countries' => array( '+' => 'US', 'IL', 'FR' ), + 'currencies' => array( '+' => 'USD', 'ILS', 'FRF' ), 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), 'selection_weight' => 0 ); diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index 398a706..62ecff8 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -2,6 +2,7 @@ countries: US: true IL: true +FR: true group: cc validation: name: true @@ -12,6 +13,7 @@ countries: US: true IL: true +FR: true group: cc validation: name: true @@ -22,6 +24,7 @@ countries: US: true IL: true +FR: true group: cc validation: name: true -- To view, visit https://gerrit.wikimedia.org/r/288547 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I628ae415ffd3f3cc011302fb96494e5d13a3bd9f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adyen form for Israel - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/286949 Change subject: Adyen form for Israel .. Adyen form for Israel Enable Adyen form in Israel and use Hebrew language. Bug: T128812 Change-Id: Ia9fe1fb229f243ba234a611dc4e598f976dfb89d --- M DonationInterfaceFormSettings.php M adyen_gateway/adyen.adapter.php 2 files changed, 23 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/49/286949/1 diff --git a/DonationInterfaceFormSettings.php b/DonationInterfaceFormSettings.php index 832aa47..df130a5 100644 --- a/DonationInterfaceFormSettings.php +++ b/DonationInterfaceFormSettings.php @@ -600,8 +600,8 @@ $forms_whitelist['adyen'] = array( 'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache', 'gateway' => 'adyen', - 'countries' => array( '+' => 'US',), - 'currencies' => array( '+' => 'USD',), + 'countries' => array( '+' => 'US', 'IL' ), + 'currencies' => array( '+' => 'USD', 'ILS' ), 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'discover' )), 'selection_weight' => 0 ); diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php index 7ac18ec..c99bd7e 100644 --- a/adyen_gateway/adyen.adapter.php +++ b/adyen_gateway/adyen.adapter.php @@ -32,7 +32,11 @@ public function getRequiredFields() { $fields = parent::getRequiredFields(); - $fields[] = 'address'; + $addressRequired = array( 'US' ); + $country = $this->getData_Unstaged_Escaped( 'country' ); + if ( in_array( $country, $addressRequired ) ) { + $fields[] = 'address'; + } $fields[] = 'payment_submethod'; return $fields; } @@ -87,18 +91,12 @@ * Define transactions */ function defineTransactions() { - + $this->transactions = array( ); $this->transactions[ 'donate' ] = array( 'request' => array( 'allowedMethods', - 'billingAddress.street', - 'billingAddress.city', - 'billingAddress.postalCode', - 'billingAddress.stateOrProvince', - 'billingAddress.country', - 'billingAddressType', 'card.cardHolderName', 'currencyCode', 'merchantAccount', @@ -130,6 +128,21 @@ ), 'iframe' => TRUE, ); + + // Add address fields for countries that use them. + $addressRequired = array( 'US' ); + $addressFields = array ( + 'billingAddress.street', + 'billingAddress.city', + 'billingAddress.postalCode', + 'billingAddress.stateOrProvince', + 'billingAddress.country', + 'billingAddressType', + ); + $country = $this->getData_Unstaged_Escaped( 'country' ); + if ( in_array( $country, $addressRequired ) ) { + $this->transactions[ 'donate' ] = array_merge( $this->transactions[ 'donate' ], $addressFields ); + } } protected function getAllowedPaymentMethods() { -- To view, visit https://gerrit.wikimedia.org/r/286949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9fe1fb229f243ba234a611dc4e598f976dfb89d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow clicking on payment method to submit form. - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/282416 Change subject: Allow clicking on payment method to submit form. .. Allow clicking on payment method to submit form. This allows user to retry the same card type when arriving via back button from the Astropay form. Bug: T130673 Change-Id: I02cc6ad9a28c803f3469ad43b778036f28beb90d --- M astropay_gateway/astropay.js 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/16/282416/1 diff --git a/astropay_gateway/astropay.js b/astropay_gateway/astropay.js index 1ced6cd..279801a 100644 --- a/astropay_gateway/astropay.js +++ b/astropay_gateway/astropay.js @@ -15,6 +15,16 @@ } } ); + // Submit on click of an already selected submethod in case we arrived + // by back button and the continue button didn't show. + $( 'input[name="payment_submethod"]' ).on( 'click', function() { + if ( window.validate_form( form ) ) { + submitForm(); + } else { + $( '#paymentContinue' ).show(); + } + } ); + $( '#paymentContinueBtn' ).click( function() { if ( window.validate_form( form ) ) { submitForm(); -- To view, visit https://gerrit.wikimedia.org/r/282416 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02cc6ad9a28c803f3469ad43b778036f28beb90d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Astropay: WebPay as main processor for credit cards CL - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/280953 Change subject: Astropay: WebPay as main processor for credit cards CL .. Astropay: WebPay as main processor for credit cards CL Comment out non-webpay credit card submethods for Chile while Astropay figures out direct cards. Bug: T131400 Change-Id: Ifa733dba5da0c2d137e815fc4c9efc56c97f2e58 --- M astropay_gateway/config/payment_submethods.yaml 1 file changed, 25 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/53/280953/1 diff --git a/astropay_gateway/config/payment_submethods.yaml b/astropay_gateway/config/payment_submethods.yaml index 3237b7e..4530b9a 100644 --- a/astropay_gateway/config/payment_submethods.yaml +++ b/astropay_gateway/config/payment_submethods.yaml @@ -5,7 +5,7 @@ countries: AR: true BR: true -CL: true +# CL: true #waiting on Astropay MX: true CO: true logo: card-visa-lg.png @@ -16,17 +16,17 @@ countries: AR: true BR: true -CL: true +# CL: true #waiting on Astropay MX: true CO: true logo: card-mc-lg.png -magna: -bank_code: MG -label: Magna -group: cc -countries: -CL: true -logo: card-magna.png +#magna: #waiting on Astropay +#bank_code: MG +#label: Magna +#group: cc +#countries: +# CL: true +#logo: card-magna.png amex: bank_code: AE label: 'American Express' @@ -34,7 +34,7 @@ countries: BR: true AR: true -CL: true +# CL: true #waiting on Astropay CO: true logo: card-amex-lg.png visa-debit: @@ -66,7 +66,7 @@ group: cc countries: BR: true -CL: true +# CL: true #waiting on Astropay CO: true logo: card-dinersclub-lg.png hiper: @@ -125,20 +125,20 @@ countries: AR: true logo: card-argencard.png -cmr: -bank_code: CM -label: CMR -group: cc -countries: -CL: true -logo: card-cmr.png -presto: -bank_code: PR -label: Presto -group: cc -countries: -CL: true -logo: card-presto.png +#cmr: #waiting on Astropay +#bank_code: CM +#label: CMR +#group: cc +#countries: +# CL: true +#logo: card-cmr.png +#presto: #waiting on Astropay +#bank_code: PR +#label: Presto +#group: cc +#countries: +# CL: true #waiting on Astropay +#logo: card-presto.png webpay: bank_code: WP label: Webpay -- To view, visit https://gerrit.wikimedia.org/r/280953 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa733dba5da0c2d137e815fc4c9efc56c97f2e58 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Astropay: remove Banco de Chile from CL/BT - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/280949 Change subject: Astropay: remove Banco de Chile from CL/BT .. Astropay: remove Banco de Chile from CL/BT Remove Banco de Chile payment submethod and logo. Bug: T131398 Change-Id: Ifce4291ee81bc69c52aa6d8bb44fc7d280292bce --- M astropay_gateway/config/payment_submethods.yaml D gateway_forms/includes/bank-banco_de_chile.png 2 files changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/49/280949/1 diff --git a/astropay_gateway/config/payment_submethods.yaml b/astropay_gateway/config/payment_submethods.yaml index 3237b7e..abb1508 100644 --- a/astropay_gateway/config/payment_submethods.yaml +++ b/astropay_gateway/config/payment_submethods.yaml @@ -148,13 +148,6 @@ countries: CL: true logo: bank-webpay.png -banco_de_chile: -bank_code: BX -label: 'Banco de Chile' -group: bt -countries: -CL: true -logo: bank-banco_de_chile.png banco_do_brasil: bank_code: BB label: 'Banco do Brasil' diff --git a/gateway_forms/includes/bank-banco_de_chile.png b/gateway_forms/includes/bank-banco_de_chile.png deleted file mode 100644 index a5089ea..000 --- a/gateway_forms/includes/bank-banco_de_chile.png +++ /dev/null Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/280949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifce4291ee81bc69c52aa6d8bb44fc7d280292bce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix opt out fields for Civi imports - change (wikimedia...crm)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/280113 Change subject: Fix opt out fields for Civi imports .. Fix opt out fields for Civi imports Allow Engage and other imports to use case insensitive 'yes' and 'true' values for do_not_* and is_opt_out fields Bug: T130768 Change-Id: I6259fa6ad2c1c214131eb8002b4cc65e82317a4c --- M sites/all/modules/offline2civicrm/ChecksFile.php 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/13/280113/1 diff --git a/sites/all/modules/offline2civicrm/ChecksFile.php b/sites/all/modules/offline2civicrm/ChecksFile.php index c92dbc3..366ae65 100644 --- a/sites/all/modules/offline2civicrm/ChecksFile.php +++ b/sites/all/modules/offline2civicrm/ChecksFile.php @@ -260,6 +260,22 @@ $msg[$field] = wmf_common_date_parse_string( $msg[$field] ); } } + +// Allow yes or true as inputs for opt-out fields +$optOutFields = array( +'do_not_email', +'do_not_mail', +'do_not_phone', +'do_not_sms', +'do_not_solicit', +'is_opt_out', +); +foreach( $optOutFields as $field ){ +if ( isset($msg[$field]) && (strtolower($msg[$field]) == 'yes' || strtolower($msg[$field]) == 'true' )){ +$msg[$field] = 1; +} +} + } /** -- To view, visit https://gerrit.wikimedia.org/r/280113 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6259fa6ad2c1c214131eb8002b4cc65e82317a4c Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Prepare logos for AstroPay LATAM banks and cards - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/274649 Change subject: Prepare logos for AstroPay LATAM banks and cards .. Prepare logos for AstroPay LATAM banks and cards Logos for LATAM donation methods modified for mustache compatability and added. Bug: T124320 Change-Id: Ic4284aeec10aded135ac91745a7c13415791bed1 --- A gateway_forms/includes/card-cabal.png A gateway_forms/includes/card-naranja.png A gateway_forms/includes/cash-banamex.png A gateway_forms/includes/cash-bancomer.png A gateway_forms/includes/cash-davivienda.png A gateway_forms/includes/cash-efecty.png A gateway_forms/includes/cash-oxxo.png A gateway_forms/includes/cash-pago-efectivo.png A gateway_forms/includes/cash-pago-facil.png A gateway_forms/includes/cash-provencia-pagos.png A gateway_forms/includes/cash-rapipago.png A gateway_forms/includes/cash-red-pagos.png 12 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/49/274649/1 diff --git a/gateway_forms/includes/card-cabal.png b/gateway_forms/includes/card-cabal.png new file mode 100644 index 000..2a54e3c --- /dev/null +++ b/gateway_forms/includes/card-cabal.png Binary files differ diff --git a/gateway_forms/includes/card-naranja.png b/gateway_forms/includes/card-naranja.png new file mode 100644 index 000..7b488fe --- /dev/null +++ b/gateway_forms/includes/card-naranja.png Binary files differ diff --git a/gateway_forms/includes/cash-banamex.png b/gateway_forms/includes/cash-banamex.png new file mode 100644 index 000..1ac55ba --- /dev/null +++ b/gateway_forms/includes/cash-banamex.png Binary files differ diff --git a/gateway_forms/includes/cash-bancomer.png b/gateway_forms/includes/cash-bancomer.png new file mode 100644 index 000..791a518 --- /dev/null +++ b/gateway_forms/includes/cash-bancomer.png Binary files differ diff --git a/gateway_forms/includes/cash-davivienda.png b/gateway_forms/includes/cash-davivienda.png new file mode 100644 index 000..db9a74b --- /dev/null +++ b/gateway_forms/includes/cash-davivienda.png Binary files differ diff --git a/gateway_forms/includes/cash-efecty.png b/gateway_forms/includes/cash-efecty.png new file mode 100644 index 000..eaaec90 --- /dev/null +++ b/gateway_forms/includes/cash-efecty.png Binary files differ diff --git a/gateway_forms/includes/cash-oxxo.png b/gateway_forms/includes/cash-oxxo.png new file mode 100644 index 000..e3ed1d5 --- /dev/null +++ b/gateway_forms/includes/cash-oxxo.png Binary files differ diff --git a/gateway_forms/includes/cash-pago-efectivo.png b/gateway_forms/includes/cash-pago-efectivo.png new file mode 100644 index 000..6c0007b --- /dev/null +++ b/gateway_forms/includes/cash-pago-efectivo.png Binary files differ diff --git a/gateway_forms/includes/cash-pago-facil.png b/gateway_forms/includes/cash-pago-facil.png new file mode 100644 index 000..d0476c7 --- /dev/null +++ b/gateway_forms/includes/cash-pago-facil.png Binary files differ diff --git a/gateway_forms/includes/cash-provencia-pagos.png b/gateway_forms/includes/cash-provencia-pagos.png new file mode 100644 index 000..5e7c48e --- /dev/null +++ b/gateway_forms/includes/cash-provencia-pagos.png Binary files differ diff --git a/gateway_forms/includes/cash-rapipago.png b/gateway_forms/includes/cash-rapipago.png new file mode 100644 index 000..2ed1682 --- /dev/null +++ b/gateway_forms/includes/cash-rapipago.png Binary files differ diff --git a/gateway_forms/includes/cash-red-pagos.png b/gateway_forms/includes/cash-red-pagos.png new file mode 100644 index 000..a60e309 --- /dev/null +++ b/gateway_forms/includes/cash-red-pagos.png Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/274649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4284aeec10aded135ac91745a7c13415791bed1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update payment methods and submethods for AstroPay LATAM rol... - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/274648 Change subject: Update payment methods and submethods for AstroPay LATAM rollout .. Update payment methods and submethods for AstroPay LATAM rollout Added cash method and many submethods to Astropay adapter for use in Brazil, Argentina, Mexico, Colombia, Chile, Peru, and Urugay. Bug: T124323 Change-Id: I9701486446242de056e4dfa75b50e5829d5b2b51 --- M astropay_gateway/astropay.adapter.php 1 file changed, 188 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/48/274648/1 diff --git a/astropay_gateway/astropay.adapter.php b/astropay_gateway/astropay.adapter.php index bd26006..a314710 100644 --- a/astropay_gateway/astropay.adapter.php +++ b/astropay_gateway/astropay.adapter.php @@ -256,6 +256,14 @@ ), ); + $this->payment_methods['cash'] = array( + 'validation' => array( + 'name' => true, + 'email' => true, + 'fiscal_number' => true, + ), + ); + $this->payment_submethods = array(); if ( self::getGlobal( 'Test' ) ) { @@ -280,6 +288,8 @@ 'countries' => array( 'AR' => true, 'BR' => true, + 'MX' => true, + 'CO' => true, ), 'logo' => 'card-visa-lg.png', ); @@ -292,6 +302,8 @@ 'countries' => array( 'AR' => true, 'BR' => true, + 'MX' => true, + 'CO' => true, ), 'logo' => 'card-mc-lg.png', ); @@ -301,12 +313,16 @@ 'bank_code' => 'AE', 'label' => 'American Express', 'group' => 'cc', - 'countries' => array( 'BR' => true, ), + 'countries' => array( + 'BR' => true, + 'AR' => true, + 'CO' => true, + ), 'logo' => 'card-amex-lg.png', ); // Visa Debit - $this->payment_submethods['visa_debit'] = array( + $this->payment_submethods['visa-debit'] = array( 'bank_code' => 'VD', 'label' => 'Visa Debit', 'group' => 'cc', @@ -339,7 +355,10 @@ 'bank_code' => 'DC', 'label' => 'Diners Club', 'group' => 'cc', - 'countries' => array( 'BR' => true, ), + 'countries' => array( + 'BR' => true, + 'CO' => true, + ), 'logo' => 'card-dinersclub-lg.png', ); @@ -352,6 +371,56 @@ 'logo' => 'card-hiper.png', ); + // MercadoLivre + $this->payment_submethods['mercadolivre'] = array( + 'bank_code' => 'ML', + 'label' => 'MercadoLivre', + 'group' => 'cc', + 'countries' => array( 'BR' => true, ), + ); + + // Cabal + $this->payment_submethods['cabal'] = array( + 'bank_code' => 'CL', + 'label' => 'Cabal', + 'group' => 'cc', + 'countries' => array( 'AR' => true, ), + 'logo' => 'card-cabal.png', + ); + + // Naranja + $this->payment_submethods['naranja'] = array( + 'bank_code' => 'NJ', + 'label' => 'Naranja', + 'group' => 'cc', + 'countries' => array( 'AR' => true, ), + 'logo' => 'card-naranja.png', //check logo + ); + + // Tarjeta Shopping + $this->payment_submethods['shopping'] = array( + 'bank_code' => 'TS', + 'label' => 'Tarjeta Shopping', + 'group' => 'cc', + 'countries' => array( 'AR' => true, ), + ); + + // Nativa + $this->payment_submethods['nativa'] = array( + 'bank_code' => 'NT', +
[MediaWiki-commits] [Gerrit] Remove France from GlobalCollect forms. - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/270113 Change subject: Remove France from GlobalCollect forms. .. Remove France from GlobalCollect forms. GC shouldn't be an option for France, take it out of the list. Change-Id: I39d7ea1194e59b78e01a13bc6e15e4cdbf4e2e05 --- M DonationInterfaceFormSettings.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/13/270113/1 diff --git a/DonationInterfaceFormSettings.php b/DonationInterfaceFormSettings.php index 720b5fb..cbbadb8 100644 --- a/DonationInterfaceFormSettings.php +++ b/DonationInterfaceFormSettings.php @@ -236,7 +236,7 @@ 'gateway' => 'globalcollect', 'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex', 'jcb' )), 'countries' => array( - '+' => array( 'AD', 'AT', 'AU', 'BE', 'BH', 'DE', 'EC', 'ES', 'FI', 'FR', 'GB', + '+' => array( 'AD', 'AT', 'AU', 'BE', 'BH', 'DE', 'EC', 'ES', 'FI', 'GB', 'GF', 'GR', 'HK', 'IE', 'IT', 'KR', 'LU', 'MY', 'NL', 'PR', 'PT', 'SG', 'SI', 'SK', 'TH', 'TW', ), ), @@ -468,7 +468,7 @@ 'BRL', 'USD', ) ), - 'payment_methods' => array( + 'payment_methods' => array( 'cc' => array( 'visa', 'mc', -- To view, visit https://gerrit.wikimedia.org/r/270113 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I39d7ea1194e59b78e01a13bc6e15e4cdbf4e2e05 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Nonsense Name Fraud Filter - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/266456 Change subject: Nonsense Name Fraud Filter .. Nonsense Name Fraud Filter New anti-fraud test to detect gibberish names. Devides keyboard into zones and assigns points based on a configurable percentage of characters coming from one zone. Bug: T120255 Change-Id: I2d664cb40d9cb1f8682101958ef00c1827299fc2 --- M gateway_common/gateway.adapter.php 1 file changed, 54 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/56/266456/1 diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index 11da3c5..3672e9a 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -2840,6 +2840,59 @@ return false; } + /** +* This custom filter function checks the global variable: +* +* KeyMapA +* KeyMapB +* +* How the score is tabulated: +* - If the majority of letters in a name come from the same zone points are added. +* - Returns an integer: 0 <= $score <= 100 +* +* @see $wgDonationInterfaceCustomFiltersFunctions +* @see $wgDonationInterfaceKeyMapA* @see $wgDonationInterfaceKeyMapB +* +* @return integer +*/ +public function getScoreName(){ + +$fName = $this.getData_Unstaged_Escaped( 'fname' ); + $lName = $this.getData_Unstaged_Escaped( 'lname' ); + +$nameArray = str_split( $fName . $lName ); + +$keyMapA = $this->getGlobal( 'KeyMapA' ); + +$keyMapB = $this->getGlobal( 'KeyMapB' ); + +$gibberishWeight = $this->getGlobal( 'NameGibberishWeight' ); + +$failScore = $this->getGlobal( 'NameScore' ); + +$points = 0; + +$score = 0; + +if ( is_array( $nameArray ) && !empty( $nameArray ) ){ +foreach($nameArray as $letter){ +// For each char in zone A add a point, zone B subtract. +if( in_array( $letter, $keyMapA ) ){ +$points++; +} +if( in_array( $letter, $keyMapB ) ){ +$points--; +} +} + +if( abs( $points ) / count( $nameArray ) >= $gibberishWeight ){ +$score = $failScore; +} +} + +return $score; + +} /** * This custom filter function checks the global variable: * @@ -2857,6 +2910,7 @@ */ public function getScoreCountryMap() { +//declare your globals to DonationInterface.php, set them in localsettings $score = 0; $country = $this->getData_Unstaged_Escaped( 'country' ); -- To view, visit https://gerrit.wikimedia.org/r/266456 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d664cb40d9cb1f8682101958ef00c1827299fc2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Default Order to WMF LYBUNT template. - change (wikimedia...crm)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/256607 Change subject: Add Default Order to WMF LYBUNT template. .. Add Default Order to WMF LYBUNT template. Make the report sort by sum of last year's donations descending. Bug: T119911 Change-Id: I9c3974a5e2d0e090ea823fcacd992ad1f9aff558 --- M sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/07/256607/1 diff --git a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php index 6ede479..611beba 100644 --- a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php +++ b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php @@ -355,6 +355,10 @@ } } +function orderBy() { + $this->_orderBy = "ORDER BY civicrm_contribution_total_amount DESC"; + } + function alterDisplay(&$rows) { // Prevent parent behavior } -- To view, visit https://gerrit.wikimedia.org/r/256607 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c3974a5e2d0e090ea823fcacd992ad1f9aff558 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update references to 2014 - change (wikimedia...dash)
XenoRyet has submitted this change and it was merged. Change subject: Update references to 2014 .. Update references to 2014 Ensure some miminal usefulness for 2015. Bug: T118050 Change-Id: Ied83dbed0538d9b74896a2b319691fd958b35ec0 --- M src/components/widgets/x-by-y/x-by-y.js M widgets/big-english.js 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/src/components/widgets/x-by-y/x-by-y.js b/src/components/widgets/x-by-y/x-by-y.js index 69507e9..d7a2c35 100644 --- a/src/components/widgets/x-by-y/x-by-y.js +++ b/src/components/widgets/x-by-y/x-by-y.js @@ -115,8 +115,8 @@ //TODO: these will trigger a saved set of parameters to draw the chart with. self.presetTitles = ko.observableArray([ 'This does not work yet.', - 'Donations During Big English 2014', - 'Donations for Fiscal Year 2014' + 'Donations During Big English 2015', + 'Donations for Fiscal Year 2015' ]); /// diff --git a/widgets/big-english.js b/widgets/big-english.js index 10d9ae9..aac55d6 100644 --- a/widgets/big-english.js +++ b/widgets/big-english.js @@ -12,7 +12,7 @@ left: { type: 'eq', left: { type: 'property', name: 'Year' }, - right: { type: 'literal', value: '2014' } + right: { type: 'literal', value: '2015' } }, right: { type: 'and', -- To view, visit https://gerrit.wikimedia.org/r/256038 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied83dbed0538d9b74896a2b319691fd958b35ec0 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/dash Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Cdentinger 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] Prevent PHP timeout when importing large files - change (wikimedia...crm)
XenoRyet has submitted this change and it was merged. Change subject: Prevent PHP timeout when importing large files .. Prevent PHP timeout when importing large files Bug: T118981 Change-Id: Iaa6abb2769ef96b478def29398e5c6a46073552d --- M sites/all/modules/offline2civicrm/ChecksFile.php 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/offline2civicrm/ChecksFile.php b/sites/all/modules/offline2civicrm/ChecksFile.php index 0dadaf3..c8b098f 100644 --- a/sites/all/modules/offline2civicrm/ChecksFile.php +++ b/sites/all/modules/offline2civicrm/ChecksFile.php @@ -51,6 +51,9 @@ $this->row_index = -1 + $this->numSkippedRows; while( ( $row = fgetcsv( $file, 0, ',', '"', '\\')) !== FALSE) { +// Reset the PHP timeout for each row. +set_time_limit( 10 ); + $this->row_index++; // Zip headers and row into a dict -- To view, visit https://gerrit.wikimedia.org/r/253975 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaa6abb2769ef96b478def29398e5c6a46073552d Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: AwightGerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Eileen Gerrit-Reviewer: Ejegg Gerrit-Reviewer: Katie Horn Gerrit-Reviewer: Pcoombe 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] Unset time limit after loop - change (wikimedia...crm)
XenoRyet has submitted this change and it was merged. Change subject: Unset time limit after loop .. Unset time limit after loop I was wondering if this was gonna act funny... I believe we're causing unit tests to time out. Change-Id: Id6eb3897d240698599b932a5e6c6c56a7667601b --- M sites/all/modules/offline2civicrm/ChecksFile.php 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/offline2civicrm/ChecksFile.php b/sites/all/modules/offline2civicrm/ChecksFile.php index c8b098f..c92dbc3 100644 --- a/sites/all/modules/offline2civicrm/ChecksFile.php +++ b/sites/all/modules/offline2civicrm/ChecksFile.php @@ -101,6 +101,9 @@ } } + // Unset time limit. + set_time_limit( 0 ); + $message = t( "Checks import complete. @successful imported, @ignored ignored, not including @duplicates duplicates.", array( '@successful' => $num_successful, '@ignored' => $num_ignored, '@duplicates' => $num_duplicates ) ); ChecksImportLog::record( $message ); watchdog( 'offline2civicrm', $message, array(), WATCHDOG_INFO ); -- To view, visit https://gerrit.wikimedia.org/r/254075 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6eb3897d240698599b932a5e6c6c56a7667601b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: AwightGerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ejegg 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] Make LYBUNT report work for calendar and fiscal year - change (wikimedia...crm)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/253808 Change subject: Make LYBUNT report work for calendar and fiscal year .. Make LYBUNT report work for calendar and fiscal year Undo hardcoding for fiscal year and make report work as chosen in the 'This Year' dropdown. Bug: T88819 Change-Id: I2b4f9e3c93d3f689ff04d13880dcbcf9a0f125f2 --- M sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/08/253808/1 diff --git a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php index 05b024e..73fdf65 100644 --- a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php +++ b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/WmfLybunt.php @@ -169,7 +169,6 @@ 'yid' => array( 'name' => 'receive_date', 'title' => ts('This Year'), -// FIXME: we've hardcoded fiscal year matching, set and lock the filter type dropdown 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => date('Y'), @@ -299,6 +298,7 @@ } function where() { + $this->_statusClause = ""; $clauses = array($this->_aliases['civicrm_contribution'] . '.is_test = 0'); $current_year= $this->_params['yid_value']; @@ -309,8 +309,13 @@ foreach ($table['filters'] as $fieldName => $field) { $clause = NULL; if ($fieldName == 'yid') { -$clause = "{$this->_aliases['wmf_donor']}.is_{$current_year}_donor = 0 +if($this->_params['yid_op'] == 'calendar') { +$clause = "YEAR({$this->_aliases['wmf_donor']}.last_donation_date) = $previous_year"; +} +else { + $clause = "{$this->_aliases['wmf_donor']}.is_{$current_year}_donor = 0 AND {$this->_aliases['wmf_donor']}.is_{$previous_year}_donor = 1"; +} } elseif (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); -- To view, visit https://gerrit.wikimedia.org/r/253808 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b4f9e3c93d3f689ff04d13880dcbcf9a0f125f2 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix JPMorgan Importer - change (wikimedia...crm)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/243716 Change subject: Fix JPMorgan Importer .. Fix JPMorgan Importer Strip commas from credits field to prevent field type error. Bug: T113381 Change-Id: Icb12a674780c9f7bad7be32516e74dccbc58 --- M sites/all/modules/offline2civicrm/JpMorganFile.php 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/16/243716/1 diff --git a/sites/all/modules/offline2civicrm/JpMorganFile.php b/sites/all/modules/offline2civicrm/JpMorganFile.php index 15c4fd3..5b550cc 100644 --- a/sites/all/modules/offline2civicrm/JpMorganFile.php +++ b/sites/all/modules/offline2civicrm/JpMorganFile.php @@ -50,4 +50,10 @@ 'restrictions' => 'Unrestricted - General', ); } + +protected function mungeMessage( &$msg ) { +$msg['gross'] = str_replace( ',' , '' , $msg['gross'] ); + +parent::mungeMessage( $msg ); +} } -- To view, visit https://gerrit.wikimedia.org/r/243716 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb12a674780c9f7bad7be32516e74dccbc58 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Direct Mail Appeal column to Trilogy Importer - change (wikimedia...crm)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/243042 Change subject: Add Direct Mail Appeal column to Trilogy Importer .. Add Direct Mail Appeal column to Trilogy Importer Bug: T114155 Change-Id: I135062b76e739153bac00052645bfee621eeccc1 --- M sites/all/modules/offline2civicrm/TrilogyFile.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/42/243042/1 diff --git a/sites/all/modules/offline2civicrm/TrilogyFile.php b/sites/all/modules/offline2civicrm/TrilogyFile.php index 8310aa6..cb6bbf5 100644 --- a/sites/all/modules/offline2civicrm/TrilogyFile.php +++ b/sites/all/modules/offline2civicrm/TrilogyFile.php @@ -11,6 +11,7 @@ 'contrib_Batch', 'contrib_Check', 'contrib_referenceNumber', +'Direct Mail Appeal', 'Email', 'FirstName', 'LastName', @@ -29,6 +30,7 @@ 'contrib_Check' => 'payment_submethod', 'contrib_Date' => 'date', 'contrib_referenceNumber' => 'gateway_txn_id', +'Direct Mail Appeal' => 'direct_mail_appeal', 'Email' => 'email', 'FirstName' => 'first_name', 'LastName' => 'last_name', -- To view, visit https://gerrit.wikimedia.org/r/243042 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I135062b76e739153bac00052645bfee621eeccc1 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set no_thank_you for Major Gifts importer - change (wikimedia...crm)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/240146 Change subject: Set no_thank_you for Major Gifts importer .. Set no_thank_you for Major Gifts importer Trilogy already sends an email, so suppress ours. Bug: T101191 Change-Id: Ief93acbf28fa17172f1a67130d3152a806ec9b6a --- M sites/all/modules/offline2civicrm/TrilogyFile.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/46/240146/1 diff --git a/sites/all/modules/offline2civicrm/TrilogyFile.php b/sites/all/modules/offline2civicrm/TrilogyFile.php index 7a5544b..8310aa6 100644 --- a/sites/all/modules/offline2civicrm/TrilogyFile.php +++ b/sites/all/modules/offline2civicrm/TrilogyFile.php @@ -41,6 +41,7 @@ return parent::getDefaultValues() + array( 'gateway' => 'trilogy', 'currency' => 'USD', +'no_thank_you' => 'trilogy', ); } } -- To view, visit https://gerrit.wikimedia.org/r/240146 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief93acbf28fa17172f1a67130d3152a806ec9b6a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Subscribing JS: remove proxy methods on cn object - change (mediawiki...CentralNotice)
XenoRyet has submitted this change and it was merged. Change subject: Subscribing JS: remove proxy methods on cn object .. Subscribing JS: remove proxy methods on cn object Change-Id: Iedbff22adea86768c3cbee4e6ed1908670499027 --- M resources/subscribing/ext.centralNotice.bannerHistoryLogger.js M resources/subscribing/ext.centralNotice.display.js M resources/subscribing/ext.centralNotice.kvStore.js 3 files changed, 18 insertions(+), 101 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js b/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js index 868a19b..1f2e5fb 100644 --- a/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js +++ b/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js @@ -3,11 +3,11 @@ * selected for the user (even if the banner is hidden). The log is kept in * LocalStorage (via CentralNotice's kvStore). A sample of logs are sent to the * server via EventLogging. Also allows triggering a call to EventLogging via - * cn.internal.bannerHistoryLogger.sendLog(). + * cn.bannerHistoryLogger.sendLog(). */ ( function ( $, mw ) { - var cn = mw.centralNotice, + var cn = mw.centralNotice, // Guaranteed to exist; we depend on display RL module mixin = new cn.Mixin( 'bannerHistoryLogger' ), now = Math.round( ( new Date() ).getTime() / 1000 ), log, @@ -24,9 +24,9 @@ */ function loadLog() { - log = cn.getKVStorageItem( + log = cn.kvStore.getItem( BANNER_HISTORY_KV_STORE_KEY, - cn.getKVStorageContexts().GLOBAL + cn.kvStore.contexts.GLOBAL ); if ( !log ) { @@ -108,10 +108,10 @@ * Store the contents of the log variable in kvStorage */ function storeLog() { - cn.setKVStorageItem( + cn.kvStore.setItem( BANNER_HISTORY_KV_STORE_KEY, log, - cn.getKVStorageContexts().GLOBAL + cn.kvStore.contexts.GLOBAL ); } @@ -129,7 +129,7 @@ function makeEventLoggingData( rate, logId ) { var elData = {}, - kvError = cn.getKVStorageError(), + kvError = cn.kvStore.getError(), i, logEntry, elLogEntry; // sample rate @@ -231,8 +231,8 @@ 'schema.' + EVENT_LOGGING_SCHEMA ] ); - if ( !cn.isKVStorageAvailable() ) { - cn.setKVStorageNotAvailableError(); + if ( !cn.kvStore.isAvailable() ) { + cn.kvStore.setNotAvailableError(); } else { // If KV storage works here, do our stuff @@ -268,8 +268,8 @@ // Register the mixin cn.registerCampaignMixin( mixin ); - // Object for access by other CentralNotice RL modules - cn.internal.bannerHistoryLogger = { + // Object for public access + cn.bannerHistoryLogger = { /** * Send the banner history log to the server, with a generated unique diff --git a/resources/subscribing/ext.centralNotice.display.js b/resources/subscribing/ext.centralNotice.display.js index 7303de6..81522a6 100644 --- a/resources/subscribing/ext.centralNotice.display.js +++ b/resources/subscribing/ext.centralNotice.display.js @@ -28,10 +28,6 @@ * * For an overview of how this all fits together, see * mw.centralNotice.reallyChooseAndMaybeDisplay() (below). - * - * We also provide access points for kvStore on mw.centralNotice, even though - * kvStore is in a different RL module. Campaign mixins that need kvStore should - * set it as a dependency and use the methods on mw.centralNotice. */ ( function ( $, mw ) { @@ -303,8 +299,11 @@ * events.bannerLoaded: Legacy location of bannerLoadedPromise. * * kvStore: Key-value store object, added by ext.centralNotice.kvStore, -* if that module has been loaded. Note: for KV store operations, -* please use instead the methods provided below. +* if that module has been loaded. +* +* bannerHistoryLogger: Banner history logging feature, added by +* ext.centralNotice.bannerHistoryLogger, if that module has been +* loaded. */ cn = { @@ -499,85 +498,6 @@ setBucket: function( bucket ) { cn.internal.bucketer.setBucket( bucket ); cn.internal.state.setBucket( bucket ); -
[MediaWiki-commits] [Gerrit] Fallback for browsers that don't support Object.defineProperty - change (mediawiki...CentralNotice)
XenoRyet has submitted this change and it was merged. Change subject: Fallback for browsers that don't support Object.defineProperty .. Fallback for browsers that don't support Object.defineProperty Bug: T112590 Bug: T112552 Change-Id: I2fdfda115b1557d6f3c201c98705140f4105877d --- M resources/subscribing/ext.centralNotice.display.js M tests/qunit/subscribing/ext.centralNotice.display.tests.js 2 files changed, 32 insertions(+), 5 deletions(-) Approvals: XenoRyet: Looks good to me, approved diff --git a/resources/subscribing/ext.centralNotice.display.js b/resources/subscribing/ext.centralNotice.display.js index 7303de6..f3decc3 100644 --- a/resources/subscribing/ext.centralNotice.display.js +++ b/resources/subscribing/ext.centralNotice.display.js @@ -101,6 +101,27 @@ } /** +* Set up the legacy cn.data property using a getter, or a normal property +* (for browsers that don't support getters). +*/ + function setUpDataProperty() { + + if ( typeof Object.defineProperty === 'function' ) { + + Object.defineProperty( cn, 'data', { + get: function() { return cn.internal.state.getData(); } + } ); + + } else { + + // FIXME For browsers that don't support defineProperty, we don't + // fully respect our internal contract with the state object to + // manage data, since we assume the object reference won't change. + cn.data = cn.internal.state.getData(); + } + } + + /** * Expose a promise object to be resolved when the banner is loaded. */ function setUpBannerLoadedPromise() { @@ -183,6 +204,11 @@ // This will gather initial data needed for selection and display. // We expose it above via a getter on the data property. state.setUp(); + + // Because of browser limitations, and to maintain our contract among + // components of this module, we have to do this here. + // TODO do this some other way... + setUpDataProperty(); // Below, we explicitly pass information from state to other // internal objects, which are not allowed to have dependencies. @@ -466,6 +492,7 @@ .fail( cn.internal.state.setInvalidGeoData ) .always( function() { cn.internal.state.setUpForTestingBanner(); + setUpDataProperty(); setUpBannerLoadedPromise(); fetchBanner(); } ); @@ -591,11 +618,6 @@ $.extend( mw.centralNotice, cn ); cn = mw.centralNotice; // Update the closured-in local variable } - - // $.extend doesn't copy getters, so we have to add our getter like so - Object.defineProperty( cn, 'data', { - get: function() { return cn.internal.state.getData(); } - } ); // Set up deprecated access points and warnings mw.log.deprecate( window, 'insertBanner', cn.insertBanner, diff --git a/tests/qunit/subscribing/ext.centralNotice.display.tests.js b/tests/qunit/subscribing/ext.centralNotice.display.tests.js index 89f9abf..3a3704b 100644 --- a/tests/qunit/subscribing/ext.centralNotice.display.tests.js +++ b/tests/qunit/subscribing/ext.centralNotice.display.tests.js @@ -122,6 +122,11 @@ }, ]; + // Make this property configurable before the first time it's set, + // so the browser lets us define it again and again (since public objects + // aren't re-created between tests). + Object.defineProperty( mw.centralNotice, 'data', { configurable: true } ); + QUnit.module( 'ext.centralNotice.display', QUnit.newMwEnvironment( { setup: function () { -- To view, visit https://gerrit.wikimedia.org/r/238326 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2fdfda115b1557d6f3c201c98705140f4105877d Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: AndyRussGGerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ejegg Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Ssmith Gerrit-Reviewer: XenoRyet Gerrit-Reviewer: jenkins-bot <> ___
[MediaWiki-commits] [Gerrit] Set up import for Major Gifts events payment/invitation tool - change (wikimedia...crm)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/237864 Change subject: Set up import for Major Gifts events payment/invitation tool .. Set up import for Major Gifts events payment/invitation tool Added import tool for getting Trilogy's data file into CiviCRM. Bug: T101191 Change-Id: Id325d66df9c2d3a5c267a8d51399be4f6a571c17 --- A sites/all/modules/offline2civicrm/TrilogyFile.php M sites/all/modules/offline2civicrm/offline2civicrm.info M sites/all/modules/offline2civicrm/offline2civicrm.module M sites/all/modules/wmf_civicrm/wmf_civicrm.install M sites/all/modules/wmf_civicrm/wmf_civicrm.module 5 files changed, 64 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/64/237864/1 diff --git a/sites/all/modules/offline2civicrm/TrilogyFile.php b/sites/all/modules/offline2civicrm/TrilogyFile.php new file mode 100644 index 000..66252e3 --- /dev/null +++ b/sites/all/modules/offline2civicrm/TrilogyFile.php @@ -0,0 +1,42 @@ + 'street_address', +'City' => 'city', +'contrib_Account' => 'raw_contribution_type', +'contrib_Amount' => 'gross', +'contrib_Batch' => 'import_batch_number', +'contrib_Date' => 'date', +'contrib_referenceNumber' => 'gateway_txn_id', +'Email' => 'email','FirstName' => 'first_name', +'LastName' => 'last_name', +'State' => 'state_province', +'Zip' => 'postal_code', +); +} + +protected function mungeMessage( &$msg ) { +$msg['gateway'] = 'trilogy'; +$msg['currency'] = 'USD'; +} + +} diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.info b/sites/all/modules/offline2civicrm/offline2civicrm.info index 6bfddf3..d11034b 100644 --- a/sites/all/modules/offline2civicrm/offline2civicrm.info +++ b/sites/all/modules/offline2civicrm/offline2civicrm.info @@ -20,6 +20,8 @@ files[] = JpMorganFile.php files[] = PayPalChecksFile.php files[] = SquareFile.php +files[] = TrilogyFile.php files[] = WmfImportFile.php files[] = WmfOrgImportFile.php files[] = tests/includes/BaseChecksFileTest.php + diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.module b/sites/all/modules/offline2civicrm/offline2civicrm.module index 9c53422..2a86037 100644 --- a/sites/all/modules/offline2civicrm/offline2civicrm.module +++ b/sites/all/modules/offline2civicrm/offline2civicrm.module @@ -107,6 +107,7 @@ 'jpmorgan' => t( 'JP Morgan' ), 'paypal' => t( 'PayPal EFT' ), 'square' => t( 'Square' ), +'trilogy' => t( 'Trilogy' ), ), ); $form['log'] = array( @@ -158,6 +159,9 @@ case 'square': $importer = new SquareFile( $file->uri ); break; + case 'trilogy': +$importer = new TrilogyFile( $file->uri ); +break; default: throw new Exception( 'Bad file format selection' ); } diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install b/sites/all/modules/wmf_civicrm/wmf_civicrm.install index 8166fa5..bffae6a 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install @@ -38,6 +38,7 @@ wmf_civicrm_update_7031(); wmf_civicrm_update_7032(); wmf_civicrm_update_7033(); +wmf_civicrm_update_7034(); } /** @@ -1439,3 +1440,12 @@ wmf_civicrm_create_option_values( 'payment_instrument', array('Square Cash') ); return array(); } + +/** + * Add "Trilogy" payment instrument. + */ +function wmf_civicrm_update_7034() { +wmf_civicrm_bootstrap_civi(); +wmf_civicrm_create_option_values( 'payment_instrument', array('Trilogy') ); +return array(); +} diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module b/sites/all/modules/wmf_civicrm/wmf_civicrm.module index 6946dc6..6a49470 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module @@ -687,6 +687,12 @@ watchdog( 'wmf_civicrm', 'payment_method constraint violated: gateway Square, but method=@method ; gateway_txn_id=@id', array( '@method' => $msg['payment_method'], '@id' => $msg['gateway_txn_id'] ), WATCHDOG_DEBUG ); } break; +case 'trilogy': +$payment_instrument = 'Trilogy'; +if ( array_key_exists( 'payment_method', $msg ) and strtolower( $msg['payment_method'] ) !== 'trilogy' ) { +watchdog( 'wmf_civicrm', 'payment_method constraint violated: gateway Trilogy, but method=@method ; gateway_txn_id=@id', array( '@method' => $msg['payment_method'], '@id' => $msg['gateway_txn_id'] ), WATCHDOG_DEBUG ); +} +break; } } -- To view, visit https://gerrit.wikimedia.org/r/237864 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
[MediaWiki-commits] [Gerrit] Merge branch 'master' into deployment - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/225938 Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 6ca39c9 Localisation updates from https://translatewiki.net. dd79602 Dynamically generate JS currency minimum amounts 00986f7 Update currency rates b4fa73c Rearrange order of CC logos on GC form for Japan 899be81 Stop exceptioning in drupal formatMessage stub ee8b703 Fix recurring GC false success report 80f1e48 Get around watchdog stripping tags ccc82b1 Remove unused logfile parsing code 854204f Quit demoting log messages to debug under drupal b671104 Localisation updates from https://translatewiki.net. Conflicts: tests/Adapter/GlobalCollect/RecurringTest.php tests/GatewayPageTest.php tests/includes/Responses/globalcollect/DO_PAYMENT_recurring.testresponse tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring.testresponse tests/includes/Responses/globalcollect/SET_PAYMENT_recurring.testresponse Change-Id: Iaa21069b0a70ba3c5816fc34d7da74be04f8bd64 --- D tests/Adapter/GlobalCollect/RecurringTest.php D tests/GatewayPageTest.php D tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-NOK.testresponse D tests/includes/Responses/globalcollect/DO_PAYMENT_recurring.testresponse D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring.testresponse D tests/includes/Responses/globalcollect/SET_PAYMENT_recurring.testresponse 6 files changed, 0 insertions(+), 368 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/38/225938/1 diff --git a/tests/Adapter/GlobalCollect/RecurringTest.php b/tests/Adapter/GlobalCollect/RecurringTest.php deleted file mode 100644 index 261399a..000 --- a/tests/Adapter/GlobalCollect/RecurringTest.php +++ /dev/null @@ -1,100 +0,0 @@ - HEAD (7654b4 Merge branch 'master' into deployment) -=== -?php -/** - * Wikimedia Foundation - * - * LICENSE - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -/** - * - * @group Fundraising - * @group DonationInterface - * @group GlobalCollect - * @group Recurring - */ -class DonationInterface_Adapter_GlobalCollect_RecurringTest extends DonationInterfaceTestCase { - - /** -* @param $name string The name of the test case -* @param $data array Any parameters read from a dataProvider -* @param $dataName string|int The name or index of the data set -*/ - function __construct( $name = null, array $data = array(), $dataName = '' ) { - parent::__construct( $name, $data, $dataName ); - $this-testAdapterClass = 'TestingGlobalCollectAdapter'; - } - - public function setUp() { - parent::setUp(); - - $this-setMwGlobals( array( - 'wgGlobalCollectGatewayEnabled' = true, - ) ); - } - - function tearDown() { - TestingGlobalCollectAdapter::clearGlobalsCache(); - parent::tearDown(); - } - - /** -* Can make a recurring payment -* -* @covers GlobalCollectAdapter::transactionRecurring_Charge -*/ - public function testRecurringCharge() { - $init = array( - 'amount' = '2345', - 'effort_id' = 2, - 'order_id' = '9998890004', - 'currency_code' = 'EUR', - 'payment_product' = '', - ); - $gateway = $this-getFreshGatewayObject( $init ); - - // FIXME: I don't understand whether the literal code should correspond to anything in GC - $gateway-setDummyGatewayResponseCode( 'recurring' ); - - $result = $gateway-do_transaction( 'Recurring_Charge' ); - - $this-assertTrue( $result-getCommunicationStatus() ); - $this-assertRegExp( '/SET_PAYMENT/', $result-getRawResponse() ); - } - - /** -* Can make a recurring payment -* -* @covers GlobalCollectAdapter::transactionRecurring_Charge -*/ - public function testDeclinedRecurringCharge() { - $init = array( - 'amount' = '2345', - 'effort_id' = 2, - 'order_id' = '9998890004', - 'currency_code' =
[MediaWiki-commits] [Gerrit] Update DonationInterface - change (mediawiki/core)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/225943 Change subject: Update DonationInterface .. Update DonationInterface Change-Id: I5ce3c846da159c73b252f071ceae717b0d276e4b --- M extensions/DonationInterface 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/43/225943/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 7654b4f..0127857 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface -Subproject commit 7654b4fed60b2a34ba0ac616e9d462101414c697 +Subproject commit 0127857d07af386ae4cec9bbb84ad9bde15158b1 -- To view, visit https://gerrit.wikimedia.org/r/225943 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ce3c846da159c73b252f071ceae717b0d276e4b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_23 Gerrit-Owner: XenoRyet dkozlow...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rearrange order of CC logos on GC form for Japan - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/225359 Change subject: Rearrange order of CC logos on GC form for Japan .. Rearrange order of CC logos on GC form for Japan Created two new forms with the requested logo ordering for A/B testing. Visa, JBC, Mastercard, Amex is ffname: cc-vjma JBC, Visa, Mastercard, Amex is ffname: cc-jvma Both forms are whitelisted in DonationInterfaceFormSettings.php for Japan Change-Id: I5093959cc3c45db59513a5ac28b078c2748093e6 --- M DonationInterfaceFormSettings.php A globalcollect_gateway/forms/html/cc/cc-jvma.html A globalcollect_gateway/forms/html/cc/cc-vjma.html 3 files changed, 219 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/59/225359/1 diff --git a/DonationInterfaceFormSettings.php b/DonationInterfaceFormSettings.php index a67e15c..256b362 100644 --- a/DonationInterfaceFormSettings.php +++ b/DonationInterfaceFormSettings.php @@ -214,6 +214,25 @@ ), ); +$forms_whitelist['cc-vjma'] = array( + 'file' = $form_dirs['gc'] . '/cc/cc-vjma.html', + 'gateway' = 'globalcollect', + 'payment_methods' = array('cc' = array( 'visa', 'jcb', 'mc', 'amex' )), + 'countries' = array( + '+' = array( 'JP', ), + ), +); + +$forms_whitelist['cc-jvma'] = array( + 'file' = $form_dirs['gc'] . '/cc/cc-jvma.html', + 'gateway' = 'globalcollect', + 'payment_methods' = array('cc' = array( 'jcb', 'visa', 'mc', 'amex' )), + 'countries' = array( + '+' = array( 'JP', ), + ), +); + + $forms_whitelist['cc-vmaj'] = array( 'file' = $form_dirs['gc'] . '/cc/cc-vmaj.html', 'gateway' = 'globalcollect', diff --git a/globalcollect_gateway/forms/html/cc/cc-jvma.html b/globalcollect_gateway/forms/html/cc/cc-jvma.html new file mode 100644 index 000..79ac7d7 --- /dev/null +++ b/globalcollect_gateway/forms/html/cc/cc-jvma.html @@ -0,0 +1,100 @@ +script type=text/javascript + mw.loader.load('gc.form.rapidhtml.cc'); + // these must go through RapidHTML and thus are inline + var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape']; + var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape']; + var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape']; + var actionURL = @action; + var scriptPath = @script_path; +/script + +table width=100% cellspacing=0 cellpadding=0 border=0 + tbody + tr + td id=appeal valign=top + {{LanguageSwitch|2011FR/@appeal/text|@language}} + /td + td id=donate valign=top + div id=greenBackground class= + @noscript + p id=topError class=creditcard-error-msg/p + + form name=payment method=post action=@action + div id=payment_gateway-personal-info + table id=payment-table-donor + tbody + tr + td + div id=step1header + h3 class=amount_header%donate_interface-amount-legend%: span id=selected-amount{% block donation-amount currency_code %}/span/h3 + /div + /td + /tr + {% block personal-information country %} +tr +td +dl class= +dd class=field style=margin-bottom: 0; margin-left: 0; +ul class=options-h id=cards style=margin: 0; +liinput id=cc-jcb name=cardtype type=radio value=jcb class=cardradio / label for=cc-jcbimg alt=JCB src=@script_path/extensions/DonationInterface/gateway_forms/includes/card-jcb.png //label/li +liinput id=cc-visa name=cardtype type=radio value=visa class=cardradio / label for=cc-visaimg alt=Visa src=@script_path/extensions/DonationInterface/gateway_forms/includes/card-visa.png //label/li +liinput id=cc-mc name=cardtype type=radio value=mc class=cardradio / label for=cc-mcimg alt=MasterCard
[MediaWiki-commits] [Gerrit] AstroPay audit glue module - change (wikimedia...crm)
XenoRyet has submitted this change and it was merged. Change subject: AstroPay audit glue module .. AstroPay audit glue module TODO: Better refund test coverage. Maybe get rid of the fakedb stuff, since it's inconsistent and means different code paths for test. Bug: T104718 Change-Id: I095134ec841f88613bcccbc4251874519b4f8042 --- M composer.lock M sites/all/modules/wmf_audit/BaseAuditProcessor.php A sites/all/modules/wmf_audit/astropay/AstroPayAuditProcessor.php A sites/all/modules/wmf_audit/astropay/astropay_audit.info A sites/all/modules/wmf_audit/astropay/astropay_audit.module A sites/all/modules/wmf_audit/tests/AstroPayAuditTest.php A sites/all/modules/wmf_audit/tests/data/AstroPay/donation/wikimedia_report_2015-06-16.csv A sites/all/modules/wmf_audit/tests/data/AstroPay/refund/wikimedia_report_2015-06-16.csv A sites/all/modules/wmf_audit/tests/data/logs/payments-astropay-20150617.gz 9 files changed, 421 insertions(+), 18 deletions(-) Approvals: XenoRyet: Looks good to me, approved diff --git a/composer.lock b/composer.lock index e27cb79..5d7a343 100644 --- a/composer.lock +++ b/composer.lock @@ -379,6 +379,7 @@ phpseclib/Crypt/Random.php ] }, +notification-url: https://packagist.org/downloads/;, include-path: [ phpseclib/ ], @@ -428,10 +429,6 @@ x.509, x509 ], -support: { -source: https://github.com/phpseclib/phpseclib/tree/0.3.7;, -issues: https://github.com/phpseclib/phpseclib/issues; -}, time: 2014-07-05 16:36:21 }, { @@ -693,13 +690,12 @@ source: { type: git, url: https://gerrit.wikimedia.org/r/mediawiki/extensions/DonationInterface.git;, -reference: 956eeef784777671dcb7090f7f79be4481e477c7 +reference: a4fc38c376a5d404aa45157c86b8d55cf47c48c3 }, require: { coderkungfu/php-queue: dev-master, fusesource/stomp-php: 2.1.*, monolog/monolog: 1.12.0, -predis/predis: 1.*, psr/log: 1.0.0, zordius/lightncandy: 0.18 }, @@ -722,7 +718,7 @@ GPL-2.0 ], description: Wikimedia Foundation payment processing library, -time: 2015-06-28 20:10:36 +time: 2015-07-06 19:45:20 }, { name: wikimedia/smash-pig, @@ -730,7 +726,7 @@ source: { type: git, url: https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;, -reference: 405bfac00a1c4f42c89352b27414d3bf07a17a97 +reference: e466dd074d545da123e71a0c629cb709cd4a1198 }, require: { fusesource/stomp-php: 2.*, @@ -769,7 +765,7 @@ donations, payments ], -time: 2015-06-25 18:10:49 +time: 2015-07-07 23:30:21 }, { name: zordius/lightncandy, @@ -1297,16 +1293,16 @@ }, { name: phpunit/phpunit-mock-objects, -version: 2.3.4, +version: 2.3.5, source: { type: git, url: https://github.com/sebastianbergmann/phpunit-mock-objects.git;, -reference: 92408bb1968a81b3217a6fdf6c1a198da83caa35 +reference: 1c330b1b6e1ea8fd15f2fbea46770576e366855c }, dist: { type: zip, -url: https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/92408bb1968a81b3217a6fdf6c1a198da83caa35;, -reference: 92408bb1968a81b3217a6fdf6c1a198da83caa35, +url: https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/1c330b1b6e1ea8fd15f2fbea46770576e366855c;, +reference: 1c330b1b6e1ea8fd15f2fbea46770576e366855c, shasum: }, require: { @@ -1348,7 +1344,7 @@ mock, xunit ], -time: 2015-06-11 15:55:48 +time: 2015-07-04 05:41:32 }, { name: sebastian/comparator, diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php b/sites/all/modules/wmf_audit/BaseAuditProcessor.php index ef73736..48c3f94 100644 --- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php +++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php @@ -167,9 +167,7 @@ */ protected function normalize_negative($record) { $send_message = array( - 'gateway_refund_id' = 'RFD' . $record['gateway_txn_id'], //Notes from a previous version: after intense deliberation, we
[MediaWiki-commits] [Gerrit] WIP Do not Merge: Red Text validation messages - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/217158 Change subject: WIP Do not Merge: Red Text validation messages .. WIP Do not Merge: Red Text validation messages This changes the GobalCollect US form to use in-page red text error messages from validation of the personal information fields, rather than alert box style errors. This change has only been implemented for one form, other RapidHTML forms will have broken validation with this commit. For review purposes only. Bug: T86214 Change-Id: I63f51ce8232c8053ad0624e3756b52a4e77b6f2f --- M globalcollect_gateway/forms/html/_personal-information/US.html M modules/validate_input.js 2 files changed, 42 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/58/217158/1 diff --git a/globalcollect_gateway/forms/html/_personal-information/US.html b/globalcollect_gateway/forms/html/_personal-information/US.html index 32b9b26..0b1866e 100644 --- a/globalcollect_gateway/forms/html/_personal-information/US.html +++ b/globalcollect_gateway/forms/html/_personal-information/US.html @@ -9,11 +9,20 @@ /td /tr tr + td + span id=fnameMsg class=halfwidth style=color:Red;display:none;float:left/spanspan id=lnameMsg class=halfwidth style=color:Red;display:none;float:right/span/td +/tr +tr tdspan class=creditcard-error-msg/span/td /tr tr td input class=fullwidth name=street value=@street type=text title=%donate_interface-donor-street% placeholder=%donate_interface-donor-street% id=street + /td +/tr +tr + td + span id=streetMsg style=color:Red;display:none/span /td /tr tr @@ -78,6 +87,21 @@ /selectinput class=thirdwidth name=zip value=@zip type=text title=%donate_interface-donor-postal% placeholder=%donate_interface-donor-postal% id=zip pattern=\d* /td /tr +tr + td + span id=cityMsg class=thirdwidth style=color:Red;display:none/span + /td +/tr +tr + td + span id=stateMsg class=thirdwidth style=color:Red;display:none/span + /td +/tr +tr + td + span id=zipMsg class=thirdwidth style=color:Red;display:none/span + /td +/tr tr style=display: none; td input type=hidden value=US name=country id=country / @@ -88,3 +112,8 @@ input class=fullwidth name=emailAdd value=@emailAdd type=email title=%donate_interface-donor-email% placeholder=%donate_interface-donor-email% id=emailAdd /td /tr +tr + td + span id=emailAddMsg style=color:Red;display:none/span + /td +/td diff --git a/modules/validate_input.js b/modules/validate_input.js index 8e288d4..d3bbd98 100644 --- a/modules/validate_input.js +++ b/modules/validate_input.js @@ -99,10 +99,12 @@ currField = '', i = 0, fields = [ 'fname', 'lname', 'street', 'city', 'zip', 'emailAdd' ], + msgFields = [ 'fnameMsg', 'lnameMsg', 'streetMsg', 'cityMsg', 'zipMsg', 'emailAddMsg' ], numFields = fields.length, invalids = [ '..', '/', '\\', ',', '', '' ]; for ( i = 0; i numFields; i++ ) { + document.getElementById( msgFields[i] ).style.display=none; if ( $( '#' + fields[i] ).length 0 ) { // Make sure field exists // See if the field is empty or equal to the placeholder value = document.getElementById( fields[i] ).value; @@ -115,6 +117,9 @@ ) { currField = mw.msg( 'donate_interface-error-msg-' + fields[i] ); output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + currField + '.\r\n'; + document.getElementById( msgFields[i] ).style.display=; + document.getElementById( msgFields[i] ).innerHTML = mw.msg( 'donate_interface-error-msg-js' ) + ' ' + currField; + } } } @@ -124,8 +129,11 @@ selectedState = stateField.options[stateField.selectedIndex].value; if ( selectedState === 'YY' || !$.trim( selectedState ) ) { output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-state-province' ) + '.\r\n'; + document.getElementById( 'stateMsg' ).style.display=; + document.getElementById( 'stateMsg' ).innerHTML = mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-state-province' ); + } else { document.getElementById( 'stateMsg' ).style.display=none; } - } + } countryField =
[MediaWiki-commits] [Gerrit] Remove Unused Javascript from GlobalCollect gateway - change (mediawiki...DonationInterface)
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/215218 Change subject: Remove Unused Javascript from GlobalCollect gateway .. Remove Unused Javascript from GlobalCollect gateway Removed three files containing methods for client side validation of the GlobalCollect form. These methods and files are currently unused, as the GC forms use the RapidHTML validation methods. Bug: T101014 Change-Id: Ia43ad18f39fde8e7a6dcfb27063666db13af0573 --- D globalcollect_gateway/modules/js/jquery.validate.additional-methods.js D globalcollect_gateway/modules/js/jquery.validate.js D globalcollect_gateway/modules/js/validate.js 3 files changed, 0 insertions(+), 2,078 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/18/215218/1 diff --git a/globalcollect_gateway/modules/js/jquery.validate.additional-methods.js b/globalcollect_gateway/modules/js/jquery.validate.additional-methods.js deleted file mode 100644 index fa0c1ec..000 --- a/globalcollect_gateway/modules/js/jquery.validate.additional-methods.js +++ /dev/null @@ -1,302 +0,0 @@ -/** - * jQuery Validation Plugin 1.9.0 - * - * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ - * http://docs.jquery.com/Plugins/Validation - * - * Copyright (c) 2006 - 2011 Jörn Zaefferer - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -(function() { - - function stripHtml(value) { - // remove html tags and space chars - return value.replace(/.[^]*?/g, ' ').replace(/nbsp;|#160;/gi, ' ') - // remove numbers and punctuation - .replace(/[0-9.(),;:!?%#$'_+=\/-]*/g,''); - } - jQuery.validator.addMethod(maxWords, function(value, element, params) { - return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length params; - }, jQuery.validator.format(Please enter {0} words or less.)); - - jQuery.validator.addMethod(minWords, function(value, element, params) { - return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length = params; - }, jQuery.validator.format(Please enter at least {0} words.)); - - jQuery.validator.addMethod(rangeWords, function(value, element, params) { - return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length = params[0] value.match(/bw+b/g).length params[1]; - }, jQuery.validator.format(Please enter between {0} and {1} words.)); - -})(); - -jQuery.validator.addMethod(letterswithbasicpunc, function(value, element) { - return this.optional(element) || /^[a-z-.,()'\\s]+$/i.test(value); -}, Letters or punctuation only please); - -jQuery.validator.addMethod(alphanumeric, function(value, element) { - return this.optional(element) || /^\w+$/i.test(value); -}, Letters, numbers, spaces or underscores only please); - -jQuery.validator.addMethod(lettersonly, function(value, element) { - return this.optional(element) || /^[a-z]+$/i.test(value); -}, Letters only please); - -jQuery.validator.addMethod(nowhitespace, function(value, element) { - return this.optional(element) || /^\S+$/i.test(value); -}, No white space please); - -jQuery.validator.addMethod(ziprange, function(value, element) { - return this.optional(element) || /^90[2-5]\d\{2}-\d{4}$/.test(value); -}, Your ZIP-code must be in the range 902xx- to 905-xx-); - -jQuery.validator.addMethod(integer, function(value, element) { - return this.optional(element) || /^-?\d+$/.test(value); -}, A positive or negative non-decimal number please); - -/** -* Return true, if the value is a valid vehicle identification number (VIN). -* -* Works with all kind of text inputs. -* -* @example input type=text size=20 name=VehicleID class={required:true,vinUS:true} / -* @desc Declares a required input element whose value must be a valid vehicle identification number. -* -* @name jQuery.validator.methods.vinUS -* @type Boolean -* @cat Plugins/Validate/Methods -*/ -jQuery.validator.addMethod( - vinUS, - function(v){ - if (v.length != 17) - return false; - var i, n, d, f, cd, cdv; - var LL= [A,B,C,D,E,F,G,H,J,K,L,M,N,P,R,S,T,U,V,W,X,Y,Z]; - var VL= [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9]; - var FL= [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2]; - var rs= 0; - for(i = 0; i 17; i++){ - f = FL[i]; - d = v.slice(i,i+1); - if(i == 8){ - cdv = d; - } - if(!isNaN(d)){ - d *= f; - } - else{ - for(n = 0; n