[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into HEAD
jenkins-bot has submitted this change and it was merged. ( 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(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified 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 ); - $this->asser
[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 = $this-
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into HEAD
jenkins-bot has submitted this change and it was merged. ( 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(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified 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 - 'gross' =
[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...SmashPig[deployment]: Merge branch 'master' into HEAD 8c1ab63 Fix EC recurring pro...
jenkins-bot has submitted this change and it was merged. ( 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(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified 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...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...SmashPig[deployment]: Merge branch 'master' into HEAD
jenkins-bot has submitted this change and it was merged. ( 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 Tests/FileDumperTest.php D phpunit.xml 25 files changed, 0 insertions(+), 1,241 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified 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', - 'propertiesEx
[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', - 'propertiesExcludedFromEx
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[deployment]: Merge branch 'master' into HEAD
jenkins-bot has submitted this change and it was merged. 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(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified 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 = $this->pendingDatabase->fetchMessageByGatewayOrderId( - 'adye
[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 = $this->pendingDatabase->fet