Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Adyen Magento2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared Libs
Adyen Magento2
Commits
57cb7dc3
Commit
57cb7dc3
authored
May 31, 2016
by
rikterbeek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add retrieve version from url
parent
e6676afa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
9 deletions
+31
-9
Block/Adminhtml/System/Config/Field/Version.php
Block/Adminhtml/System/Config/Field/Version.php
+5
-8
Controller/Process/Json.php
Controller/Process/Json.php
+13
-0
Helper/Data.php
Helper/Data.php
+13
-1
No files found.
Block/Adminhtml/System/Config/Field/Version.php
View file @
57cb7dc3
...
...
@@ -30,12 +30,9 @@ class Version extends \Magento\Config\Block\System\Config\Form\Field
{
/**
* Contains list of modules
*
* @var \Magento\Framework\Module\ModuleListInterface
* @var \Adyen\Payment\Helper\Data
*/
protected
$_moduleList
;
protected
$_adyenHelper
;
/**
* Version constructor.
* @param \Magento\Framework\Module\ModuleListInterface $moduleList
...
...
@@ -43,12 +40,12 @@ class Version extends \Magento\Config\Block\System\Config\Form\Field
* @param array $data
*/
public
function
__construct
(
\
Magento\Framework\Module\ModuleListInterface
$moduleList
,
\
Adyen\Payment\Helper\Data
$adyenHelper
,
\Magento\Backend\Block\Template\Context
$context
,
array
$data
=
[]
)
{
parent
::
__construct
(
$context
,
$data
);
$this
->
_
moduleList
=
$moduleList
;
$this
->
_
adyenHelper
=
$adyenHelper
;
}
/**
...
...
@@ -59,6 +56,6 @@ class Version extends \Magento\Config\Block\System\Config\Form\Field
*/
protected
function
_getElementHtml
(
\Magento\Framework\Data\Form\Element\AbstractElement
$element
)
{
return
(
string
)
$this
->
_moduleList
->
getOne
(
"Adyen_Payment"
)[
'setup_version'
]
;
return
$this
->
_adyenHelper
->
getModuleVersion
()
;
}
}
\ No newline at end of file
Controller/Process/Json.php
View file @
57cb7dc3
...
...
@@ -75,6 +75,19 @@ class Json extends \Magento\Framework\App\Action\Action
*/
public
function
execute
()
{
// if version is in the notification string show the module version
$response
=
$this
->
getRequest
()
->
getParams
();
if
(
isset
(
$response
[
'version'
]))
{
$this
->
getResponse
()
->
clearHeader
(
'Content-Type'
)
->
setHeader
(
'Content-Type'
,
'text/html'
)
->
setBody
(
$this
->
_adyenHelper
->
getModuleVersion
());
return
;
}
try
{
$notificationItems
=
json_decode
(
file_get_contents
(
'php://input'
),
true
);
...
...
Helper/Data.php
View file @
57cb7dc3
...
...
@@ -46,6 +46,11 @@ class Data extends AbstractHelper
*/
protected
$_country
;
/**
* @var \Magento\Framework\Module\ModuleListInterface
*/
protected
$_moduleList
;
/**
* Data constructor.
*
...
...
@@ -57,12 +62,14 @@ class Data extends AbstractHelper
\Magento\Framework\App\Helper\Context
$context
,
\Magento\Framework\Encryption\EncryptorInterface
$encryptor
,
\Magento\Framework\Config\DataInterface
$dataStorage
,
\Magento\Directory\Model\Config\Source\Country
$country
\Magento\Directory\Model\Config\Source\Country
$country
,
\Magento\Framework\Module\ModuleListInterface
$moduleList
)
{
parent
::
__construct
(
$context
);
$this
->
_encryptor
=
$encryptor
;
$this
->
_dataStorage
=
$dataStorage
;
$this
->
_country
=
$country
;
$this
->
_moduleList
=
$moduleList
;
}
/**
...
...
@@ -573,4 +580,9 @@ class Data extends AbstractHelper
}
return
$sepaCountries
;
}
public
function
getModuleVersion
()
{
return
(
string
)
$this
->
_moduleList
->
getOne
(
"Adyen_Payment"
)[
'setup_version'
];
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment