Skip to content

Commit

Permalink
Merge pull request #57 from shopware5/ntr/add-try-catch-to-transactio…
Browse files Browse the repository at this point in the history
…n-report

NTR - Add try catch to transaction report
  • Loading branch information
mitelg authored Jul 11, 2024
2 parents 0ad2eb5 + addeff3 commit 3fae02a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Components/TransactionReport/TransactionReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use DateTime;
use Doctrine\DBAL\Connection;
use Exception;
use GuzzleHttp\Client;
use PDO;
use Shopware\Models\Order\Status;
Expand Down Expand Up @@ -66,9 +67,12 @@ public function report($shopwareVersion, $instanceId, Client $client)
'reportDataKeys' => ['turnover' => $reportResult->getTurnover($currency)],
];

$client->post(self::POST_URL_ENDPOINT, ['json' => $requestBody]);

$this->deleteReportedOrders($reportResult->getOrderIds($currency));
try {
$client->post(self::POST_URL_ENDPOINT, ['json' => $requestBody]);
$this->deleteReportedOrders($reportResult->getOrderIds($currency));
} catch (Exception $e) {
// nothing to do
}
}
}

Expand Down

0 comments on commit 3fae02a

Please sign in to comment.