1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 15:42:51 +01:00
invoiceninja/app/models/Gateway.php

39 lines
706 B
PHP
Raw Normal View History

2013-11-26 13:45:07 +01:00
<?php
class Gateway extends Eloquent
{
2014-01-08 21:09:47 +01:00
public $timestamps = false;
protected $softDelete = false;
public function paymentlibrary()
{
return $this->belongsTo('PaymentLibrary', 'payment_library_id');
}
public function getLogoUrl()
{
return '/images/gateways/logo_'.$this->provider.'.png';
}
public function getFields()
{
$paymentLibrary = $this->paymentlibrary;
2014-07-17 22:44:34 +02:00
if ($paymentLibrary->id == PAYMENT_LIBRARY_OMNIPAY)
{
$fields = Omnipay::create($this->provider)->getDefaultParameters();
}
else
{
2014-04-13 07:28:16 +02:00
$fields = Payment_Utility::load('config', 'drivers/'.strtolower($this->provider));
}
2014-07-17 22:44:34 +02:00
if ($fields == null)
{
$fields = array();
}
return $fields;
}
2014-07-17 22:44:34 +02:00
2013-11-26 13:45:07 +01:00
}