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
13859261
Commit
13859261
authored
May 03, 2019
by
cyattilakiss
Committed by
GitHub
May 03, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #433 from Adyen/PW-1186
PW-1186 At open invoice pass item id because now oney method fails
parents
64453dbd
32de28fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
19 deletions
+64
-19
Block/Redirect/Redirect.php
Block/Redirect/Redirect.php
+11
-12
Gateway/Request/CaptureDataBuilder.php
Gateway/Request/CaptureDataBuilder.php
+2
-1
Gateway/Request/RefundDataBuilder.php
Gateway/Request/RefundDataBuilder.php
+2
-1
Helper/Data.php
Helper/Data.php
+49
-5
No files found.
Block/Redirect/Redirect.php
View file @
13859261
...
...
@@ -128,11 +128,9 @@ class Redirect extends \Magento\Payment\Block\Form
if
(
$this
->
getPaymentMethodSelectionOnAdyen
())
{
$url
=
'https://test.adyen.com/hpp/select.shtml'
;
}
else
{
if
(
$this
->
_adyenHelper
->
isPaymentMethodOpenInvoiceMethod
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
'brand_code'
)
)
||
$this
->
_adyenHelper
->
isPaymentMethodMolpayMethod
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
'brand_code'
)
)
if
(
$this
->
_adyenHelper
->
doesPaymentMethodSkipDetails
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
'brand_code'
)
)
)
{
$url
=
"https://test.adyen.com/hpp/skipDetails.shtml"
;
}
else
{
...
...
@@ -148,11 +146,9 @@ class Redirect extends \Magento\Payment\Block\Form
if
(
$this
->
getPaymentMethodSelectionOnAdyen
())
{
$url
=
'https://live.adyen.com/hpp/select.shtml'
;
}
else
{
if
(
$this
->
_adyenHelper
->
isPaymentMethodOpenInvoiceMethod
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
'brand_code'
)
)
||
$this
->
_adyenHelper
->
isPaymentMethodMolpayMethod
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
'brand_code'
)
)
if
(
$this
->
_adyenHelper
->
doesPaymentMethodSkipDetails
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
'brand_code'
)
)
)
{
$url
=
"https://live.adyen.com/hpp/skipDetails.shtml"
;
}
else
{
...
...
@@ -444,6 +440,7 @@ class Redirect extends \Magento\Payment\Block\Form
$currency
=
$this
->
_order
->
getOrderCurrencyCode
();
foreach
(
$this
->
_order
->
getAllVisibleItems
()
as
$item
)
{
/** @var $item \Magento\Sales\Model\Order\Item */
++
$count
;
$numberOfItems
=
(
int
)
$item
->
getQtyOrdered
();
...
...
@@ -457,7 +454,8 @@ class Redirect extends \Magento\Payment\Block\Form
$item
->
getPriceInclTax
(),
$item
->
getTaxPercent
(),
$numberOfItems
,
$this
->
_order
->
getPayment
()
$this
->
_order
->
getPayment
(),
$item
->
getId
()
);
}
...
...
@@ -480,7 +478,8 @@ class Redirect extends \Magento\Payment\Block\Form
$itemVatAmount
,
$itemVatPercentage
,
$numberOfItems
,
$this
->
_order
->
getPayment
()
$this
->
_order
->
getPayment
(),
"discount"
);
}
...
...
Gateway/Request/CaptureDataBuilder.php
View file @
13859261
...
...
@@ -115,7 +115,8 @@ class CaptureDataBuilder implements BuilderInterface
$invoiceItem
->
getPriceInclTax
(),
$invoiceItem
->
getTaxPercent
(),
$numberOfItems
,
$payment
$payment
,
$invoiceItem
->
getId
()
);
}
...
...
Gateway/Request/RefundDataBuilder.php
View file @
13859261
...
...
@@ -203,7 +203,8 @@ class RefundDataBuilder implements BuilderInterface
$refundItem
->
getPriceInclTax
(),
$refundItem
->
getTaxPercent
(),
$numberOfItems
,
$payment
$payment
,
$refundItem
->
getId
()
);
}
...
...
Helper/Data.php
View file @
13859261
...
...
@@ -1007,6 +1007,38 @@ class Data extends AbstractHelper
return
false
;
}
/**
* @param $paymentMethod
* @return bool
*/
public
function
isPaymentMethodOneyMethod
(
$paymentMethod
)
{
if
(
strpos
(
$paymentMethod
,
'facilypay_'
)
!==
false
)
{
return
true
;
}
return
false
;
}
/**
* @param $paymentMethod
* @return bool
*/
public
function
doesPaymentMethodSkipDetails
(
$paymentMethod
)
{
if
(
$this
->
isPaymentMethodOpenInvoiceMethod
(
$paymentMethod
)
||
$this
->
isPaymentMethodMolpayMethod
(
$paymentMethod
)
||
$this
->
isPaymentMethodOneyMethod
(
$paymentMethod
)
)
{
return
true
;
}
return
false
;
}
/**
* @return mixed
*/
public
function
getRatePayId
()
{
return
$this
->
getAdyenHppConfigData
(
"ratepay_id"
);
...
...
@@ -1099,6 +1131,7 @@ class Data extends AbstractHelper
* @param $taxPercent
* @param $numberOfItems
* @param $payment
* @param null $itemId
* @return mixed
*/
public
function
createOpenInvoiceLineItem
(
...
...
@@ -1111,7 +1144,8 @@ class Data extends AbstractHelper
$priceInclTax
,
$taxPercent
,
$numberOfItems
,
$payment
$payment
,
$itemId
=
null
)
{
$description
=
str_replace
(
"
\n
"
,
''
,
trim
(
$name
));
$itemAmount
=
$this
->
formatAmount
(
$price
,
$currency
);
...
...
@@ -1135,7 +1169,8 @@ class Data extends AbstractHelper
$itemVatAmount
,
$itemVatPercentage
,
$numberOfItems
,
$payment
$payment
,
$itemId
);
}
...
...
@@ -1187,7 +1222,8 @@ class Data extends AbstractHelper
$itemVatAmount
,
$itemVatPercentage
,
$numberOfItems
,
$payment
$payment
,
"shipping"
);
}
...
...
@@ -1222,7 +1258,8 @@ class Data extends AbstractHelper
* @param $itemVatPercentage
* @param $numberOfItems
* @param $payment
* @return
* @param null|int $itemId optional
* @return mixed
*/
public
function
getOpenInvoiceLineData
(
$formFields
,
...
...
@@ -1233,9 +1270,16 @@ class Data extends AbstractHelper
$itemVatAmount
,
$itemVatPercentage
,
$numberOfItems
,
$payment
$payment
,
$itemId
=
null
)
{
$linename
=
"line"
.
$count
;
// item id is optional
if
(
$itemId
)
{
$formFields
[
'openinvoicedata.'
.
$linename
.
'.itemId'
]
=
$itemId
;
}
$formFields
[
'openinvoicedata.'
.
$linename
.
'.currencyCode'
]
=
$currencyCode
;
$formFields
[
'openinvoicedata.'
.
$linename
.
'.description'
]
=
$description
;
$formFields
[
'openinvoicedata.'
.
$linename
.
'.itemAmount'
]
=
$itemAmount
;
...
...
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