Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390306 )

Change subject: Demote error to warning, change WS
......................................................................

Demote error to warning, change WS

Logger::error will send a failmail - let's not do that when we're
still going to retry.

Bug: T177893
Change-Id: Icca3161ff75da00a11804164975e18be748262bf
---
M PaymentProviders/Adyen/WSDL/Payment.php
1 file changed, 15 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/06/390306/1

diff --git a/PaymentProviders/Adyen/WSDL/Payment.php 
b/PaymentProviders/Adyen/WSDL/Payment.php
index ae62e79..3c629a8 100644
--- a/PaymentProviders/Adyen/WSDL/Payment.php
+++ b/PaymentProviders/Adyen/WSDL/Payment.php
@@ -499,19 +499,17 @@
                'Type' => 'Type',
        );
 
-       protected $count;
        protected $retries;
        protected $uri = 'http://payment.services.adyen.com';
 
        public function Payment( $wsdl = 
"https://pal-live.adyen.com/pal/Payment.wsdl";, $options = array() ) {
-               $this->retries = 
Context::get()->getProviderConfiguration()->val('curl/retries');
+               $this->retries = 
Context::get()->getProviderConfiguration()->val( 'curl/retries' );
                foreach ( self::$classmap as $key => $value ) {
                        if ( !isset( $options['classmap'][$key] ) ) {
                                $options['classmap'][$key] = $value;
                        }
-                       $options['connection_timeout'] = 
Context::get()->getProviderConfiguration()->val('curl/timeout');
+                       $options['connection_timeout'] = 
Context::get()->getProviderConfiguration()->val( 'curl/timeout' );
                        $options['exceptions'] = true;
-
                }
                parent::__construct( $wsdl, $options );
        }
@@ -624,7 +622,6 @@
         */
        public function refund( refund $parameters ) {
                return $this->makeApiCall( 'refund', $parameters );
-
        }
 
        /**
@@ -638,19 +635,24 @@
        }
 
        protected function makeApiCall ( $path, $parameters ) {
-               $this->count = 0;
-               while ( $this->count < $this->retries ) {
+               $count = 0;
+               while ( $count < $this->retries ) {
                        try {
-                               return $this->__soapCall( $path, 
array($parameters), array('uri' => $this->uri, 'soapaction' => '') );
-                       } catch (\SoapFault $e) {
-                $this->count += 1;
-                               if ($this->count == $this->retries) {
+                               return $this->__soapCall(
+                                       $path,
+                                       array( $parameters ),
+                                       array( 'uri' => $this->uri, 
'soapaction' => '' )
+                               );
+                       } catch ( \SoapFault $e ) {
+                               $count += 1;
+                               if ( $count == $this->retries ) {
                                        throw $e;
                                }
-                               Logger::error( "Exception caught in Soap call 
$path: {$e->getMessage()}", $e->getTrace(), $e );
+                               Logger::warning(
+                                       "Exception caught in Soap call $path: 
{$e->getMessage()}", $e->getTrace(), $e
+                               );
                        }
                }
-
        }
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icca3161ff75da00a11804164975e18be748262bf
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

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

Reply via email to