XenoRyet has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/386019 )

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

Merge branch 'master' into deployment

1b34555 Add .editorconfig
1c12a5b Add sqlite3 to requre-dev
be10b92 Handle additional type of failed recurrance.

Change-Id: I6de3786fe314a708617ecbb6d7da5af7ca4aee7c
---
D 
PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
D 
PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
D PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
3 files changed, 0 insertions(+), 238 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/19/386019/1

diff --git 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
deleted file mode 100644
index 845fc4e..0000000
--- 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "payment_cycle": "Monthly",
-  "txn_type": "recurring_payment_suspended_due_to_max_failed_payment",
-  "last_name": "Public",
-  "next_payment_date": "N/A",
-  "residence_country": "US",
-  "initial_payment_amount": "0.00",
-  "rp_invoice_id": "49006681",
-  "currency_code": "USD",
-  "time_created": "06:14:38 Aug 02, 2017 PDT",
-  "verify_sign": "AjCMMDabnuh7zx7wI4NpWflSS.lHAqA5jlFVAAuXLAx61931ulA3ylnl",
-  "period_type": " Regular",
-  "payer_status": "verified",
-  "tax": "0.00",
-  "payer_email": "j...@public.com",
-  "first_name": "John",
-  "receiver_email": "nob...@wikimedia.org",
-  "payer_id": "WK4ADPUHGWN6U",
-  "product_type": "1",
-  "shipping": "0.00",
-  "amount_per_cycle": "5.00",
-  "profile_status": "Suspended",
-  "charset": "UTF-8",
-  "notify_version": "3.8",
-  "amount": "5.00",
-  "outstanding_balance": "15.00",
-  "recurring_payment_id": "I-WCJA1MBC3CWY",
-  "product_name": "Monthly donation to the Wikimedia Foundation",
-  "ipn_track_id": "4b8cbe1a39fec"
-}
\ No newline at end of file
diff --git 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
deleted file mode 100644
index 3f5bcce..0000000
--- 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "subscr_id": "I-WCJA1MBC3CWY",
-  "txn_type": "subscr_failed",
-  "contribution_tracking_id": "49006681",
-  "order_id": "49006681",
-  "email": "j...@public.com",
-  "first_name": "John",
-  "last_name": "Public",
-  "country": "US",
-  "gateway": "paypal_ec",
-  "recurring": "1",
-  "gross": "5.00",
-  "currency": "USD",
-  "date": "1501679678"
-}
diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
deleted file mode 100644
index 28ecaca..0000000
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ /dev/null
@@ -1,193 +0,0 @@
-<<<<<<< HEAD   (d056a1 Merge branch 'master' into deployment 77a7ef7 Short 
array sy)
-=======
-<?php
-namespace SmashPig\PaymentProviders\PayPal\Tests;
-
-use SmashPig\Core\Context;
-use SmashPig\Core\GlobalConfiguration;
-use SmashPig\Core\ProviderConfiguration;
-use SmashPig\CrmLink\Messages\SourceFields;
-use SmashPig\PaymentProviders\PayPal\Listener;
-use SmashPig\Tests\BaseSmashPigUnitTestCase;
-use SmashPig\Core\Http\Response;
-use SmashPig\Core\Http\Request;
-use SmashPig\Core\DataStores\JsonSerializableObject;
-use SmashPig\Tests\TestingProviderConfiguration;
-
-/**
- * Test the IPN listener which receives messages, stores and processes them.
- * @group PayPal
- */
-class CaptureIncomingMessageTest extends BaseSmashPigUnitTestCase {
-
-       /**
-        * @var GlobalConfiguration
-        */
-       public $config;
-
-       /**
-        * @var ProviderConfiguration
-        */
-       public $providerConfig;
-
-       /**
-        * @var array
-        */
-       // filename and the queue it should get dropped in
-       static $message_data = [
-               'web_accept.json' => 'donations',
-               'express_checkout.json' => 'donations',
-               'recurring_payment_profile_created.json' => 'recurring',
-               'subscr_signup.json' => 'recurring',
-               'subscr_payment.json' => 'recurring',
-               'recurring_payment.json' => 'recurring',
-               'refund.json' => 'refund',
-               'refund_ec.json' => 'refund',
-               'refund_recurring_ec.json' => 'refund',
-               'chargeback_settlement.json' => 'refund',
-               'chargeback_settlement_ec.json' => 'refund',
-               'buyer_complaint.json' => 'refund',
-               'refund_other.json' => 'refund',
-               'refund_unauthorized_spoof.json' => 'refund',
-               'refund_admin_fraud_reversal.json' => 'refund',
-               'recurring_payment_suspended_due_to_max_failed_payment.json' => 
'recurring',
-               // this should not actually get written to
-               // TODO 'new_case.json' => 'no-op',
-       ];
-
-       public function setUp() {
-               parent::setUp();
-               $this->config = Context::get()->getGlobalConfiguration();
-               $this->providerConfig = $this->setProviderConfiguration( 
'paypal' );
-       }
-
-       public function tearDown() {
-               $this->providerConfig->overrideObjectInstance( 'curl/wrapper', 
null );
-               parent::tearDown();
-       }
-
-       public function messageProvider() {
-               $messages = [];
-               foreach ( self::$message_data as $file => $type ) {
-                       $payloadFile = __DIR__ . '/../Data/' . $file;
-                       $messageData = [
-                               'type' => $type,
-                               'payload' => json_decode(
-                                       file_get_contents( $payloadFile ),
-                                       true
-                               )
-                       ];
-                       $transformedFile = str_replace( '.json', 
'_transformed.json', $payloadFile );
-                       if ( file_exists( $transformedFile ) ) {
-                               $messageData['transformed'] = json_decode(
-                                       file_get_contents( $transformedFile ),
-                                       true
-                               );
-                       }
-                       $messages[] = [ $messageData ];
-               }
-               return $messages;
-       }
-
-       private function capture( $msg ) {
-               $request = new Request( $msg );
-               $response = new Response;
-               $listener = new Listener;
-               return $listener->execute( $request, $response );
-       }
-
-       protected function getCurlMock( $returnString ) {
-               $wrapper = $this->getMock( 'SmashPig\Core\Http\CurlWrapper' );
-               $wrapper->method( 'execute' )
-                       ->willReturn( [
-                               'body' => $returnString
-                       ] );
-               $this->providerConfig->overrideObjectInstance( 'curl/wrapper', 
$wrapper );
-               return $wrapper;
-       }
-
-       /**
-        * @dataProvider messageProvider
-        */
-       public function testCapture( $msg ) {
-               $this->getCurlMock( 'VERIFIED' );
-               $this->capture( $msg['payload'] );
-
-               $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
-               $jobMessage = $jobQueue->pop();
-
-               $this->assertEquals( $jobMessage['php-message-class'],
-                       'SmashPig\PaymentProviders\PayPal\Job' );
-
-               $this->assertEquals( $jobMessage['payload'], $msg['payload'] );
-       }
-
-       public function testBlankMessage() {
-               $this->capture( [] );
-               $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
-               $this->assertNull( $jobQueue->pop() );
-       }
-
-       /**
-        * @dataProvider messageProvider
-        */
-       public function testConsume( $msg ) {
-               $this->getCurlMock( 'VERIFIED' );
-               $this->capture( $msg['payload'] );
-
-               $jobQueue = $this->config->object( 'data-store/jobs-paypal' );
-               $jobMessage = $jobQueue->pop();
-
-               $job = JsonSerializableObject::fromJsonProxy(
-                       $jobMessage['php-message-class'],
-                       json_encode( $jobMessage )
-               );
-
-               $job->execute();
-
-               $queue = $this->config->object( 'data-store/' . $msg['type'] );
-               $message = $queue->pop();
-
-               if ( $job->is_reject() ) {
-                       $this->assertEmpty( $message );
-               } else {
-                       $this->assertNotEmpty( $message );
-                       if ( isset( $message['contribution_tracking_id'] ) ) {
-                               $this->assertEquals( 
$message['contribution_tracking_id'], $message['order_id'] );
-                       }
-
-                       if ( isset( $message['supplemental_address_1'] ) ) {
-                               $this->assertNotEquals(
-                                       $message['supplemental_address_1'],
-                                       "{$message['first_name']} 
{$message['last_name']}"
-                               );
-                       }
-                       if ( isset( $msg['transformed'] ) ) {
-                               SourceFields::removeFromMessage( $message );
-                               $this->assertEquals( $msg['transformed'], 
$message );
-                       }
-               }
-       }
-
-       public function testFailedVerification() {
-               $this->getCurlMock( 'INVALID' );
-               $jobMessage = [ 'txn_type' => 'fail' ];
-               $this->assertFalse( $this->capture( $jobMessage ) );
-       }
-
-       public function testRetryValidator() {
-               $validator = $this->providerConfig->object( 'curl/validator' );
-               $response = [
-                       'status' => 200,
-                       'headers' => [],
-                       'body' => 
'<html><head><title>Fail</title></head><body>Oops</body></html>'
-               ];
-               $this->assertTrue( $validator->shouldRetry( $response ) );
-               $response['body'] = 'INVALID';
-               $this->assertFalse( $validator->shouldRetry( $response ) );
-               $response['body'] = 'VERIFIED';
-               $this->assertFalse( $validator->shouldRetry( $response ) );
-       }
-
-}
->>>>>>> BRANCH (be10b9 Handle additional type of failed recurrance.)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6de3786fe314a708617ecbb6d7da5af7ca4aee7c
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: deployment
Gerrit-Owner: XenoRyet <dkozlow...@wikimedia.org>

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

Reply via email to