Align refund status transitions with tolerance config

This commit is contained in:
萝卜
2026-03-13 16:38:16 +00:00
parent 388fa333b5
commit 8f91add742
2 changed files with 26 additions and 10 deletions

View File

@@ -68,11 +68,11 @@ class AdminPlatformOrderRefundReceiptAccumulateToFullyRefundedTest extends TestC
$order->refresh();
$this->assertSame('partially_refunded', $order->payment_status);
// 第二次退款 20 -> 累计 30应推进到 refunded
// 第二次退款 20.01 -> 累计 30.01(超过 tol=0.01,应推进到 refunded
$this->post('/admin/platform-orders/' . $order->id . '/add-refund-receipt', [
'type' => 'refund',
'channel' => 'wechat',
'amount' => 20,
'amount' => 20.01,
'refunded_at' => now()->addMinute()->format('Y-m-d H:i:s'),
'note' => '第二次退款',
])->assertRedirect();
@@ -83,6 +83,6 @@ class AdminPlatformOrderRefundReceiptAccumulateToFullyRefundedTest extends TestC
$this->assertNotNull($order->refunded_at);
$refundSummaryTotal = (float) data_get($order->meta, 'refund_summary.total_amount');
$this->assertSame(30.0, $refundSummaryTotal);
$this->assertSame(30.01, $refundSummaryTotal);
}
}