Added intuit payments
This commit is contained in:
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\DB;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
|
||||
use App\Interfaces\IDs;
|
||||
use App\Traits\ProviderRef;
|
||||
use App\Traits\PushNew;
|
||||
|
||||
/**
|
||||
@@ -24,7 +25,7 @@ use App\Traits\PushNew;
|
||||
*/
|
||||
class Payment extends Model implements IDs
|
||||
{
|
||||
use PushNew,ScopeActive;
|
||||
use PushNew,ScopeActive,ProviderRef;
|
||||
|
||||
protected $dates = [
|
||||
'paid_at',
|
||||
@@ -75,6 +76,13 @@ class Payment extends Model implements IDs
|
||||
return $this->hasMany(PaymentItem::class);
|
||||
}
|
||||
|
||||
public function providers()
|
||||
{
|
||||
return $this->belongsToMany(ProviderOauth::class,'payment__provider')
|
||||
->where('payment__provider.site_id',$this->site_id)
|
||||
->withPivot('ref','synctoken','created_at','updated_at');
|
||||
}
|
||||
|
||||
/* SCOPES */
|
||||
|
||||
/**
|
||||
|
@@ -31,6 +31,13 @@ class ProviderOauth extends Model
|
||||
->withPivot('ref','synctoken','created_at','updated_at');
|
||||
}
|
||||
|
||||
public function payments()
|
||||
{
|
||||
return $this->belongsToMany(Payment::class,'payment__provider')
|
||||
->where('payment__provider.site_id',$this->site_id)
|
||||
->withPivot('ref','synctoken','created_at','updated_at');
|
||||
}
|
||||
|
||||
public function taxes()
|
||||
{
|
||||
return $this->belongsToMany(Tax::class,'tax__provider')
|
||||
|
Reference in New Issue
Block a user