-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* Copyright � 2015 SIGNIFYD Inc. All rights reserved. | ||
* See LICENSE.txt for license details. | ||
*/ | ||
namespace Signifyd\Connect\Model; | ||
|
||
use Magento\Config\Model\Config\CommentInterface; | ||
use Magento\Framework\UrlInterface; | ||
|
||
|
||
/** | ||
* Defines link data for the comment field in the config page | ||
*/ | ||
class WebhookLink implements CommentInterface | ||
{ | ||
/** | ||
* @var \Magento\Framework\UrlInterface | ||
*/ | ||
protected $_urlInterface; | ||
|
||
public function __construct( | ||
UrlInterface $urlInterface) | ||
{ | ||
$this->_urlInterface = $urlInterface; | ||
} | ||
|
||
public function getCommentText($elementValue) | ||
{ | ||
$url = ""; | ||
if($this->_urlInterface != null) | ||
{ | ||
$url = $this->_urlInterface->getRouteUrl("signifyd/webhooks/index"); | ||
$url = str_replace("/admin", "", $url); | ||
$url = "<a href=\"" . $url . "\">$url</a>"; | ||
} | ||
else | ||
{ | ||
$url = "{{store url}}/signifyd/webhooks/index"; | ||
} | ||
return "Scores will be updated via webhooks. Please setup webhooks on your Signifyd account page (Webhook URL for this site is $url"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters