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
4fbf8974
Commit
4fbf8974
authored
Jan 09, 2018
by
Rik ter Beek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove custom set-payment-method and use core code to place order
parent
c0c84b89
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
105 deletions
+65
-105
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
+0
-1
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
...nd/web/js/view/payment/method-renderer/adyen-cc-method.js
+0
-1
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
...d/web/js/view/payment/method-renderer/adyen-hpp-method.js
+39
-11
view/frontend/web/js/view/payment/method-renderer/adyen-oneclick-method.js
.../js/view/payment/method-renderer/adyen-oneclick-method.js
+0
-1
view/frontend/web/js/view/payment/method-renderer/adyen-pos-method.js
...d/web/js/view/payment/method-renderer/adyen-pos-method.js
+26
-8
view/frontend/web/js/view/payment/method-renderer/adyen-sepa-method.js
.../web/js/view/payment/method-renderer/adyen-sepa-method.js
+0
-1
No files found.
view/frontend/web/js/action/set-payment-method.js
deleted
100755 → 0
View file @
c0c84b89
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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 @
4fbf8974
...
...
@@ -19,7 +19,6 @@
*
* Author: Adyen <magento@adyen.com>
*/
define
(
[
'
underscore
'
,
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
View file @
4fbf8974
...
...
@@ -19,7 +19,6 @@
*
* Author: Adyen <magento@adyen.com>
*/
define
(
[
'
jquery
'
,
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-hpp-method.js
View file @
4fbf8974
...
...
@@ -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,9 +32,10 @@ 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
'
,
],
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
)
{
'
use strict
'
;
var
brandCode
=
ko
.
observable
(
null
);
var
paymentMethod
=
ko
.
observable
(
null
);
...
...
@@ -150,6 +148,15 @@ define(
result
.
validate
=
function
()
{
return
self
.
validate
();
};
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 +219,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
;
}
},
...
...
@@ -245,9 +254,7 @@ define(
}
data
.
additional_data
=
additionalData
;
selectPaymentMethodAction
(
data
);
setPaymentMethodAction
();
this
.
placeRedirectOrder
(
data
);
}
return
false
;
...
...
@@ -275,6 +282,27 @@ define(
return
true
;
},
placeRedirectOrder
:
function
(
data
)
{
// Place Order but use our own redirect url after
var
self
=
this
;
this
.
isPlaceOrderActionAllowed
(
false
);
fullScreenLoader
.
startLoader
();
$
.
when
(
placeOrderAction
(
data
,
this
.
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 @
4fbf8974
...
...
@@ -19,7 +19,6 @@
*
* Author: Adyen <magento@adyen.com>
*/
define
(
[
'
ko
'
,
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-pos-method.js
View file @
4fbf8974
...
...
@@ -19,15 +19,16 @@
*
* Author: Adyen <magento@adyen.com>
*/
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
'
;
return
Component
.
extend
({
self
:
this
,
...
...
@@ -41,12 +42,29 @@ 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
();
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
()
{
return
window
.
checkoutConfig
.
payment
.
adyen
.
showLogo
;
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-sepa-method.js
View file @
4fbf8974
...
...
@@ -19,7 +19,6 @@
*
* Author: Adyen <magento@adyen.com>
*/
define
(
[
'
underscore
'
,
...
...
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