forked from rvvup/magento-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
cacd049
commit 494bb1c
Showing
21 changed files
with
537 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Rvvup\Payments\Api\Data; | ||
|
||
interface WebhookInterface | ||
{ | ||
/** | ||
* String constants for property names | ||
*/ | ||
public const WEBHOOK_ID = "webhook_id"; | ||
public const ID = "id"; | ||
public const PAYLOAD = "payload"; | ||
|
||
/** | ||
* Getter for Id. | ||
* | ||
* @return int|null | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* Setter for Id. | ||
* | ||
* @param int|null $id | ||
* | ||
* @return void | ||
*/ | ||
public function setId($id); | ||
|
||
/** | ||
* Getter for Payload. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getPayload(): ?string; | ||
|
||
/** | ||
* Setter for Payload. | ||
* | ||
* @param string|null $payload | ||
* | ||
* @return void | ||
*/ | ||
public function setPayload(?string $payload): void; | ||
} |
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,32 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Rvvup\Payments\Api; | ||
|
||
use Rvvup\Payments\Api\Data\WebhookInterface; | ||
|
||
interface WebhookRepositoryInterface | ||
{ | ||
/** | ||
* @param array $data | ||
* @return WebhookInterface | ||
*/ | ||
public function new(array $data = []): WebhookInterface; | ||
|
||
/** | ||
* @param WebhookInterface $webhook | ||
* @return WebhookInterface | ||
*/ | ||
public function save(WebhookInterface $webhook): WebhookInterface; | ||
|
||
/** | ||
* @param int $id | ||
* @return WebhookInterface | ||
*/ | ||
public function getById(int $id): WebhookInterface; | ||
|
||
/** | ||
* @param WebhookInterface $webhook | ||
* @return WebhookInterface | ||
*/ | ||
public function delete(WebhookInterface $webhook): WebhookInterface; | ||
} |
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 declare(strict_types=1); | ||
|
||
namespace Rvvup\Payments\Model\Data; | ||
|
||
use Magento\Framework\Model\AbstractModel; | ||
use Rvvup\Payments\Api\Data\WebhookInterface; | ||
use Rvvup\Payments\Model\ResourceModel\WebhookResource; | ||
|
||
class WebhookData extends AbstractModel implements WebhookInterface | ||
{ | ||
/** @var string */ | ||
protected $_eventPrefix = 'rvvup_webhook'; | ||
|
||
/** | ||
* Set resource | ||
*/ | ||
protected function _construct() | ||
{ | ||
$this->_init(WebhookResource::class); | ||
} | ||
|
||
/** | ||
* Getter for Payload. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getPayload(): ?string | ||
{ | ||
return $this->getData(self::PAYLOAD); | ||
} | ||
|
||
/** | ||
* Setter for Payload. | ||
* | ||
* @param string|null $payload | ||
* | ||
* @return void | ||
*/ | ||
public function setPayload(?string $payload): void | ||
{ | ||
$this->setData(self::PAYLOAD, $payload); | ||
} | ||
} |
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
Oops, something went wrong.