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
cfb02277
Commit
cfb02277
authored
Jan 31, 2018
by
Rik ter Beek
Committed by
GitHub
Jan 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #241 from Adyen/PW-352
Pw 352
parents
a713fbd5
d2458081
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
335 additions
and
378 deletions
+335
-378
view/frontend/layout/checkout_index_index.xml
view/frontend/layout/checkout_index_index.xml
+3
-0
view/frontend/web/js/action/place-order.js
view/frontend/web/js/action/place-order.js
+0
-80
view/frontend/web/js/action/set-payment-method.js
view/frontend/web/js/action/set-payment-method.js
+0
-82
view/frontend/web/js/view/payment/method-renderer/adyen-boleto-method.js
...eb/js/view/payment/method-renderer/adyen-boleto-method.js
+15
-42
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
...nd/web/js/view/payment/method-renderer/adyen-cc-method.js
+29
-22
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+68
-12
view/frontend/web/js/view/payment/method-renderer/adyen-oneclick-method.js
.../js/view/payment/method-renderer/adyen-oneclick-method.js
+135
-67
view/frontend/web/js/view/payment/method-renderer/adyen-pos-method.js
...d/web/js/view/payment/method-renderer/adyen-pos-method.js
+29
-18
view/frontend/web/js/view/payment/method-renderer/adyen-sepa-method.js
.../web/js/view/payment/method-renderer/adyen-sepa-method.js
+15
-42
view/frontend/web/template/payment/boleto-form.html
view/frontend/web/template/payment/boleto-form.html
+4
-0
view/frontend/web/template/payment/cc-form.html
view/frontend/web/template/payment/cc-form.html
+8
-0
view/frontend/web/template/payment/hpp-form.html
view/frontend/web/template/payment/hpp-form.html
+11
-7
view/frontend/web/template/payment/oneclick-form.html
view/frontend/web/template/payment/oneclick-form.html
+10
-5
view/frontend/web/template/payment/pos-form.html
view/frontend/web/template/payment/pos-form.html
+5
-0
view/frontend/web/template/payment/sepa-form.html
view/frontend/web/template/payment/sepa-form.html
+3
-1
No files found.
view/frontend/layout/checkout_index_index.xml
View file @
cfb02277
...
...
@@ -61,6 +61,9 @@
<item
name=
"adyen_boleto"
xsi:type=
"array"
>
<item
name=
"isBillingAddressRequired"
xsi:type=
"boolean"
>
true
</item>
</item>
<item
name=
"adyen_pos"
xsi:type=
"array"
>
<item
name=
"isBillingAddressRequired"
xsi:type=
"boolean"
>
true
</item>
</item>
<item
name=
"adyen_apple_pay"
xsi:type=
"array"
>
<item
name=
"isBillingAddressRequired"
xsi:type=
"boolean"
>
true
</item>
</item>
...
...
view/frontend/web/js/action/place-order.js
deleted
100755 → 0
View file @
a713fbd5
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
define
(
[
'
Magento_Checkout/js/model/quote
'
,
'
Magento_Checkout/js/model/url-builder
'
,
'
mage/storage
'
,
'
mage/url
'
,
'
Magento_Checkout/js/model/error-processor
'
,
'
Magento_Customer/js/model/customer
'
,
'
Magento_Checkout/js/model/full-screen-loader
'
],
function
(
quote
,
urlBuilder
,
storage
,
url
,
errorProcessor
,
customer
,
fullScreenLoader
)
{
'
use strict
'
;
return
function
(
paymentData
,
redirectOnSuccess
)
{
var
serviceUrl
,
payload
;
//redirectOnSuccess = redirectOnSuccess !== false;
redirectOnSuccess
=
redirectOnSuccess
===
false
?
false
:
true
;
/** Checkout for guest and registered customer. */
if
(
!
customer
.
isLoggedIn
())
{
serviceUrl
=
urlBuilder
.
createUrl
(
'
/guest-carts/:quoteId/payment-information
'
,
{
quoteId
:
quote
.
getQuoteId
()
});
payload
=
{
cartId
:
quote
.
getQuoteId
(),
email
:
quote
.
guestEmail
,
paymentMethod
:
paymentData
,
billingAddress
:
quote
.
billingAddress
()
};
}
else
{
serviceUrl
=
urlBuilder
.
createUrl
(
'
/carts/mine/payment-information
'
,
{});
payload
=
{
cartId
:
quote
.
getQuoteId
(),
paymentMethod
:
paymentData
,
billingAddress
:
quote
.
billingAddress
()
};
}
fullScreenLoader
.
startLoader
();
return
storage
.
post
(
serviceUrl
,
JSON
.
stringify
(
payload
)
).
done
(
function
(
response
)
{
if
(
redirectOnSuccess
)
{
window
.
location
.
replace
(
url
.
build
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
));
}
else
{
fullScreenLoader
.
stopLoader
();
}
}
).
fail
(
function
(
response
)
{
errorProcessor
.
process
(
response
);
fullScreenLoader
.
stopLoader
();
}
);
};
}
);
view/frontend/web/js/action/set-payment-method.js
deleted
100755 → 0
View file @
a713fbd5
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
define
(
[
'
jquery
'
,
'
Magento_Checkout/js/model/quote
'
,
'
Magento_Checkout/js/model/url-builder
'
,
'
mage/storage
'
,
'
Magento_Checkout/js/model/error-processor
'
,
'
Magento_Customer/js/model/customer
'
,
'
Magento_Checkout/js/model/full-screen-loader
'
,
'
Magento_CheckoutAgreements/js/model/agreements-assigner
'
],
function
(
$
,
quote
,
urlBuilder
,
storage
,
errorProcessor
,
customer
,
fullScreenLoader
,
agreementsAssigner
)
{
'
use strict
'
;
return
function
()
{
var
serviceUrl
,
payload
,
paymentData
=
quote
.
paymentMethod
();
// use core code to assign the agreement
agreementsAssigner
(
paymentData
);
/** Checkout for guest and registered customer. */
if
(
!
customer
.
isLoggedIn
())
{
serviceUrl
=
urlBuilder
.
createUrl
(
'
/guest-carts/:quoteId/payment-information
'
,
{
quoteId
:
quote
.
getQuoteId
()
});
payload
=
{
cartId
:
quote
.
getQuoteId
(),
email
:
quote
.
guestEmail
,
paymentMethod
:
paymentData
,
billingAddress
:
quote
.
billingAddress
()
};
}
else
{
serviceUrl
=
urlBuilder
.
createUrl
(
'
/carts/mine/payment-information
'
,
{});
payload
=
{
cartId
:
quote
.
getQuoteId
(),
paymentMethod
:
paymentData
,
billingAddress
:
quote
.
billingAddress
()
};
}
fullScreenLoader
.
startLoader
();
return
storage
.
post
(
serviceUrl
,
JSON
.
stringify
(
payload
)
).
done
(
function
()
{
$
.
mage
.
redirect
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
);
}
).
fail
(
function
(
response
)
{
errorProcessor
.
process
(
response
);
fullScreenLoader
.
stopLoader
();
}
);
};
}
);
view/frontend/web/js/view/payment/method-renderer/adyen-boleto-method.js
View file @
cfb02277
...
...
@@ -19,19 +19,14 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
underscore
'
,
'
jquery
'
,
'
Magento_Checkout/js/model/quote
'
,
'
Magento_Payment/js/view/payment/cc-form
'
,
'
Adyen_Payment/js/action/place-order
'
,
'
mage/translate
'
,
'
Magento_Checkout/js/model/payment/additional-validators
'
'
Magento_Payment/js/view/payment/cc-form
'
],
function
(
_
,
$
,
quote
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
)
{
function
(
_
,
$
,
quote
,
Component
)
{
'
use strict
'
;
var
billingAddress
=
quote
.
billingAddress
();
return
Component
.
extend
({
...
...
@@ -51,16 +46,16 @@ define(
]);
return
this
;
},
setPlaceOrderHandler
:
function
(
handler
)
{
setPlaceOrderHandler
:
function
(
handler
)
{
this
.
placeOrderHandler
=
handler
;
},
setValidateHandler
:
function
(
handler
)
{
setValidateHandler
:
function
(
handler
)
{
this
.
validateHandler
=
handler
;
},
getCode
:
function
()
{
getCode
:
function
()
{
return
'
adyen_boleto
'
;
},
getData
:
function
()
{
getData
:
function
()
{
return
{
'
method
'
:
this
.
item
.
method
,
'
additional_data
'
:
{
...
...
@@ -71,56 +66,34 @@ define(
}
};
},
isActive
:
function
()
{
isActive
:
function
()
{
return
true
;
},
/**
* @override
*/
placeOrder
:
function
(
data
,
event
)
{
var
self
=
this
,
placeOrder
;
if
(
event
)
{
event
.
preventDefault
();
}
if
(
this
.
validate
()
&&
additionalValidators
.
validate
())
{
this
.
isPlaceOrderActionAllowed
(
false
);
placeOrder
=
placeOrderAction
(
this
.
getData
(),
this
.
redirectAfterPlaceOrder
);
$
.
when
(
placeOrder
).
fail
(
function
(
response
)
{
self
.
isPlaceOrderActionAllowed
(
true
);
});
return
true
;
}
return
false
;
},
getControllerName
:
function
()
{
getControllerName
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
iframe
.
controllerName
[
this
.
getCode
()];
},
getPlaceOrderUrl
:
function
()
{
getPlaceOrderUrl
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
iframe
.
placeOrderUrl
[
this
.
getCode
()];
},
context
:
function
()
{
context
:
function
()
{
return
this
;
},
validate
:
function
()
{
var
form
=
'
form[data-role=adyen-boleto-form]
'
;
var
validate
=
$
(
form
).
validation
()
&&
$
(
form
).
validation
(
'
isValid
'
);
var
validate
=
$
(
form
).
validation
()
&&
$
(
form
).
validation
(
'
isValid
'
);
if
(
!
validate
)
{
if
(
!
validate
)
{
return
false
;
}
return
true
;
},
showLogo
:
function
()
{
showLogo
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
adyen
.
showLogo
;
},
getBoletoTypes
:
function
()
{
return
_
.
map
(
window
.
checkoutConfig
.
payment
.
adyenBoleto
.
boletoTypes
,
function
(
value
,
key
)
{
getBoletoTypes
:
function
()
{
return
_
.
map
(
window
.
checkoutConfig
.
payment
.
adyenBoleto
.
boletoTypes
,
function
(
value
,
key
)
{
return
{
'
key
'
:
value
.
value
,
'
value
'
:
value
.
label
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
View file @
cfb02277
...
...
@@ -19,23 +19,19 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
underscore
'
,
'
jquery
'
,
'
ko
'
,
'
Magento_Payment/js/view/payment/cc-form
'
,
'
Adyen_Payment/js/action/place-order
'
,
'
mage/translate
'
,
'
Magento_Checkout/js/model/payment/additional-validators
'
,
'
Magento_Customer/js/model/customer
'
,
'
Magento_Payment/js/model/credit-card-validation/credit-card-data
'
,
'
Magento_Checkout/js/model/payment/additional-validators
'
,
'
Magento_Checkout/js/model/quote
'
,
'
ko
'
,
'
Adyen_Payment/js/model/installments
'
,
'
mage/url
'
],
function
(
_
,
$
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
,
customer
,
creditCardData
,
quote
,
ko
,
installments
)
{
function
(
$
,
ko
,
Component
,
customer
,
creditCardData
,
additionalValidators
,
quote
,
installments
,
url
)
{
'
use strict
'
;
var
cvcLength
=
ko
.
observable
(
4
);
...
...
@@ -160,39 +156,50 @@ define(
* @override
*/
placeOrder
:
function
(
data
,
event
)
{
var
self
=
this
,
placeOrder
;
var
self
=
this
;
if
(
event
)
{
event
.
preventDefault
();
}
var
options
=
{};
var
cseInstance
=
adyen
.
createEncryption
(
options
);
var
generationtime
=
self
.
getGenerationTime
();
var
generationtime
=
this
.
getGenerationTime
();
var
cardData
=
{
number
:
self
.
creditCardNumber
(),
cvc
:
self
.
creditCardVerificationNumber
(),
holderName
:
self
.
creditCardOwner
(),
expiryMonth
:
self
.
creditCardExpMonth
(),
expiryYear
:
self
.
creditCardExpYear
(),
number
:
this
.
creditCardNumber
(),
cvc
:
this
.
creditCardVerificationNumber
(),
holderName
:
this
.
creditCardOwner
(),
expiryMonth
:
this
.
creditCardExpMonth
(),
expiryYear
:
this
.
creditCardExpYear
(),
generationtime
:
generationtime
};
var
data
=
cseInstance
.
encrypt
(
cardData
);
self
.
encryptedData
(
data
);
this
.
encryptedData
(
data
);
if
(
this
.
validate
()
&&
additionalValidators
.
validate
())
{
this
.
isPlaceOrderActionAllowed
(
false
);
placeOrder
=
placeOrderAction
(
this
.
getData
(),
this
.
redirectAfterPlaceOrder
);
$
.
when
(
placeOrder
).
fail
(
function
(
response
)
{
self
.
isPlaceOrderActionAllowed
(
true
);
});
this
.
getPlaceOrderDeferredObject
()
.
fail
(
function
()
{
self
.
isPlaceOrderActionAllowed
(
true
);
}
).
done
(
function
()
{
self
.
afterPlaceOrder
();
if
(
self
.
redirectAfterPlaceOrder
)
{
// use custom redirect Link for supporting 3D secure
window
.
location
.
replace
(
url
.
build
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
));
}
}
);
return
true
;
}
return
false
;
},
getControllerName
:
function
()
{
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
cfb02277
...
...
@@ -19,14 +19,11 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
ko
'
,
'
jquery
'
,
'
Magento_Checkout/js/view/payment/default
'
,
'
Adyen_Payment/js/action/set-payment-method
'
,
'
Magento_Checkout/js/action/select-payment-method
'
,
'
Magento_Checkout/js/model/quote
'
,
'
Magento_Checkout/js/checkout-data
'
,
...
...
@@ -35,14 +32,17 @@ define(
'
Magento_Checkout/js/model/url-builder
'
,
'
Adyen_Payment/js/model/adyen-payment-service
'
,
'
Magento_Customer/js/model/customer
'
,
'
Magento_Checkout/js/model/full-screen-loader
'
'
Magento_Checkout/js/model/full-screen-loader
'
,
'
Magento_Checkout/js/action/place-order
'
,
'
uiLayout
'
,
'
Magento_Ui/js/model/messages
'
],
function
(
ko
,
$
,
Component
,
se
tPaymentMethodAction
,
selectPaymentMethodAction
,
quote
,
checkoutData
,
additionalValidators
,
storage
,
urlBuilder
,
adyenPaymentService
,
customer
,
fullScreenLoader
)
{
function
(
ko
,
$
,
Component
,
se
lectPaymentMethodAction
,
quote
,
checkoutData
,
additionalValidators
,
storage
,
urlBuilder
,
adyenPaymentService
,
customer
,
fullScreenLoader
,
placeOrderAction
,
layout
,
Messages
)
{
'
use strict
'
;
var
brandCode
=
ko
.
observable
(
null
);
var
paymentMethod
=
ko
.
observable
(
null
);
var
dfValue
=
ko
.
observable
(
null
);
var
messageComponents
;
return
Component
.
extend
({
self
:
this
,
defaults
:
{
...
...
@@ -128,6 +128,27 @@ define(
document
.
body
.
appendChild
(
dfScriptTag
);
waitForDfSet
();
// create component needs to be in initialize method
var
messageComponents
=
{};
_
.
map
(
response
,
function
(
value
)
{
var
messageContainer
=
new
Messages
();
var
name
=
'
messages-
'
+
value
.
brandCode
;
var
messagesComponent
=
{
parent
:
self
.
name
,
name
:
'
messages-
'
+
value
.
brandCode
,
displayArea
:
'
messages-
'
+
value
.
brandCode
,
component
:
'
Magento_Ui/js/view/messages
'
,
config
:
{
messageContainer
:
messageContainer
}
};
layout
([
messagesComponent
]);
messageComponents
[
name
]
=
messageContainer
;
});
self
.
messageComponents
=
messageComponents
;
fullScreenLoader
.
stopLoader
();
}
).
fail
(
function
(
error
)
{
...
...
@@ -150,6 +171,15 @@ define(
result
.
validate
=
function
()
{
return
self
.
validate
(
value
.
brandCode
);
};
result
.
placeRedirectOrder
=
function
placeRedirectOrder
(
data
)
{
return
self
.
placeRedirectOrder
(
data
);
};
result
.
isPlaceOrderActionAllowed
=
function
(
bool
)
{
return
self
.
isPlaceOrderActionAllowed
(
bool
);
};
result
.
afterPlaceOrder
=
function
()
{
return
self
.
afterPlaceOrder
();
};
result
.
isPaymentMethodOpenInvoiceMethod
=
function
()
{
return
value
.
isPaymentMethodOpenInvoiceMethod
;
};
...
...
@@ -212,10 +242,12 @@ define(
},
/** Redirect to adyen */
continueToAdyen
:
function
()
{
var
self
=
this
;
if
(
this
.
validate
()
&&
additionalValidators
.
validate
())
{
//update payment method information if additional data was changed
this
.
selectPaymentMethod
()
;
setPaymentMethodAction
(
);
var
data
=
{};
data
.
method
=
self
.
method
;
this
.
placeRedirectOrder
(
data
);
return
false
;
}
},
...
...
@@ -246,9 +278,7 @@ define(
}
data
.
additional_data
=
additionalData
;
selectPaymentMethodAction
(
data
);
setPaymentMethodAction
();
this
.
placeRedirectOrder
(
data
);
}
return
false
;
...
...
@@ -276,6 +306,32 @@ define(
return
true
;
},
placeRedirectOrder
:
function
(
data
)
{
// Place Order but use our own redirect url after
var
self
=
this
;
var
messageContainer
=
this
.
messageContainer
;
if
(
brandCode
())
{
messageContainer
=
self
.
messageComponents
[
'
messages-
'
+
brandCode
()];
}
this
.
isPlaceOrderActionAllowed
(
false
);
fullScreenLoader
.
startLoader
();
$
.
when
(
placeOrderAction
(
data
,
messageContainer
)
).
fail
(
function
()
{
self
.
isPlaceOrderActionAllowed
(
true
);
}
).
done
(
function
()
{
self
.
afterPlaceOrder
();
$
.
mage
.
redirect
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
);
}
)
},
isBrandCodeChecked
:
ko
.
computed
(
function
()
{
if
(
!
quote
.
paymentMethod
())
{
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-oneclick-method.js
View file @
cfb02277
This diff is collapsed.
Click to expand it.
view/frontend/web/js/view/payment/method-renderer/adyen-pos-method.js
View file @
cfb02277
...
...
@@ -19,42 +19,53 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
ko
'
,
'
jquery
'
,
'
Magento_Checkout/js/view/payment/default
'
,
'
Adyen_Payment/js/action/set-payment-method
'
,
'
Magento_Checkout/js/model/payment/additional-validators
'
'
Magento_Checkout/js/model/payment/additional-validators
'
,
'
Magento_Checkout/js/model/full-screen-loader
'
,
'
Magento_Checkout/js/action/place-order
'
,
'
Magento_Checkout/js/model/quote
'
],
function
(
ko
,
Component
,
setPaymentMethodAction
,
additionalValidators
)
{
function
(
$
,
Component
,
additionalValidators
,
fullScreenLoader
,
placeOrderAction
,
quote
)
{
'
use strict
'
;
var
brandCode
=
ko
.
observable
(
null
);
var
paymentMethod
=
ko
.
observable
(
null
);
return
Component
.
extend
({
self
:
this
,
defaults
:
{
template
:
'
Adyen_Payment/payment/pos-form
'
,
brandCode
:
''
template
:
'
Adyen_Payment/payment/pos-form
'
},
initObservable
:
function
()
{
this
.
_super
()
.
observe
([
]);
.
observe
([]);
return
this
;
},
/** Redirect to adyen */
continueToAdyen
:
function
()
{
var
self
=
this
;
if
(
this
.
validate
()
&&
additionalValidators
.
validate
())
{
//update payment method information if additional data was changed
this
.
selectPaymentMethod
();
setPaymentMethodAction
();
return
false
;
this
.
isPlaceOrderActionAllowed
(
false
);
fullScreenLoader
.
startLoader
();
$
.
when
(
placeOrderAction
(
this
.
getData
(),
this
.
messageContainer
)
).
fail
(
function
()
{
self
.
isPlaceOrderActionAllowed
(
true
);
}
).
done
(
function
()
{
self
.
afterPlaceOrder
();
$
.
mage
.
redirect
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
);
}
);
}
return
false
;
},
showLogo
:
function
()
{
showLogo
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
adyen
.
showLogo
;
},
validate
:
function
()
{
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-sepa-method.js
View file @
cfb02277
...
...
@@ -19,19 +19,14 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
underscore
'
,
'
jquery
'
,
'
Magento_Checkout/js/model/quote
'
,
'
Magento_Payment/js/view/payment/cc-form
'
,
'
Adyen_Payment/js/action/place-order
'
,
'
mage/translate
'
,
'
Magento_Checkout/js/model/payment/additional-validators
'
'
Magento_Payment/js/view/payment/cc-form
'
],
function
(
_
,
$
,
quote
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
)
{
function
(
_
,
$
,
quote
,
Component
)
{
'
use strict
'
;
var
billingAddress
=
quote
.
billingAddress
();
return
Component
.
extend
({
...
...
@@ -56,16 +51,16 @@ define(
isShowLegend
:
function
()
{
return
true
;
},
setPlaceOrderHandler
:
function
(
handler
)
{
setPlaceOrderHandler
:
function
(
handler
)
{
this
.
placeOrderHandler
=
handler
;
},
setValidateHandler
:
function
(
handler
)
{
setValidateHandler
:
function
(
handler
)
{
this
.
validateHandler
=
handler
;
},
getCode
:
function
()
{
getCode
:
function
()
{
return
'
adyen_sepa
'
;
},
getData
:
function
()
{
getData
:
function
()
{
return
{
'
method
'
:
this
.
item
.
method
,
'
additional_data
'
:
{
...
...
@@ -76,56 +71,34 @@ define(
}
};
},
isActive
:
function
()
{
isActive
:
function
()
{
return
true
;
},
/**
* @override
*/
placeOrder
:
function
(
data
,
event
)
{
var
self
=
this
,
placeOrder
;
if
(
event
)
{
event
.
preventDefault
();
}
if
(
this
.
validate
()
&&
additionalValidators
.
validate
())
{
this
.
isPlaceOrderActionAllowed
(
false
);
placeOrder
=
placeOrderAction
(
this
.
getData
(),
this
.
redirectAfterPlaceOrder
);
$
.
when
(
placeOrder
).
fail
(
function
(
response
)
{
self
.
isPlaceOrderActionAllowed
(
true
);
});
return
true
;
}
return
false
;
},
getControllerName
:
function
()
{
getControllerName
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
iframe
.
controllerName
[
this
.
getCode
()];
},
getPlaceOrderUrl
:
function
()
{
getPlaceOrderUrl
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
iframe
.
placeOrderUrl
[
this
.
getCode
()];
},
context
:
function
()
{
context
:
function
()
{
return
this
;
},
validate
:
function
()
{
var
form
=
'
form[data-role=adyen-sepa-form]
'
;
var
validate
=
$
(
form
).
validation
()
&&
$
(
form
).
validation
(
'
isValid
'
);
var
validate
=
$
(
form
).
validation
()
&&
$
(
form
).
validation
(
'
isValid
'
);
if
(
!
validate
)
{
if
(
!
validate
)
{
return
false
;
}
return
true
;
},
showLogo
:
function
()
{
showLogo
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
adyen
.
showLogo
;
},
getCountries
:
function
()
{
return
_
.
map
(
window
.
checkoutConfig
.
payment
.
adyenSepa
.
countries
,
function
(
value
,
key
)
{
getCountries
:
function
()
{
return
_
.
map
(
window
.
checkoutConfig
.
payment
.
adyenSepa
.
countries
,
function
(
value
,
key
)
{
return
{
'
key
'
:
key
,
'
value
'
:
value
...
...
view/frontend/web/template/payment/boleto-form.html
View file @
cfb02277
...
...
@@ -55,6 +55,10 @@
'orderSaveUrl':getPlaceOrderUrl(),
}, 'validation':[]}"
>
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<fieldset
data-bind=
"attr: {class: 'fieldset payment items adyen_boleto ' + getCode(), id: 'payment_form_' + getCode()}"
>
<!-- ko if: (isShowLegend())-->
...
...
view/frontend/web/template/payment/cc-form.html
View file @
cfb02277
...
...
@@ -38,6 +38,7 @@
</div>
<div
class=
"payment-method-content"
>
<div
class=
"payment-method-billing-address"
>
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
...
...
@@ -53,6 +54,11 @@
}, 'validation':[]}"
>
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<fieldset
data-bind=
"attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'payment_form_' + getCode()}"
>
<!-- ko if: (isShowLegend())-->
...
...
@@ -268,6 +274,8 @@
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<div
class=
"actions-toolbar"
>
<div
class=
"primary"
>
<button
class=
"action primary checkout"
...
...
view/frontend/web/template/payment/hpp-form.html
View file @
cfb02277
...
...
@@ -97,13 +97,17 @@
<div
class=
"control"
>
<input
type=
"text"
class=
"input-text"
name=
"payment[dob]"
data-bind=
" datepicker: { storage: datepickerValue, options: { showOn: 'both', changeYear: true, yearRange: '-99:-1', defaultDate: '-20y' } },
attr: {
id: getCode() + '_dob_' + value,
title: $t('Date of Birth'),
'data-container': getCode() + '-dob'
},
value: dob"
data-bind=
"
attr: {
id: getCode() + '_dob_' + value,
title: $t('Date of Birth'),
'data-container': getCode() + '-dob_' + value,
},
datepicker: {
storage: datepickerValue,
options: { showOn: 'both', changeYear: true, yearRange: '-99:-1', defaultDate: '-20y' }
},
value: dob"
data-validate=
"{required:true}"
/>
</div>
...
...
view/frontend/web/template/payment/oneclick-form.html
View file @
cfb02277
...
...
@@ -23,9 +23,11 @@
-->
<!-- ko foreach: getAdyenBillingAgreements() -->
<!-- ko foreach: getAdyenBillingAgreements() -->
<div
class=
"payment-method"
data-bind=
"css: {'_active': (value == $parent.isBillingAgreementChecked())}"
>
<div
class=
"payment-method-title field choice"
>
<input
type=
"radio"
name=
"payment[method]"
...
...
@@ -50,12 +52,18 @@
</div>
<div
class=
"payment-method-content"
>
<!-- ko foreach: $parent.getRegion(getMessageName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div
class=
"payment-method-billing-address"
>
<!-- ko foreach: $parents[1].getRegion($parent.getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<form
class=
"form"
action=
"#"
method=
"post"
data-bind=
"
attr: {'id': 'adyen_oneclick_' + value, 'data-role': 'adyen_oneclick_' + value },
mageInit: {
...
...
@@ -221,9 +229,6 @@
<!-- /ko -->
</fieldset>
<div
class=
"checkout-agreements-block"
>
<!-- ko foreach: $parents[1].getRegion('before-place-order') -->
...
...
@@ -235,7 +240,7 @@
<button
class=
"action primary checkout"
type=
"submit"
data-bind=
"
click:
$parent.
placeOrder,
click: placeOrder,
attr: {title: $t('Place Order')},
enable: (value == $parent.isBillingAgreementChecked())
"
...
...
view/frontend/web/template/payment/pos-form.html
View file @
cfb02277
...
...
@@ -45,6 +45,11 @@
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<fieldset
class=
"fieldset"
data-bind=
'attr: {id: "payment_form_" + getCode()}'
>
<div
class=
"payment-method-note"
>
<!-- ko text: $t('You will be redirected to the Adyen App.') --><!-- /ko -->
...
...
view/frontend/web/template/payment/sepa-form.html
View file @
cfb02277
...
...
@@ -46,7 +46,9 @@
<!--/ko-->
</div>
<!-- ko foreach: getRegion('messages') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<form
class=
"form"
id=
"adyen-sepa-form"
data-role=
"adyen-sepa-form"
action=
"#"
method=
"post"
data-bind=
"mageInit: {
'transparent':{
...
...
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