Bug ACP errors after refund.

Status
Not open for further replies.

AndroidRep

Customer
After refunding a user we are getting the following errors in acp:

Code:
TypeError: Argument 2 passed to DBTech\eCommerce\Service\Order\Complete::__construct() must be an instance of DBTech\eCommerce\Entity\Order, null given, called in /public/src/XF/Container.php on line 270
src/addons/DBTech/eCommerce/Service/Order/Complete.php:52

#0 src/XF/Container.php(270): DBTech\eCommerce\Service\Order\Complete->__construct(Object(XF\Pub\App), NULL, Object(SV\ModeratorEssentials\XF\Entity\User))
#1 src/XF/App.php(1576): XF\Container->createObject('DBTech\\eCommerc...', Array)
#2 src/XF/Container.php(228): XF\App->XF\{closure}('DBTech\\eCommerc...', Array, Object(XF\Container))
#3 src/XF/App.php(2782): XF\Container->create('service', 'DBTech\\eCommerc...', Array)
#4 src/addons/DBTech/eCommerce/Purchasable/Order.php(239): XF\App->service('DBTech\\eCommerc.

["txn_type"] => string(10) "web_accept"
["item_name"] => string(30) "eCommerce order #2831 (xxxx)"
["discount"] => string(4) "0.00"


I saw a post from 2019 where you were adding a work around for this problem, i wonder if it creeped back in ?

Also this error is also prevelent, i dont know if its related to the same user but we have this every time the cronjob runs now.

Code:
TypeError: Argument 1 passed to XF::asVisitor() must be an instance of XF\Entity\User, null given, called in /public/src/addons/DBTech/eCommerce/Repository/License.php on line 417
src/XF.php:473

#0 src/addons/DBTech/eCommerce/Repository/License.php(417): XF::asVisitor(NULL, Object(Closure))
#1 [internal function]: DBTech\eCommerce\Repository\License->DBTech\eCommerce\Repository\{closure}(Object(DBTech\eCommerce\Entity\License))
#2 src/XF/Mvc/Entity/AbstractCollection.php(189): array_filter(Array, Object(Closure))
#3 src/addons/DBTech/eCommerce/Repository/License.php(425): XF\Mvc\Entity\AbstractCollection->

Thanks!
 
Last edited:
Could you please include the full stack trace and context? It appears to have been cut off for both error messages.
 
Could you please include the full stack trace and context? It appears to have been cut off for both error messages.
Yes most certainly, sorry about that.

#1
Code:
#0 src/XF/Container.php(270): DBTech\eCommerce\Service\Order\Complete->__construct(Object(XF\Pub\App), NULL, Object(SV\ModeratorEssentials\XF\Entity\User))
#1 src/XF/App.php(1576): XF\Container->createObject('DBTech\\eCommerc...', Array)
#2 src/XF/Container.php(228): XF\App->XF\{closure}('DBTech\\eCommerc...', Array, Object(XF\Container))
#3 src/XF/App.php(2782): XF\Container->create('service', 'DBTech\\eCommerc...', Array)
#4 src/addons/DBTech/eCommerce/Purchasable/Order.php(239): XF\App->service('DBTech\\eCommerc...', NULL, Object(SV\ModeratorEssentials\XF\Entity\User))
#5 src/XF/Payment/AbstractProvider.php(172): DBTech\eCommerce\Purchasable\Order->completePurchase(Object(XF\Payment\CallbackState))
#6 payment_callback.php(63): XF\Payment\AbstractProvider->completeTransaction(Object(XF\Payment\CallbackState))
#7 {main}

#2
Code:
#0 src/addons/DBTech/eCommerce/Repository/License.php(417): XF::asVisitor(NULL, Object(Closure))
#1 [internal function]: DBTech\eCommerce\Repository\License->DBTech\eCommerce\Repository\{closure}(Object(DBTech\eCommerce\Entity\License))
#2 src/XF/Mvc/Entity/AbstractCollection.php(189): array_filter(Array, Object(Closure))
#3 src/addons/DBTech/eCommerce/Repository/License.php(425): XF\Mvc\Entity\AbstractCollection->filter(Object(Closure))
#4 src/addons/DBTech/eCommerce/Cron/CleanUp.php(30): DBTech\eCommerce\Repository\License->sendExpiredAlerts()
#5 [internal function]: DBTech\eCommerce\Cron\CleanUp::runDailyCleanUp(Object(XF\Entity\CronEntry))
#6 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#7 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#8 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#9 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#10 job.php(42): XF\Job\Manager->runQueue(false, 8)
#11 {main}
 
#1
Code:
#0 src/XF/Container.php(270): DBTech\eCommerce\Service\Order\Complete->__construct(Object(XF\Pub\App), NULL, Object(SV\ModeratorEssentials\XF\Entity\User))
#1 src/XF/App.php(1576): XF\Container->createObject('DBTech\\eCommerc...', Array)
#2 src/XF/Container.php(228): XF\App->XF\{closure}('DBTech\\eCommerc...', Array, Object(XF\Container))
#3 src/XF/App.php(2782): XF\Container->create('service', 'DBTech\\eCommerc...', Array)
#4 src/addons/DBTech/eCommerce/Purchasable/Order.php(239): XF\App->service('DBTech\\eCommerc...', NULL, Object(SV\ModeratorEssentials\XF\Entity\User))
#5 src/XF/Payment/AbstractProvider.php(172): DBTech\eCommerce\Purchasable\Order->completePurchase(Object(XF\Payment\CallbackState))
#6 payment_callback.php(63): XF\Payment\AbstractProvider->completeTransaction(Object(XF\Payment\CallbackState))
#7 {main}
Did you delete the order after refunding it?

#2
Code:
#0 src/addons/DBTech/eCommerce/Repository/License.php(417): XF::asVisitor(NULL, Object(Closure))
#1 [internal function]: DBTech\eCommerce\Repository\License->DBTech\eCommerce\Repository\{closure}(Object(DBTech\eCommerce\Entity\License))
#2 src/XF/Mvc/Entity/AbstractCollection.php(189): array_filter(Array, Object(Closure))
#3 src/addons/DBTech/eCommerce/Repository/License.php(425): XF\Mvc\Entity\AbstractCollection->filter(Object(Closure))
#4 src/addons/DBTech/eCommerce/Cron/CleanUp.php(30): DBTech\eCommerce\Repository\License->sendExpiredAlerts()
#5 [internal function]: DBTech\eCommerce\Cron\CleanUp::runDailyCleanUp(Object(XF\Entity\CronEntry))
#6 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#7 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#8 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#9 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#10 job.php(42): XF\Job\Manager->runQueue(false, 8)
#11 {main}
This appears to be from a deleted user. I've made a couple changes for this in the next version.
 
Did you delete the order after refunding it?

This appears to be from a deleted user. I've made a couple changes for this in the next version.
No the funny thing is the order actually never appeared, the order/user was not processed at all so we refunded him and the spam started.
 
No the funny thing is the order actually never appeared, the order/user was not processed at all so we refunded him and the spam started.
It's entirely impossible for a purchase request to appear without a matching order record. I'll work around this in the next version, but the more plausible solution is that someone manually deleted the order record.
 
It's entirely impossible for a purchase request to appear without a matching order record. I'll work around this in the next version, but the more plausible solution is that someone manually deleted the order record.
I can assure you i am the only person with access to the orders and i did NOT delete any orders.

The user purchased and complained their order was not processed so we refunded them so they can buy again.

At that time there was a error in the ACP but i did not record it, if it happens again i will be sure to save it for you.

Appreciate your responses, thanks again!
 
Sorry to bump this but we had another payment completed today without a matching order.

Looks like the same error:
  • TypeError: Argument 2 passed to DBTech\eCommerce\Service\Order\Complete::__construct() must be an instance of DBTech\eCommerce\Entity\Order, null given, called in /public/src/XF/Container.php on line 270
  • src/addons/DBTech/eCommerce/Service/Order/Complete.php:52
  • Generated by: Unknown account
  • Jul 11, 2020 at 20:13
Stack trace
#0 src/XF/Container.php(270): DBTech\eCommerce\Service\Order\Complete->__construct(Object(XF\Pub\App), NULL, Object(SV\ModeratorEssentials\XF\Entity\User))
#1 src/XF/App.php(1576): XF\Container->createObject('DBTech\\eCommerc...', Array)
#2 src/XF/Container.php(228): XF\App->XF\{closure}('DBTech\\eCommerc...', Array, Object(XF\Container))
#3 src/XF/App.php(2782): XF\Container->create('service', 'DBTech\\eCommerc...', Array)
#4 src/addons/DBTech/eCommerce/Purchasable/Order.php(239): XF\App->service('DBTech\\eCommerc...', NULL, Object(SV\ModeratorEssentials\XF\Entity\User))
#5 src/XF/Payment/AbstractProvider.php(172): DBTech\eCommerce\Purchasable\Order->completePurchase(Object(XF\Payment\CallbackState))
#6 payment_callback.php(63): XF\Payment\AbstractProvider->completeTransaction(Object(XF\Payment\CallbackState))
#7 {main}

["txn_type"] => string(10) "web_accept"
["item_name"] => string(33) "eCommerce order #3478 (xxxx)"
["mc_currency"] => string(3) "USD"

Order 3478 does not exist in the order log, neither pending nor complete.

Is there a way i can insert these orders manually to fix the issues ?
 
I would strongly recommend you contact the users in question and ask them the steps they took.

Also, what's the contents of your "delete pending orders older than" setting, if it's enabled?
 
I would strongly recommend you contact the users in question and ask them the steps they took.

Also, what's the contents of your "delete pending orders older than" setting, if it's enabled?
We have been in contact with the first user and he said he had a totally normal checkout procedure IE add to cart, checkout and pay.

We also do not have any additional errors in the ACP suggesting anything else is failing.

Regarding the expired orders it is set to 5 days.
 
If you search for those order IDs in the xf_dbtech_ecommerce_order_item tables, do they exist there? There's an order_id column in that table as well.

If they do, that would indicate your main xf_dbtech_ecommerce_order table might be corrupted.
 
If you search for those order IDs in the xf_dbtech_ecommerce_order_item tables, do they exist there? There's an order_id column in that table as well.

If they do, that would indicate your main xf_dbtech_ecommerce_order table might be corrupted.

Yes it does exist:
Showing rows 0 - 0 (1 total, Query took 0.0083 seconds.)
 
Zero out of zero would seem to indicate it does not exist. You need to look at the query result, not the query run data.
 
Then this is likely data corruption in your xf_dbtech_ecommerce_order table, unless you have a 3rd party add-on that interfaces with eCommerce in some way. I would recommend running the Optimize and Repair maintenance actions in phpMyAdmin, and if it continues to happen, contact your server administrator.
 
Then this is likely data corruption in your xf_dbtech_ecommerce_order table, unless you have a 3rd party add-on that interfaces with eCommerce in some way. I would recommend running the Optimize and Repair maintenance actions in phpMyAdmin, and if it continues to happen, contact your server administrator.
I really have to disagree with this theory, we have 20 to 30 orders a day without a issue.

The first one i reported was due to issuing a refund but the order also did not exist for some reason.

The second one we just checked further and the first IPN sent from paypal and the email we received from paypal was the payment was on hold for 24 hours so the payment was not completed at first, i wonder if this caused a issue ?

1594482773525.png

We are only using the dbtech_ecommerce_license_purchase and even so a error there would show up in the ACP normally, and it would not explain the other orders all being fine.

Do you have any theory or info as to why the order would be lost at this point in the purchase flow ?

Normally on the Purchase Log the "Purchasable Item:" line would include the order id too.
 
Data corruption on MySQL tables does not mean 100% of the data is erased. There is no other explanation as to why only the xf_dbtech_ecommerce_order table entry is deleted, whereas the xf_dbtech_ecommerce_order_item table entry remains.

There have been multiple instances of payments being on hold here @ this site, so there is no issue there.
 
Hello @AndroidRep,

We hope your ticket regarding DragonByte eCommerce has been addressed to your satisfaction. This ticket has now been scheduled to be closed.

If your ticket has not been resolved, you can reply to this thread at any point in the next 7 days in order to reopen the ticket, afterwards this thread will be closed.

Please do not reply to this thread if your ticket has been resolved.

Thank you.


- DragonByte Technologies, Ltd.
 
Status
Not open for further replies.

DragonByte eCommerce

XenForo 2.0.6+ XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
2,430
Customer rating
4.83 star(s) 6 ratings
Back
Top