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
8a1ca3e3
Commit
8a1ca3e3
authored
Jul 17, 2017
by
Rik ter Beek
Committed by
GitHub
Jul 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #140 from Adyen/develop-rik
#139 Afterpay use vatCategory "High"
parents
7a5f8041
41f072c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
Block/Redirect/Redirect.php
Block/Redirect/Redirect.php
+2
-3
Helper/Data.php
Helper/Data.php
+16
-0
No files found.
Block/Redirect/Redirect.php
View file @
8a1ca3e3
...
...
@@ -453,9 +453,8 @@ class Redirect extends \Magento\Payment\Block\Form
$formFields
[
'openinvoicedata.'
.
$linename
.
'.itemVatPercentage'
]
=
$percentageMinorUnits
;
$formFields
[
'openinvoicedata.'
.
$linename
.
'.numberOfItems'
]
=
(
int
)
$item
->
getQtyOrdered
();
if
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
\Adyen\Payment\Observer\AdyenHppDataAssignObserver
::
BRAND_CODE
)
==
"klarna"
)
{
if
(
$this
->
_adyenHelper
->
isVatCategoryHigh
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
\Adyen\Payment\Observer\AdyenHppDataAssignObserver
::
BRAND_CODE
)))
{
$formFields
[
'openinvoicedata.'
.
$linename
.
'.vatCategory'
]
=
"High"
;
}
else
{
$formFields
[
'openinvoicedata.'
.
$linename
.
'.vatCategory'
]
=
"None"
;
...
...
Helper/Data.php
View file @
8a1ca3e3
...
...
@@ -770,6 +770,22 @@ class Data extends AbstractHelper
}
}
/**
* For Klarna And AfterPay use VatCategory High others use none
*
* @param $paymentMethod
* @return bool
*/
public
function
isVatCategoryHigh
(
$paymentMethod
)
{
if
(
$paymentMethod
==
"klarna"
||
strlen
(
$paymentMethod
)
>=
9
&&
substr
(
$paymentMethod
,
0
,
9
)
==
'afterpay_'
)
{
return
true
;
}
return
false
;
}
/**
* @return bool
*/
...
...
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