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
84a7b6ff
Commit
84a7b6ff
authored
Oct 21, 2019
by
Alessio Zampatti
Committed by
GitHub
Oct 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PW-1784 Missing shopperInteraction for Recurring BA payments (#547)
parent
72ea16e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
102 deletions
+10
-102
Gateway/Request/OneclickAuthorizationDataBuilder.php
Gateway/Request/OneclickAuthorizationDataBuilder.php
+0
-101
Helper/Requests.php
Helper/Requests.php
+10
-1
No files found.
Gateway/Request/OneclickAuthorizationDataBuilder.php
deleted
100644 → 0
View file @
72ea16e7
<?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
Adyen\Payment\Observer\AdyenOneclickDataAssignObserver
;
use
Magento\Payment\Gateway\Request\BuilderInterface
;
class
OneclickAuthorizationDataBuilder
implements
BuilderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private
$adyenHelper
;
/**
* CaptureDataBuilder constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public
function
__construct
(
\Adyen\Payment\Helper\Data
$adyenHelper
)
{
$this
->
adyenHelper
=
$adyenHelper
;
}
/**
* @param array $buildSubject
* @return mixed
*/
public
function
build
(
array
$buildSubject
)
{
$request
=
[];
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$payment
=
$paymentDataObject
->
getPayment
();
// If ccType is set use this. For bcmc you need bcmc otherwise it will fail
$request
[
'paymentMethod'
][
'type'
]
=
"scheme"
;
if
(
$variant
=
$payment
->
getAdditionalInformation
(
AdyenOneclickDataAssignObserver
::
VARIANT
))
{
$request
[
'paymentMethod'
][
'type'
]
=
$variant
;
}
if
(
$securityCode
=
$payment
->
getAdditionalInformation
(
AdyenOneclickDataAssignObserver
::
ENCRYPTED_SECURITY_CODE
))
{
$request
[
'paymentMethod'
][
'encryptedSecurityCode'
]
=
$securityCode
;
}
$payment
->
unsAdditionalInformation
(
AdyenOneclickDataAssignObserver
::
ENCRYPTED_SECURITY_CODE
);
if
(
$payment
->
getAdditionalInformation
(
'customer_interaction'
))
{
$shopperInteraction
=
"Ecommerce"
;
}
else
{
$shopperInteraction
=
"ContAuth"
;
}
$request
[
'shopperInteraction'
]
=
$shopperInteraction
;
$request
[
'paymentMethod'
][
'recurringDetailReference'
]
=
$payment
->
getAdditionalInformation
(
AdyenOneclickDataAssignObserver
::
RECURRING_DETAIL_REFERENCE
);
// if it is a sepadirectdebit set selectedBrand to sepadirectdebit in the case of oneclick
if
(
$payment
->
getCcType
()
==
"sepadirectdebit"
)
{
$request
[
'selectedBrand'
]
=
"sepadirectdebit"
;
}
/*
* For recurring Ideal and Sofort needs to be converted to SEPA
* for this it is mandatory to set selectBrand to sepadirectdebit
*/
if
(
!
$payment
->
getAdditionalInformation
(
'customer_interaction'
))
{
if
(
$payment
->
getCcType
()
==
"directEbanking"
||
$payment
->
getCcType
()
==
"ideal"
)
{
$request
[
'selectedBrand'
]
=
"sepadirectdebit"
;
}
}
// if installments is set add it into the request
if
(
$payment
->
getAdditionalInformation
(
AdyenOneclickDataAssignObserver
::
NUMBER_OF_INSTALLMENTS
)
>
0
)
{
$request
[
'installments'
][
'value'
]
=
$payment
->
getAdditionalInformation
(
AdyenOneclickDataAssignObserver
::
NUMBER_OF_INSTALLMENTS
);
}
return
$request
;
}
}
Helper/Requests.php
View file @
84a7b6ff
...
...
@@ -363,7 +363,7 @@ class Requests extends AbstractHelper
/**
* @param $request
* @param $payment
* @param $storeId
* @param $storeId
buildCCData
* @return mixed
*/
public
function
buildCCData
(
$request
=
[],
$payload
,
$storeId
,
$areaCode
)
...
...
@@ -409,6 +409,15 @@ class Requests extends AbstractHelper
$request
[
'paymentMethod'
][
'recurringDetailReference'
]
=
$recurringDetailReference
;
}
// set customerInteraction
$recurringContractType
=
$this
->
adyenHelper
->
getAdyenOneclickConfigData
(
'recurring_payment_type'
);
if
(
!
empty
(
$payload
[
'method'
])
&&
$payload
[
'method'
]
==
'adyen_oneclick'
&&
$recurringContractType
==
\Adyen\Payment\Model\RecurringType
::
RECURRING
)
{
$request
[
'shopperInteraction'
]
=
"ContAuth"
;
}
else
{
$request
[
'shopperInteraction'
]
=
"Ecommerce"
;
}
/**
* if MOTO for backend is enabled use MOTO as shopper interaction type
*/
...
...
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