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
a51649f3
Commit
a51649f3
authored
Aug 02, 2017
by
Giorgos Adam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fallback to Magento/blank theme when no theme is detected for displaying HPP assets. Fixes #154
parent
deeb9a4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
Helper/PaymentMethods.php
Helper/PaymentMethods.php
+33
-5
No files found.
Helper/PaymentMethods.php
View file @
a51649f3
...
...
@@ -80,6 +80,16 @@ class PaymentMethods extends AbstractHelper
*/
protected
$_assetSource
;
/**
* @var \Magento\Framework\View\DesignInterface
*/
protected
$_design
;
/**
* @var \Magento\Framework\View\Design\Theme\ThemeProviderInterface
*/
protected
$_themeProvider
;
/**
* PaymentMethods constructor.
*
...
...
@@ -93,6 +103,8 @@ class PaymentMethods extends AbstractHelper
* @param \Magento\Framework\View\Asset\Repository $assetRepo
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\View\Asset\Source $assetSource
* @param \Magento\Framework\View\DesignInterface $design
* @param \Magento\Framework\View\Design\Theme\ThemeProviderInterface $themeProvider
*/
public
function
__construct
(
\Magento\Quote\Api\CartRepositoryInterface
$quoteRepository
,
...
...
@@ -104,7 +116,9 @@ class PaymentMethods extends AbstractHelper
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Magento\Framework\View\Asset\Repository
$assetRepo
,
\Magento\Framework\App\RequestInterface
$request
,
\Magento\Framework\View\Asset\Source
$assetSource
\Magento\Framework\View\Asset\Source
$assetSource
,
\Magento\Framework\View\DesignInterface
$design
,
\Magento\Framework\View\Design\Theme\ThemeProviderInterface
$themeProvider
)
{
$this
->
_quoteRepository
=
$quoteRepository
;
$this
->
_quoteIdMaskFactory
=
$quoteIdMaskFactory
;
...
...
@@ -116,7 +130,8 @@ class PaymentMethods extends AbstractHelper
$this
->
_assetRepo
=
$assetRepo
;
$this
->
_request
=
$request
;
$this
->
_assetSource
=
$assetSource
;
$this
->
_design
=
$design
;
$this
->
_themeProvider
=
$themeProvider
;
}
/**
...
...
@@ -208,11 +223,24 @@ class PaymentMethods extends AbstractHelper
// add icon location in result
if
(
$this
->
_adyenHelper
->
showLogos
())
{
// Fix for MAGETWO-70402 https://github.com/magento/magento2/pull/7686
// Explicitly setting theme
$themeCode
=
"Magento/blank"
;
$themeId
=
$this
->
_design
->
getConfigurationDesignTheme
(
\Magento\Framework\App\Area
::
AREA_FRONTEND
);
if
(
!
empty
(
$themeId
))
{
$theme
=
$this
->
_themeProvider
->
getThemeById
(
$themeId
);
if
(
$theme
&&
!
empty
(
$theme
->
getCode
()))
{
$themeCode
=
$theme
->
getCode
();
}
}
$params
=
[];
// use frontend area
$params
=
array_merge
([
'area'
=>
'frontend'
,
'_secure'
=>
$this
->
_request
->
isSecure
()],
$params
);
$params
=
array_merge
([
'area'
=>
\Magento\Framework\App\Area
::
AREA_FRONTEND
,
'_secure'
=>
$this
->
_request
->
isSecure
(),
'theme'
=>
$themeCode
],
$params
);
$asset
=
$this
->
_assetRepo
->
createAsset
(
'Adyen_Payment::images/logos/'
.
$paymentMethodCode
.
'.png'
,
$params
);
...
...
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