diff --git a/app/Console/Commands/AccountingPaymentGet.php b/app/Console/Commands/AccountingPaymentGet.php index 690cb7f..88f2b21 100644 --- a/app/Console/Commands/AccountingPaymentGet.php +++ b/app/Console/Commands/AccountingPaymentGet.php @@ -7,6 +7,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\Config; use Intuit\Exceptions\ConnectionIssueException; +use App\Jobs\AccountingPaymentSync as Job; use App\Models\{ProviderOauth,Site,User}; class AccountingPaymentGet extends Command @@ -47,12 +48,16 @@ class AccountingPaymentGet extends Command try { $api = $to->API(); - dump($api->getPaymentQuery($this->argument('id'))); + $acc = $api->getPayment($this->argument('id')); + dump($acc); } catch (ConnectException|ConnectionIssueException $e) { $this->error($e->getMessage()); return Command::FAILURE; } + + if ($acc) + Job::dispatchSync($to,$acc); } } \ No newline at end of file diff --git a/app/Jobs/AccountingPaymentSync.php b/app/Jobs/AccountingPaymentSync.php index c235e8b..2700017 100644 --- a/app/Jobs/AccountingPaymentSync.php +++ b/app/Jobs/AccountingPaymentSync.php @@ -12,6 +12,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; use App\Models\{Account,Invoice,Payment,PaymentItem,ProviderToken}; +use Intuit\Models\Payment as PaymentModel; /** * Synchronise payments with our payments. @@ -26,7 +27,7 @@ class AccountingPaymentSync implements ShouldQueue private const LOGKEY = 'JPS'; - private \Intuit\Models\Payment $pmi; + private PaymentModel $pmi; private ProviderToken $to; /** @@ -34,7 +35,7 @@ class AccountingPaymentSync implements ShouldQueue * * @return void */ - public function __construct(ProviderToken $to,\Intuit\Models\Payment $pmi) + public function __construct(ProviderToken $to,PaymentModel $pmi) { $this->pmi = $pmi; $this->to = $to; diff --git a/composer.lock b/composer.lock index 7f7108d..fec2a3f 100644 --- a/composer.lock +++ b/composer.lock @@ -3681,11 +3681,11 @@ }, { "name": "leenooks/intuit", - "version": "0.1.4", + "version": "0.1.5", "source": { "type": "git", "url": "https://dev.dege.au/leenooks/intuit", - "reference": "2f75c7dd1fa6179e25f06ba2a617993858ccb7eb" + "reference": "dd8250900895daf911230db10177e40a98530f9f" }, "require": { "jenssegers/model": "^1.5" @@ -3715,7 +3715,7 @@ "laravel", "leenooks" ], - "time": "2023-05-13T11:17:36+00:00" + "time": "2023-05-13T11:58:49+00:00" }, { "name": "leenooks/laravel",