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

Change subject: Don't cancel payments missing donor details
......................................................................


Don't cancel payments missing donor details

We had been assuming that meant a duplicate authorization (see
https://phabricator.wikimedia.org/T129935 ) but it can also happen
when there's a queue outage.  Leave them for manual resolution.

Bug: T136038
Change-Id: Ibc788d3a486e0f3260e147b559b197d00b66dd96
---
M PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
1 file changed, 10 insertions(+), 8 deletions(-)

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



diff --git a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php 
b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
index be14beb..c4f556c 100644
--- a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
+++ b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php
@@ -34,8 +34,8 @@
        // Actions to take after examining capture request and queue message
        const ACTION_PROCESS = 'process'; // all clear to capture payment
        const ACTION_REJECT = 'reject'; // very likely fraud - cancel the 
authorization
-       const ACTION_REVIEW = 'review'; // potential fraud - do not capture now
-       const ACTION_DUPLICATE = 'duplicate'; // probable duplicate - cancel 
the authorization
+       const ACTION_REVIEW = 'review'; // potential fraud or duplicate - do 
not capture now
+       const ACTION_DUPLICATE = 'duplicate'; // known duplicate - cancel the 
authorization
 
        public static function factory( Authorisation $authMessage ) {
                $obj = new ProcessCaptureRequestJob();
@@ -60,11 +60,13 @@
                );
 
                // Determine if a message exists in the pending queue; if it 
does not then
-               // this payment has already been sent to the verified queue. If 
it does,
-               // we need to check $capture_requested in case we have 
requested a capture
-               // but have not yet received notification of capture success. 
Either case can
-               // occur when a donor submits their credit card details 
multiple times against
-               // a single order ID. We should cancel all the duplicate 
authorizations.
+               // this payment has already been sent to the verified queue, or 
there is a
+               // problem with the queue. If it does exist, we need to check
+               // $capture_requested in case we have requested a capture but 
have not yet
+               // received notification of capture success. Either case can 
occur when a
+               // donor submits their credit card details multiple times 
against a single
+               // order ID. We should cancel duplicate authorizations, but 
leave payments
+               // with missing donor details open for potential manual capture.
                $this->logger->debug( 'Attempting to locate associated message 
in pending queue.' );
                /**
                 * @var \SmashPig\Core\DataStores\KeyedOpaqueDataStore
@@ -143,7 +145,7 @@
                                        "ID '{$this->correlationId}'.",
                                $queueMessage
                        );
-                       return self::ACTION_DUPLICATE;
+                       return self::ACTION_REVIEW;
                }
                if ( $queueMessage->captured ) {
                        $this->logger->info(

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

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

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

Reply via email to