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
bff0916e
Commit
bff0916e
authored
Jun 11, 2020
by
attilak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor retrieving action and additionalData in Success.php block
parent
4e26bfaa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
20 deletions
+26
-20
Block/Checkout/Success.php
Block/Checkout/Success.php
+26
-20
No files found.
Block/Checkout/Success.php
View file @
bff0916e
...
...
@@ -90,6 +90,7 @@ class Success extends \Magento\Framework\View\Element\Template
/**
* Detect if Boleto is used as payment method
*
* @return bool
*/
public
function
isBoletoPayment
()
...
...
@@ -102,14 +103,15 @@ class Success extends \Magento\Framework\View\Element\Template
}
/**
* @return
null|\
string[]
* @return
array|
string[]
*/
public
function
getBoletoData
()
{
if
(
$this
->
isBoletoPayment
())
{
return
$this
->
get
Order
()
->
getPayment
()
->
getAdditionalInformation
(
'action'
);
return
$this
->
get
ActionData
(
);
}
return
null
;
return
[];
}
/**
...
...
@@ -119,38 +121,42 @@ class Success extends \Magento\Framework\View\Element\Template
*/
public
function
getBankTransferData
()
{
$result
=
[];
if
(
!
empty
(
$this
->
getOrder
()
->
getPayment
())
&&
!
empty
(
$this
->
getOrder
()
->
getPayment
()
->
getAdditionalInformation
(
'bankTransfer.owner'
))
)
{
$result
=
$this
->
getOrder
()
->
getPayment
()
->
getAdditionalInformation
();
$additionalData
=
$this
->
getAdditionalData
();
if
(
empty
(
$additionalData
[
'bankTransfer.owner'
]))
{
return
[];
}
return
$
result
;
return
$
additionalData
;
}
/**
*
Get multibanco additional data
*
Retreive additionalData for a payment
*
* @return array|string[]
*/
public
function
get
Multibanco
Data
()
public
function
get
Additional
Data
()
{
$result
=
[];
if
(
empty
(
$this
->
getOrder
()
->
getPayment
()))
{
return
$result
;
}
$action
=
$this
->
getOrder
()
->
getPayment
()
->
getAdditionalInformation
(
'action'
);
if
(
!
empty
(
$action
[
"paymentMethodType"
])
&&
(
strcmp
(
$action
[
"paymentMethodType"
],
'multibanco'
)
===
0
)
)
{
$result
=
$action
;
return
[];
}
return
$
result
;
return
$
this
->
getOrder
()
->
getPayment
()
->
getAdditionalInformation
(
'additionalData'
)
;
}
/**
* Retreive action for a payment
*
* @return array|string[]
*/
public
function
getActionData
()
{
if
(
empty
(
$this
->
getOrder
()
->
getPayment
()))
{
return
[];
}
return
$this
->
getOrder
()
->
getPayment
()
->
getAdditionalInformation
(
'action'
);
}
/**
* @return \Magento\Sales\Model\Order
...
...
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