jenkins-bot has submitted this change and it was merged.

Change subject: Add CT_ID to Astropay audit refund messages
......................................................................


Add CT_ID to Astropay audit refund messages

For Astropay, we need to look up log lines by CT_ID instead of
gateway_txn_id.

Bug: T90507
Change-Id: Iccb936309b0f1977b74fbc9aa9065b530a605da8
---
M PaymentProviders/Astropay/Audit/AstropayAudit.php
M PaymentProviders/Astropay/Tests/phpunit/AuditTest.php
2 files changed, 8 insertions(+), 2 deletions(-)

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



diff --git a/PaymentProviders/Astropay/Audit/AstropayAudit.php 
b/PaymentProviders/Astropay/Audit/AstropayAudit.php
index 92ab85d..517fceb 100644
--- a/PaymentProviders/Astropay/Audit/AstropayAudit.php
+++ b/PaymentProviders/Astropay/Audit/AstropayAudit.php
@@ -93,6 +93,7 @@
        }
 
        protected function parseRefund( array $row, array &$msg ) {
+               $msg['contribution_tracking_id'] = 
$this->getContributionTrackingId( $row['Transaction Invoice'] );
                $msg['gateway_parent_id'] = $row['Transaction Reference'];
                $msg['gateway_refund_id'] = 'RFD ' . $row['Reference'];
                $msg['gross_currency'] = 'BRL'; // FIXME when AP adds this 
column!
@@ -100,8 +101,7 @@
        }
 
        protected function parseDonation( array $row, array &$msg ) {
-               $parts = explode( '.', $row['Invoice'] );
-               $msg['contribution_tracking_id'] = $parts[0];
+               $msg['contribution_tracking_id'] = 
$this->getContributionTrackingId( $row['Invoice'] );
                $msg['country'] = $row['Country'];
                $msg['currency'] = 'BRL'; // FIXME when AP adds this column!
                $msg['email'] = $row['User Mail'];
@@ -117,4 +117,9 @@
                        $msg['settled_gross'] = $row['Amount (USD)'];
                }
        }
+
+       protected function getContributionTrackingId( $invoice ) {
+               $parts = explode( '.', $invoice );
+               return $parts[0];
+       }
 }
diff --git a/PaymentProviders/Astropay/Tests/phpunit/AuditTest.php 
b/PaymentProviders/Astropay/Tests/phpunit/AuditTest.php
index bf02552..1669fcc 100644
--- a/PaymentProviders/Astropay/Tests/phpunit/AuditTest.php
+++ b/PaymentProviders/Astropay/Tests/phpunit/AuditTest.php
@@ -43,6 +43,7 @@
                $actual = $output[0];
                $expected = array(
                        'gateway' => 'astropay',
+                       'contribution_tracking_id' => '314159265',
                        'date' => 1434747909,
                        'gross' => '5.00',
                        'gateway_parent_id' => '7654321',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iccb936309b0f1977b74fbc9aa9065b530a605da8
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Cdentinger <cdentin...@wikimedia.org>
Gerrit-Reviewer: XenoRyet <dkozlow...@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