1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00
invoiceninja/app/Models/AccountGateway.php

29 lines
630 B
PHP
Raw Normal View History

2015-03-16 22:45:25 +01:00
<?php
class AccountGateway extends EntityModel
{
public function gateway()
{
return $this->belongsTo('Gateway');
}
public function getCreditcardTypes()
{
$flags = unserialize(CREDIT_CARDS);
$arrayOfImages = [];
foreach ($flags as $card => $name) {
if (($this->accepted_credit_cards & $card) == $card) {
$arrayOfImages[] = ['source' => asset($name['card']), 'alt' => $name['text']];
}
}
return $arrayOfImages;
}
public function isPayPal() {
return $this->gateway_id == GATEWAY_PAYPAL_EXPRESS;
}
}