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
264b2264
Commit
264b2264
authored
Nov 07, 2018
by
Aleffio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formatting
parent
bdb6d949
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
17 deletions
+9
-17
Gateway/Http/Client/TransactionPosCloudSync.php
Gateway/Http/Client/TransactionPosCloudSync.php
+1
-2
Gateway/Response/PaymentPosCloudHandler.php
Gateway/Response/PaymentPosCloudHandler.php
+3
-2
Gateway/Validator/PosCloudResponseValidator.php
Gateway/Validator/PosCloudResponseValidator.php
+3
-1
Model/AdyenInitiateTerminalApi.php
Model/AdyenInitiateTerminalApi.php
+2
-12
No files found.
Gateway/Http/Client/TransactionPosCloudSync.php
View file @
264b2264
...
...
@@ -67,8 +67,7 @@ class TransactionPosCloudSync implements ClientInterface
*
* @param \Magento\Payment\Gateway\Http\TransferInterface $transferObject
* @return array
* @throws \Magento\Payment\Gateway\Http\ClientException
* @throws \Magento\Payment\Gateway\Http\ConverterException
* @throws \Magento\Framework\Exception\LocalizedException
*/
public
function
placeRequest
(
\Magento\Payment\Gateway\Http\TransferInterface
$transferObject
)
{
...
...
Gateway/Response/PaymentPosCloudHandler.php
View file @
264b2264
...
...
@@ -58,8 +58,9 @@ class PaymentPosCloudHandler implements HandlerInterface
* Handles response
*
* @param array $handlingSubject
* @param array $
r
esponse
* @param array $
paymentR
esponse
* @return void
* @throws Exception
*/
public
function
handle
(
array
$handlingSubject
,
array
$paymentResponse
)
{
...
...
@@ -71,7 +72,7 @@ class PaymentPosCloudHandler implements HandlerInterface
// set transaction not to processing by default wait for notification
$payment
->
setIsTransactionPending
(
true
);
//
n
o not send order confirmation mail
//
d
o not send order confirmation mail
$payment
->
getOrder
()
->
setCanSendNewEmailFlag
(
false
);
// set transaction(status)
...
...
Gateway/Validator/PosCloudResponseValidator.php
View file @
264b2264
...
...
@@ -72,13 +72,15 @@ class PosCloudResponseValidator extends AbstractValidator
// Check for errors
if
(
!
empty
(
$response
[
'error'
]))
{
if
(
!
empty
(
$response
[
'code'
])
&&
$response
[
'code'
]
==
CURLE_OPERATION_TIMEOUTED
)
{
//
Do the
status call(try to place an order)
//
If the initiate call resulted in a timeout, do a
status call(try to place an order)
return
$this
->
createResult
(
$isValid
,
$errorMessages
);
}
else
{
// There is an error which is not a timeout, stop the transaction and show the error
$this
->
adyenLogger
->
error
(
json_encode
(
$response
));
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
$response
[
'error'
]));
}
}
else
{
// We have a paymentResponse from the terminal
$paymentResponse
=
$response
;
}
...
...
Model/AdyenInitiateTerminalApi.php
View file @
264b2264
...
...
@@ -42,31 +42,22 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
/**
* AdyenInitiateTerminalApi constructor.
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType
* @param \Magento\Checkout\Model\Session $_checkoutSession
* @param \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerCollectionFactory
* @param array $data
*/
public
function
__construct
(
\Magento\Framework\Model\Context
$context
,
\Magento\Framework\Encryption\EncryptorInterface
$encryptor
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Adyen\Payment\Model\RecurringType
$recurringType
,
\Magento\Checkout\Model\Session
$_checkoutSession
,
\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory
$customerCollectionFactory
,
array
$data
=
[]
)
{
$this
->
_encryptor
=
$encryptor
;
$this
->
_adyenHelper
=
$adyenHelper
;
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
_recurringType
=
$recurringType
;
$this
->
_appState
=
$context
->
getAppState
();
$this
->
_checkoutSession
=
$_checkoutSession
;
$this
->
_customerCollectionFactory
=
$customerCollectionFactory
;
...
...
@@ -95,9 +86,8 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
/**
* Trigger sync call on terminal
*
* @return mixed
* @throws \
Magento\Framework\Exception\Localized
Exception
* @throws \Exception
*/
public
function
initiate
()
{
...
...
@@ -207,4 +197,4 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
$quote
->
save
();
return
$response
;
}
}
\ No newline at end of file
}
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