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
b3a741d5
Commit
b3a741d5
authored
Sep 22, 2015
by
rikterbeek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use payment_action from config and added exception if CSE key is not generated on checkout
parent
9b182736
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
22 deletions
+11
-22
app/code/Adyen/Payment/Model/Method/Cc.php
app/code/Adyen/Payment/Model/Method/Cc.php
+10
-21
app/code/Adyen/Payment/etc/config.xml
app/code/Adyen/Payment/etc/config.xml
+1
-1
No files found.
app/code/Adyen/Payment/Model/Method/Cc.php
View file @
b3a741d5
...
...
@@ -68,6 +68,8 @@ class Cc extends \Magento\Payment\Model\Method\Cc
protected
$_urlBuilder
;
protected
$_adyenHelper
;
/**
* @param \Magento\Framework\Model\Context $context
...
...
@@ -88,6 +90,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
\Adyen\Payment\Logger\AdyenLogger
$adyenLogger
,
\Magento\Checkout\Model\Session
$checkoutSession
,
\Magento\Framework\UrlInterface
$urlBuilder
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
\Magento\Framework\Model\Context
$context
,
\Magento\Framework\Registry
$registry
,
\Magento\Framework\Api\ExtensionAttributesFactory
$extensionFactory
,
...
...
@@ -119,6 +122,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
$this
->
_adyenLogger
=
$adyenLogger
;
$this
->
_checkoutSession
=
$checkoutSession
;
$this
->
_urlBuilder
=
$urlBuilder
;
$this
->
_adyenHelper
=
$adyenHelper
;
}
protected
$_paymentMethodType
=
'api'
;
...
...
@@ -137,13 +141,13 @@ class Cc extends \Magento\Payment\Model\Method\Cc
parent
::
assignData
(
$data
);
$infoInstance
=
$this
->
getInfoInstance
();
$this
->
_adyenLogger
if
(
isset
(
$data
[
'encrypted_data'
]))
{
$infoInstance
->
setAdditionalInformation
(
'encrypted_data'
,
$data
[
'encrypted_data'
]);
if
(
$this
->
_adyenHelper
->
getAdyenAbstractConfigDataFlag
(
'cse_enabled'
))
{
if
(
isset
(
$data
[
'encrypted_data'
]))
{
$infoInstance
->
setAdditionalInformation
(
'encrypted_data'
,
$data
[
'encrypted_data'
]);
}
else
{
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
'Card encryption failed'
));
}
}
$this
->
_adyenLogger
->
info
(
"CSE key is set"
);
return
$this
;
}
...
...
@@ -162,20 +166,6 @@ class Cc extends \Magento\Payment\Model\Method\Cc
return
$this
;
}
/**
* Get config payment action url
* Used to universalize payment actions when processing payment place
*
* @return string
* @api
*/
public
function
getConfigPaymentAction
()
{
// return $this->getConfigData('payment_action');
return
\Magento\Payment\Model\Method\AbstractMethod
::
ACTION_AUTHORIZE
;
}
protected
function
_processRequest
(
\Magento\Framework\Object
$payment
,
$amount
,
$request
)
{
switch
(
$request
)
{
...
...
@@ -189,7 +179,6 @@ class Cc extends \Magento\Payment\Model\Method\Cc
}
else
{
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
'Empty result.'
));
}
}
protected
function
_processResponse
(
\Magento\Payment\Model\InfoInterface
$payment
,
$response
)
...
...
app/code/Adyen/Payment/etc/config.xml
View file @
b3a741d5
...
...
@@ -57,7 +57,7 @@
<sort_order>
10
</sort_order>
<place_order_url>
adyen/process/redirect
</place_order_url>
<order_place_redirect_url>
adyen/process/redirect
</order_place_redirect_url>
<payment_action>
Authorization
</payment_action>
<payment_action>
authorize
</payment_action>
<group>
adyen
</group>
</adyen_hpp>
</payment>
...
...
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