Skip to content

Commit

Permalink
Add method for generating bank icon
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Sep 24, 2015
1 parent 7b08f4b commit b2f812d
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/Helper/DataApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

class DataApi
{
/**
* @var Tp\MerchantConfig
*/
protected $config;

function __construct(Tp\MerchantConfig $config)
Expand All @@ -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
Expand Down

0 comments on commit b2f812d

Please sign in to comment.