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..0000000 --- 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' => 'EUR', - 'payment_product' => '', - ); - $gateway = $this->getFreshGatewayObject( $init ); - - $gateway->setDummyGatewayResponseCode( 'recurring-NOK' ); - - $result = $gateway->do_transaction( 'Recurring_Charge' ); - - $this->assertEquals( 1, count( $gateway->curled ), 'Should not make another reqest after DO_PAYMENT fails' ); - $this->assertEquals( FinalStatus::FAILED, $gateway->getFinalStatus() ); - } -} ->>>>>>> BRANCH (6ca39c Localisation updates from https://translatewiki.net.) diff --git a/tests/GatewayPageTest.php b/tests/GatewayPageTest.php deleted file mode 100644 index 4d12662..0000000 --- a/tests/GatewayPageTest.php +++ /dev/null @@ -1,108 +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 GatewayPage - */ -class GatewayPageTest extends DonationInterfaceTestCase { - - protected $page; - protected $adapter; - - public function setUp() { - $this->page = new TestingGatewayPage(); - $this->adapter = new TestingGenericAdapter(); - $this->adapter->addRequestData( array( - 'amount' => '200', - 'currency_code' => 'BBD' ) ); - $this->adapter->errorsForRevalidate[0] = array( 'currency_code' => 'blah' ); - $this->adapter->errorsForRevalidate[1] = array(); - $this->page->adapter = $this->adapter; - TestingGenericAdapter::$fakeGlobals = array ( 'FallbackCurrency' => 'USD' ); - parent::setUp(); - } - - public function testFallbackWithNotification() { - TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = true; - - $this->page->validateForm(); - - $this->assertTrue( $this->adapter->validatedOK() ); - - $manualErrors = $this->adapter->getManualErrors(); - $msg = $this->page->msg( 'donate_interface-fallback-currency-notice', 'USD' )->text(); - $this->assertEquals( $msg, $manualErrors['general'] ); - $this->assertEquals( 100, $this->adapter->getData_Unstaged_Escaped( 'amount' ) ); - $this->assertEquals( 'USD', $this->adapter->getData_Unstaged_Escaped( 'currency_code' ) ); - } - - public function testFallbackIntermediateConversion() { - TestingGenericAdapter::$fakeGlobals['FallbackCurrency'] = 'OMR'; - TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = true; - - $this->page->validateForm(); - - $manualErrors = $this->adapter->getManualErrors(); - $msg = $this->page->msg( 'donate_interface-fallback-currency-notice', 'OMR' )->text(); - $this->assertEquals( $msg, $manualErrors['general'] ); - $this->assertEquals( 38, $this->adapter->getData_Unstaged_Escaped( 'amount' ) ); - $this->assertEquals( 'OMR', $this->adapter->getData_Unstaged_Escaped( 'currency_code' ) ); - } - - public function testFallbackWithoutNotification() { - TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = false; - - $this->page->validateForm(); - - $this->assertTrue( $this->adapter->validatedOK() ); - - $manualErrors = $this->adapter->getManualErrors(); - $this->assertEquals( null, $manualErrors['general'] ); - $this->assertEquals( 100, $this->adapter->getData_Unstaged_Escaped( 'amount' ) ); - $this->assertEquals( 'USD', $this->adapter->getData_Unstaged_Escaped( 'currency_code' ) ); - } - - public function testFallbackAlwaysNotifiesIfOtherErrors() { - TestingGenericAdapter::$fakeGlobals['NotifyOnConvert'] = false; - $this->adapter->errorsForRevalidate[1] = array( 'amount' => 'bad amount' ); - - $this->page->validateForm(); - - $manualErrors = $this->adapter->getManualErrors(); - $msg = $this->page->msg( 'donate_interface-fallback-currency-notice', 'USD' )->text(); - $this->assertEquals( $msg, $manualErrors['general'] ); - $this->assertEquals( 100, $this->adapter->getData_Unstaged_Escaped( 'amount' ) ); - $this->assertEquals( 'USD', $this->adapter->getData_Unstaged_Escaped( 'currency_code' ) ); - } - - public function testNoFallbackForSupportedCurrency() { - $this->adapter->errorsForRevalidate[0] = array( 'address' => 'blah' ); - - $this->page->validateForm(); - - $manualErrors = $this->adapter->getManualErrors(); - $this->assertEquals( null, $manualErrors['general'] ); - $this->assertEquals( 200, $this->adapter->getData_Unstaged_Escaped( 'amount' ) ); - $this->assertEquals( 'BBD', $this->adapter->getData_Unstaged_Escaped( 'currency_code' ) ); - } -} ->>>>>>> BRANCH (6ca39c Localisation updates from https://translatewiki.net.) diff --git a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-NOK.testresponse b/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-NOK.testresponse deleted file mode 100644 index 57397ef..0000000 --- a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-NOK.testresponse +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version = "1.0"?> -<XML> - <REQUEST> - <ACTION>DO_PAYMENT</ACTION> - <META> - <MERCHANTID>test</MERCHANTID> - <IPADDRESS>127.0.0.1</IPADDRESS> - <VERSION>1.0</VERSION> - <REQUESTIPADDRESS>127.0.0.1</REQUESTIPADDRESS> - </META> - <PARAMS> - <PAYMENT> - <MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE> - <ORDERID>626113410</ORDERID> - <EFFORTID>2</EFFORTID> - <AMOUNT>155</AMOUNT> - <CURRENCYCODE>USD</CURRENCYCODE> - <HOSTEDINDICATOR>0</HOSTEDINDICATOR> - <AUTHENTICATIONINDICATOR>0</AUTHENTICATIONINDICATOR> - </PAYMENT> - </PARAMS> - <RESPONSE> - <RESULT>NOK</RESULT> - <META> - <REQUESTID>1891851</REQUESTID> - <RESPONSEDATETIME>20140327165513</RESPONSEDATETIME> - </META> - <ERROR> - <CODE>430306</CODE> - <MESSAGE>Card expired</MESSAGE> - </ERROR> - <ROW> - <AVSRESULT>0</AVSRESULT> - <ORDERID>626113410</ORDERID> - </ROW> - </RESPONSE> - </REQUEST> -</XML> diff --git a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring.testresponse b/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring.testresponse deleted file mode 100644 index 691d049..0000000 --- a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring.testresponse +++ /dev/null @@ -1,45 +0,0 @@ -<<<<<<< HEAD (7654b4 Merge branch 'master' into deployment) -======= -<?xml version = "1.0"?> -<XML> - <REQUEST> - <ACTION>DO_PAYMENT</ACTION> - <META> - <MERCHANTID>test</MERCHANTID> - <IPADDRESS>127.0.0.1</IPADDRESS> - <VERSION>1.0</VERSION> - <REQUESTIPADDRESS>127.0.0.1</REQUESTIPADDRESS> - </META> - <PARAMS> - <PAYMENT> - <MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE> - <ORDERID>626113410</ORDERID> - <EFFORTID>2</EFFORTID> - <AMOUNT>155</AMOUNT> - <CURRENCYCODE>USD</CURRENCYCODE> - <HOSTEDINDICATOR>0</HOSTEDINDICATOR> - <AUTHENTICATIONINDICATOR>0</AUTHENTICATIONINDICATOR> - </PAYMENT> - </PARAMS> - <RESPONSE> - <RESULT>OK</RESULT> - <META> - <REQUESTID>1891851</REQUESTID> - <RESPONSEDATETIME>20140327165513</RESPONSEDATETIME> - </META> - <ROW> - <STATUSDATE>20140327165513</STATUSDATE> - <PAYMENTREFERENCE>0</PAYMENTREFERENCE> - <ADDITIONALREFERENCE>14222.39313</ADDITIONALREFERENCE> - <ORDERID>626113410</ORDERID> - <EXTERNALREFERENCE>14222.39313</EXTERNALREFERENCE> - <EFFORTID>2</EFFORTID> - <ATTEMPTID>1</ATTEMPTID> - <AVSRESULT>S</AVSRESULT> - <MERCHANTID>test</MERCHANTID> - <STATUSID>600</STATUSID> - </ROW> - </RESPONSE> - </REQUEST> -</XML> ->>>>>>> BRANCH (6ca39c Localisation updates from https://translatewiki.net.) diff --git a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring.testresponse b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring.testresponse deleted file mode 100644 index a639eb8..0000000 --- a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring.testresponse +++ /dev/null @@ -1,48 +0,0 @@ -<<<<<<< HEAD (7654b4 Merge branch 'master' into deployment) -======= -<XML> - <REQUEST> - <ACTION>GET_ORDERSTATUS</ACTION> - <META> - <MERCHANTID>test</MERCHANTID> - <IPADDRESS>123.123.123.123</IPADDRESS> - <VERSION>2.0</VERSION> - <REQUESTIPADDRESS>123.123.123.123</REQUESTIPADDRESS> - </META> - <PARAMS> - <ORDER> - <ORDERID>626113410</ORDERID> - <EFFORTID>2</EFFORTID> - </ORDER> - </PARAMS> - <RESPONSE> - <RESULT>OK</RESULT> - <META> - <REQUESTID>245</REQUESTID> - <RESPONSEDATETIME>20100419133351</RESPONSEDATETIME> - </META> - <STATUS> - <PAYMENTMETHODID>1</PAYMENTMETHODID> - <STATUSID>600</STATUSID> - <CURRENCYCODE>EUR</CURRENCYCODE> - <FRAUDRESULT>N</FRAUDRESULT> - <EFFORTID>2</EFFORTID> - <CREDITCARDNUMBER>************7977</CREDITCARDNUMBER> - <PAYMENTREFERENCE>0</PAYMENTREFERENCE> - <ATTEMPTID>2</ATTEMPTID> - <MERCHANTID>test</MERCHANTID> - <MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE> - <AMOUNT>155</AMOUNT> - <STATUSDATE>20100419132926</STATUSDATE> - <PAYMENTPRODUCTID>1</PAYMENTPRODUCTID> - <CVVRESULT>0</CVVRESULT> - <AVSRESULT>S</AVSRESULT> - <TOTALAMOUNTPAID>310</TOTALAMOUNTPAID> - <TOTALAMOUNTREFUNDED>0</TOTALAMOUNTREFUNDED> - <ORDERID>9998890004</ORDERID> - <EXPIRYDATE>1210</EXPIRYDATE> - </STATUS> - </RESPONSE> - </REQUEST> -</XML> ->>>>>>> BRANCH (6ca39c Localisation updates from https://translatewiki.net.) diff --git a/tests/includes/Responses/globalcollect/SET_PAYMENT_recurring.testresponse b/tests/includes/Responses/globalcollect/SET_PAYMENT_recurring.testresponse deleted file mode 100644 index c7944d4..0000000 --- a/tests/includes/Responses/globalcollect/SET_PAYMENT_recurring.testresponse +++ /dev/null @@ -1,29 +0,0 @@ -<<<<<<< HEAD (7654b4 Merge branch 'master' into deployment) -======= -<?xml version = "1.0"?> -<XML> - <REQUEST> - <ACTION>SET_PAYMENT</ACTION> - <META> - <MERCHANTID>test</MERCHANTID> - <IPADDRESS>127.0.0.1</IPADDRESS> - <VERSION>1.0</VERSION> - <REQUESTIPADDRESS>127.0.0.1</REQUESTIPADDRESS> - </META> - <PARAMS> - <PAYMENT> - <ORDERID>626113410</ORDERID> - <EFFORTID>2</EFFORTID> - <PAYMENTPRODUCTID>1</PAYMENTPRODUCTID> - </PAYMENT> - </PARAMS> - <RESPONSE> - <RESULT>OK</RESULT> - <META> - <REQUESTID>1891851</REQUESTID> - <RESPONSEDATETIME>20140327165513</RESPONSEDATETIME> - </META> - </RESPONSE> - </REQUEST> -</XML> ->>>>>>> BRANCH (6ca39c Localisation updates from https://translatewiki.net.) -- To view, visit https://gerrit.wikimedia.org/r/225938 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaa21069b0a70ba3c5816fc34d7da74be04f8bd64 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet <dkozlow...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits