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
4e492262
Commit
4e492262
authored
Sep 06, 2017
by
Alessio Zampatti
Committed by
GitHub
Sep 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PW-251: Update device fingerprint for ratepay (#187)
* PW-251: Update device fingerprint for ratepay
parent
5e1086fc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
7 deletions
+50
-7
Block/Redirect/Redirect.php
Block/Redirect/Redirect.php
+1
-1
Helper/Data.php
Helper/Data.php
+5
-0
Model/Ui/AdyenHppConfigProvider.php
Model/Ui/AdyenHppConfigProvider.php
+11
-3
etc/adminhtml/system/adyen_hpp.xml
etc/adminhtml/system/adyen_hpp.xml
+5
-0
etc/config.xml
etc/config.xml
+1
-0
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+27
-3
No files found.
Block/Redirect/Redirect.php
View file @
4e492262
...
...
@@ -200,7 +200,7 @@ class Redirect extends \Magento\Payment\Block\Form
$countryCode
=
trim
(
$this
->
_adyenHelper
->
getAdyenHppConfigData
(
'country_code'
));
$countryCode
=
(
!
empty
(
$countryCode
))
?
$countryCode
:
false
;
// if directory lookup is enabled use the billingadress as countrycode
// if directory lookup is enabled use the billingad
d
ress as countrycode
if
(
$countryCode
==
false
)
{
if
(
$this
->
_order
->
getBillingAddress
()
&&
$this
->
_order
->
getBillingAddress
()
->
getCountryId
()
!=
""
)
{
...
...
Helper/Data.php
View file @
4e492262
...
...
@@ -770,6 +770,11 @@ class Data extends AbstractHelper
}
}
public
function
getRatePayId
()
{
return
$this
->
getAdyenHppConfigData
(
"ratepay_id"
);
}
/**
* For Klarna And AfterPay use VatCategory High others use none
*
...
...
Model/Ui/AdyenHppConfigProvider.php
View file @
4e492262
...
...
@@ -59,6 +59,10 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
*/
protected
$_customerSession
;
/**
* @var \Magento\Checkout\Model\Session
*/
protected
$_session
;
/**
* AdyenHppConfigProvider constructor.
...
...
@@ -68,23 +72,26 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\UrlInterface $urlBuilder
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Checkout\Model\Session $session
*/
public
function
__construct
(
PaymentHelper
$paymentHelper
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Magento\Framework\App\RequestInterface
$request
,
\Magento\Framework\UrlInterface
$urlBuilder
,
\Magento\Customer\Model\Session
$customerSession
\Magento\Customer\Model\Session
$customerSession
,
\Magento\Checkout\Model\Session
$session
)
{
$this
->
_paymentHelper
=
$paymentHelper
;
$this
->
_adyenHelper
=
$adyenHelper
;
$this
->
_request
=
$request
;
$this
->
_urlBuilder
=
$urlBuilder
;
$this
->
_customerSession
=
$customerSession
;
$this
->
_session
=
$session
;
}
/**
* Set configuration for AdyenHPP pay
em
nt method
* Set configuration for AdyenHPP pay
me
nt method
*
* @return array
*/
...
...
@@ -133,7 +140,8 @@ class AdyenHppConfigProvider implements ConfigProviderInterface
$config
[
'payment'
]
[
'adyenHpp'
][
'showTelephone'
]
=
$this
->
_adyenHelper
->
getAdyenHppConfigDataFlag
(
'show_telephone'
);
$config
[
'payment'
]
[
'adyenHpp'
][
'ratePayId'
]
=
$this
->
_adyenHelper
->
getRatePayId
();
$config
[
'payment'
]
[
'adyenHpp'
][
'deviceIdentToken'
]
=
md5
(
$this
->
_session
->
getQuoteId
()
.
date
(
'c'
));
return
$config
;
...
...
etc/adminhtml/system/adyen_hpp.xml
View file @
4e492262
...
...
@@ -79,6 +79,11 @@
<source_model>
Magento\Config\Model\Config\Source\Yesno
</source_model>
<config_path>
payment/adyen_hpp/ignore_second_address_field
</config_path>
</field>
<field
id=
"ratepay_id"
translate=
"label"
type=
"text"
sortOrder=
"50"
showInDefault=
"1"
showInWebsite=
"1"
showInStore=
"1"
>
<label>
RatePAY Device Ident SId
</label>
<tooltip>
Unique RatePAY Id provided by RatePAY integration consultant
</tooltip>
<config_path>
payment/adyen_hpp/ratepay_id
</config_path>
</field>
</group>
<group
id=
"adyen_hpp_advanced_settings"
translate=
"label"
showInDefault=
"1"
showInWebsite=
"1"
sortOrder=
"200"
>
<label>
Advanced Settings
</label>
...
...
etc/config.xml
View file @
4e492262
...
...
@@ -96,6 +96,7 @@
<payment_routine>
single
</payment_routine>
<delivery_days>
5
</delivery_days>
<allowspecific>
0
</allowspecific>
<ratepay_id>
oj9GsQ
</ratepay_id>
<sort_order>
3
</sort_order>
<payment_action>
order
</payment_action>
<can_initialize>
1
</can_initialize>
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
4e492262
...
...
@@ -63,6 +63,7 @@ define(
return
this
;
},
initialize
:
function
()
{
var
self
=
this
;
this
.
_super
();
fullScreenLoader
.
startLoader
();
...
...
@@ -73,7 +74,6 @@ define(
// retrieve payment methods
var
serviceUrl
,
payload
;
if
(
customer
.
isLoggedIn
())
{
serviceUrl
=
urlBuilder
.
createUrl
(
'
/carts/mine/retrieve-adyen-payment-methods
'
,
{});
}
else
{
...
...
@@ -92,7 +92,23 @@ define(
).
done
(
function
(
response
)
{
adyenPaymentService
.
setPaymentMethods
(
response
);
if
(
JSON
.
stringify
(
response
).
indexOf
(
"
ratepay
"
)
>
-
1
)
{
var
ratePayId
=
window
.
checkoutConfig
.
payment
.
adyenHpp
.
ratePayId
;
window
.
di
=
{
t
:
''
,
v
:
ratePayId
,
l
:
'
Checkout
'
};
function
waitForDfValue
()
{
var
dfValueRatePay
=
self
.
getRatePayDeviceIdentToken
();
if
(
dfValueRatePay
)
{
window
.
di
.
t
=
dfValueRatePay
.
replace
(
'
:
'
,
''
);
var
scriptTag
=
document
.
createElement
(
'
script
'
);
scriptTag
.
src
=
"
//d.ratepay.com/
"
+
ratePayId
+
"
/di.js
"
;
scriptTag
.
type
=
"
text/javascript
"
;
document
.
body
.
appendChild
(
scriptTag
);
}
else
{
setTimeout
(
waitForDfValue
,
200
);
}
}
waitForDfValue
();
}
// set device fingerprint value
dfSet
(
'
dfValue
'
,
0
);
// propagate this manually to knockoutjs otherwise it would not work
...
...
@@ -107,7 +123,6 @@ define(
},
getAdyenHppPaymentMethods
:
function
()
{
var
self
=
this
;
var
paymentMethods
=
adyenPaymentService
.
getAvailablePaymentMethods
();
var
paymentList
=
_
.
map
(
paymentMethods
,
function
(
value
)
{
...
...
@@ -135,6 +150,9 @@ define(
result
.
isPaymentMethodOpenInvoiceMethod
=
function
()
{
return
value
.
isPaymentMethodOpenInvoiceMethod
;
}
result
.
getRatePayDeviceIdentToken
=
function
()
{
return
window
.
checkoutConfig
.
payment
.
adyenHpp
.
deviceIdentToken
;
}
return
result
;
});
return
paymentList
;
...
...
@@ -176,6 +194,9 @@ define(
additionalData
.
gender
=
this
.
gender
();
additionalData
.
dob
=
this
.
dob
();
additionalData
.
telephone
=
this
.
telephone
();
if
(
brandCode
()
==
"
ratepay
"
){
additionalData
.
df_value
=
this
.
getRatePayDeviceIdentToken
();
}
}
data
.
additional_data
=
additionalData
;
...
...
@@ -237,6 +258,9 @@ define(
},
validate
:
function
()
{
return
true
;
},
getRatePayDeviceIdentToken
:
function
(){
return
window
.
checkoutConfig
.
payment
.
adyenHpp
.
deviceIdentToken
;
}
});
}
...
...
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