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
9f43b97c
Commit
9f43b97c
authored
Nov 23, 2018
by
attilak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Route HPP / APMs through checkout /payments
parent
06164536
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
18 deletions
+109
-18
Gateway/Request/HppAuthorizationDataBuilder.php
Gateway/Request/HppAuthorizationDataBuilder.php
+91
-0
Gateway/Validator/CheckoutResponseValidator.php
Gateway/Validator/CheckoutResponseValidator.php
+18
-18
No files found.
Gateway/Request/HppAuthorizationDataBuilder.php
0 → 100644
View file @
9f43b97c
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
namespace
Adyen\Payment\Gateway\Request
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
use
Adyen\Payment\Observer\AdyenHppDataAssignObserver
;
class
HppAuthorizationDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
private
$storeManager
;
/**
* CcAuthorizationDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Magento\Store\Model\StoreManagerInterface
$storeManager
)
{
$this
->
adyenHelper
=
$adyenHelper
;
$this
->
storeManager
=
$storeManager
;
}
/**
* @param array $buildSubject
* @return mixed
*/
public
function
build
(
array
$buildSubject
)
{
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
$order
=
$payment
->
getOrder
();
$request
=
[];
// do not send email
$order
->
setCanSendNewEmailFlag
(
false
);
$request
[
'paymentMethod'
][
'type'
]
=
$payment
->
getAdditionalInformation
(
AdyenHppDataAssignObserver
::
BRAND_CODE
);
$request
[
'returnUrl'
]
=
$this
->
storeManager
->
getStore
()
->
getBaseUrl
(
\Magento\Framework\UrlInterface
::
URL_TYPE_LINK
)
.
'adyen/process/result'
;
// update customer based on additionalFields
if
(
$payment
->
getAdditionalInformation
(
"gender"
))
{
$order
->
setCustomerGender
(
\Adyen\Payment\Model\Gender
::
getMagentoGenderFromAdyenGender
(
$payment
->
getAdditionalInformation
(
"gender"
))
);
}
if
(
$payment
->
getAdditionalInformation
(
"dob"
))
{
$order
->
setCustomerDob
(
$payment
->
getAdditionalInformation
(
"dob"
));
}
if
(
$payment
->
getAdditionalInformation
(
"telephone"
))
{
$order
->
getBillingAddress
()
->
setTelephone
(
$payment
->
getAdditionalInformation
(
"telephone"
));
}
return
$request
;
}
}
Gateway/Validator/CheckoutResponseValidator.php
View file @
9f43b97c
...
...
@@ -27,24 +27,24 @@ use Magento\Payment\Gateway\Validator\AbstractValidator;
class
CheckoutResponseValidator
extends
AbstractValidator
{
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
private
$adyenLogger
;
/**
* GeneralResponseValidator constructor.
*
* @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public
function
__construct
(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory
$resultFactory
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
)
{
$this
->
adyenLogger
=
$adyenLogger
;
parent
::
__construct
(
$resultFactory
);
}
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
private
$adyenLogger
;
/**
* GeneralResponseValidator constructor.
*
* @param \Magento\Payment\Gateway\Validator\ResultInterfaceFactory $resultFactory
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public
function
__construct
(
\Magento\Payment\Gateway\Validator\ResultInterfaceFactory
$resultFactory
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
)
{
$this
->
adyenLogger
=
$adyenLogger
;
parent
::
__construct
(
$resultFactory
);
}
/**
* @param array $validationSubject
...
...
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