Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue job fails when syncing subscription orders #46

Closed
aelvan opened this issue Sep 7, 2019 · 1 comment
Closed

Queue job fails when syncing subscription orders #46

aelvan opened this issue Sep 7, 2019 · 1 comment

Comments

@aelvan
Copy link

aelvan commented Sep 7, 2019

Description

I'm trying to sync in existing orders for subscriptions from Stripe, but get the following error:

2019-09-07 23:07:08 [-][1][-][error][craft\queue\QueueLogBehavior::afterError]  [1] Syncing Subscription Orders (attempt: 1) - Error (time: 1.394s): Call to a member function format() on bool
2019-09-07 23:07:08 [-][1][-][error][Error] Error: Call to a member function format() on bool in /mypath/vendor/enupal/stripe/src/jobs/SyncSubscriptionPayments.php:134
Stack trace:
#0 /mypath/vendor/yiisoft/yii2-queue/src/Queue.php(214): enupal\stripe\jobs\SyncSubscriptionPayments->execute(Object(craft\queue\Queue))
#1 /mypath/vendor/yiisoft/yii2-queue/src/cli/Queue.php(147): yii\queue\Queue->handleMessage('1', 'O:43:"enupal\\st...', '3600', 1)
#2 /mypath/vendor/craftcms/cms/src/queue/Queue.php(96): yii\queue\cli\Queue->handleMessage('1', 'O:43:"enupal\\st...', '3600', 1)
#3 /mypath/vendor/craftcms/cms/src/controllers/QueueController.php(86): craft\queue\Queue->run()
#4 /mypath/vendor/craftcms/cms/src/controllers/QueueController.php(106): craft\controllers\QueueController->actionRun()
#5 [internal function]: craft\controllers\QueueController->actionRetry()
#6 /mypath/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#7 /mypath/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#8 /mypath/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('retry', Array)
#9 /mypath/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('retry', Array)
#10 /mypath/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('queue/retry', Array)
#11 /mypath/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application->runAction('queue/retry', Array)
#12 /mypath/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#13 /mypath/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#14 /mypath/web/index.php(21): yii\base\Application->run()
#15 {main}

The line that fail is:

$newOrder->dateOrdered = DateTimeHelper::toDateTime($invoice['date'])->format('Y-m-d H:i:s');

I logged $invoice, and there is no key date. There is created though, and if I change the line above to $invoice['created'], the job works. No idea if this is the case for all types of orders though.

Steps to reproduce

...

Additional info

  • Craft version: 3.3.1.1
  • PHP version: 7.3.8
  • Database driver & version: Mysql 5.7.26
  • Plugin version: 2.0.4
andrelopez added a commit that referenced this issue Sep 7, 2019
@andrelopez
Copy link
Member

Hi @aelvan we just released v2.0.5 with a fix to this issue

Thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants