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
7a7741c9
Commit
7a7741c9
authored
Apr 20, 2017
by
Rik ter Beek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#78 Do not store card if user is not loggedin
parent
164a2b06
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
38 deletions
+27
-38
Block/Redirect/Pos.php
Block/Redirect/Pos.php
+4
-8
Block/Redirect/Redirect.php
Block/Redirect/Redirect.php
+5
-7
Gateway/Command/PayByMailCommand.php
Gateway/Command/PayByMailCommand.php
+6
-10
Gateway/Request/CustomerDataBuilder.php
Gateway/Request/CustomerDataBuilder.php
+9
-10
Gateway/Request/RecurringDataBuilder.php
Gateway/Request/RecurringDataBuilder.php
+3
-1
Model/Api/PaymentRequest.php
Model/Api/PaymentRequest.php
+0
-2
No files found.
Block/Redirect/Pos.php
View file @
7a7741c9
...
...
@@ -27,10 +27,6 @@ use Symfony\Component\Config\Definition\Exception\Exception;
class
Pos
extends
\Magento\Payment\Block\Form
{
/**
* quest prefix
*/
const
GUEST_ID
=
'customer_'
;
protected
$_orderFactory
;
/**
...
...
@@ -118,13 +114,13 @@ class Pos extends \Magento\Payment\Block\Form
$currencyCode
=
$orderCurrencyCode
;
$paymentAmount
=
$amount
;
$merchantReference
=
$realOrderId
;
$shopperReference
=
(
!
empty
(
$customerId
))
?
$customerId
:
self
::
GUEST_ID
.
$realOrderId
;
$shopperEmail
=
$shopperEmail
;
$recurringParams
=
""
;
if
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
"store_cc"
)
!=
""
)
{
if
(
$this
->
_order
->
getPayment
()
->
getAdditionalInformation
(
"store_cc"
)
!=
""
&&
$customerId
>
0
)
{
$recurringParams
=
"&recurringContract="
.
urlencode
(
$recurringContract
)
.
"&shopperReference="
.
urlencode
(
$
shopperReference
)
.
"&shopperEmail="
.
urlencode
(
$shopperEmail
);
urlencode
(
$
customerId
)
.
"&shopperEmail="
.
urlencode
(
$shopperEmail
);
}
$receiptOrderLines
=
""
;
...
...
Block/Redirect/Redirect.php
View file @
7a7741c9
...
...
@@ -28,11 +28,6 @@ use Symfony\Component\Config\Definition\Exception\Exception;
class
Redirect
extends
\Magento\Payment\Block\Form
{
/**
* quest prefix
*/
const
GUEST_ID
=
'customer_'
;
/**
* @var \Magento\Sales\Model\OrderFactory
*/
...
...
@@ -233,8 +228,11 @@ class Redirect extends \Magento\Payment\Block\Form
$recurringType
=
"RECURRING"
;
}
$formFields
[
'recurringContract'
]
=
$recurringType
;
$formFields
[
'shopperReference'
]
=
(
!
empty
(
$customerId
))
?
$customerId
:
self
::
GUEST_ID
.
$realOrderId
;
if
(
$customerId
>
0
)
{
$formFields
[
'recurringContract'
]
=
$recurringType
;
$formFields
[
'shopperReference'
]
=
$customerId
;
}
//blocked methods
$formFields
[
'blockedMethods'
]
=
""
;
...
...
Gateway/Command/PayByMailCommand.php
View file @
7a7741c9
...
...
@@ -29,11 +29,6 @@ use Magento\Payment\Gateway\CommandInterface;
class
PayByMailCommand
implements
CommandInterface
{
/**
* quest prefix
*/
const
GUEST_ID
=
'customer_'
;
/**
* @var \Adyen\Payment\Helper\Data
*/
...
...
@@ -190,10 +185,7 @@ class PayByMailCommand implements CommandInterface
$formFields
[
'shopperEmail'
]
=
$shopperEmail
;
// recurring
$recurringType
=
trim
(
$this
->
_adyenHelper
->
getAdyenAbstractConfigData
(
'recurring_type'
));
$formFields
[
'recurringContract'
]
=
$recurringType
;
$sessionValidity
=
$this
->
_adyenHelper
->
getAdyenPayByMailConfigData
(
'session_validity'
);
if
(
$sessionValidity
==
""
)
{
...
...
@@ -201,7 +193,11 @@ class PayByMailCommand implements CommandInterface
}
$formFields
[
'sessionValidity'
]
=
date
(
"c"
,
strtotime
(
"+"
.
$sessionValidity
.
" days"
));
$formFields
[
'shopperReference'
]
=
(
!
empty
(
$customerId
))
?
$customerId
:
self
::
GUEST_ID
.
$realOrderId
;
if
(
$customerId
>
0
)
{
$formFields
[
'recurringContract'
]
=
$recurringType
;
$formFields
[
'shopperReference'
]
=
$customerId
;
}
// Sort the array by key using SORT_STRING order
ksort
(
$formFields
,
SORT_STRING
);
...
...
Gateway/Request/CustomerDataBuilder.php
View file @
7a7741c9
...
...
@@ -29,10 +29,6 @@ use Magento\Payment\Gateway\Request\BuilderInterface;
*/
class
CustomerDataBuilder
implements
BuilderInterface
{
/**
* quest prefix
*/
const
GUEST_ID
=
'customer_'
;
/**
* Add shopper data into request
...
...
@@ -42,19 +38,22 @@ class CustomerDataBuilder implements BuilderInterface
*/
public
function
build
(
array
$buildSubject
)
{
$result
=
[];
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject
=
\Magento\Payment\Gateway\Helper\SubjectReader
::
readPayment
(
$buildSubject
);
$order
=
$paymentDataObject
->
getOrder
();
$billingAddress
=
$order
->
getBillingAddress
();
$customerEmail
=
$billingAddress
->
getEmail
();
$realOrderId
=
$order
->
getOrderIncrementId
();
$customerId
=
$order
->
getCustomerId
();
$shopperReference
=
(
!
empty
(
$customerId
))
?
$customerId
:
self
::
GUEST_ID
.
$realOrderId
;
return
[
"shopperEmail"
=>
$customerEmail
,
"shopperReference"
=>
$shopperReference
];
if
(
$customerId
>
0
)
{
$result
[
'shopperReference'
]
=
$customerId
;
}
$result
[
'shopperEmail'
]
=
$customerEmail
;
return
$result
;
}
}
Gateway/Request/RecurringDataBuilder.php
View file @
7a7741c9
...
...
@@ -63,6 +63,7 @@ class RecurringDataBuilder implements BuilderInterface
$payment
=
$paymentDataObject
->
getPayment
();
// Needs to change when oneclick,cc using facade impl.
$paymentMethodCode
=
$payment
->
getMethodInstance
()
->
getCode
();
$customerId
=
$payment
->
getOrder
()
->
getCustomerId
();
$storeId
=
null
;
if
(
$this
->
appState
->
getAreaCode
()
===
\Magento\Backend\App\Area\FrontNameResolver
::
AREA_CODE
)
{
...
...
@@ -95,7 +96,8 @@ class RecurringDataBuilder implements BuilderInterface
}
}
if
(
$recurringContractType
)
{
// only when recurringContractType is set and when a customer is loggedIn
if
(
$recurringContractType
&&
$customerId
>
0
)
{
$recurring
=
[
'contract'
=>
$recurringContractType
];
$result
[
'recurring'
]
=
$recurring
;
}
...
...
Model/Api/PaymentRequest.php
View file @
7a7741c9
...
...
@@ -58,8 +58,6 @@ class PaymentRequest extends DataObject
*/
protected
$_appState
;
const
GUEST_ID
=
'customer_'
;
/**
* PaymentRequest constructor.
*
...
...
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