Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

returns module version and website base url upon register #153

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Api/Data/RegisterSharedSecret/ResultInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public function getWebsiteId(): ?int;
*/
public function getModuleVersion(): ?string;

/**
* Retrieve website base url
*
* @return string|null
*/
public function getWebsiteBaseUrl(): ?string;

/**
* Retrieve errors.
*
Expand Down
1 change: 1 addition & 0 deletions Model/RegisterSharedSecret.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function register(string $shopId, string $sharedSecret): ResultInterface
'websiteCode' => $website->getCode(),
'websiteId' => $website->getId(),
'moduleVersion' => $this->moduleVersion->getVersion($shopId),
'websiteBaseUrl' => $website->getDefaultStore()->getBaseUrl(),
]
);
}
Expand Down
15 changes: 15 additions & 0 deletions Model/RegisterSharedSecret/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class Result implements ResultInterface
* @var string|null
*/
private $moduleVersion;

/**
* @var string|null
*/
private $websiteBaseUrl;

/**
* @param string|null $shopId
Expand All @@ -55,6 +60,7 @@ public function __construct(
string $websiteCode = null,
int $websiteId = null,
string $moduleVersion = null,
string $websiteBaseUrl = null,
array $errors = [],
ResultExtensionInterface $extensionAttributes = null
) {
Expand All @@ -64,6 +70,7 @@ public function __construct(
$this->errors = $errors;
$this->websiteId = $websiteId;
$this->moduleVersion = $moduleVersion;
$this->websiteBaseUrl = $websiteBaseUrl;
}

/**
Expand Down Expand Up @@ -98,6 +105,14 @@ public function getModuleVersion(): ?string
return $this->moduleVersion;
}

/**
* @inheritDoc
*/
public function getWebsiteBaseUrl(): ?string
{
return $this->websiteBaseUrl;
}

/**
* @inheritDoc
*/
Expand Down