Shopify 卸载 webhook 在安装应用程序时请求卸载 url
Shopify uninstall webhook requesting uninstall url when installing app
我有一个问题,当商店卸载我的应用程序时,我的 Shopify webhook 会在安装应用程序时触发我的卸载路由。如果我卸载应用程序,我的卸载路径会按预期触发。我只是不明白为什么它会在安装应用程序时触发。
我的 webhook 有问题吗?
这是我的 webhook 代码:
$webhook = $this->sh->call([
'URL' => 'https://'.$shop.'/admin/webhooks.json',
'METHOD' => 'POST',
'DATA' => array (
'webhook' => array (
'topic' => 'app/uninstalled',
'address' => 'https://myserver.homelinux.com/uninstall',
'format' => 'json',
)
)
], false);
我在商店接受付款交易时调用此代码。它立即请求我的 address
url https://myserver.homelinux.com/uninstall
我的理解是这个应该注册webhook,只有在店铺卸载app的时候才会请求这个地址
如果 help/advice 有这个就好了。
上面的代码没问题,问题出在别处。我的逻辑现在如下并且按预期工作:
if($this->isNotActive($shop)){
$this->registerUninstallWebHook($shop);
}
我有一个问题,当商店卸载我的应用程序时,我的 Shopify webhook 会在安装应用程序时触发我的卸载路由。如果我卸载应用程序,我的卸载路径会按预期触发。我只是不明白为什么它会在安装应用程序时触发。
我的 webhook 有问题吗?
这是我的 webhook 代码:
$webhook = $this->sh->call([
'URL' => 'https://'.$shop.'/admin/webhooks.json',
'METHOD' => 'POST',
'DATA' => array (
'webhook' => array (
'topic' => 'app/uninstalled',
'address' => 'https://myserver.homelinux.com/uninstall',
'format' => 'json',
)
)
], false);
我在商店接受付款交易时调用此代码。它立即请求我的 address
url https://myserver.homelinux.com/uninstall
我的理解是这个应该注册webhook,只有在店铺卸载app的时候才会请求这个地址
如果 help/advice 有这个就好了。
上面的代码没问题,问题出在别处。我的逻辑现在如下并且按预期工作:
if($this->isNotActive($shop)){
$this->registerUninstallWebHook($shop);
}