mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
34 lines
771 B
PHP
34 lines
771 B
PHP
<?php namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class AccountGateway extends EntityModel
|
|
{
|
|
use SoftDeletes;
|
|
protected $dates = ['deleted_at'];
|
|
|
|
public function gateway()
|
|
{
|
|
return $this->belongsTo('App\Models\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;
|
|
}
|
|
}
|
|
|