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
ddd0d39b
Commit
ddd0d39b
authored
Jan 04, 2018
by
Rik ter Beek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove place-order and use core code
parent
3281c8ab
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
215 deletions
+46
-215
view/frontend/web/js/action/place-order.js
view/frontend/web/js/action/place-order.js
+0
-80
view/frontend/web/js/view/payment/method-renderer/adyen-boleto-method.js
...eb/js/view/payment/method-renderer/adyen-boleto-method.js
+16
-42
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
...nd/web/js/view/payment/method-renderer/adyen-cc-method.js
+6
-21
view/frontend/web/js/view/payment/method-renderer/adyen-oneclick-method.js
.../js/view/payment/method-renderer/adyen-oneclick-method.js
+4
-20
view/frontend/web/js/view/payment/method-renderer/adyen-pos-method.js
...d/web/js/view/payment/method-renderer/adyen-pos-method.js
+4
-10
view/frontend/web/js/view/payment/method-renderer/adyen-sepa-method.js
.../web/js/view/payment/method-renderer/adyen-sepa-method.js
+16
-42
No files found.
view/frontend/web/js/action/place-order.js
deleted
100755 → 0
View file @
3281c8ab
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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
()
{
if
(
redirectOnSuccess
)
{
window
.
location
.
replace
(
url
.
build
(
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 @
ddd0d39b
...
...
@@ -19,19 +19,15 @@
*
* 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 +47,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 +67,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 @
ddd0d39b
...
...
@@ -19,23 +19,17 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
underscore
'
,
'
jquery
'
,
'
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/quote
'
,
'
ko
'
,
'
Adyen_Payment/js/model/installments
'
,
'
Adyen_Payment/js/model/installments
'
],
function
(
_
,
$
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
,
customer
,
creditCardData
,
quote
,
ko
,
installments
)
{
function
(
$
,
Component
,
customer
,
creditCardData
,
quote
,
installments
)
{
'
use strict
'
;
var
cvcLength
=
ko
.
observable
(
4
);
...
...
@@ -150,8 +144,7 @@ define(
if
(
event
)
{
event
.
preventDefault
();
}
var
options
=
{};
var
cseInstance
=
adyen
.
createEncryption
(
options
);
var
generationtime
=
self
.
getGenerationTime
();
...
...
@@ -168,16 +161,8 @@ define(
var
data
=
cseInstance
.
encrypt
(
cardData
);
self
.
encryptedData
(
data
);
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
;
// rest is default placeOrder logic
return
self
.
_super
();
},
getControllerName
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
iframe
.
controllerName
[
this
.
getCode
()];
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-oneclick-method.js
View file @
ddd0d39b
...
...
@@ -19,22 +19,18 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
ko
'
,
'
underscore
'
,
'
jquery
'
,
'
Magento_Payment/js/view/payment/cc-form
'
,
'
Adyen_Payment/js/action/place-order
'
,
'
mage/translate
'
,
'
Magento_Checkout/js/model/payment/additional-validators
'
,
'
Magento_Checkout/js/action/select-payment-method
'
,
'
Magento_Checkout/js/model/quote
'
,
'
Magento_Checkout/js/checkout-data
'
],
function
(
ko
,
_
,
$
,
Component
,
placeOrderAction
,
$t
,
additionalValidators
,
selectPaymentMethodAction
,
quote
,
checkoutData
)
{
function
(
ko
,
_
,
$
,
Component
,
selectPaymentMethodAction
,
quote
,
checkoutData
)
{
'
use strict
'
;
var
updatedExpiryDate
=
false
;
var
recurringDetailReference
=
ko
.
observable
(
null
);
...
...
@@ -55,10 +51,6 @@ define(
]);
return
this
;
},
initialize
:
function
()
{
var
self
=
this
;
this
.
_super
();
},
placeOrderHandler
:
null
,
validateHandler
:
null
,
setPlaceOrderHandler
:
function
(
handler
)
{
...
...
@@ -117,16 +109,8 @@ define(
data
.
additional_data
.
number_of_installments
=
self
.
installment
;
}
if
(
this
.
validate
()
&&
additionalValidators
.
validate
())
{
//this.isPlaceOrderActionAllowed(false);
placeOrder
=
placeOrderAction
(
data
,
this
.
redirectAfterPlaceOrder
);
$
.
when
(
placeOrder
).
fail
(
function
(
response
)
{
//self.isPlaceOrderActionAllowed(true);
});
return
true
;
}
return
false
;
// rest is default placeOrder logic
return
self
.
_super
();
},
getControllerName
:
function
()
{
return
window
.
checkoutConfig
.
payment
.
iframe
.
controllerName
[
this
.
getCode
()];
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-pos-method.js
View file @
ddd0d39b
...
...
@@ -19,8 +19,7 @@
*
* Author: Adyen <magento@adyen.com>
*/
/*browser:true*/
/*global define*/
define
(
[
'
ko
'
,
...
...
@@ -30,19 +29,14 @@ define(
],
function
(
ko
,
Component
,
setPaymentMethodAction
,
additionalValidators
)
{
'
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 */
...
...
@@ -54,7 +48,7 @@ define(
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 @
ddd0d39b
...
...
@@ -19,19 +19,15 @@
*
* 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 +52,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 +72,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
...
...
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