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

Change subject: Add order_id to sparse donation messages
......................................................................


Add order_id to sparse donation messages

Needed for pending DB consumption

Bug: T140484
Change-Id: I1cd942473c1277a3d56dde62ccaab9d3d1bcfab9
---
M CrmLink/Messages/DonationInterfaceMessage.php
M PaymentProviders/Amazon/ExpatriatedMessages/PaymentCapture.php
M PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php
M PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
M PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php
5 files changed, 11 insertions(+), 0 deletions(-)

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



diff --git a/CrmLink/Messages/DonationInterfaceMessage.php 
b/CrmLink/Messages/DonationInterfaceMessage.php
index 1538dbe..a707bbc 100644
--- a/CrmLink/Messages/DonationInterfaceMessage.php
+++ b/CrmLink/Messages/DonationInterfaceMessage.php
@@ -28,6 +28,7 @@
        public $last_name_2 = '';
        public $middle_name = '';
        public $net = '';
+       public $order_id = '';
        public $payment_method = '';
        public $payment_submethod = '';
        public $postal_code = '';
diff --git a/PaymentProviders/Amazon/ExpatriatedMessages/PaymentCapture.php 
b/PaymentProviders/Amazon/ExpatriatedMessages/PaymentCapture.php
index d9c0dd5..c051084 100644
--- a/PaymentProviders/Amazon/ExpatriatedMessages/PaymentCapture.php
+++ b/PaymentProviders/Amazon/ExpatriatedMessages/PaymentCapture.php
@@ -6,7 +6,11 @@
 
        // The completion message ID associates the details in this message with
        // a message in the pending queue that has donor and tracking details
+       // TODO: when we've switched over to the pending DB instead of queue,
+       // either change this to a boolean flag, or act like the Adyen
+       // RecordCaptureJob and combine the pending info before sending to Civi
        protected $completion_message_id;
+       protected $order_id;
        protected $contribution_tracking_id;
        protected $fee;
        protected $gateway_status;
@@ -19,6 +23,7 @@
 
                $captureReferenceId = $details['CaptureReferenceId'];
                $this->completion_message_id = "amazon-$captureReferenceId";
+               $this->order_id = $captureReferenceId;
 
                $parts = explode( '-', $captureReferenceId );
                $this->contribution_tracking_id = $parts[0];
@@ -41,6 +46,7 @@
                $queueMsg->date = $this->date;
                $queueMsg->gateway_status = $this->gateway_status;
                $queueMsg->gateway_txn_id = $this->gateway_txn_id;
+               $queueMsg->order_id = $this->order_id;
                $queueMsg->payment_method = 'amazon';
                $queueMsg->fee = $this->fee;
 
diff --git a/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php 
b/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php
index bafd0e9..9524d54 100644
--- a/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php
+++ b/PaymentProviders/Amazon/Tests/phpunit/NormalizeTest.php
@@ -30,6 +30,7 @@
                        'gateway_status' => 'Completed',
                        'gateway_txn_id' => 'P01-0000000-0000000-000000',
                        'gross' => '10.0',
+                       'order_id' => '98765432-1',
                        'payment_method' => 'amazon',
                );
                $stripFields = array(
diff --git a/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php 
b/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
index affe4b5..2d2a749 100644
--- a/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
+++ b/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
@@ -79,7 +79,9 @@
                // a message in the pending queue with the rest of the info we 
need.
                // This differs from the correlationId because we don't get the 
gateway
                // transaction ID unless the donor makes it back to the thank 
you page.
+               // TODO: see comment on 
Amazon\ExpatriatedMessages\PaymentCapture->completion_message_id
                $queueMsg->completion_message_id = 'astropay-' . 
$this->x_invoice;
+               $queueMsg->order_id = $this->x_invoice;
 
                return $queueMsg;
        }
diff --git a/PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php 
b/PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php
index 668282b..572a03e 100644
--- a/PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php
+++ b/PaymentProviders/AstroPay/Tests/phpunit/NormalizeTest.php
@@ -27,6 +27,7 @@
                        'gateway_status' => '9',
                        'gateway_txn_id' => '31912',
                        'gross' => '100.00',
+                       'order_id' => '32303.1',
                );
                $stripFields = array(
                        'propertiesExportedAsKeys',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1cd942473c1277a3d56dde62ccaab9d3d1bcfab9
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to