Added intuit payments

This commit is contained in:
2023-05-13 21:20:56 +10:00
parent a518158ccf
commit 8ad9e73abb
12 changed files with 347 additions and 22 deletions

View File

@@ -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 */
/**

View File

@@ -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')