diff --git a/app/code/Magento/Payment/Model/CcConfigProvider.php b/app/code/Magento/Payment/Model/CcConfigProvider.php
index 15bdd0072a51a..497ce93c30c71 100644
--- a/app/code/Magento/Payment/Model/CcConfigProvider.php
+++ b/app/code/Magento/Payment/Model/CcConfigProvider.php
@@ -44,7 +44,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getConfig()
{
@@ -69,7 +69,7 @@ public function getIcons()
}
$types = $this->ccConfig->getCcAvailableTypes();
- foreach (array_keys($types) as $code) {
+ foreach ($types as $code => $label) {
if (!array_key_exists($code, $this->icons)) {
$asset = $this->ccConfig->createAsset('Magento_Payment::images/cc/' . strtolower($code) . '.png');
$placeholder = $this->assetSource->findSource($asset);
@@ -78,7 +78,8 @@ public function getIcons()
$this->icons[$code] = [
'url' => $asset->getUrl(),
'width' => $width,
- 'height' => $height
+ 'height' => $height,
+ 'title' => __($label),
];
}
}
diff --git a/app/code/Magento/Payment/Test/Unit/Model/CcConfigProviderTest.php b/app/code/Magento/Payment/Test/Unit/Model/CcConfigProviderTest.php
index a8856166995fc..ff6aea44645cf 100644
--- a/app/code/Magento/Payment/Test/Unit/Model/CcConfigProviderTest.php
+++ b/app/code/Magento/Payment/Test/Unit/Model/CcConfigProviderTest.php
@@ -42,12 +42,14 @@ public function testGetConfig()
'vi' => [
'url' => 'http://cc.card/vi.png',
'width' => getimagesize($imagesDirectoryPath . 'vi.png')[0],
- 'height' => getimagesize($imagesDirectoryPath . 'vi.png')[1]
+ 'height' => getimagesize($imagesDirectoryPath . 'vi.png')[1],
+ 'title' => __('Visa'),
],
'ae' => [
'url' => 'http://cc.card/ae.png',
'width' => getimagesize($imagesDirectoryPath . 'ae.png')[0],
- 'height' => getimagesize($imagesDirectoryPath . 'ae.png')[1]
+ 'height' => getimagesize($imagesDirectoryPath . 'ae.png')[1],
+ 'title' => __('American Express'),
]
]
]
@@ -56,11 +58,13 @@ public function testGetConfig()
$ccAvailableTypesMock = [
'vi' => [
+ 'title' => 'Visa',
'fileId' => 'Magento_Payment::images/cc/vi.png',
'path' => $imagesDirectoryPath . 'vi.png',
'url' => 'http://cc.card/vi.png'
],
'ae' => [
+ 'title' => 'American Express',
'fileId' => 'Magento_Payment::images/cc/ae.png',
'path' => $imagesDirectoryPath . 'ae.png',
'url' => 'http://cc.card/ae.png'
@@ -68,7 +72,11 @@ public function testGetConfig()
];
$assetMock = $this->createMock(\Magento\Framework\View\Asset\File::class);
- $this->ccConfigMock->expects($this->once())->method('getCcAvailableTypes')->willReturn($ccAvailableTypesMock);
+ $this->ccConfigMock->expects($this->once())->method('getCcAvailableTypes')
+ ->willReturn(array_combine(
+ array_keys($ccAvailableTypesMock),
+ array_column($ccAvailableTypesMock, 'title')
+ ));
$this->ccConfigMock->expects($this->atLeastOnce())
->method('createAsset')
diff --git a/app/code/Magento/Vault/view/frontend/web/template/payment/form.html b/app/code/Magento/Vault/view/frontend/web/template/payment/form.html
index b5593626fb15c..5f32281686a65 100644
--- a/app/code/Magento/Vault/view/frontend/web/template/payment/form.html
+++ b/app/code/Magento/Vault/view/frontend/web/template/payment/form.html
@@ -19,7 +19,8 @@