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
8d705218
Commit
8d705218
authored
Aug 08, 2018
by
Maikel Koek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
B: Only delete Vault token remotely when payment method is Adyen
Fixes #297
parent
114a3aca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Plugin/PaymentVaultDeleteToken.php
Plugin/PaymentVaultDeleteToken.php
+5
-4
No files found.
Plugin/PaymentVaultDeleteToken.php
View file @
8d705218
...
@@ -27,7 +27,6 @@ use Magento\Vault\Api\Data\PaymentTokenInterface;
...
@@ -27,7 +27,6 @@ use Magento\Vault\Api\Data\PaymentTokenInterface;
class
PaymentVaultDeleteToken
class
PaymentVaultDeleteToken
{
{
/**
/**
* @var \Adyen\Payment\Model\Api\PaymentRequest
* @var \Adyen\Payment\Model\Api\PaymentRequest
*/
*/
...
@@ -52,6 +51,10 @@ class PaymentVaultDeleteToken
...
@@ -52,6 +51,10 @@ class PaymentVaultDeleteToken
public
function
beforeDelete
(
\Magento\Vault\Api\PaymentTokenRepositoryInterface
$subject
,
PaymentTokenInterface
$paymentToken
)
public
function
beforeDelete
(
\Magento\Vault\Api\PaymentTokenRepositoryInterface
$subject
,
PaymentTokenInterface
$paymentToken
)
{
{
if
(
strpos
(
$paymentToken
->
getPaymentMethodCode
(),
'adyen_'
)
!==
0
)
{
return
$paymentToken
;
}
try
{
try
{
$this
->
_paymentRequest
->
disableRecurringContract
(
$this
->
_paymentRequest
->
disableRecurringContract
(
$paymentToken
->
getGatewayToken
(),
$paymentToken
->
getGatewayToken
(),
...
@@ -61,7 +64,5 @@ class PaymentVaultDeleteToken
...
@@ -61,7 +64,5 @@ class PaymentVaultDeleteToken
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
'Failed to disable this contract'
));
throw
new
\Magento\Framework\Exception\LocalizedException
(
__
(
'Failed to disable this contract'
));
}
}
}
}
}
}
\ 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