Katie Horn has submitted this change and it was merged.
Change subject: Use real contribution tracking id for recurring GC
......................................................................
Use real contribution tracking id for recurring GC
We were using a dummy contribution tracking ID to avoid some
mediawiki-dependent code paths, and ended up sending 123456 as the
merchant reference for a few days worth of recurring contributions.
This patch should look up the real tracking id and use that instead
of the dummy.
Change-Id: Idce6d10eb17497a212651a2b7daf6e8b61e6f144
---
M sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
M sites/all/modules/recurring_globalcollect/tests/RecurringGlobalcollectTest.php
2 files changed, 8 insertions(+), 4 deletions(-)
Approvals:
Katie Horn: Looks good to me, approved
diff --git
a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
index 7adf3b3..6d1271a 100644
--- a/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
+++ b/sites/all/modules/recurring_globalcollect/recurring_globalcollect.module
@@ -291,6 +291,11 @@
$subscription = recurring_globalcollect_get_payment_by_id(
$contribution_recur_id );
$transaction = WmfTransaction::from_unique_id( $subscription->trxn_id );
+ $contribution_tracking_id = recurring_get_contribution_tracking_id( array(
+ 'txn_type' => 'subscr_payment',
+ 'subscr_id' => $subscription->trxn_id,
+ 'payment_date' => strtotime( "now" ),
+ ) );
$values = array(
'amount' => $subscription->amount,
'effort_id' => $subscription->processor_id + 1,
@@ -298,9 +303,7 @@
'currency_code' => $subscription->currency,
'payment_product' => '',
'language' => 'en',
- // We just need to avoid some ContributionTracking MediaWiki extension
code,
- // it's possible to look the actual ID, but it should not be necessary.
- 'contribution_tracking_id' => '123456',
+ 'contribution_tracking_id' => $contribution_tracking_id,
// Avoiding some more code.
'referrer' => 'dummy',
);
diff --git
a/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalcollectTest.php
b/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalcollectTest.php
index 710c427..1e8fe3e 100644
---
a/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalcollectTest.php
+++
b/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalcollectTest.php
@@ -42,7 +42,8 @@
'trxn_id' => 'RECURRING GLOBALCOLLECT STUB_ORIG_CONTRIB-' .
mt_rand(),
) );
$this->contributions[] = $result['id'];
- }
+ wmf_civicrm_insert_contribution_tracking( '..rcc', 'civicrm',
wmf_common_date_unix_to_sql( strtotime( 'now' ) ), $result['id'] );
+ }
function tearDown() {
variable_set( 'standalone_globalcollect_adapter_path',
$this->original_standalone_globalcollect_adapter_path );
--
To view, visit https://gerrit.wikimedia.org/r/170378
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idce6d10eb17497a212651a2b7daf6e8b61e6f144
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits