
Getting this error when doing a checkout....
"TypeError: Argument 5 passed to uc_payment_enter() must be of the type array, object given, called in .../modules/ubercart/payment/uc_credit/src/CreditCardPaymentMethodBase.php on line 625 in uc_payment_enter() (line 146 of .../modules/ubercart/payment/uc_payment/uc_payment.module) #0 "
Comments
Comment #2
tr CreditAttribution: tr commentedWhat payment method are you using? About a month ago I added type hinting to the uc_payment_enter() parameters (http://cgit.drupalcode.org/ubercart/commit/?id=c85275a), which affects that 5th parameter. I'm pretty sure all of core Ubercart is correctly passing an array, not an object, but I can't speak for other contributed modules...
Regardless, the important information here would be where is the uc_payment_enter() call coming from - that's the code that needs fixing.
Comment #3
tr CreditAttribution: tr commentedHmm, maybe PayPal Website Payment Pro?
If so, try this patch. I don't see anything else in core Ubercart that looks like it could be a problem.
Comment #4
tr CreditAttribution: tr commentedOr, better yet, let's make that a little more consistent with what we do in uc_authorizenet.
Comment #5
cayenne CreditAttribution: cayenne commentedSorry, this is Paypal Website Payments Pro.
I'll set up a test site to try the current release of the dev. I had to revert to keep the business running!
Comment #6
cayenne CreditAttribution: cayenne commenteddeleted. mis-patched
Comment #7
cayenne CreditAttribution: cayenne commentedRe #6 above, the payments are getting through, but the ipn callback is triggering an error, it seems. Paypal reports the payments as being made, and the order now shows as completed on my site, but the user experiences an error with whitescreen on checkout.
So... Progress, but....
Comment #8
cayenne CreditAttribution: cayenne commentedHere is the error we get. It's in the post-sale side, being the ipn that should not give us the white error screen.
The key, I guess is undefined method Drupal\uc_paypal\Controller\PayPalController::logger()
Error: Call to undefined method Drupal\uc_paypal\Controller\PayPalController::logger() in Drupal\uc_paypal\Controller\PayPalController->processIpn() (line 174 of /***Drupal***/modules/ubercart/payment/uc_paypal/src/Controller/PayPalController.php) #0 /***Drupal***/modules/ubercart/payment/uc_paypal/src/Controller/PayPalController.php(93): Drupal\uc_paypal\Controller\PayPalController->processIpn(Array) #1 [internal function]: Drupal\uc_paypal\Controller\PayPalController->ipn(Object(Symfony\Component\HttpFoundation\Request)) #2 /***Drupal***/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #3 /***Drupal***/core/lib/Drupal/Core/Render/Renderer.php(576): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #4 /***Drupal***/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #5 /***Drupal***/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #6 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #7 /***Drupal***/vendor/symfony/http-kernel/HttpKernel.php(153): call_user_func_array(Object(Closure), Array) #8 /***Drupal***/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #9 /***Drupal***/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #10 /***Drupal***/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /***Drupal***/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /***Drupal***/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /***Drupal***/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /***Drupal***/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /***Drupal***/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /***Drupal***/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /***Drupal***/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #18 {main}.
Comment #9
cayenne CreditAttribution: cayenne commentedShould the call to $this->logger() instead be \Drupal::logger?
Further note, when I comment out line 174, it reveals a next error:
Error: Call to undefined method Drupal\Component\Render\HtmlEscapedText::toString() in Drupal\uc_paypal\Plugin\Ubercart\PaymentMethod\PayPalWebsitePaymentsPro->chargeCard() (line 218 of /..../modules/ubercart/payment/uc_paypal/src/Plugin/Ubercart/PaymentMethod/PayPalWebsitePaymentsPro.php) #0 /..../modules/ubercart/payment/uc_credit/src/CreditCardPaymentMethodBase.php(619): .........
Comment #10
tr CreditAttribution: tr commentedTry this... (Now using $this->getLogger() because ControllerBase has changed since we wrote this and now we don't have to inject the logger anymore...)
Comment #11
cayenne CreditAttribution: cayenne commentedSUCCESS with the patch in #10
"Order complete
Your order is complete! Your order number is 29.
Thank you for shopping at..."
Comment #13
tr CreditAttribution: tr commentedOK, committed. Thanks for testing the patch.
Can you test another small PayPal patch while you're at it? #2800003-8: New Paypal IPN address for HTTPS
Comment #14
cayenne CreditAttribution: cayenne commentedThe patch referenced in #13 works both with Paypal Standard and WSP.
Nice work.
Comment #15
tr CreditAttribution: tr commentedCommitted fix.