2013-11-26 14:45:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class Gateway extends Eloquent
|
|
|
|
|
{
|
2014-01-08 20:09:47 +00:00
|
|
|
public $timestamps = false;
|
|
|
|
|
protected $softDelete = false;
|
2014-03-21 08:15:53 -04:00
|
|
|
|
|
|
|
|
public function paymentlibrary()
|
|
|
|
|
{
|
2014-03-25 20:59:33 -04:00
|
|
|
return $this->belongsTo('PaymentLibrary', 'payment_library_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getLogoUrl()
|
|
|
|
|
{
|
|
|
|
|
return '/images/gateways/logo_'.$this->provider.'.png';
|
2014-03-21 08:15:53 -04:00
|
|
|
}
|
2014-03-29 19:42:37 -04:00
|
|
|
|
|
|
|
|
public function getFields()
|
|
|
|
|
{
|
|
|
|
|
$paymentLibrary = $this->paymentlibrary;
|
|
|
|
|
|
2014-04-06 14:24:56 -04:00
|
|
|
if($paymentLibrary->id == PAYMENT_LIBRARY_OMNIPAY)
|
2014-03-29 19:42:37 -04:00
|
|
|
{
|
|
|
|
|
$fields = Omnipay::create($this->provider)->getDefaultParameters();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-04-13 08:28:16 +03:00
|
|
|
$fields = Payment_Utility::load('config', 'drivers/'.strtolower($this->provider));
|
2014-03-29 19:42:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($fields == null)
|
|
|
|
|
{
|
|
|
|
|
$fields = array();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $fields;
|
|
|
|
|
}
|
2013-11-26 14:45:07 +02:00
|
|
|
}
|