yoomoney / cms-drupal8

YooKassa payment module for Drupal 8.x
https://yookassa.ru/developers
3 stars 6 forks source link

Warning: Trying to access array offset on value of type null в YooKassaEventSubscriber->onSendSecondReceipt() (строка 99) #26

Open superromeo opened 2 years ago

superromeo commented 2 years ago

Предупреждение при окончании успешного платежа.

Тип | php понедельник, 10 января 2022 - 13:10 Гость (не проверено) https://xn----7sblvlgns.xn--p1ai/payment/notify/yookassa_ru   Warning: Trying to access array offset on value of type null в Drupal\yookassa\EventSubscriber\YooKassaEventSubscriber->onSendSecondReceipt() (строка 99 из /DATA/home-sites/lom/web/modules/contrib/commerce_yookassa/src/EventSubscriber/YooKassaEventSubscriber.php)

0 /DATA/home-sites/lom/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real(2, 'Trying to acces...', '/DATA/home-site...', 99)

1 /DATA/home-sites/lom/web/modules/contrib/commerce_yookassa/src/EventSubscriber/YooKassaEventSubscriber.php(99): _drupal_error_handler(2, 'Trying to acces...', '/DATA/home-site...', 99)

2 [internal function]: Drupal\yookassa\EventSubscriber\YooKassaEventSubscriber->onSendSecondReceipt(Object(Drupal\commerce_order\Event\OrderEvent), 'commerce_order....', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))

3 /DATA/home-sites/lom/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Drupal\commerce_order\Event\OrderEvent), 'commerce_order....', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))

4 /DATA/home-sites/lom/web/modules/contrib/commerce/src/CommerceContentEntityStorage.php(60): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Drupal\commerce_order\Event\OrderEvent), 'commerce_order....')

5 /DATA/home-sites/lom/web/modules/contrib/commerce/modules/order/src/OrderStorage.php(64): Drupal\commerce\CommerceContentEntityStorage->invokeHook('presave', Object(Drupal\commerce_order\Entity\Order))

6 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(567): Drupal\commerce_order\OrderStorage->invokeHook('presave', Object(Drupal\commerce_order\Entity\Order))

7 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(750): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\commerce_order\Entity\Order))

8 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(521): Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object(Drupal\commerce_order\Entity\Order))

9 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(802): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\commerce_order\Entity\Order))

10 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\commerce_order\Entity\Order))

11 /DATA/home-sites/lom/web/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(95): Drupal\Core\Entity\EntityBase->save()

12 /DATA/home-sites/lom/web/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(59): Drupal\commerce_payment\PaymentOrderUpdater->updateOrder(Object(Drupal\commerce_order\Entity\Order), true)

13 /DATA/home-sites/lom/web/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(106): Drupal\commerce_payment\PaymentOrderUpdater->updateOrders()

14 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php(51): Drupal\commerce_payment\PaymentOrderUpdater->destruct()

15 [internal function]: Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))

16 /DATA/home-sites/lom/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))

17 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(100): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...')

18 /DATA/home-sites/lom/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))

19 /DATA/home-sites/lom/web/core/lib/Drupal/Core/DrupalKernel.php(686): Stack\StackedHttpKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))

20 /DATA/home-sites/lom/web/index.php(22): Drupal\Core\DrupalKernel->terminate(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpFoundation\Response))

21 {main}.

Идентификатор платежа: 296e1983-000f-5000-9000-13870e0406cc

ostulov commented 2 years ago

Добрый день!

В настройках модуля ЮKassa проверьте, как заполнены значения для отправки второго чека. Попробуйте пересохранить эти настройки.

superromeo commented 2 years ago

У меня Отправлять в ЮKassa данные для чеков (54-ФЗ) не отмечено. Отметить? А где заполнять значения для отправки второго чека?

superromeo commented 2 years ago

Увидел.

superromeo commented 2 years ago

Заполнил. Оплатил. Вот мой лог: screenshot

1.

Warning: Trying to access array offset on value of type null в Drupal\yookassa\Plugin\Commerce\PaymentGateway\YooKassa->onNotify() (строка 553 из /DATA/home-sites/lom/web/modules/contrib/commerce_yookassa/src/Plugin/Commerce/PaymentGateway/YooKassa.php)

0 /DATA/home-sites/lom/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real(2, 'Trying to acces...', '/DATA/home-site...', 553)

1 /DATA/home-sites/lom/web/modules/contrib/commerce_yookassa/src/Plugin/Commerce/PaymentGateway/YooKassa.php(553): _drupal_error_handler(2, 'Trying to acces...', '/DATA/home-site...', 553)

2 /DATA/home-sites/lom/web/modules/contrib/commerce/modules/payment/src/Controller/PaymentNotificationController.php(35): Drupal\yookassa\Plugin\Commerce\PaymentGateway\YooKassa->onNotify(Object(Symfony\Component\HttpFoundation\Request))

3 [internal function]: Drupal\commerce_payment\Controller\PaymentNotificationController->notifyPage(Object(Drupal\commerce_payment\Entity\PaymentGateway), Object(Symfony\Component\HttpFoundation\Request))

4 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)

5 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()

6 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))

7 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)

8 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()

9 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)

10 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

11 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

12 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

13 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)

14 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)

15 /DATA/home-sites/lom/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

16 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

17 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

18 /DATA/home-sites/lom/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

19 /DATA/home-sites/lom/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

20 /DATA/home-sites/lom/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))

21 {main}

.

2.

TypeError: YooKassa\Model\Notification\NotificationWaitingForCapture::__construct(): Argument #1 ($source) must be of type array, null given, called in /DATA/home-sites/lom/web/modules/contrib/commerce_yookassa/src/Plugin/Commerce/PaymentGateway/YooKassa.php on line 555 в YooKassa\Model\Notification\NotificationWaitingForCapture->__construct() (строка 74 из /DATA/home-sites/lom/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationWaitingForCapture.php)

0 /DATA/home-sites/lom/web/modules/contrib/commerce_yookassa/src/Plugin/Commerce/PaymentGateway/YooKassa.php(555): YooKassa\Model\Notification\NotificationWaitingForCapture->__construct(NULL)

1 /DATA/home-sites/lom/web/modules/contrib/commerce/modules/payment/src/Controller/PaymentNotificationController.php(35): Drupal\yookassa\Plugin\Commerce\PaymentGateway\YooKassa->onNotify(Object(Symfony\Component\HttpFoundation\Request))

2 [internal function]: Drupal\commerce_payment\Controller\PaymentNotificationController->notifyPage(Object(Drupal\commerce_payment\Entity\PaymentGateway), Object(Symfony\Component\HttpFoundation\Request))

3 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)

4 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()

5 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))

6 /DATA/home-sites/lom/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)

7 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()

8 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)

9 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

10 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

11 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

12 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)

13 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)

14 /DATA/home-sites/lom/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

15 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

16 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

17 /DATA/home-sites/lom/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

18 /DATA/home-sites/lom/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

19 /DATA/home-sites/lom/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))

20 {main}

.

Настройки: screenshot_2

ostulov commented 2 years ago

Сделали исправление этой проблемы в последней версии модуля v2.2.5