Problem/Motivation

I cant specify it in the metadata but I am testing Payment + Drupal 9.

I am using this module for the first time and the handbook information is a little too convoluted to just install and start using the module. There are quite a lot of moving parts and configuration steps (though not as many as commerce!) so getting started with a simple payment on a node is not so simple. It would be great to have some simple documented installation steps (from module install to making a payment) or even better to include a submodule with an example content type + payment field preconfigured.

I cant locate documentation on how to just add a payment form to a node. Assuming that adding a field as a "payment form" is the way to go (is that correct?)... I add the field, then a add a line item. When I save the item instead of the rendered entity I see a white screen with error message:

The website encountered an unexpected error. Please try again later.

and a log error

Type	php
Date	Thursday, August 26, 2021 - 10:49
User	user1
Location	http://kindful.syntapse.co.uk/product/voucher
Referrer	https://kindful.syntapse.co.uk/node/34/edit
Message	Error: Call to undefined function Drupal\payment\Entity\bcadd() in Drupal\payment\Entity\Payment->getAmount() (line 345 of /var/www/html/web/modules/contrib/payment/src/Entity/Payment.php)
#0 /var/www/html/web/modules/contrib/payment/src/Plugin/Payment/Method/PaymentMethodBase.php(365): Drupal\payment\Entity\Payment->getAmount()
#1 /var/www/html/web/modules/contrib/payment/src/Plugin/Payment/Method/PaymentMethodBase.php(207): Drupal\payment\Plugin\Payment\Method\PaymentMethodBase->executePaymentAccessCurrency(Object(Drupal\Core\Session\AccountProxy))
#2 /var/www/html/web/modules/contrib/payment/src/Plugin/Payment/Method/PaymentExecutionPaymentMethodManager.php(64): Drupal\payment\Plugin\Payment\Method\PaymentMethodBase->executePaymentAccess(Object(Drupal\Core\Session\AccountProxy))
#3 /var/www/html/web/modules/contrib/plugin/src/PluginDiscovery/PluginDiscoveryDecorator.php(58): Drupal\payment\Plugin\Payment\Method\PaymentExecutionPaymentMethodManager->processDecoratedDefinitions(Array)
#4 /var/www/html/web/modules/contrib/plugin/src/PluginDiscovery/PluginDiscoveryDecorator.php(58): Drupal\plugin\PluginDiscovery\PluginDiscoveryDecorator->getDefinitions()
#5 /var/www/html/web/modules/contrib/plugin/src/Plugin/Plugin/PluginSelector/AdvancedPluginSelectorBase.php(66): Drupal\plugin\PluginDiscovery\PluginDiscoveryDecorator->getDefinitions()
#6 /var/www/html/web/modules/contrib/payment/modules/payment_form/src/Entity/Payment/PaymentForm.php(106): Drupal\plugin\Plugin\Plugin\PluginSelector\AdvancedPluginSelectorBase->buildSelectorForm(Array, Object(Drupal\Core\Form\FormState))
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityForm.php(106): Drupal\payment_form\Entity\Payment\PaymentForm->form(Array, Object(Drupal\Core\Form\FormState))
#8 [internal function]: Drupal\Core\Entity\EntityForm->buildForm(Array, Object(Drupal\Core\Form\FormState))
#9 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(532): call_user_func_array(Array, Array)
#10 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(278): Drupal\Core\Form\FormBuilder->retrieveForm('payment_payment...', Object(Drupal\Core\Form\FormState))
#11 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\payment_form\Entity\Payment\PaymentForm), Object(Drupal\Core\Form\FormState))
#12 /var/www/html/web/modules/contrib/payment/modules/payment_form/src/Plugin/Field/FieldFormatter/PaymentForm.php(127): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\payment\Entity\Payment), 'payment_form')
#13 /var/www/html/web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\payment_form\Plugin\Field\FieldFormatter\PaymentForm->viewElements(Object(Drupal\Core\Field\FieldItemList), 'en')
#14 /var/www/html/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(263): Drupal\Core\Field\FormatterBase->view(Object(Drupal\Core\Field\FieldItemList), 'en')
#15 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array)
#16 /var/www/html/web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full')
#17 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full')
#18 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(239): Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array)
#19 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build(Array)
#20 /var/www/html/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#21 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(786): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#22 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(377): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#23 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(201): Drupal\Core\Render\Renderer->doRender(Array, false)
#24 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(241): Drupal\Core\Render\Renderer->render(Array, false)
#25 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(578): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#26 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#27 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#28 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#29 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#30 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#31 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(163): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#32 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(716): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#41 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#42 {main}
.
Severity	Error
Hostname	172.28.2.1
Operations	

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Syntapse created an issue.