[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Handle additional type of failed recurrance.

2017-10-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/383949 )

Change subject: Handle additional type of failed recurrance.
..


Handle additional type of failed recurrance.

Sort transaction type 'recurring_payment_suspended_due_to_max_failed_payment' 
into it's proper slot.

Bug: T178086
Change-Id: I3b63ced8c957ff97c071846ad72873b5e2b56bbd
---
M PaymentProviders/PayPal/RecurringMessage.php
A 
PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
A 
PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
M config/paypal/main.yaml
5 files changed, 48 insertions(+), 0 deletions(-)

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



diff --git a/PaymentProviders/PayPal/RecurringMessage.php 
b/PaymentProviders/PayPal/RecurringMessage.php
index e840fc2..8fe1644 100644
--- a/PaymentProviders/PayPal/RecurringMessage.php
+++ b/PaymentProviders/PayPal/RecurringMessage.php
@@ -55,6 +55,7 @@
case 'recurring_payment_failed':
case 'recurring_payment_skipped':
case 'recurring_payment_suspended':
+   case 
'recurring_payment_suspended_due_to_max_failed_payment':
$message['txn_type'] = 'subscr_failed';
break;
 
diff --git 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
new file mode 100644
index 000..845fc4e
--- /dev/null
+++ 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
@@ -0,0 +1,30 @@
+{
+  "payment_cycle": "Monthly",
+  "txn_type": "recurring_payment_suspended_due_to_max_failed_payment",
+  "last_name": "Public",
+  "next_payment_date": "N/A",
+  "residence_country": "US",
+  "initial_payment_amount": "0.00",
+  "rp_invoice_id": "49006681",
+  "currency_code": "USD",
+  "time_created": "06:14:38 Aug 02, 2017 PDT",
+  "verify_sign": "AjCMMDabnuh7zx7wI4NpWflSS.lHAqA5jlFVAAuXLAx61931ulA3ylnl",
+  "period_type": " Regular",
+  "payer_status": "verified",
+  "tax": "0.00",
+  "payer_email": "j...@public.com",
+  "first_name": "John",
+  "receiver_email": "nob...@wikimedia.org",
+  "payer_id": "WK4ADPUHGWN6U",
+  "product_type": "1",
+  "shipping": "0.00",
+  "amount_per_cycle": "5.00",
+  "profile_status": "Suspended",
+  "charset": "UTF-8",
+  "notify_version": "3.8",
+  "amount": "5.00",
+  "outstanding_balance": "15.00",
+  "recurring_payment_id": "I-WCJA1MBC3CWY",
+  "product_name": "Monthly donation to the Wikimedia Foundation",
+  "ipn_track_id": "4b8cbe1a39fec"
+}
\ No newline at end of file
diff --git 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
new file mode 100644
index 000..3f5bcce
--- /dev/null
+++ 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
@@ -0,0 +1,15 @@
+{
+  "subscr_id": "I-WCJA1MBC3CWY",
+  "txn_type": "subscr_failed",
+  "contribution_tracking_id": "49006681",
+  "order_id": "49006681",
+  "email": "j...@public.com",
+  "first_name": "John",
+  "last_name": "Public",
+  "country": "US",
+  "gateway": "paypal_ec",
+  "recurring": "1",
+  "gross": "5.00",
+  "currency": "USD",
+  "date": "1501679678"
+}
diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
index ea0cb1e..3cb6fc7 100644
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
@@ -48,6 +48,7 @@
'refund_other.json' => 'refund',
'refund_unauthorized_spoof.json' => 'refund',
'refund_admin_fraud_reversal.json' => 'refund',
+   'recurring_payment_suspended_due_to_max_failed_payment.json' => 
'recurring',
// this should not actually get written to
// TODO 'new_case.json' => 'no-op',
];
diff --git a/config/paypal/main.yaml b/config/paypal/main.yaml
index c95ebe1..94b61ad 100644
--- a/config/paypal/main.yaml
+++ b/config/paypal/main.yaml
@@ -17,6 +17,7 @@
 
 # TODO: merge this with DonationInterface style var_map
 var_map:
+time_created: date
 payment_date: date # needs strtotime(payment_date)
 # FIXME Recurring messages use non-normalized field names, for example:
 txn_type: txn_type

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

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Handle additional type of failed recurrance.

2017-10-12 Thread XenoRyet (Code Review)
XenoRyet has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/383949 )

Change subject: Handle additional type of failed recurrance.
..

Handle additional type of failed recurrance.

Sort transaction type 'recurring_payment_suspended_due_to_max_failed_payment' 
into it's proper slot.

Bug: T178086
Change-Id: I3b63ced8c957ff97c071846ad72873b5e2b56bbd
---
M PaymentProviders/PayPal/RecurringMessage.php
A 
PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
A 
PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
M config/paypal/main.yaml
5 files changed, 48 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/49/383949/1

diff --git a/PaymentProviders/PayPal/RecurringMessage.php 
b/PaymentProviders/PayPal/RecurringMessage.php
index e840fc2..8fe1644 100644
--- a/PaymentProviders/PayPal/RecurringMessage.php
+++ b/PaymentProviders/PayPal/RecurringMessage.php
@@ -55,6 +55,7 @@
case 'recurring_payment_failed':
case 'recurring_payment_skipped':
case 'recurring_payment_suspended':
+   case 
'recurring_payment_suspended_due_to_max_failed_payment':
$message['txn_type'] = 'subscr_failed';
break;
 
diff --git 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
new file mode 100644
index 000..845fc4e
--- /dev/null
+++ 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment.json
@@ -0,0 +1,30 @@
+{
+  "payment_cycle": "Monthly",
+  "txn_type": "recurring_payment_suspended_due_to_max_failed_payment",
+  "last_name": "Public",
+  "next_payment_date": "N/A",
+  "residence_country": "US",
+  "initial_payment_amount": "0.00",
+  "rp_invoice_id": "49006681",
+  "currency_code": "USD",
+  "time_created": "06:14:38 Aug 02, 2017 PDT",
+  "verify_sign": "AjCMMDabnuh7zx7wI4NpWflSS.lHAqA5jlFVAAuXLAx61931ulA3ylnl",
+  "period_type": " Regular",
+  "payer_status": "verified",
+  "tax": "0.00",
+  "payer_email": "j...@public.com",
+  "first_name": "John",
+  "receiver_email": "nob...@wikimedia.org",
+  "payer_id": "WK4ADPUHGWN6U",
+  "product_type": "1",
+  "shipping": "0.00",
+  "amount_per_cycle": "5.00",
+  "profile_status": "Suspended",
+  "charset": "UTF-8",
+  "notify_version": "3.8",
+  "amount": "5.00",
+  "outstanding_balance": "15.00",
+  "recurring_payment_id": "I-WCJA1MBC3CWY",
+  "product_name": "Monthly donation to the Wikimedia Foundation",
+  "ipn_track_id": "4b8cbe1a39fec"
+}
\ No newline at end of file
diff --git 
a/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
new file mode 100644
index 000..3f5bcce
--- /dev/null
+++ 
b/PaymentProviders/PayPal/Tests/Data/recurring_payment_suspended_due_to_max_failed_payment_transformed.json
@@ -0,0 +1,15 @@
+{
+  "subscr_id": "I-WCJA1MBC3CWY",
+  "txn_type": "subscr_failed",
+  "contribution_tracking_id": "49006681",
+  "order_id": "49006681",
+  "email": "j...@public.com",
+  "first_name": "John",
+  "last_name": "Public",
+  "country": "US",
+  "gateway": "paypal_ec",
+  "recurring": "1",
+  "gross": "5.00",
+  "currency": "USD",
+  "date": "1501679678"
+}
diff --git 
a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php 
b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
index ea0cb1e..3cb6fc7 100644
--- a/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
+++ b/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
@@ -48,6 +48,7 @@
'refund_other.json' => 'refund',
'refund_unauthorized_spoof.json' => 'refund',
'refund_admin_fraud_reversal.json' => 'refund',
+   'recurring_payment_suspended_due_to_max_failed_payment.json' => 
'recurring',
// this should not actually get written to
// TODO 'new_case.json' => 'no-op',
];
diff --git a/config/paypal/main.yaml b/config/paypal/main.yaml
index c95ebe1..94b61ad 100644
--- a/config/paypal/main.yaml
+++ b/config/paypal/main.yaml
@@ -17,6 +17,7 @@
 
 # TODO: merge this with DonationInterface style var_map
 var_map:
+time_created: date
 payment_date: date # needs strtotime(payment_date)
 # FIXME Recurring messages use non-normalized field names, for example:
 txn_type: txn_type

-- 
To view, visit https://gerrit.wikimedia.org/r/383949
To unsubsc