Add event to process webhook payments
This commit is contained in:
@@ -9,9 +9,10 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Models\{Account,Invoice,Payment,PaymentItem,ProviderToken};
|
||||
use App\Models\{Account,Invoice,Payment,PaymentItem,ProviderToken,Site};
|
||||
use Intuit\Models\Payment as PaymentModel;
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,10 @@ class AccountingPaymentSync implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
// @todo Can this be automatically determined?
|
||||
$site = Site::findOrFail($this->to->site_id);
|
||||
Config::set('site',$site);
|
||||
|
||||
// See if we are already linked
|
||||
if (($x=$this->to->provider->payments->where('pivot.ref',$this->pmi->id))->count() === 1) {
|
||||
$o = $x->pop();
|
||||
|
Reference in New Issue
Block a user