Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public function createWebhooks(string $storeName, array $topics) |
||
35 | { |
||
36 | $api = $this->apis->getForStore($storeName); |
||
37 | |||
38 | foreach ($topics as $topic) { |
||
39 | $webhook = GenericResource::create([ |
||
40 | 'topic' => $topic, |
||
41 | 'address' => $this->webhookUrl, |
||
42 | 'format' => 'json', |
||
43 | ]); |
||
44 | |||
45 | $api->Webhook->create($webhook); |
||
46 | } |
||
49 |