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
6c204f96
Commit
6c204f96
authored
Jul 02, 2019
by
attilak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use shippin address instead of billing address and do not use subscribe
parent
351d6fbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+12
-13
No files found.
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
6c204f96
...
...
@@ -42,6 +42,7 @@ define(
var
brandCode
=
ko
.
observable
(
null
);
var
paymentMethod
=
ko
.
observable
(
null
);
var
messageComponents
;
var
shippingAddressCountryCode
=
quote
.
shippingAddress
().
countryId
;
/**
* Shareble adyen checkout component
* @type {AdyenCheckout}
...
...
@@ -89,7 +90,7 @@ define(
// reset variable:
adyenPaymentService
.
setPaymentMethods
();
adyenPaymentService
.
retrieveAvailablePaymentMethods
(
function
()
{
let
paymentMethods
=
adyenPaymentService
.
getAvailablePaymentMethods
();
if
(
JSON
.
stringify
(
paymentMethods
).
indexOf
(
"
ratepay
"
)
>
-
1
)
{
...
...
@@ -130,23 +131,21 @@ define(
});
self
.
messageComponents
=
messageComponents
;
var
billingAddressCountryCode
=
quote
.
billingAddress
().
countryId
;
// subscribe to the billing address changes
quote
.
billingAddress
.
subscribe
(
function
(
billingAddress
)
{
if
(
billingAddress
)
{
if
(
billingAddressCountryCode
!=
billingAddress
.
countryId
)
{
adyenPaymentService
.
retrieveAvailablePaymentMethods
();
billingAddressCountryCode
=
billingAddress
.
countryId
;
}
}
});
fullScreenLoader
.
stopLoader
();
});
},
getAdyenHppPaymentMethods
:
function
()
{
var
self
=
this
;
let
currentShippingAddressCountryCode
=
quote
.
shippingAddress
().
countryId
;
// retrieve new payment methods if country code changed
if
(
shippingAddressCountryCode
!=
currentShippingAddressCountryCode
)
{
fullScreenLoader
.
startLoader
();
adyenPaymentService
.
retrieveAvailablePaymentMethods
();
shippingAddressCountryCode
=
currentShippingAddressCountryCode
;
fullScreenLoader
.
stopLoader
();
}
var
paymentMethods
=
adyenPaymentService
.
getAvailablePaymentMethods
();
var
paymentList
=
_
.
map
(
paymentMethods
,
function
(
value
)
{
...
...
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