[DBTech] Payment UI

[DBTech] Payment UI 2.0.1

No permission to download
Anything logged in the server error log?

Server error log:

Code:
TypeError: Macro public:dbtech_payment_profile_macros :: payment_options() error: Cannot access offset of type string on string internal_data/code_cache/templates/l1/s6/public/dbtech_payment_profile_macros.php:36

Generated by: Nirjonmela Mar 9, 2024 at 5:46 PM

Stack trace

#0 src/XF/Template/Templater.php(828): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#1 internal_data/code_cache/templates/l1/s6/public/af_paidregistrations_purchase.php(149): XF\Template\Templater->callMacro('dbtech_payment_...', 'payment_options', Array, Array)
#2 src/XF/Template/Templater.php(1655): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#3 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('af_paidregistra...', Array)
#4 src/XF/Mvc/Renderer/Json.php(86): XF\Template\Template->render()
#5 src/XF/Mvc/Renderer/Json.php(70): XF\Mvc\Renderer\Json->renderHtmlFallback('', 'public:af_paidr...', Array)
#6 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Json->renderView('', 'public:af_paidr...', Array)
#7 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(KL\EditorManager\XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#8 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(KL\EditorManager\XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#10 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#11 src/XF.php(524): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

Request state

array(4) {
  ["url"] => string(172) "/account/upgrade-payment-options?accountType=2&_xfRequestUri=%2Faccount%2Fupgrades&_xfWithData=1&_xfToken=1709984792%2C169cfa0b15c3a272df5566a61c6f6cdf&_xfResponseType=json"
  ["referrer"] => string(39) "/account/upgrades"
  ["_GET"] => array(5) {
    ["accountType"] => string(1) "2"
    ["_xfRequestUri"] => string(17) "/account/upgrades"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(43) "1709984792,169cfa0b15c3a272df5566a61c6f6cdf"
    ["_xfResponseType"] => string(4) "json"
  }
  ["_POST"] => array(0) {
  }
 
Server error log:

Code:
TypeError: Macro public:dbtech_payment_profile_macros :: payment_options() error: Cannot access offset of type string on string internal_data/code_cache/templates/l1/s6/public/dbtech_payment_profile_macros.php:36

Generated by: Nirjonmela Mar 9, 2024 at 5:46 PM

Stack trace

#0 src/XF/Template/Templater.php(828): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#1 internal_data/code_cache/templates/l1/s6/public/af_paidregistrations_purchase.php(149): XF\Template\Templater->callMacro('dbtech_payment_...', 'payment_options', Array, Array)
#2 src/XF/Template/Templater.php(1655): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#3 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('af_paidregistra...', Array)
#4 src/XF/Mvc/Renderer/Json.php(86): XF\Template\Template->render()
#5 src/XF/Mvc/Renderer/Json.php(70): XF\Mvc\Renderer\Json->renderHtmlFallback('', 'public:af_paidr...', Array)
#6 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Json->renderView('', 'public:af_paidr...', Array)
#7 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(KL\EditorManager\XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#8 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(KL\EditorManager\XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#10 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#11 src/XF.php(524): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

Request state

array(4) {
  ["url"] => string(172) "/account/upgrade-payment-options?accountType=2&_xfRequestUri=%2Faccount%2Fupgrades&_xfWithData=1&_xfToken=1709984792%2C169cfa0b15c3a272df5566a61c6f6cdf&_xfResponseType=json"
  ["referrer"] => string(39) "/account/upgrades"
  ["_GET"] => array(5) {
    ["accountType"] => string(1) "2"
    ["_xfRequestUri"] => string(17) "/account/upgrades"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(43) "1709984792,169cfa0b15c3a272df5566a61c6f6cdf"
    ["_xfResponseType"] => string(4) "json"
  }
  ["_POST"] => array(0) {
  }
That’s a bug in Paid Registrations, it doesn’t follow the new standard of loading payment profiles introduced in XF 2.2.12.
 
DragonByte Tech updated [DBTech] Payment UI with a new update entry:

2.0.0 Release Candidate 1

Update highlights​

!!!This version requires PHP 8.0+!!!

This version mainly introduces compatibility with XenForo 2.3. The add-on has been fully updated, meaning no compatibility layers such as loading jQuery or other such patches are required for this add-on.

Furthermore, a few reported bugs since the release of the last version for XenForo 2.2 have also been resolved.


Complete Change Log​

Change: Updated macros to XF...

Read the rest of this update entry...
 
DragonByte Tech updated [DBTech] Payment UI with a new update entry:

2.0.1

Update highlights​

This version improves compatibility with future versions of XenForo by moving certain code calls out of templates.

There are no changes to functionality, but the update is recommended to avoid compatibility issues with the upcoming XenForo v2.3.8 & newer.


Complete Change Log​

Change: Move database query calls from templates to PHP files

Read the rest of this update entry...
 
The account_upgrades template modification in this add-on invalidates and breaks any other account_upgrades modification that comes after it.

I found the issue with 2.0.0 so I just tried upgrading to 2.0.1, but the issue persists (same template modification in both versions).
Well yes, if other addons rely on this block of code to be present:
HTML:
                                        <xf:select name="payment_profile_id">
                                            <xf:option>{{ phrase('(choose_payment_method)') }}</xf:option>
                                            <xf:foreach loop="$upgrade.payment_profile_ids" value="$profileId">
                                                <xf:if is="{$profiles.{$profileId}}">
                                                    <xf:option value="{$profileId}">{{ $profiles.{$profileId}.display_title ?: $profiles.{$profileId}.title }}</xf:option>
                                                </xf:if>
                                            </xf:foreach>
                                        </xf:select>

                                        <span class="inputGroup-splitter"></span>

                                        <xf:button type="submit" icon="purchase" />
in account_upgrades, then they will break after installing this addon.

Are the other addons in the list free? If so, I can install them locally and see if I can add compatibility, but I can't guarantee it.
 
Yeah, i was just deleting my posts to check what you're suggesting first. I'll remove all other add-ons and see which modification is the culprit. Just testing more in depth now.
 
Okay, found the issue; and I'm not sure if it's your add-on or the other one mentioned below, but your template modification and "Better Analytics" template modification don't play well together.

DragonByte Payment UI
account_upgrades Override checkout for multiple payment processors

Better Analytics
account_upgrades Adds payload to purchase buttons

If either of the above 2 template modifications are run at the same time everything breaks.
 
You can't just nuke a bunch of code that other template modifications and other add-on developers may require. Obviously you can and did, but should you?
1. Yes, because it is literally the only way to do what this addon says it does.
2. By that logic, you shouldn't create any skin like UI.X or similar because they change a bunch of the HTML of the site which addons may rely on.
3. I don't personally use any other addon that interacts with that block of code, and this is one of those "I use it personally and it works for me, so why not share it for free" addons.

I'll look into whether I can make any changes to avoid conflicts.
 
Fair enough; I guess I didn't realize that adding a payment form add-on would gimp everything else that touches the payment buttons.
 
Fair enough; I guess I didn't realize that adding a payment form add-on would gimp everything else that touches the payment buttons.
In order to replace the drop-down with individual buttons, I have to remove the drop-down before I can place the individual buttons in its place :)
 
Back
Top Bottom