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
2a276782
Commit
2a276782
authored
Dec 24, 2020
by
Attila Kiss
Committed by
GitHub
Dec 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle 3DS1 with Google pay (#930)
parent
847bb848
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
9 deletions
+44
-9
Gateway/Request/GooglePayAuthorizationDataBuilder.php
Gateway/Request/GooglePayAuthorizationDataBuilder.php
+14
-1
view/frontend/web/js/view/payment/method-renderer/adyen-google-pay-method.js
...s/view/payment/method-renderer/adyen-google-pay-method.js
+30
-8
No files found.
Gateway/Request/GooglePayAuthorizationDataBuilder.php
View file @
2a276782
...
...
@@ -39,6 +39,11 @@ class GooglePayAuthorizationDataBuilder implements BuilderInterface
*/
private
$adyenLogger
;
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
private
$storeManager
;
/**
* GooglePayAuthorizationDataBuilder constructor.
*
...
...
@@ -46,10 +51,12 @@ class GooglePayAuthorizationDataBuilder implements BuilderInterface
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Magento\Store\Model\StoreManagerInterface
$storeManager
)
{
$this
->
adyenHelper
=
$adyenHelper
;
$this
->
adyenLogger
=
$adyenLogger
;
$this
->
storeManager
=
$storeManager
;
}
public
function
build
(
array
$buildSubject
)
...
...
@@ -57,6 +64,8 @@ class GooglePayAuthorizationDataBuilder implements BuilderInterface
$requestBody
=
[];
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
/** @var \Magento\Sales\Model\Order $order */
$order
=
$payment
->
getOrder
();
$token
=
$payment
->
getAdditionalInformation
(
'token'
);
$requestBody
[
'paymentMethod'
][
'type'
]
=
'paywithgoogle'
;
...
...
@@ -67,6 +76,10 @@ class GooglePayAuthorizationDataBuilder implements BuilderInterface
$this
->
adyenLogger
->
addAdyenDebug
(
"PaymentToken is empty"
);
}
$requestBody
[
'returnUrl'
]
=
$this
->
storeManager
->
getStore
()
->
getBaseUrl
(
\Magento\Framework\UrlInterface
::
URL_TYPE_LINK
)
.
'adyen/transparent/redirect?merchantReference='
.
$order
->
getIncrementId
();
$request
[
'body'
]
=
$requestBody
;
return
$request
;
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-google-pay-method.js
View file @
2a276782
...
...
@@ -161,18 +161,40 @@ define(
* @param responseJSON
*/
validateThreeDSOrPlaceOrder
:
function
(
responseJSON
)
{
var
self
=
this
;
var
response
=
JSON
.
parse
(
responseJSON
);
if
(
response
&&
response
.
type
===
'
RedirectShopper
'
)
{
// TODO do redirect with the component
window
.
location
.
replace
(
url
.
build
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
));
if
(
!!
response
.
isFinal
)
{
// Status is final redirect to the redirectUrl
$
.
mage
.
redirect
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
successUrl
,
);
}
else
{
window
.
location
.
replace
(
url
.
build
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
successUrl
));
// render component
self
.
renderActionComponent
(
response
.
action
);
}
},
renderActionComponent
:
function
(
action
)
{
var
self
=
this
;
var
actionNode
=
document
.
getElementById
(
'
ActionContainer
'
);
fullScreenLoader
.
stopLoader
();
self
.
popupModal
=
$
(
'
#ActionModal
'
).
modal
({
// disable user to hide popup
clickableOverlay
:
false
,
responsive
:
true
,
innerScroll
:
false
,
// empty buttons, we don't need that
buttons
:
[],
modalClass
:
'
ActionModal
'
,
});
self
.
popupModal
.
modal
(
'
openModal
'
);
self
.
actionComponent
=
self
.
checkoutComponent
.
createFromAction
(
action
).
mount
(
actionNode
);
},
isGooglePayAllowed
:
function
()
{
return
!!
this
.
googlePayAllowed
();
},
...
...
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