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
e5b7358b
Commit
e5b7358b
authored
Aug 20, 2019
by
attilak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add guest email address to card payments when only that email address is
available
parent
a0b24485
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
Helper/Requests.php
Helper/Requests.php
+17
-3
Model/AdyenPaymentProcess.php
Model/AdyenPaymentProcess.php
+1
-1
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
...nd/web/js/view/payment/method-renderer/adyen-cc-method.js
+1
-0
No files found.
Helper/Requests.php
View file @
e5b7358b
...
...
@@ -67,12 +67,15 @@ class Requests extends AbstractHelper
}
/**
* @param $request
* @param
array
$request
* @param int $customerId
* @param $billingAddress
* @return mixed
* @param $storeId
* @param null $payment
* @param null $payload
* @return array
*/
public
function
buildCustomerData
(
$request
=
[],
$customerId
=
0
,
$billingAddress
,
$storeId
,
$payment
=
null
)
public
function
buildCustomerData
(
$request
=
[],
$customerId
=
0
,
$billingAddress
,
$storeId
,
$payment
=
null
,
$payload
=
null
)
{
if
(
$customerId
>
0
)
{
$request
[
'shopperReference'
]
=
$customerId
;
...
...
@@ -83,6 +86,17 @@ class Requests extends AbstractHelper
$paymentMethod
=
$payment
->
getAdditionalInformation
(
AdyenHppDataAssignObserver
::
BRAND_CODE
);
}
// In case of virtual product and guest checkout there is a workaround to get the guest's email address
if
(
!
empty
(
$payload
[
'additional_data'
][
'guestEmail'
]))
{
if
(
$this
->
adyenHelper
->
isPaymentMethodOpenInvoiceMethod
(
$paymentMethod
)
&&
!
$this
->
adyenHelper
->
isPaymentMethodAfterpayTouchMethod
(
$paymentMethod
)
)
{
$request
[
'paymentMethod'
][
'personalDetails'
][
'shopperEmail'
]
=
$payload
[
'additional_data'
][
'guestEmail'
];
}
else
{
$request
[
'shopperEmail'
]
=
$payload
[
'additional_data'
][
'guestEmail'
];
}
}
if
(
!
empty
(
$billingAddress
))
{
// Openinvoice (klarna and afterpay BUT not afterpay touch) methods requires different request format
if
(
$this
->
adyenHelper
->
isPaymentMethodOpenInvoiceMethod
(
$paymentMethod
)
&&
...
...
Model/AdyenPaymentProcess.php
View file @
e5b7358b
...
...
@@ -131,7 +131,7 @@ class AdyenPaymentProcess implements AdyenPaymentProcessInterface
// Customer data builder
$customerId
=
$quote
->
getCustomerId
();
$billingAddress
=
$quote
->
getBillingAddress
();
$request
=
$this
->
adyenRequestHelper
->
buildCustomerData
(
$request
,
$customerId
,
$billingAddress
,
$storeId
);
$request
=
$this
->
adyenRequestHelper
->
buildCustomerData
(
$request
,
$customerId
,
$billingAddress
,
$storeId
,
null
,
$payload
);
// Customer Ip data builder
$shopperIp
=
$quote
->
getXForwardedFor
();
...
...
view/frontend/web/js/view/payment/method-renderer/adyen-cc-method.js
View file @
e5b7358b
...
...
@@ -280,6 +280,7 @@ define(
var
data
=
{
'
method
'
:
this
.
item
.
method
,
additional_data
:
{
'
guestEmail
'
:
quote
.
guestEmail
,
'
cc_type
'
:
this
.
creditCardType
(),
'
number
'
:
this
.
creditCardNumber
(),
'
cvc
'
:
this
.
securityCode
(),
...
...
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