Ejegg has submitted this change and it was merged.

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


Merge branch 'master' into deployment

616d003 pared down iframe stylesheet
e972f67 Catch error queueing final status message
4f0e325 Remove GC account number from tests
b8d0ca2 Handle another GC error indicating Order ID reuse

Change-Id: I3e3dc340f025fe7367983252eb4b63be4512686c
---
D tests/Adapter/GlobalCollect/GlobalCollectTest.php
D 
tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-resume.testresponse
D 
tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-settled.testresponse
D 
tests/includes/Responses/globalcollect/GET_ORDERSTATUS_20001000-expiry.testresponse
D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_21000050.testresponse
D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430260.testresponse
D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430285.testresponse
D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430306.testresponse
D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430330.testresponse
D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430354.testresponse
D tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430357.testresponse
D 
tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring-declined.testresponse
D 
tests/includes/Responses/globalcollect/INSERT_ORDERWITHPAYMENT_duplicate.testresponse
D tests/includes/test_gateway/TestingGlobalCollectAdapter.php
14 files changed, 0 insertions(+), 1,392 deletions(-)

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



diff --git a/tests/Adapter/GlobalCollect/GlobalCollectTest.php 
b/tests/Adapter/GlobalCollect/GlobalCollectTest.php
deleted file mode 100644
index b43744a..0000000
--- a/tests/Adapter/GlobalCollect/GlobalCollectTest.php
+++ /dev/null
@@ -1,624 +0,0 @@
-<<<<<<< HEAD   (a8a458 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.
- *
- */
-use Psr\Log\LogLevel;
-
-/**
- *
- * @group Fundraising
- * @group DonationInterface
- * @group GlobalCollect
- */
-class DonationInterface_Adapter_GlobalCollect_GlobalCollectTest extends 
DonationInterfaceTestCase {
-       public function setUp() {
-               global $wgGlobalCollectGatewayHtmlFormDir;
-
-               parent::setUp();
-
-               $this->setMwGlobals( array(
-                       'wgGlobalCollectGatewayEnabled' => true,
-                       'wgDonationInterfaceAllowedHtmlForms' => array(
-                               'cc-vmad' => array(
-                                       'file' => 
$wgGlobalCollectGatewayHtmlFormDir . '/cc/cc-vmad.html',
-                                       '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';
-       }
-
-       function tearDown() {
-               TestingGlobalCollectAdapter::clearGlobalsCache();
-               parent::tearDown();
-       }
-
-       /**
-        * 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() {
-               $init = self::$initial_vars;
-               unset( $init['order_id'] );
-
-               //no order_id from anywhere, explicit no generate
-               $gateway = $this->getFreshGatewayObject( $init, 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( $init, 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' );
-
-               $_GET['order_id'] = '55555';
-               $_SESSION['Donor']['order_id'] = '44444';
-
-               //conflicting order_id in $GET and $SESSION, default GC 
generation
-               $gateway = $this->getFreshGatewayObject( $init );
-               $this->assertEquals( '55555', 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'GlobalCollect gateway is 
preferring session data over the $_GET. Session should be secondary.' );
-
-               //conflicting order_id in $GET and $SESSION, garbage data in 
$_GET, default GC generation
-               $_GET['order_id'] = 'nonsense!';
-               $gateway = $this->getFreshGatewayObject( $init );
-               $this->assertEquals( '44444', 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'GlobalCollect gateway is not 
ignoring nonsensical order_id candidates' );
-
-               unset( $_GET['order_id'] );
-               //order_id in $SESSION, default GC generation
-               $gateway = $this->getFreshGatewayObject( $init );
-               $this->assertEquals( '44444', 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'GlobalCollect gateway is not 
recognizing the session order_id' );
-
-               $_POST['order_id'] = '33333';
-               //conflicting order_id in $_POST and $SESSION, default GC 
generation
-               $gateway = $this->getFreshGatewayObject( $init );
-               $this->assertEquals( '33333', 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'GlobalCollect gateway is 
preferring session data over the $_POST. Session should be secondary.' );
-
-               $init['order_id'] = '22222';
-               //conflicting order_id in init data, $_POST and $SESSION, 
explicit GC generation, batch mode
-               $gateway = $this->getFreshGatewayObject( $init, array ( 
'order_id_meta' => array ( 'generate' => TRUE ), 'batch_mode' => TRUE, ) );
-               $this->assertEquals( $init['order_id'], 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'Failed asserting that an 
extrenally provided order id is being honored in batch mode' );
-
-               //make sure that decimal numbers are rejected by GC. Should be 
a toss and regen
-               $init['order_id'] = '2143.0';
-               unset( $_POST['order_id'] );
-               unset( $_SESSION['Donor']['order_id'] );
-               //conflicting order_id in init data, $_POST and $SESSION, 
explicit GC generation, batch mode
-               $gateway = $this->getFreshGatewayObject( $init, array ( 
'order_id_meta' => array ( 'generate' => TRUE, 'disallow_decimals' => TRUE ), 
'batch_mode' => TRUE, ) );
-               $this->assertNotEquals( $init['order_id'], 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'Failed assering that a 
decimal order_id was regenerated, when disallow_decimals is true' );
-       }
-
-       /**
-        * Non-exhaustive integration tests to verify that order_id, when in
-        * self-generation mode, won't regenerate until it is told to.
-        * @covers GatewayAdapter::normalizeOrderID
-        * @covers GatewayAdapter::regenerateOrderID
-        */
-       function testStickyGeneratedOrderID() {
-               $init = self::$initial_vars;
-               unset( $init['order_id'] );
-
-               //no order_id from anywhere, explicit generate
-               $gateway = $this->getFreshGatewayObject( $init, array ( 
'order_id_meta' => array ( 'generate' => TRUE ) ) );
-               $this->assertNotNull( $gateway->getData_Unstaged_Escaped( 
'order_id' ), 'Generated order_id is null. The rest of this test is broken.' );
-               $original_order_id = $gateway->getData_Unstaged_Escaped( 
'order_id' );
-
-               $gateway->normalizeOrderID();
-               $this->assertEquals( $original_order_id, 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'Re-normalized order_id has 
changed without explicit regeneration.' );
-
-               //this might look a bit strange, but we need to be able to 
generate valid order_ids without making them stick to anything.
-               $gateway->generateOrderID();
-               $this->assertEquals( $original_order_id, 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'function generateOrderID 
auto-changed the selected order ID. Not cool.' );
-
-               $gateway->regenerateOrderID();
-               $this->assertNotEquals( $original_order_id, 
$gateway->getData_Unstaged_Escaped( 'order_id' ), 'Re-normalized order_id has 
not changed, after explicit regeneration.' );
-       }
-
-       /**
-        * Integration test to verify that order_id can be retrieved from
-        * performing an INSERT_ORDERWITHPAYMENT.
-        */
-       function testOrderIDRetrieval() {
-               $init = $this->getDonorTestData();
-               unset( $init['order_id'] );
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-
-               //no order_id from anywhere, explicit generate
-               $gateway = $this->getFreshGatewayObject( $init, array ( 
'order_id_meta' => array ( 'generate' => FALSE ) ) );
-               $this->assertNull( $gateway->getData_Unstaged_Escaped( 
'order_id' ), 'Ungenerated order_id is not null. The rest of this test is 
broken.' );
-
-               $gateway->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
-
-               $this->assertNotNull( $gateway->getData_Unstaged_Escaped( 
'order_id' ), 'No order_id was retrieved from INSERT_ORDERWITHPAYMENT' );
-       }
-
-       /**
-        * Just run the GET_ORDERSTATUS transaction and make sure we load the 
data
-        */
-       function testGetOrderStatus() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@safedomain.org';
-
-               $gateway = $this->getFreshGatewayObject( $init );
-
-               $gateway->do_transaction( 'GET_ORDERSTATUS' );
-
-               $data = $gateway->getTransactionData();
-
-               $this->assertEquals( 'N', $data['CVVRESULT'], 'CVV Result not 
loaded from XML response' );
-       }
-
-       /**
-        * Don't fraud-fail someone for bad CVV if GET_ORDERSTATUS
-        * comes back with STATUSID 25 and no CVVRESULT
-        * @group CvvResult
-        */
-       function testConfirmCreditCardStatus25() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@safedomain.org';
-
-               $this->setMwGlobals( 'wgRequest',
-                       new FauxRequest( array( 'CVVRESULT' => 'M' ), false ) );
-
-               $gateway = $this->getFreshGatewayObject( $init );
-               $gateway->setDummyGatewayResponseCode( '25' );
-
-               $gateway->do_transaction( 'Confirm_CreditCard' );
-               $action = $gateway->getValidationAction();
-               $this->assertEquals( 'process', $action, 'Gateway should not 
fraud fail on STATUSID 25' );
-       }
-
-       /**
-        * If CVVRESULT is unrecognized, fraud-fail and warn
-        * @group CvvResult
-        */
-       function testConfirmCreditCardBadCVVResult() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@safedomain.org';
-
-               $this->setMwGlobals( 'wgRequest',
-                       new FauxRequest( array( 'CVVRESULT' => ' ' ), false ) );
-
-               $gateway = $this->getFreshGatewayObject( $init );
-               $gateway->setDummyGatewayResponseCode( '800' );
-
-               $gateway->do_transaction( 'Confirm_CreditCard' );
-               $result = $gateway->getCvvResult();
-               $this->assertEquals( false, $result, 'Gateway should fraud fail 
if CVVRESULT is not mapped' );
-               $matches = $this->getLogMatches( LogLevel::WARNING, 
"/Unrecognized cvv_result ' '$/" );
-               $this->assertNotEmpty( $matches, 'Did not log expected warning 
on unmapped CVVRESULT' );
-       }
-
-       /**
-        * We should skip the API call if we're already suspicious
-        */
-       function testGetOrderStatusSkipsIfFail() {
-               DonationInterface_FraudFiltersTest::setupFraudMaps();
-
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'swhipl...@wikipedia.org'; //configured as a 
fraudy domain
-
-               $gateway = $this->getFreshGatewayObject( $init );
-
-               $gateway->do_transaction( 'GET_ORDERSTATUS' );
-
-               $data = $gateway->getTransactionData();
-
-               $this->assertEquals( null, $data['CVVRESULT'], 'preprocess 
should stop API call if fraud detected' );
-       }
-
-       /**
-        * Ensure the Confirm_CreditCard transaction prefers CVVRESULT from the 
XML
-        * over any value from the querystring
-        */
-       function testConfirmCreditCardPrefersXmlCvv() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@safedomain.org';
-
-               $this->setMwGlobals( 'wgRequest',
-                       new FauxRequest( array( 'CVVRESULT' => 'M' ), false ) );
-
-               $gateway = $this->getFreshGatewayObject( $init );
-
-               $gateway->do_transaction( 'Confirm_CreditCard' );
-
-               $this->assertEquals( 'N', 
$gateway->getData_Unstaged_Escaped('cvv_result'), 'CVV Result not taken from 
XML response' );
-       }
-
-       /**
-        * If querystring and XML have different CVVRESULT, that's awfully fishy
-        */
-       function testConfirmCreditCardFailsOnCvvResultConflict() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@safedomain.org';
-
-               $this->setMwGlobals( 'wgRequest',
-                       new FauxRequest( array( 'CVVRESULT' => 'M' ), false ) );
-
-               $gateway = $this->getFreshGatewayObject( $init );
-
-               $result = $gateway->do_transaction( 'Confirm_CreditCard' );
-               // FIXME: this is not a communication failure, it's a fraud 
failure
-               $this->assertFalse( $result->getCommunicationStatus(), 'Credit 
card should fail if querystring and XML have different CVVRESULT' );
-       }
-
-       /**
-        * Make sure we record the actual amount charged, even if the donor has
-        * opened a new window and screwed up their session data.
-        */
-       function testConfirmCreditCardUpdatesAmount() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@safedomain.org';
-               // The values in session are not the values we originally used
-               // for INSERT_ORDERWITHPAYMENT
-               $init['amount'] = '12.50';
-               $init['currency_code'] = 'USD';
-
-               $gateway = $this->getFreshGatewayObject( $init );
-
-               $amount = $gateway->getData_Unstaged_Escaped( 'amount' );
-               $currency = $gateway->getData_Unstaged_Escaped( 'currency_code' 
);
-               $this->assertEquals( '12.50', $amount );
-               $this->assertEquals( 'USD', $currency );
-
-               $gateway->do_transaction( 'Confirm_CreditCard' );
-
-               $amount = $gateway->getData_Unstaged_Escaped( 'amount' );
-               $currency = $gateway->getData_Unstaged_Escaped( 'currency_code' 
);
-               $this->assertEquals( '23.45', $amount, 'Not recording correct 
amount' );
-               $this->assertEquals( 'EUR', $currency, 'Not recording correct 
currency'  );
-       }
-
-       /**
-        * testDefineVarMap
-        *
-        * This is tested with a bank transfer from Spain.
-        *
-        * @covers GlobalCollectAdapter::__construct
-        * @covers GlobalCollectAdapter::defineVarMap
-        */
-       public function testDefineVarMap() {
-
-               $gateway = $this->getFreshGatewayObject( self::$initial_vars );
-
-               $var_map = array(
-                       'ORDERID' => 'order_id',
-                       'AMOUNT' => 'amount',
-                       'CURRENCYCODE' => 'currency_code',
-                       'LANGUAGECODE' => 'language',
-                       'COUNTRYCODE' => 'country',
-                       'MERCHANTREFERENCE' => 'contribution_tracking_id',
-                       'RETURNURL' => 'returnto',
-                       'IPADDRESS' => 'server_ip',
-                       'ISSUERID' => 'issuer_id',
-                       'PAYMENTPRODUCTID' => 'payment_product',
-                       'CVV' => 'cvv',
-                       'EXPIRYDATE' => 'expiration',
-                       'CREDITCARDNUMBER' => 'card_num',
-                       'FIRSTNAME' => 'fname',
-                       'SURNAME' => 'lname',
-                       'STREET' => 'street',
-                       'CITY' => 'city',
-                       'STATE' => 'state',
-                       'ZIP' => 'zip',
-                       'EMAIL' => 'email',
-                       'ACCOUNTHOLDER' => 'account_holder',
-                       'ACCOUNTNAME' => 'account_name',
-                       'ACCOUNTNUMBER' => 'account_number',
-                       'ADDRESSLINE1E' => 'address_line_1e',
-                       'ADDRESSLINE2' => 'address_line_2',
-                       'ADDRESSLINE3' => 'address_line_3',
-                       'ADDRESSLINE4' => 'address_line_4',
-                       'ATTEMPTID' => 'attempt_id',
-                       'AUTHORISATIONID' => 'authorization_id',
-                       'BANKACCOUNTNUMBER' => 'bank_account_number',
-                       'BANKAGENZIA' => 'bank_agenzia',
-                       'BANKCHECKDIGIT' => 'bank_check_digit',
-                       'BANKCODE' => 'bank_code',
-                       'BANKFILIALE' => 'bank_filiale',
-                       'BANKNAME' => 'bank_name',
-                       'BRANCHCODE' => 'branch_code',
-                       'COUNTRYCODEBANK' => 'country_code_bank',
-                       'COUNTRYDESCRIPTION' => 'country_description',
-                       'CUSTOMERBANKCITY' => 'customer_bank_city',
-                       'CUSTOMERBANKSTREET' => 'customer_bank_street',
-                       'CUSTOMERBANKNUMBER' => 'customer_bank_number',
-                       'CUSTOMERBANKZIP' => 'customer_bank_zip',
-                       'DATECOLLECT' => 'date_collect',
-                       'DESCRIPTOR' => 'descriptor',
-                       'DIRECTDEBITTEXT' => 'direct_debit_text',
-                       'DOMICILIO' => 'domicilio',
-                       'EFFORTID' => 'effort_id',
-                       'IBAN' => 'iban',
-                       'IPADDRESSCUSTOMER' => 'user_ip',
-                       'PAYMENTREFERENCE' => 'payment_reference',
-                       'PROVINCIA' => 'provincia',
-                       'SPECIALID' => 'special_id',
-                       'SWIFTCODE' => 'swift_code',
-                       'TRANSACTIONTYPE' => 'transaction_type',
-                       'FISCALNUMBER' => 'fiscal_number',
-               );
-
-               $exposed = TestingAccessWrapper::newFromObject( $gateway );
-               $this->assertEquals( $var_map, $exposed->var_map );
-       }
-
-       public function testLanguageStaging() {
-               $options = $this->getDonorTestData( 'NO' );
-               $options['payment_method'] = 'cc';
-               $options['payment_submethod'] = 'visa';
-               $gateway = $this->getFreshGatewayObject( $options );
-
-               $exposed = TestingAccessWrapper::newFromObject( $gateway );
-               $exposed->stageData();
-
-               $this->assertEquals( $exposed->getData_Staged( 'language' ), 
'no', "'NO' donor's language was inproperly set. Should be 'no'" );
-       }
-
-       public function testLanguageFallbackStaging() {
-               $options = $this->getDonorTestData( 'Catalonia' );
-               $options['payment_method'] = 'cc';
-               $options['payment_submethod'] = 'visa';
-               $gateway = $this->getFreshGatewayObject( $options );
-
-               $exposed = TestingAccessWrapper::newFromObject( $gateway );
-               $exposed->stageData();
-
-               // Requesting the fallback language from the gateway.
-               $this->assertEquals( 'en', $exposed->getData_Staged( 'language' 
) );
-       }
-
-       /**
-        * Make sure unstaging functions don't overwrite core donor data.
-        */
-       public function testAddResponseData_underzealous() {
-               $options = $this->getDonorTestData( 'Catalonia' );
-               $options['payment_method'] = 'cc';
-               $options['payment_submethod'] = 'visa';
-               $gateway = $this->getFreshGatewayObject( $options );
-
-               // This will set staged_data['language'] = 'en'.
-               $exposed = TestingAccessWrapper::newFromObject( $gateway );
-               $exposed->stageData();
-
-               $ctid = mt_rand();
-
-               $gateway->addResponseData( array(
-                       'contribution_tracking_id' => $ctid . '.1',
-               ) );
-
-               $exposed = TestingAccessWrapper::newFromObject( $gateway );
-               // Desired vars were written into normalized data.
-               $this->assertEquals( $ctid, $exposed->dataObj->getVal_Escaped( 
'contribution_tracking_id' ) );
-
-               // Language was not overwritten.
-               $this->assertEquals( 'ca', $exposed->dataObj->getVal_Escaped( 
'language' ) );
-       }
-
-       /**
-        * Tests to make sure that certain error codes returned from GC will or
-        * will not create payments error loglines.
-        */
-       function testCCLogsOnGatewayError() {
-               $init = $this->getDonorTestData( 'US' );
-               unset( $init['order_id'] );
-               $init['ffname'] = 'cc-vmad';
-
-               //this should not throw any payments errors: Just an invalid 
card.
-               $gateway = $this->getFreshGatewayObject( $init );
-               $gateway->setDummyGatewayResponseCode( '430285' );
-               $gateway->do_transaction( 'GET_ORDERSTATUS' );
-               $this->verifyNoLogErrors();
-
-               //Now test one we want to throw a payments error
-               $gateway = $this->getFreshGatewayObject( $init );
-               $gateway->setDummyGatewayResponseCode( '21000050' );
-               $gateway->do_transaction( 'GET_ORDERSTATUS' );
-               $loglines = $this->getLogMatches( LogLevel::ERROR, 
'/Investigation required!/' );
-               $this->assertNotEmpty( $loglines, 'GC Error 21000050 is not 
generating the expected payments log error' );
-
-               //Reset logs
-               $this->testLogger->messages = array();
-
-               //Most irritating version of 20001000 - They failed to enter an 
expiration date on GC's form. This should log some specific info, but not an 
error.
-               $gateway = $this->getFreshGatewayObject( $init );
-               $gateway->setDummyGatewayResponseCode( '20001000-expiry' );
-               $gateway->do_transaction( 'GET_ORDERSTATUS' );
-               $this->verifyNoLogErrors();
-               $loglines = $this->getLogMatches( LogLevel::INFO, 
'/processResponse:.*EXPIRYDATE/' );
-               $this->assertNotEmpty( $loglines, 'GC Error 20001000-expiry is 
not generating the expected payments log line' );
-       }
-
-       /**
-        * Tests to make sure that certain error codes returned from GC will
-        * trigger order cancellation, even if retryable errors also exist.
-        * @dataProvider mcNoRetryCodeProvider
-        */
-       public function testNoMastercardFinesForRepeatOnBadCodes( $code ) {
-               $init = $this->getDonorTestData( 'US' );
-               unset( $init['order_id'] );
-               $init['ffname'] = 'cc-vmad';
-               //Make it not look like an orphan
-               $this->setMwGlobals( 'wgRequest',
-                       new FauxRequest( array(
-                               'CVVRESULT' => 'M',
-                               'AVSRESULT' => '0'
-                       ), false ) );
-
-               //Toxic card should not retry, even if there's an order id 
collision
-               $gateway = $this->getFreshGatewayObject( $init );
-               $gateway->setDummyGatewayResponseCode( $code );
-               $gateway->do_transaction( 'Confirm_CreditCard' );
-               $this->assertEquals( 1, count( $gateway->curled ), "Gateway 
kept trying even with response code $code!  MasterCard could fine us a thousand 
bucks for that!" );
-
-               // Test limbo queue contents.
-               $this->assertEquals( array( true ), $gateway->limbo_messages,
-                       "Gateway did not delete limbo message for code $code!" 
);
-       }
-
-       /**
-        * Tests that two API requests don't send the same order ID and merchant
-        * reference.  This was the case when users doubleclicked and we were
-        * using the last 5 digits of time in seconds as a suffix.  We want to 
see
-        * what happens when a 2nd request comes in while the 1st is still 
waiting
-        * for a CURL response, so here we fake that situation by having CURL 
throw
-        * an exception during the 1st response.
-        */
-       public function testNoDupeOrderId( ) {
-               $this->setMwGlobals( 'wgRequest',
-                       new FauxRequest( array(
-                               'action'=>'donate',
-                               'amount'=>'3.00',
-                               'card_type'=>'amex',
-                               'city'=>'Hollywood',
-                               'contribution_tracking_id'=>'22901382',
-                               'country'=>'US',
-                               'currency_code'=>'USD',
-                               'emailAdd'=>'faketyf...@gmail.com',
-                               'fname'=>'Fakety',
-                               'format'=>'json',
-                               'gateway'=>'globalcollect',
-                               'language'=>'en',
-                               'lname'=>'Fake',
-                               'payment_method'=>'cc',
-                               
'referrer'=>'http://en.wikipedia.org/wiki/Main_Page',
-                               'state'=>'MA',
-                               'street'=>'99 Fake St',
-                               'utm_campaign'=>'C14_en5C_dec_dsk_FR',
-                               'utm_medium'=>'sitenotice',
-                               
'utm_source'=>'B14_120921_5C_lg_fnt_sans.no-LP.cc',
-                               'zip'=>'90210'
-                       ), false ) );
-
-               $gateway = new TestingGlobalCollectAdapter( array( 
'api_request' => 'true' ) );
-               $gateway->setDummyGatewayResponseCode( 'Exception' );
-               try {
-                       $gateway->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
-               }
-               catch ( Exception $e ) {
-                       // totally expected this
-               }
-               $first = $gateway->curled[0];
-               //simulate another request coming in before we get anything 
back from GC
-               $anotherGateway = new TestingGlobalCollectAdapter( array( 
'api_request' => 'true' ) );
-               $anotherGateway->do_transaction( 'INSERT_ORDERWITHPAYMENT' );
-               $second = $anotherGateway->curled[0];
-               $this->assertFalse( $first == $second, 'Two calls to the api 
did the same thing');
-       }
-
-       /**
-        * Tests to see that we don't claim we're going to retry when we aren't
-        * going to. For GC, we really only want to retry on code 300620
-        * @dataProvider benignNoRetryCodeProvider
-        */
-       public function testNoClaimRetryOnBoringCodes( $code ) {
-               $init = $this->getDonorTestData( 'US' );
-               unset( $init['order_id'] );
-               $init['ffname'] = 'cc-vmad';
-               //Make it not look like an orphan
-               $this->setMwGlobals( 'wgRequest',
-                       new FauxRequest( array(
-                               'CVVRESULT' => 'M',
-                               'AVSRESULT' => '0'
-                       ), false ) );
-
-               $gateway = $this->getFreshGatewayObject( $init );
-               $gateway->setDummyGatewayResponseCode( $code );
-               $exposed = TestingAccessWrapper::newFromObject( $gateway );
-               $start_id = $exposed->getData_Staged( 'order_id' );
-               $gateway->do_transaction( 'Confirm_CreditCard' );
-               $finish_id = $exposed->getData_Staged( 'order_id' );
-               $loglines = $this->getLogMatches( LogLevel::INFO, '/Repeating 
transaction on request for vars:/' );
-               $this->assertEmpty( $loglines, "Log says we are going to repeat 
the transaction for code $code, but that is not true" );
-               $this->assertEquals( $start_id, $finish_id, "Needlessly 
regenerated order id for code $code ");
-       }
-
-       /**
-        * doPayment should return an iframe result with normal data
-        */
-       function testDoPaymentSuccess() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@clean.com';
-               $init['ffname'] = 'cc-vmad';
-               unset( $init['order_id'] );
-
-               $gateway = $this->getFreshGatewayObject( $init );
-               $result = $gateway->doPayment();
-               $this->assertEmpty( $result->isFailed(), 'PaymentResult should 
not be failed' );
-               $this->assertEmpty( $result->getErrors(), 'PaymentResult should 
have no errors' );
-               $this->assertEquals( 'url_placeholder', $result->getIframe(), 
'PaymentResult should have iframe set' );
-       }
-
-       /**
-        * doPayment should recover from an attempt to use a duplicate order ID.
-        */
-       function testDuplicateOrderId() {
-               $init = $this->getDonorTestData();
-               $init['payment_method'] = 'cc';
-               $init['payment_submethod'] = 'visa';
-               $init['email'] = 'innoc...@localhost.net';
-               $init['ffname'] = 'cc-vmad';
-               unset( $init['order_id'] );
-
-               $gateway = $this->getFreshGatewayObject( $init );
-               $orig_id = $gateway->getData_Unstaged_Escaped( 'order_id' );
-               $gateway->setDummyGatewayResponseCode( function ( $gateway ) 
use ( $orig_id ) {
-                       if ( $gateway->getData_Unstaged_Escaped( 'order_id' ) 
=== $orig_id ) {
-                               return 'duplicate';
-                       } else {
-                               return null;
-                       }
-               } );
-               $result = $gateway->doPayment();
-               $this->assertEmpty( $result->isFailed(), 'PaymentResult should 
not be failed' );
-               $this->assertEmpty( $result->getErrors(), 'PaymentResult should 
have no errors' );
-       }
-}
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-resume.testresponse
 
b/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-resume.testresponse
deleted file mode 100644
index d9e11fb..0000000
--- 
a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-resume.testresponse
+++ /dev/null
@@ -1,37 +0,0 @@
-<<<<<<< HEAD   (a8a458 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>
-                       <ERROR>
-                               <CODE>400120</CODE>
-                               <MESSAGE>INSERTATTEMPT PAYMENT FOR ORDER 
ALREADY FINAL FOR COMBINATION (1234,9581203623,11)</MESSAGE>
-                       </ERROR>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-settled.testresponse
 
b/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-settled.testresponse
deleted file mode 100644
index d9e11fb..0000000
--- 
a/tests/includes/Responses/globalcollect/DO_PAYMENT_recurring-settled.testresponse
+++ /dev/null
@@ -1,37 +0,0 @@
-<<<<<<< HEAD   (a8a458 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>
-                       <ERROR>
-                               <CODE>400120</CODE>
-                               <MESSAGE>INSERTATTEMPT PAYMENT FOR ORDER 
ALREADY FINAL FOR COMBINATION (1234,9581203623,11)</MESSAGE>
-                       </ERROR>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_20001000-expiry.testresponse
 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_20001000-expiry.testresponse
deleted file mode 100644
index 12f3b5d..0000000
--- 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_20001000-expiry.testresponse
+++ /dev/null
@@ -1,50 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<!--GET_ORDERSTATUS with the most common error 20001000 cause-->
-<?xml version = "1.0"?>
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                               <EFFORTID>1</EFFORTID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20141203003328</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20141203003328</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>2000</AMOUNT>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>S</TYPE>
-                                               <CODE>20001000</CODE>
-                                               <MESSAGE>20001000 REQUEST 
1234567 NULL VALUE NOT ALLOWED FOR EXPIRYDATE</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_21000050.testresponse 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_21000050.testresponse
deleted file mode 100644
index 6ec1fce..0000000
--- 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_21000050.testresponse
+++ /dev/null
@@ -1,53 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<!--Plain, no-problems I_OWP-->
-<?xml version = "1.0"?>
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>D</TYPE>
-                                               <CODE>21000050</CODE>
-                                               <MESSAGE>21000050 REQUEST 
8046577 VALUE ******* OF FIELD CVV IS NOT A NUMBER WITH MINLENGTH 1, MAXLENGTH 
4 AND PRECISION 0</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430260.testresponse 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430260.testresponse
deleted file mode 100644
index a7b6679..0000000
--- a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430260.testresponse
+++ /dev/null
@@ -1,59 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<?xml version = "1.0"?>
-<!-- 'Call security' error and dupe order id.  Should not be retried, even 
though
-there is a recoverable error. Checking the case with recoverable first -->
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>300620</CODE>
-                                               <MESSAGE>300620 Duplicate Order 
ID</MESSAGE>
-                                       </ERROR>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>430260</CODE>
-                                               <MESSAGE>430260 Call Security 
Department</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430285.testresponse 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430285.testresponse
deleted file mode 100644
index 320674d..0000000
--- a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430285.testresponse
+++ /dev/null
@@ -1,53 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<!--Plain, no-problems I_OWP-->
-<?xml version = "1.0"?>
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>430285</CODE>
-                                               <MESSAGE>430285 Not 
authorised</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430306.testresponse 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430306.testresponse
deleted file mode 100644
index 61cadb8..0000000
--- a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430306.testresponse
+++ /dev/null
@@ -1,59 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<?xml version = "1.0"?>
-<!--Expired card error and dupe order id.  Should not be retried even though
-there is a recoverable error. Tests the case with the recoverable error last. 
-->
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>430306</CODE>
-                                               <MESSAGE>430306 Card 
Expired</MESSAGE>
-                                       </ERROR>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>300620</CODE>
-                                               <MESSAGE>300620 Duplicate Order 
ID</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430330.testresponse 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430330.testresponse
deleted file mode 100644
index 269e22a..0000000
--- a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430330.testresponse
+++ /dev/null
@@ -1,53 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<?xml version = "1.0"?>
-<!--Invalid card number.  Should not be retried-->
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>430330</CODE>
-                                               <MESSAGE>430330 Invalid Card 
Number</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430354.testresponse 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430354.testresponse
deleted file mode 100644
index ade795c..0000000
--- a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430354.testresponse
+++ /dev/null
@@ -1,53 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<?xml version = "1.0"?>
-<!--Issuer unknown.  Should not be retried-->
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>430354</CODE>
-                                               <MESSAGE>430354 Issuer 
Unknown</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430357.testresponse 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430357.testresponse
deleted file mode 100644
index bbbc108..0000000
--- a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_430357.testresponse
+++ /dev/null
@@ -1,54 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<?xml version = "1.0"?>
-<!--Lost or stolen card.  Should not be retried, and should be penalized in
-velocity filter.-->
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>430357</CODE>
-                                               <MESSAGE>430357 Lost or Stolen 
Card</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring-declined.testresponse
 
b/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring-declined.testresponse
deleted file mode 100644
index 320674d..0000000
--- 
a/tests/includes/Responses/globalcollect/GET_ORDERSTATUS_recurring-declined.testresponse
+++ /dev/null
@@ -1,53 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<!--Plain, no-problems I_OWP-->
-<?xml version = "1.0"?>
-<XML>
-       <REQUEST>
-               <ACTION>GET_ORDERSTATUS</ACTION>
-               <META>
-                       <MERCHANTID>test</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>2.0</VERSION>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>1234567890</ORDERID>
-                       </ORDER>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>OK</RESULT>
-                       <META>
-                               <REQUESTID>1234567</REQUESTID>
-                               
<RESPONSEDATETIME>20140704021818</RESPONSEDATETIME>
-                       </META>
-                       <STATUS>
-                               <STATUSDATE>20140704021814</STATUSDATE>
-                               <PAYMENTMETHODID>1</PAYMENTMETHODID>
-                               
<MERCHANTREFERENCE>14222.39313</MERCHANTREFERENCE>
-                               <FRAUDRESULT>N</FRAUDRESULT>
-                               <ATTEMPTID>1</ATTEMPTID>
-                               <PAYMENTREFERENCE>0</PAYMENTREFERENCE>
-                               <AMOUNT>155</AMOUNT>
-                               <AVSRESULT>0</AVSRESULT>
-                               <EXPIRYDATE>0714</EXPIRYDATE>
-                               <MERCHANTID>1234</MERCHANTID>
-                               <ORDERID>1234567890</ORDERID>
-                               <STATUSID>100</STATUSID>
-                               
<CREDITCARDNUMBER>************2105</CREDITCARDNUMBER>
-                               <EFFORTID>1</EFFORTID>
-                               <CVVRESULT>M</CVVRESULT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <ERRORS>
-                                       <ERROR>
-                                               <TYPE>B</TYPE>
-                                               <CODE>430285</CODE>
-                                               <MESSAGE>430285 Not 
authorised</MESSAGE>
-                                       </ERROR>
-                               </ERRORS>
-                       </STATUS>
-               </RESPONSE>
-       </REQUEST>
-</XML>
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)
diff --git 
a/tests/includes/Responses/globalcollect/INSERT_ORDERWITHPAYMENT_duplicate.testresponse
 
b/tests/includes/Responses/globalcollect/INSERT_ORDERWITHPAYMENT_duplicate.testresponse
deleted file mode 100644
index f7013b2..0000000
--- 
a/tests/includes/Responses/globalcollect/INSERT_ORDERWITHPAYMENT_duplicate.testresponse
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<XML>
-       <REQUEST>
-               <ACTION>INSERT_ORDERWITHPAYMENT</ACTION>
-               <META>
-                       <MERCHANTID>1234</MERCHANTID>
-                       <IPADDRESS>127.0.0.1</IPADDRESS>
-                       <VERSION>1.0</VERSION>
-                       <REQUESTIPADDRESS>1.2.3.4</REQUESTIPADDRESS>
-               </META>
-               <PARAMS>
-                       <ORDER>
-                               <ORDERID>6022799044</ORDERID>
-                               <AMOUNT>300</AMOUNT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <LANGUAGECODE>en</LANGUAGECODE>
-                               <COUNTRYCODE>US</COUNTRYCODE>
-                               
<MERCHANTREFERENCE>30848751.32810</MERCHANTREFERENCE>
-                               <IPADDRESSCUSTOMER>4.3.2.1</IPADDRESSCUSTOMER>
-                               <EMAIL>test+...@wikimedia.org</EMAIL>
-                       </ORDER>
-                       <PAYMENT>
-                               <PAYMENTPRODUCTID>3</PAYMENTPRODUCTID>
-                               <AMOUNT>300</AMOUNT>
-                               <CURRENCYCODE>USD</CURRENCYCODE>
-                               <LANGUAGECODE>en</LANGUAGECODE>
-                               <COUNTRYCODE>US</COUNTRYCODE>
-                               <HOSTEDINDICATOR>1</HOSTEDINDICATOR>
-                               
<RETURNURL>https://payments.wikimedia.org/index.php/Special:GlobalCollectGatewayResult?order_id=6022799044</RETURNURL>
-                               
<AUTHENTICATIONINDICATOR>0</AUTHENTICATIONINDICATOR>
-                               <FIRSTNAME>Test</FIRSTNAME>
-                               <SURNAME>DupId</SURNAME>
-                               <STREET>123 St.</STREET>
-                               <CITY>Walnut Creek</CITY>
-                               <STATE>CA</STATE>
-                               <ZIP>94597</ZIP>
-                               <EMAIL>test+...@wikimedia.org</EMAIL>
-                       </PAYMENT>
-               </PARAMS>
-               <RESPONSE>
-                       <RESULT>NOK</RESULT>
-                       <META>
-                               <REQUESTID>34582949</REQUESTID>
-                               
<RESPONSEDATETIME>20151208074353</RESPONSEDATETIME>
-                       </META>
-                       <ERROR>
-                               <CODE>400120</CODE>
-                               <MESSAGE>INSERTATTEMPT PAYMENT FOR ORDER 
ALREADY FINAL FOR COMBINATION (1234,6022799044,1)</MESSAGE>
-                       </ERROR>
-               </RESPONSE>
-       </REQUEST>
-</XML>
diff --git a/tests/includes/test_gateway/TestingGlobalCollectAdapter.php 
b/tests/includes/test_gateway/TestingGlobalCollectAdapter.php
deleted file mode 100644
index a758280..0000000
--- a/tests/includes/test_gateway/TestingGlobalCollectAdapter.php
+++ /dev/null
@@ -1,155 +0,0 @@
-<<<<<<< HEAD   (a8a458 Merge branch 'master' into deployment)
-=======
-<?php
-
-/**
- * TestingGlobalCollectAdapter
- *
- * TODO: Add dependency injection to the base class so we don't have to repeat 
code here.
- */
-class TestingGlobalCollectAdapter extends GlobalCollectAdapter {
-
-       public $curled = array ( );
-
-       public $limbo_messages = array();
-
-       public $dummyGatewayResponseCode;
-
-       /**
-        * Also set a useful MerchantID.
-        */
-       public function __construct( $options = array ( ) ) {
-               if ( is_null( $options ) ) {
-                       $options = array ( );
-               }
-
-               //I hate myself for this part, and so do you.
-               //Deliberately not fixing the actual problem for this patchset.
-               //@TODO: Change the way the constructor works in all adapter
-               //objects, such that the mess I am about to make is no longer
-               //necessary. A patchset may already be near-ready for this...
-               if ( array_key_exists( 'order_id_meta', $options ) ) {
-                       $this->order_id_meta = $options['order_id_meta'];
-                       unset( $options['order_id_meta'] );
-               }
-
-               $this->options = $options;
-
-               parent::__construct( $this->options );
-       }
-
-       /**
-        * Clear the static globals cache.
-        */
-       public static function clearGlobalsCache() {
-               self::$globalsCache = array ( );
-       }
-
-       /**
-        * @TODO: Get rid of this and the override mechanism as soon as you
-        * refactor the constructor into something reasonable.
-        * @return type
-        */
-       public function defineOrderIDMeta() {
-               if ( isset( $this->order_id_meta ) ) {
-                       return;
-               }
-               parent::defineOrderIDMeta();
-       }
-
-       // TODO: Store and test the actual messages.
-       public function setLimboMessage( $queue = 'limbo' ) {
-               $this->limbo_messages[] = false;
-       }
-
-       /**
-        * Stub out the limboStomp fn and record the calls
-        */
-       public function deleteLimboMessage( $queue = 'limbo' ) {
-               $this->limbo_messages[] = true;
-       }
-
-       //@TODO: That minfraud jerk needs its own isolated tests.
-       function runAntifraudHooks() {
-               //now screw around with the batch settings to trick the fraud 
filters into triggering
-               $is_batch = $this->isBatchProcessor();
-               $this->batch = true;
-
-               parent::runAntifraudHooks();
-
-               $this->batch = $is_batch;
-       }
-
-       /**
-        * Set the error code you want the dummy response to return
-        */
-       public function setDummyGatewayResponseCode( $code ) {
-               $this->dummyGatewayResponseCode = $code;
-       }
-
-       /**
-        * Set the error code you want the dummy response to return
-        */
-       public function setDummyCurlResponseCode( $code ) {
-               $this->dummyCurlResponseCode = $code;
-       }
-
-       protected function curl_transaction( $data ) {
-               $this->curled[] = $data;
-               return parent::curl_transaction( $data );
-       }
-
-       /**
-        * Load in some dummy response XML so we can test proper response 
processing
-        * @throws RuntimeException
-        */
-       protected function curl_exec( $ch ) {
-               $code = '';
-               if ( $this->dummyGatewayResponseCode ) {
-                       if ( is_array( $this->dummyGatewayResponseCode ) ) {
-                               $code = array_shift( 
$this->dummyGatewayResponseCode );
-                       } elseif ( is_callable( $this->dummyGatewayResponseCode 
) ) {
-                               $code = call_user_func( 
$this->dummyGatewayResponseCode, $this );
-                       } else {
-                               $code = $this->dummyGatewayResponseCode;
-                       }
-               }
-               if ( $code ) {
-                       if ( $code === 'Exception' ) {
-                               throw new RuntimeException('blah!');
-                       }
-                       $code = '_' . $code;
-               }
-
-               //could start stashing these in a further-down subdir if 
payment type starts getting in the way,
-               //but frankly I don't want to write tests that test our dummy 
responses.
-               $file_path = __DIR__ . '/../';
-               $file_path .= 'Responses' . '/' . self::getIdentifier() . '/';
-               $file_path .= $this->getCurrentTransaction() . $code . 
'.testresponse';
-
-               //these are all going to be short, so...
-               if ( file_exists( $file_path ) ) {
-                       return file_get_contents( $file_path );
-               } else {
-                       echo "File $file_path does not exist.\n"; //<-That will 
deliberately break the test.
-                       return false;
-               }
-       }
-
-       /**
-        * Load in some dummy curl response info so we can test proper response 
processing
-        */
-       protected function curl_getinfo( $ch, $opt = null ) {
-               $code = 200; //response OK
-               if ( property_exists( $this, 'dummyCurlResponseCode' ) ) {
-                       $code = ( int ) $this->dummyCurlResponseCode;
-               }
-
-               //put more here if it ever turns out that we care about it.
-               return array (
-                       'http_code' => $code,
-               );
-       }
-
-}
->>>>>>> BRANCH (b8d0ca Handle another GC error indicating Order ID reuse)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e3dc340f025fe7367983252eb4b63be4512686c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to