平台订单详情:BMPA禁用提示增加就地引导链接(补回执/核对退款)
This commit is contained in:
@@ -185,9 +185,17 @@
|
||||
</form>
|
||||
|
||||
@if($markPaidBlockedByRefund)
|
||||
<div class="muted text-danger" style="margin-top:6px; width:100%;">提示:当前订单已存在退款记录/退款汇总,建议先核对退款轨迹与状态后再进行「标记支付并生效」。</div>
|
||||
<div class="muted text-danger" style="margin-top:6px; width:100%;">
|
||||
提示:当前订单已存在退款记录/退款汇总,建议先核对退款轨迹与状态后再进行「标记支付并生效」。
|
||||
<span class="muted">|</span>
|
||||
<a class="link" href="#refund-receipts">去核对退款</a>
|
||||
</div>
|
||||
@elseif($markPaidBlockedByReceiptMismatch)
|
||||
<div class="muted text-danger" style="margin-top:6px; width:100%;">提示:当前订单已存在支付回执,但回执总额与订单金额不一致,建议先补齐/修正回执后再进行「标记支付并生效」。</div>
|
||||
<div class="muted text-danger" style="margin-top:6px; width:100%;">
|
||||
提示:当前订单已存在支付回执,但回执总额与订单金额不一致,建议先补齐/修正回执后再进行「标记支付并生效」。
|
||||
<span class="muted">|</span>
|
||||
<a class="link" href="#add-payment-receipt">去补回执</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="post" action="/admin/platform-orders/{{ $order->id }}/activate-subscription" onsubmit="return confirm('确认同步订阅?将根据该订单创建/续期订阅');">
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\Merchant;
|
||||
use App\Models\Plan;
|
||||
use App\Models\PlatformOrder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderShowMarkPaidAndActivateGuidanceLinksTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function loginAsPlatformAdmin(): void
|
||||
{
|
||||
$this->seed();
|
||||
|
||||
$this->post('/admin/login', [
|
||||
'email' => 'platform.admin@demo.local',
|
||||
'password' => 'Platform@123456',
|
||||
])->assertRedirect('/admin');
|
||||
}
|
||||
|
||||
public function test_when_bmpa_blocked_by_refund_should_show_refund_guidance_link(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$merchant = Merchant::query()->firstOrFail();
|
||||
$plan = Plan::query()->create([
|
||||
'code' => 'po_show_bmpa_guidance_refund_plan',
|
||||
'name' => 'BMPA引导-退款场景测试套餐',
|
||||
'billing_cycle' => 'monthly',
|
||||
'price' => 10,
|
||||
'list_price' => 10,
|
||||
'status' => 'active',
|
||||
'sort' => 10,
|
||||
'published_at' => now(),
|
||||
]);
|
||||
|
||||
$order = PlatformOrder::query()->create([
|
||||
'merchant_id' => $merchant->id,
|
||||
'plan_id' => $plan->id,
|
||||
'order_no' => 'PO_SHOW_BMPA_GUIDANCE_REFUND_0001',
|
||||
'order_type' => 'new_purchase',
|
||||
'status' => 'pending',
|
||||
'payment_status' => 'unpaid',
|
||||
'plan_name' => $plan->name,
|
||||
'billing_cycle' => $plan->billing_cycle,
|
||||
'period_months' => 1,
|
||||
'quantity' => 1,
|
||||
'payable_amount' => 10,
|
||||
'paid_amount' => 0,
|
||||
'placed_at' => now(),
|
||||
'meta' => [
|
||||
'refund_receipts' => [
|
||||
[
|
||||
'type' => 'refund',
|
||||
'channel' => 'offline',
|
||||
'amount' => 1,
|
||||
'refunded_at' => now()->toDateTimeString(),
|
||||
'note' => 'test-refund',
|
||||
'created_at' => now()->toDateTimeString(),
|
||||
'admin_id' => 1,
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$res = $this->get('/admin/platform-orders/' . $order->id);
|
||||
$res->assertOk();
|
||||
|
||||
$res->assertSee('去核对退款', false);
|
||||
$res->assertSee('href="#refund-receipts"', false);
|
||||
}
|
||||
|
||||
public function test_when_bmpa_blocked_by_receipt_mismatch_should_show_receipt_guidance_link(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$merchant = Merchant::query()->firstOrFail();
|
||||
$plan = Plan::query()->create([
|
||||
'code' => 'po_show_bmpa_guidance_receipt_plan',
|
||||
'name' => 'BMPA引导-回执差额场景测试套餐',
|
||||
'billing_cycle' => 'monthly',
|
||||
'price' => 10,
|
||||
'list_price' => 10,
|
||||
'status' => 'active',
|
||||
'sort' => 10,
|
||||
'published_at' => now(),
|
||||
]);
|
||||
|
||||
$order = PlatformOrder::query()->create([
|
||||
'merchant_id' => $merchant->id,
|
||||
'plan_id' => $plan->id,
|
||||
'order_no' => 'PO_SHOW_BMPA_GUIDANCE_RCPT_0001',
|
||||
'order_type' => 'new_purchase',
|
||||
'status' => 'pending',
|
||||
'payment_status' => 'unpaid',
|
||||
'plan_name' => $plan->name,
|
||||
'billing_cycle' => $plan->billing_cycle,
|
||||
'period_months' => 1,
|
||||
'quantity' => 1,
|
||||
'payable_amount' => 10,
|
||||
'paid_amount' => 0,
|
||||
'placed_at' => now(),
|
||||
'meta' => [
|
||||
'payment_receipts' => [
|
||||
[
|
||||
'type' => 'bank_transfer',
|
||||
'channel' => 'offline',
|
||||
'amount' => 9,
|
||||
'paid_at' => now()->toDateTimeString(),
|
||||
'note' => 'test-pay',
|
||||
'created_at' => now()->toDateTimeString(),
|
||||
'admin_id' => 1,
|
||||
],
|
||||
],
|
||||
'payment_summary' => [
|
||||
'count' => 1,
|
||||
'total_amount' => 9,
|
||||
'last_at' => now()->toDateTimeString(),
|
||||
'last_amount' => 9,
|
||||
'last_channel' => 'offline',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$res = $this->get('/admin/platform-orders/' . $order->id);
|
||||
$res->assertOk();
|
||||
|
||||
$res->assertSee('去补回执', false);
|
||||
$res->assertSee('href="#add-payment-receipt"', false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user