Exclude cancelled and fully refunded Etsy orders from dispatch lists
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 28s
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 28s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
8a281b5b61
commit
504a867351
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Services\Etsy;
|
||||
use App\Services\IntegrationCache;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EtsyReceiptFilterTest extends TestCase
|
||||
{
|
||||
public function test_cancelled_and_fully_refunded_orders_are_not_outstanding(): void
|
||||
{
|
||||
$etsy = new Etsy(new IntegrationCache);
|
||||
$total = ['amount' => 1500, 'divisor' => 100, 'currency_code' => 'GBP'];
|
||||
|
||||
$this->assertTrue($etsy->isCancelledOrRefunded(['status' => 'Canceled', 'grandtotal' => $total]));
|
||||
$this->assertTrue($etsy->isCancelledOrRefunded(['status' => 'Paid', 'grandtotal' => $total, 'refunds' => [['amount' => ['amount' => 1500, 'divisor' => 100]]]]));
|
||||
$this->assertTrue($etsy->isCancelledOrRefunded(['status' => 'Paid', 'grandtotal' => $total, 'refunds' => [['amount' => ['amount' => 1000, 'divisor' => 100]], ['amount' => ['amount' => 500, 'divisor' => 100]]]]));
|
||||
$this->assertFalse($etsy->isCancelledOrRefunded(['status' => 'Paid', 'grandtotal' => $total, 'refunds' => [['amount' => ['amount' => 500, 'divisor' => 100]]]]));
|
||||
$this->assertFalse($etsy->isCancelledOrRefunded(['status' => 'Paid', 'grandtotal' => $total]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user