From b2f812d3b54d826ef010b4e102f348acc6d30fef Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Thu, 24 Sep 2015 15:32:37 +0200 Subject: [PATCH] Add method for generating bank icon --- src/Helper/DataApi.php | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/Helper/DataApi.php b/src/Helper/DataApi.php index 43aaf6c..0bb270a 100644 --- a/src/Helper/DataApi.php +++ b/src/Helper/DataApi.php @@ -15,6 +15,9 @@ class DataApi { + /** + * @var Tp\MerchantConfig + */ protected $config; function __construct(Tp\MerchantConfig $config) @@ -31,6 +34,55 @@ public function getPaymentMethods($onlyActive = TRUE) return Tp\Helper\DataApi::getPaymentMethods($this->config, $onlyActive); } + /** + * @param Tp\DataApi\MerchantAccountMethod $method + * @return null|string + */ + public function getPaymentMethodIcon(Tp\DataApi\MerchantAccountMethod $method) + { + switch ($method->getName()) { + case 'Platba kartou': + $file = 'muzo'; + break; + case 'Platba 24': + $file = 'platba24'; + break; + case 'MojePlatba': + $file = 'moje-platba'; + break; + case 'eKonto': + $file = 'ekonto'; + break; + case 'mPeníze': + $file = 'mpenize'; + break; + case 'Ge Money': + $file = 'gemoney'; + break; + case 'ČSOB': + $file = 'csob'; + break; + case 'Fio banka': + $file = 'fio'; + break; + case 'Jiná banka': + $file = 'transfer'; + break; + case 'SuperCash': + $file = 'super-cash'; + break; + case 'FerBuy': + $file = 'ferbuy'; + break; + + default: + + return NULL; + } + + return $this->config->gateUrl . 'radiobuttons/style/icons/' . $file . '.png'; + } + /** * @param string $paymentId * @return Tp\DataApi\GetPaymentResponse