【发布时间】:2016-08-24 19:19:42
【问题描述】:
我正在 shopify 中创建/注册“订单/创建”挂钩,但出现以下错误
致命错误:带有消息的未捕获异常“ShopifyApiException” /var/www/wicked_report/shopify.php:70 堆栈中的“无法处理的实体” 跟踪:#0 /var/www/wicked_report/shopifyapp.php(143): ShopifyClient->call('POST', '/admin/webhooks...', Array) #1 {main} 在第 70 行的 /var/www/wicked_report/shopify.php 中抛出
因为我能够创建“客户/创建”钩子。
这是我用来创建挂钩的代码
$customerhook = array("webhook"=>array(
"topic"=>"customers/create",
"address"=>"filepath/customer.php",
"format"=>"json"
)
);
$hook1 = $sc->call('POST', '/admin/webhooks.json', $customerhook);
$orderhook = array("webhook"=>array(
"topic"=>"orders/create",
"address"=>"filepath/order.php",
"format"=>"json"
)
);
$hook2 = $sc->call('POST', '/admin/webhooks.json', $orderhook);
【问题讨论】:
-
什么调用导致错误,第一个或第二个(即哪一行代码是第 143 行)?我上次使用 Shopify 是前一段时间,但“地址”属性是否需要是完整的 URI(带有 http[s])?
-
$orderhook = array("webhook"=>array("topic"=>"orders/create", "address"=>"filepath/order.php", "format"=>" json")); $hook2 = $sc->call('POST', '/admin/webhooks.json', $orderhook);此代码发送错误消息...地址是完整的网址。出于安全原因,我刚刚将其更改为全路径。