jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/376585 )

Change subject: Add __toString method for PaymentTransactionResponse
......................................................................


Add __toString method for PaymentTransactionResponse

There are a lot of useless lines in the logs with

PaymentTransactionResponse Object (     [errors:protected] => Array
(         )      [rawResponse:protected] =>      [message:protected] =>
[gatewayTransactionId:protected] =>      [communicationStatus:protected] =>
[data:protected] =>      [forceCancel:protected] =>
[txnMessage:protected] =>      [redirect:protected] =>  )

Change-Id: I4edfe16498204f8c7ad4c631e90b122b51c61476
---
M gateway_common/PaymentTransactionResponse.php
1 file changed, 20 insertions(+), 0 deletions(-)

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



diff --git a/gateway_common/PaymentTransactionResponse.php 
b/gateway_common/PaymentTransactionResponse.php
index 0499212..374c7c9 100644
--- a/gateway_common/PaymentTransactionResponse.php
+++ b/gateway_common/PaymentTransactionResponse.php
@@ -192,4 +192,24 @@
        public function setRedirect( $redirect ) {
                $this->redirect = $redirect;
        }
+
+       public function __toString() {
+               $stringVal = "Communication Status: 
'{$this->communicationStatus}', " .
+                       "Communication Status: '{$this->communicationStatus}', 
" .
+                       "Gateway Txn ID: '{$this->gatewayTransactionId}', " .
+                       "Message: '{$this->message}', " .
+                       "Txn Message: '{$this->txnMessage}', " .
+                       'Data: ' . print_r( $this->data, true ) . ', ' .
+                       "Force cancel: '{$this->forceCancel}', " .
+                       "Redirect: '{$this->redirect}', " .
+                       "Raw response: '{$this->rawResponse}', Errors: ";
+               $errorStrings = [];
+               foreach ( $this->errors as $error ) {
+                       if ( $error instanceof PaymentError ) {
+                               $errorStrings[] .= ' code ' . 
$error->getErrorCode() .
+                                       ': ' . $error->getDebugMessage();
+                       }
+               }
+               return $stringVal . implode( ';', $errorStrings );
+       }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4edfe16498204f8c7ad4c631e90b122b51c61476
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <ej...@ejegg.com>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Mepps <me...@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