Skip to content

Commit b2f812d

Browse files
committed
Add method for generating bank icon
1 parent 7b08f4b commit b2f812d

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/Helper/DataApi.php

+52
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
class DataApi
1717
{
18+
/**
19+
* @var Tp\MerchantConfig
20+
*/
1821
protected $config;
1922

2023
function __construct(Tp\MerchantConfig $config)
@@ -31,6 +34,55 @@ public function getPaymentMethods($onlyActive = TRUE)
3134
return Tp\Helper\DataApi::getPaymentMethods($this->config, $onlyActive);
3235
}
3336

37+
/**
38+
* @param Tp\DataApi\MerchantAccountMethod $method
39+
* @return null|string
40+
*/
41+
public function getPaymentMethodIcon(Tp\DataApi\MerchantAccountMethod $method)
42+
{
43+
switch ($method->getName()) {
44+
case 'Platba kartou':
45+
$file = 'muzo';
46+
break;
47+
case 'Platba 24':
48+
$file = 'platba24';
49+
break;
50+
case 'MojePlatba':
51+
$file = 'moje-platba';
52+
break;
53+
case 'eKonto':
54+
$file = 'ekonto';
55+
break;
56+
case 'mPeníze':
57+
$file = 'mpenize';
58+
break;
59+
case 'Ge Money':
60+
$file = 'gemoney';
61+
break;
62+
case 'ČSOB':
63+
$file = 'csob';
64+
break;
65+
case 'Fio banka':
66+
$file = 'fio';
67+
break;
68+
case 'Jiná banka':
69+
$file = 'transfer';
70+
break;
71+
case 'SuperCash':
72+
$file = 'super-cash';
73+
break;
74+
case 'FerBuy':
75+
$file = 'ferbuy';
76+
break;
77+
78+
default:
79+
80+
return NULL;
81+
}
82+
83+
return $this->config->gateUrl . 'radiobuttons/style/icons/' . $file . '.png';
84+
}
85+
3486
/**
3587
* @param string $paymentId
3688
* @return Tp\DataApi\GetPaymentResponse

0 commit comments

Comments
 (0)