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
34bbb13c
Commit
34bbb13c
authored
Nov 06, 2020
by
Alexandros Moraitis
Committed by
GitHub
Nov 06, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #876 from Adyen/develop
Release 6.6.5
parents
4d50e700
9b5d48cf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
92 deletions
+45
-92
Gateway/Request/RedirectDataBuilder.php
Gateway/Request/RedirectDataBuilder.php
+0
-69
Helper/Requests.php
Helper/Requests.php
+0
-13
Model/AdyenOrderPaymentStatus.php
Model/AdyenOrderPaymentStatus.php
+10
-0
Model/Ui/AdyenGooglePayConfigProvider.php
Model/Ui/AdyenGooglePayConfigProvider.php
+4
-0
README.md
README.md
+3
-1
composer.json
composer.json
+1
-1
etc/di.xml
etc/di.xml
+0
-1
view/frontend/web/js/view/payment/method-renderer/adyen-google-pay-method.js
...s/view/payment/method-renderer/adyen-google-pay-method.js
+27
-7
No files found.
Gateway/Request/RedirectDataBuilder.php
deleted
100644 → 0
View file @
4d50e700
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2020 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
class
RedirectDataBuilder
implements
BuilderInterface
{
/**
* @var \Magento\Framework\App\State
*/
private
$appState
;
/**
* @var \Adyen\Payment\Helper\Requests
*/
private
$adyenRequestsHelper
;
/**
* RedirectDataBuilder constructor.
*
* @param \Magento\Framework\Model\Context $context
* @param \Adyen\Payment\Helper\Requests $adyenRequestsHelper
*/
public
function
__construct
(
\Magento\Framework\Model\Context
$context
,
\Adyen\Payment\Helper\Requests
$adyenRequestsHelper
)
{
$this
->
appState
=
$context
->
getAppState
();
$this
->
adyenRequestsHelper
=
$adyenRequestsHelper
;
}
/**
* @param array $buildSubject
* @return array
* @throws \Magento\Framework\Exception\LocalizedException
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
$storeId
=
$payment
->
getOrder
()
->
getStoreId
();
$request
[
'body'
]
=
$this
->
adyenRequestsHelper
->
buildRedirectData
(
$storeId
,
[]);
return
$request
;
}
}
Helper/Requests.php
View file @
34bbb13c
...
...
@@ -357,19 +357,6 @@ class Requests extends AbstractHelper
return
$request
;
}
/**
* @param array $request
* @return array
* @deprecated
*/
public
function
buildRedirectData
(
$storeId
,
$request
=
[])
{
$request
[
'redirectFromIssuerMethod'
]
=
'GET'
;
$request
[
'redirectToIssuerMethod'
]
=
'POST'
;
$request
[
'returnUrl'
]
=
$this
->
urlBuilder
->
getUrl
(
'adyen/process/redirect'
);
return
$request
;
}
/**
* @param $request
* @param $areaCode
...
...
Model/AdyenOrderPaymentStatus.php
View file @
34bbb13c
...
...
@@ -25,6 +25,7 @@
namespace
Adyen\Payment\Model
;
use
Adyen\Payment\Model\Ui\AdyenCcConfigProvider
;
use
Adyen\Payment\Model\Ui\AdyenGooglePayConfigProvider
;
use
Adyen\Payment\Model\Ui\AdyenHppConfigProvider
;
use
Adyen\Payment\Model\Ui\AdyenOneclickConfigProvider
;
...
...
@@ -102,6 +103,15 @@ class AdyenOrderPaymentStatus implements \Adyen\Payment\Api\AdyenOrderPaymentSta
return
json_encode
([
'action'
=>
$additionalInformation
[
'action'
]]);
}
}
/**
* If payment method is google pay
*/
if
(
$payment
->
getMethod
()
===
AdyenGooglePayConfigProvider
::
CODE
)
{
$additionalInformation
=
$payment
->
getAdditionalInformation
();
if
(
!
empty
(
$additionalInformation
[
'threeDSType'
]))
{
return
json_encode
([
'type'
=>
$additionalInformation
[
'threeDSType'
]]);
}
}
return
true
;
}
...
...
Model/Ui/AdyenGooglePayConfigProvider.php
View file @
34bbb13c
...
...
@@ -97,6 +97,10 @@ class AdyenGooglePayConfigProvider implements ConfigProviderInterface
self
::
CODE
=>
[
'isActive'
=>
true
,
'redirectUrl'
=>
$this
->
urlBuilder
->
getUrl
(
'adyen/process/redirect/'
,
[
'_secure'
=>
$this
->
_getRequest
()
->
isSecure
()]
),
'successUrl'
=>
$this
->
urlBuilder
->
getUrl
(
'checkout/onepage/success/'
,
[
'_secure'
=>
$this
->
_getRequest
()
->
isSecure
()]
)
...
...
README.md
View file @
34bbb13c
...
...
@@ -12,7 +12,9 @@ Inside Adyen toggle the following settings on inside the API and Responses secti
*
Variant
## Requirements
This plugin supports Magento2 version 2.2.8 and higher.
This plugin supports Magento2 version
*
2.2.9 and higher
*
2.3.1 and higher
## Contributing
We strongly encourage you to join us in contributing to this repository so everyone can benefit from:
...
...
composer.json
View file @
34bbb13c
...
...
@@ -2,7 +2,7 @@
"name"
:
"adyen/module-payment"
,
"description"
:
"Official Magento2 Plugin to connect to Payment Service Provider Adyen."
,
"type"
:
"magento2-module"
,
"version"
:
"6.6.
4
"
,
"version"
:
"6.6.
5
"
,
"license"
:
[
"OSL-3.0"
,
"AFL-3.0"
...
...
etc/di.xml
View file @
34bbb13c
...
...
@@ -607,7 +607,6 @@
<item
name=
"recurring"
xsi:type=
"string"
>
Adyen\Payment\Gateway\Request\RecurringDataBuilder
</item>
<item
name=
"oneclick"
xsi:type=
"string"
>
Adyen\Payment\Gateway\Request\OneclickAuthorizationDataBuilder
</item>
<item
name=
"threeds2"
xsi:type=
"string"
>
Adyen\Payment\Gateway\Request\ThreeDS2DataBuilder
</item>
<item
name=
"redirect"
xsi:type=
"string"
>
Adyen\Payment\Gateway\Request\RedirectDataBuilder
</item>
</argument>
</arguments>
</virtualType>
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-google-pay-method.js
View file @
34bbb13c
...
...
@@ -34,9 +34,10 @@ define(
'
Magento_Checkout/js/model/full-screen-loader
'
,
'
mage/url
'
,
'
Magento_Vault/js/view/payment/vault-enabler
'
,
'
Adyen_Payment/js/model/adyen-payment-service
'
,
'
adyenCheckout
'
],
function
(
ko
,
$
,
Component
,
placeOrderAction
,
additionalValidators
,
quote
,
urlBuilder
,
fullScreenLoader
,
url
,
VaultEnabler
,
AdyenCheckout
)
{
function
(
ko
,
$
,
Component
,
placeOrderAction
,
additionalValidators
,
quote
,
urlBuilder
,
fullScreenLoader
,
url
,
VaultEnabler
,
adyenPaymentService
,
AdyenCheckout
)
{
'
use strict
'
;
/**
...
...
@@ -128,13 +129,16 @@ define(
self
.
isPlaceOrderActionAllowed
(
true
);
}
).
done
(
function
()
{
self
.
afterPlaceOrder
();
window
.
location
.
replace
(
url
.
build
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
));
}
);
function
(
orderId
)
{
self
.
afterPlaceOrder
();
adyenPaymentService
.
getOrderPaymentStatus
(
orderId
)
.
done
(
function
(
responseJSON
)
{
self
.
validateThreeDSOrPlaceOrder
(
responseJSON
)
});
}
);
}
},
buttonColor
:
'
black
'
,
// default/black/white
buttonType
:
'
long
'
,
// long/short
...
...
@@ -150,6 +154,22 @@ define(
self
.
googlePayAllowed
(
false
);
});
},
/**
* Based on the response we can start a 3DS2 validation or place the order
* @param responseJSON
*/
validateThreeDSOrPlaceOrder
:
function
(
responseJSON
)
{
var
response
=
JSON
.
parse
(
responseJSON
);
if
(
response
&&
response
.
type
===
'
RedirectShopper
'
)
{
window
.
location
.
replace
(
url
.
build
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
redirectUrl
));
}
else
{
window
.
location
.
replace
(
url
.
build
(
window
.
checkoutConfig
.
payment
[
quote
.
paymentMethod
().
method
].
successUrl
));
}
},
isGooglePayAllowed
:
function
()
{
if
(
this
.
googlePayAllowed
())
{
return
true
;
...
...
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