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;
|
2014-03-21 13:15:53 +01:00
|
|
|
|
|
|
|
public function paymentlibrary()
|
|
|
|
{
|
2014-03-26 01:59:33 +01:00
|
|
|
return $this->belongsTo('PaymentLibrary', 'payment_library_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLogoUrl()
|
|
|
|
{
|
|
|
|
return '/images/gateways/logo_'.$this->provider.'.png';
|
2014-03-21 13:15:53 +01:00
|
|
|
}
|
2014-03-30 00:42:37 +01:00
|
|
|
|
|
|
|
public function getFields()
|
|
|
|
{
|
|
|
|
$paymentLibrary = $this->paymentlibrary;
|
|
|
|
|
|
|
|
if($paymentLibrary->name == 'Omnipay')
|
|
|
|
{
|
|
|
|
$fields = Omnipay::create($this->provider)->getDefaultParameters();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$fields = Payment_Utility::load('config', 'drivers/'.$this->provider);
|
|
|
|
}
|
|
|
|
|
|
|
|
if($fields == null)
|
|
|
|
{
|
|
|
|
$fields = array();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $fields;
|
|
|
|
}
|
2013-11-26 13:45:07 +01:00
|
|
|
}
|