Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PW-7179] - Adjust vault tokenization functionality (#1709)
* PW-7179 - Re-add parent AdyenUiComponentProvider * PW-7179 - Check if property exists before checking type * PW-7179 - Fix issue created in merge commit and update PaymentVaultDeleteToken * PW-7179 - Do not show ApplePay and AmazonPay for now. Also add to do annotations for them * [PW-7157]Add India live prefix for frontend (#1708) * Add India live prefix for frontend * revert adyen-methods.js Co-authored-by: Jeantwan Teuma <Morerice@users.noreply.github.com> * PW-7179 - Move tooltip to comment * PW-7129: Remove full request/response logging (#1712) * PW-7129: Remove full request/response logging Add new log processors to help with troubleshooting. * PW-7129: Use context placeholders * Adding number format to getAmountIncludingTax in test (#1715) * Adding number format to getAmountIncludingTax in test * Apply number format on getTaxAmount Co-authored-by: Alexandros Moraitis <alexandros.moraitis@adyen.com> Co-authored-by: Michael Paul <michael.paul@adyen.com> Co-authored-by: Ángel Campos <angel.campos@adyen.com>
- Loading branch information
1 parent
1794741
commit 9ec4f80
Showing
16 changed files
with
118 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment module (https://www.adyen.com/) | ||
* | ||
* Copyright (c) 2022 Adyen BV (https://www.adyen.com/) | ||
* See LICENSE.txt for license details. | ||
* | ||
* Author: Adyen <magento@adyen.com> | ||
*/ | ||
|
||
namespace Adyen\Payment\Model\Ui; | ||
|
||
use Adyen\Payment\Helper\Data; | ||
use Magento\Vault\Api\Data\PaymentTokenInterface; | ||
use Magento\Vault\Model\Ui\TokenUiComponentInterface; | ||
use Magento\Vault\Model\Ui\TokenUiComponentProviderInterface; | ||
use Magento\Vault\Model\Ui\TokenUiComponentInterfaceFactory; | ||
|
||
class AdyenUiComponentProvider | ||
{ | ||
|
||
protected $componentFactory; | ||
protected $dataHelper; | ||
|
||
/** | ||
* @param TokenUiComponentInterfaceFactory $componentFactory | ||
* @param Data $dataHelper | ||
*/ | ||
public function __construct( | ||
TokenUiComponentInterfaceFactory $componentFactory, | ||
Data $dataHelper | ||
) { | ||
$this->componentFactory = $componentFactory; | ||
$this->dataHelper = $dataHelper; | ||
} | ||
|
||
/** | ||
* Get UI component for token | ||
* | ||
* @param PaymentTokenInterface $paymentToken | ||
* @return TokenUiComponentInterface | ||
*/ | ||
public function getCardComponentForToken(PaymentTokenInterface $paymentToken): TokenUiComponentInterface | ||
{ | ||
$details = json_decode($paymentToken->getTokenDetails() ?: '{}', true); | ||
$details['icon'] = $this->dataHelper->getVariantIcon($details['type']); | ||
|
||
return $this->componentFactory->create( | ||
[ | ||
'config' => [ | ||
'code' => AdyenCcConfigProvider::CC_VAULT_CODE, | ||
TokenUiComponentProviderInterface::COMPONENT_DETAILS => $details, | ||
TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash() | ||
], | ||
'name' => 'Adyen_Payment/js/view/payment/method-renderer/vault' | ||
] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.