fix: 快递共用合同证明和收款账户证明按账号核验 (#1487)
This commit is contained in:
parent
f8efd97115
commit
56de349bfc
@ -87,11 +87,6 @@ class CourierAgreementSignatures extends Controller
|
||||
}
|
||||
if ($type === 'shared-contract') {
|
||||
$data['contract_partner_name'] = trim((string) $data['contract_partner_name']);
|
||||
if ($data['counterparty_signer_type'] === 'person') {
|
||||
$data['operator_name'] = $data['contract_partner_name'];
|
||||
} elseif (blank($data['operator_name'] ?? null)) {
|
||||
throw ValidationException::withMessages(['operator_name' => '请填写物流商归属企业经办人的 E 签宝实名认证姓名。']);
|
||||
}
|
||||
$sharedCouriers = collect($data['shared_courier_names'] ?? [])
|
||||
->map(static fn ($name): string => trim((string) $name))
|
||||
->filter()
|
||||
@ -113,7 +108,10 @@ class CourierAgreementSignatures extends Controller
|
||||
$data['counterparty_signer_type'] = $data['counterparty_signer_type'] ?? 'organization';
|
||||
$data['operator_name'] = trim((string) ($data['operator_name'] ?? '')) ?: null;
|
||||
|
||||
if ($type !== 'quote-confirmation' && $data['counterparty_signer_type'] === 'organization' && blank($data['operator_name'])) {
|
||||
$usesCourierAccountLookup = $type === 'account-proof' && $data['partner_type'] === 'courier';
|
||||
|
||||
if ($type !== 'quote-confirmation' && ! $usesCourierAccountLookup
|
||||
&& $data['counterparty_signer_type'] === 'organization' && blank($data['operator_name'])) {
|
||||
throw ValidationException::withMessages(['operator_name' => '企业签署主体必须填写 E 签宝实名认证姓名。']);
|
||||
}
|
||||
|
||||
@ -122,7 +120,7 @@ class CourierAgreementSignatures extends Controller
|
||||
throw ValidationException::withMessages(['operator_name' => '请填写签署账号绑定的个人实名姓名,不能填写快递名称或企业名称。']);
|
||||
}
|
||||
|
||||
if ($data['counterparty_signer_type'] === 'person') {
|
||||
if ($data['counterparty_signer_type'] === 'person' && ! $usesCourierAccountLookup) {
|
||||
// A personal signer uses the same real name for the signer and
|
||||
// the E-sign identity; the UI should not require it twice.
|
||||
$data['operator_name'] = trim((string) $data['counterparty_organization_name']);
|
||||
@ -477,7 +475,12 @@ class CourierAgreementSignatures extends Controller
|
||||
'esign_account' => ['required', 'string', 'max:255'],
|
||||
'secondary_esign_account' => [Rule::excludeIf(request('document_type') === 'cooperation-contract'), 'required_if:document_type,authorization,entity-change', 'nullable', 'string', 'max:255'],
|
||||
'secondary_operator_name' => ['exclude_if:document_type,entity-change', 'nullable', 'string', 'min:2', 'max:100'],
|
||||
'operator_name' => ['exclude_if:document_type,cooperation-contract,entity-change', 'nullable', 'string', 'min:2', 'max:100'],
|
||||
'operator_name' => [
|
||||
Rule::excludeIf(in_array(request('document_type'), ['cooperation-contract', 'entity-change'], true)
|
||||
|| (request('partner_type') === 'courier'
|
||||
&& in_array(request('document_type'), CourierAgreementSignature::COURIER_DOCUMENTS_WITH_ACCOUNT_LOOKUP, true))),
|
||||
'nullable', 'string', 'min:2', 'max:100',
|
||||
],
|
||||
'counterparty_organization_name' => ['required_if:document_type,account-proof,account-change,quote-confirmation', 'nullable', 'string', 'min:2', 'max:255'],
|
||||
'counterparty_signer_type' => ['required_if:document_type,account-proof,account-change,entity-change,cooperation-contract,authorization,shared-contract,quote-confirmation', 'nullable', 'in:organization,person'],
|
||||
'secondary_signer_type' => ['nullable', 'in:organization,person'],
|
||||
|
||||
@ -21,6 +21,8 @@ class CourierAgreementSignature extends Model
|
||||
|
||||
public const COOPERATION_PARTY_A_PHONE = '18052733960';
|
||||
|
||||
public const COURIER_DOCUMENTS_WITH_ACCOUNT_LOOKUP = ['shared-contract', 'account-proof'];
|
||||
|
||||
public const DOCUMENTS = [
|
||||
'account-proof' => [
|
||||
'code' => 'TPL-ACCOUNT-CERT-V2',
|
||||
|
||||
@ -121,10 +121,10 @@ final class CourierAgreementSignatureService
|
||||
|
||||
$flowCreationStarted = false;
|
||||
try {
|
||||
$signers = $this->signersFor($signature);
|
||||
$client = app(EsignClient::class);
|
||||
$initiatorName = data_get($signature->payload, 'signing_subject');
|
||||
$client->assertSignFlowInitiator($initiatorName);
|
||||
$signers = $this->signersFor($signature);
|
||||
$bytes = Storage::disk('uploads')->get($signature->source_pdf_path);
|
||||
$fileName = 'agreement-' . $signature->business_no . '.pdf';
|
||||
$fileId = $client->uploadPdf($bytes, $fileName);
|
||||
@ -369,29 +369,25 @@ final class CourierAgreementSignatureService
|
||||
{
|
||||
$payload = $signature->payload ?? [];
|
||||
|
||||
if ($signature->document_type === 'shared-contract') {
|
||||
if (in_array($signature->document_type, ['shared-contract', 'account-proof', 'account-change'], true)) {
|
||||
$isPerson = ($payload['counterparty_signer_type'] ?? 'organization') === 'person';
|
||||
if (blank($signature->operator_name)) {
|
||||
throw new RuntimeException('请填写物流商归属主体签署人的 E 签宝实名认证姓名。');
|
||||
}
|
||||
|
||||
return [[
|
||||
$signer = [
|
||||
'signer_type' => $isPerson ? 0 : 1,
|
||||
'organization_name' => $isPerson ? null : $signature->organization_name,
|
||||
'operator_name' => $signature->operator_name,
|
||||
'operator_account' => $signature->operator_account,
|
||||
]];
|
||||
}
|
||||
];
|
||||
|
||||
if (in_array($signature->document_type, ['account-proof', 'account-change'], true)) {
|
||||
$isPerson = ($payload['counterparty_signer_type'] ?? 'organization') === 'person';
|
||||
if ($signature->partnerType() === 'courier'
|
||||
&& in_array($signature->document_type, CourierAgreementSignature::COURIER_DOCUMENTS_WITH_ACCOUNT_LOOKUP, true)) {
|
||||
return [$this->resolveSignerIdentity($signer, '对方')];
|
||||
}
|
||||
|
||||
return [[
|
||||
'signer_type' => $isPerson ? 0 : 1,
|
||||
'organization_name' => $isPerson ? null : $signature->organization_name,
|
||||
'operator_name' => $isPerson ? ($signature->operator_name ?: $signature->organization_name) : $signature->operator_name,
|
||||
'operator_account' => $signature->operator_account,
|
||||
]];
|
||||
if ($isPerson && blank($signer['operator_name'])) {
|
||||
$signer['operator_name'] = $signature->organization_name;
|
||||
}
|
||||
|
||||
return [$signer];
|
||||
}
|
||||
|
||||
$primary = [
|
||||
@ -469,8 +465,8 @@ final class CourierAgreementSignatureService
|
||||
];
|
||||
|
||||
return [
|
||||
$this->entityChangeSigner($formerSigner, '变更前主体'),
|
||||
$this->entityChangeSigner($changedSigner, '变更后主体'),
|
||||
$this->resolveSignerIdentity($formerSigner, '变更前主体'),
|
||||
$this->resolveSignerIdentity($changedSigner, '变更后主体'),
|
||||
];
|
||||
}
|
||||
|
||||
@ -496,7 +492,7 @@ final class CourierAgreementSignatureService
|
||||
return [$primary];
|
||||
}
|
||||
|
||||
private function entityChangeSigner(array $signer, string $label): array
|
||||
private function resolveSignerIdentity(array $signer, string $label): array
|
||||
{
|
||||
// Previously created tasks keep their saved signer names when retried.
|
||||
if (filled($signer['operator_name'])) {
|
||||
|
||||
@ -3658,6 +3658,8 @@
|
||||
var courier = fieldValue('[name="courier_name"]', currentPartnerType === 'supplier' ? '供应商' : '快递公司');
|
||||
var companyName = fieldValue('[name="company_full_name"]', '待填写公司全称');
|
||||
var accountAgreement = templateType === 'account-proof' || templateType === 'account-change';
|
||||
var resolvesCourierSigner = currentPartnerType === 'courier'
|
||||
&& @json(\App\Models\Business\CourierAgreementSignature::COURIER_DOCUMENTS_WITH_ACCOUNT_LOOKUP).includes(templateType);
|
||||
var quoteConfirmation = templateType === 'quote-confirmation';
|
||||
var counterpartyIdentity = accountAgreement || quoteConfirmation;
|
||||
var entityChange = templateType === 'entity-change';
|
||||
@ -3697,7 +3699,7 @@
|
||||
if (accountSignerTypeField) {
|
||||
accountSignerTypeField.hidden = !signerTypeFieldVisible;
|
||||
setText('[data-signer-type-organization-title]', '企业签署');
|
||||
setText('[data-signer-type-organization-help]', quoteConfirmation ? '企业全称自动带入,经办人按账号核验' : cooperationContract ? '填写乙方合同主体及 E 签宝手机号' : '企业名称和经办人姓名分别填写');
|
||||
setText('[data-signer-type-organization-help]', quoteConfirmation ? '企业全称自动带入,经办人按账号核验' : cooperationContract ? '填写乙方合同主体及 E 签宝手机号' : resolvesCourierSigner ? '填写企业全称,经办人按账号核验' : '企业名称和经办人姓名分别填写');
|
||||
setText('[data-signer-type-person-title]', '个人签署');
|
||||
setText('[data-signer-type-person-help]', cooperationContract ? '填写乙方个人及其 E 签宝手机号' : '签署人姓名须与 E 签宝账号实名认证一致');
|
||||
}
|
||||
@ -3709,12 +3711,13 @@
|
||||
accountOrganizationInput.required = counterpartyIdentity;
|
||||
accountOrganizationInput.autocomplete = accountSignerIsPerson ? 'name' : 'organization';
|
||||
accountOrganizationInput.placeholder = accountSignerIsPerson
|
||||
? '填写对方在 E 签宝实名认证的姓名'
|
||||
? (resolvesCourierSigner ? '填写对方签署人的姓名' : '填写对方在 E 签宝实名认证的姓名')
|
||||
: '填写对方在 E 签宝认证的企业全称';
|
||||
}
|
||||
if (operatorNameInput) {
|
||||
var quoteAccountIdentity = quoteConfirmation && !accountSignerIsPerson;
|
||||
var needsPrimaryOperator = (sharedContract && !sharedSignerIsPerson) || (accountAgreement && !accountSignerIsPerson) || (authorization && !otherSignerIsPerson);
|
||||
var needsPrimaryOperator = (accountAgreement && !resolvesCourierSigner && !accountSignerIsPerson)
|
||||
|| (authorization && !otherSignerIsPerson);
|
||||
operatorNameInput.disabled = !needsPrimaryOperator;
|
||||
operatorNameInput.required = needsPrimaryOperator;
|
||||
operatorNameInput.placeholder = quoteAccountIdentity ? '推送时按上方账号自动核验,无需填写姓名' : '填写与 E 签宝账号匹配的实名姓名';
|
||||
@ -3729,18 +3732,16 @@
|
||||
|
||||
}
|
||||
if (operatorHelp) {
|
||||
operatorHelp.textContent = sharedContract
|
||||
? '填写物流商归属企业经办人的真实姓名,须与上方 E 签宝账号实名认证一致;快递名称填写在下方物流商名单。'
|
||||
: quoteConfirmation
|
||||
? '推送时向 E 签宝查询并核验该账号的实名身份;接口可能不返回姓名,无需手工填写。未实名或查询失败时会提示原因。'
|
||||
: '仅用于 E 签宝身份核验,不是收款人姓名;收款人姓名请填写在下方账户资料中。';
|
||||
operatorHelp.textContent = quoteConfirmation
|
||||
? '推送时向 E 签宝查询并核验该账号的实名身份;接口可能不返回姓名,无需手工填写。未实名或查询失败时会提示原因。'
|
||||
: '仅用于 E 签宝身份核验,不是收款人姓名;收款人姓名请填写在下方账户资料中。';
|
||||
}
|
||||
if (accountSignerLabel) {
|
||||
accountSignerLabel.textContent = accountSignerIsPerson ? '对方签署个人姓名' : '对方签署企业全称';
|
||||
}
|
||||
if (accountSignerHelp) {
|
||||
accountSignerHelp.textContent = accountSignerIsPerson
|
||||
? '填写与 E 签宝账号实名一致的个人姓名;该姓名会作为个人签署人发送,不需要填写企业全称。'
|
||||
? (resolvesCourierSigner ? '填写与 E 签宝账号实名一致的个人姓名,推送时按账号查找签署人。' : '填写与 E 签宝账号实名一致的个人姓名;该姓名会作为个人签署人发送,不需要填写企业全称。')
|
||||
: quoteConfirmation
|
||||
? '按快递名称从快递资料的“合同主体”预填,可修改;资料缺失或同名资料不唯一时请手工填写并核对。'
|
||||
: '必须与对方 E 签宝企业认证名称一致;这是签署主体,不要求与银行卡持卡人姓名一致。';
|
||||
|
||||
@ -61,6 +61,7 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
$this->assertSame('TPL-ACCOUNT-CERT-V2', $signature->template_code);
|
||||
$this->assertSame(CourierAgreementSignature::STATUS_SIGNING, $signature->status);
|
||||
$this->assertSame('flow-agreement-001', $signature->esign_sign_flow_id);
|
||||
$this->assertNull($signature->operator_name);
|
||||
$this->assertSame('新北中通快递有限公司', $signature->organization_name);
|
||||
$this->assertSame('2026-09-21', $signature->payload['signature_date']);
|
||||
$this->assertSame('courier', $signature->payload['partner_type']);
|
||||
@ -76,12 +77,12 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
return data_get($request->data(), 'signFlowInitiator.orgInitiator.orgId') === 'org-selected'
|
||||
&& data_get($request->data(), 'signFlowInitiator.orgInitiator.transactor.psnId') === 'person-selected'
|
||||
&& data_get($request->data(), 'signers.0.signerType') === 1
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.orgName') === '新北中通快递有限公司'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.transactorInfo.psnInfo.psnName') === '张经理';
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.orgId') === 'org-courier'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.transactorInfo') === ['psnId' => 'person-courier'];
|
||||
});
|
||||
|
||||
$this->loginAs()->post(route('business.courier-agreement-signatures.store'), $payload)->assertRedirect();
|
||||
Http::assertSentCount(4);
|
||||
Http::assertSentCount(6);
|
||||
$this->assertSame(1, CourierAgreementSignature::query()->count());
|
||||
}
|
||||
|
||||
@ -372,6 +373,7 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
{
|
||||
$this->fakeEsign();
|
||||
$payload = $this->accountProofPayload('request-private-holder');
|
||||
unset($payload['operator_name']);
|
||||
$payload['account_proof_account_name'] = '李四';
|
||||
|
||||
$this->loginAs()
|
||||
@ -388,8 +390,8 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
}
|
||||
|
||||
return data_get($request->data(), 'signers.0.signerType') === 1
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.orgName') === '新北中通快递有限公司'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.transactorInfo.psnInfo.psnName') === '张经理'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.orgId') === 'org-courier'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.transactorInfo') === ['psnId' => 'person-courier']
|
||||
&& data_get($request->data(), 'signers.0.psnSignerInfo') === null;
|
||||
});
|
||||
}
|
||||
@ -421,11 +423,18 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
});
|
||||
}
|
||||
|
||||
public function test_account_proof_requires_esign_real_name_separate_from_payee_name(): void
|
||||
public function test_supplier_account_proof_still_requires_esign_real_name(): void
|
||||
{
|
||||
$this->fakeEsign();
|
||||
$payload = $this->accountProofPayload('request-missing-operator-name');
|
||||
$payload['partner_type'] = 'supplier';
|
||||
$payload['supplier_id'] = 7;
|
||||
unset($payload['operator_name']);
|
||||
$repository = Mockery::mock(SupplierManagementMirrorRepository::class);
|
||||
$repository->shouldReceive('signingSupplier')->with(7)->once()->andReturn((object) [
|
||||
'Id' => 7, 'scmname' => '测试供应商', 'accountbankno' => '13800138000',
|
||||
]);
|
||||
$this->app->instance(SupplierManagementMirrorRepository::class, $repository);
|
||||
|
||||
$this->withExceptionHandling()
|
||||
->loginAs()
|
||||
@ -465,7 +474,8 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
|
||||
$signature = CourierAgreementSignature::query()->firstOrFail();
|
||||
$this->assertSame('person', $signature->payload['counterparty_signer_type']);
|
||||
$this->assertSame('李斯', $signature->operator_name);
|
||||
$this->assertSame('李斯', $signature->organization_name);
|
||||
$this->assertNull($signature->operator_name);
|
||||
|
||||
Http::assertSent(function (ClientRequest $request): bool {
|
||||
if ($request->url() !== 'https://smlopenapi.esign.test/v3/sign-flow/create-by-file') {
|
||||
@ -473,7 +483,7 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
}
|
||||
|
||||
return data_get($request->data(), 'signers.0.signerType') === 0
|
||||
&& data_get($request->data(), 'signers.0.psnSignerInfo.psnInfo.psnName') === '李斯'
|
||||
&& data_get($request->data(), 'signers.0.psnSignerInfo') === ['psnId' => 'person-courier']
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo') === null;
|
||||
});
|
||||
}
|
||||
@ -924,7 +934,6 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
'signature_date' => '2026-09-21',
|
||||
'signing_deadline' => now()->addDays(7)->toDateString(),
|
||||
'esign_account' => '13800138000',
|
||||
'operator_name' => '张经理',
|
||||
'archive_mode' => 'auto',
|
||||
'contract_partner_name' => '宿迁天枢物流科技有限公司',
|
||||
'shared_courier_names' => ['常州圆通其他', '常州圆通-丁楼'],
|
||||
@ -936,7 +945,7 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
$this->assertSame(['常州圆通其他', '常州圆通-丁楼'], $signature->payload['shared_courier_names']);
|
||||
$this->assertSame('宿迁天枢物流科技有限公司', $signature->organization_name);
|
||||
$this->assertSame('organization', $signature->payload['counterparty_signer_type']);
|
||||
$this->assertSame('张经理', $signature->operator_name);
|
||||
$this->assertNull($signature->operator_name);
|
||||
$this->assertSame('常州圆通其他', $signature->payload['shared_courier_name']);
|
||||
$this->assertSame('请在3个工作日内完成签章。', $signature->payload['shared_note']);
|
||||
$pdf = Storage::disk('uploads')->get($signature->source_pdf_path);
|
||||
@ -964,9 +973,8 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
|
||||
return count($request->data()['signers'] ?? []) === 1
|
||||
&& data_get($request->data(), 'signers.0.signerType') === 1
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.orgName') === '宿迁天枢物流科技有限公司'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.transactorInfo.psnAccount') === '13800138000'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.transactorInfo.psnInfo.psnName') === '张经理';
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.orgId') === 'org-courier'
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo.transactorInfo') === ['psnId' => 'person-courier'];
|
||||
});
|
||||
}
|
||||
|
||||
@ -992,7 +1000,7 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
$signature = CourierAgreementSignature::query()->firstOrFail();
|
||||
$this->assertSame('person', $signature->payload['counterparty_signer_type']);
|
||||
$this->assertSame('张三', $signature->organization_name);
|
||||
$this->assertSame('张三', $signature->operator_name);
|
||||
$this->assertNull($signature->operator_name);
|
||||
$this->assertSame($payload['shared_courier_names'], $signature->payload['shared_courier_names']);
|
||||
$this->assertStringStartsWith('%PDF-', Storage::disk('uploads')->get($signature->source_pdf_path));
|
||||
$html = view('business.pdf.courier-agreement', [
|
||||
@ -1013,21 +1021,20 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
return $request->url() === 'https://smlopenapi.esign.test/v3/sign-flow/create-by-file'
|
||||
&& count($request->data()['signers'] ?? []) === 1
|
||||
&& data_get($request->data(), 'signers.0.signerType') === 0
|
||||
&& data_get($request->data(), 'signers.0.psnSignerInfo.psnAccount') === '13800138000'
|
||||
&& data_get($request->data(), 'signers.0.psnSignerInfo.psnInfo.psnName') === '张三'
|
||||
&& data_get($request->data(), 'signers.0.psnSignerInfo') === ['psnId' => 'person-courier']
|
||||
&& data_get($request->data(), 'signers.0.orgSignerInfo') === null;
|
||||
});
|
||||
|
||||
$this->post(route('business.courier-agreement-signatures.store'), $payload)->assertRedirect();
|
||||
$this->assertDatabaseCount('business_courier_agreement_signatures', 1);
|
||||
Http::assertSentCount(4);
|
||||
Http::assertSentCount(5);
|
||||
}
|
||||
|
||||
public function test_shared_contract_rejects_missing_real_name_without_creating_a_task_or_remote_request(): void
|
||||
public function test_shared_contract_rejects_invalid_signing_subject_without_creating_a_task(): void
|
||||
{
|
||||
Http::fake();
|
||||
$payload = [
|
||||
'idempotency_key' => 'shared-contract-missing-name',
|
||||
'idempotency_key' => 'shared-contract-invalid-subject',
|
||||
'courier_name' => '快递公司乙',
|
||||
'document_type' => 'shared-contract',
|
||||
'signing_subject' => $this->company->name,
|
||||
@ -1040,18 +1047,8 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
'shared_courier_names' => ['快递公司乙', '快递公司丙'],
|
||||
];
|
||||
|
||||
$this->withExceptionHandling()->loginAs()
|
||||
->postJson(route('business.courier-agreement-signatures.store'), $payload)
|
||||
->assertStatus(422)
|
||||
->assertJsonValidationErrors('operator_name');
|
||||
|
||||
$payload['operator_name'] = ' ';
|
||||
$this->postJson(route('business.courier-agreement-signatures.store'), $payload)
|
||||
->assertStatus(422)
|
||||
->assertJsonValidationErrors('operator_name');
|
||||
|
||||
$this->withExceptionHandling()->loginAs();
|
||||
$payload['counterparty_signer_type'] = 'person';
|
||||
unset($payload['operator_name']);
|
||||
$payload['contract_partner_name'] = ' ';
|
||||
$this->postJson(route('business.courier-agreement-signatures.store'), $payload)
|
||||
->assertStatus(422)
|
||||
@ -1574,6 +1571,12 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
{
|
||||
Http::fake(function (ClientRequest $request) {
|
||||
return match (true) {
|
||||
str_starts_with($request->url(), 'https://smlopenapi.esign.test/v3/organizations/identity-info?') => Http::response([
|
||||
'code' => 0, 'data' => ['realnameStatus' => 1, 'orgId' => 'org-courier'],
|
||||
]),
|
||||
str_starts_with($request->url(), 'https://smlopenapi.esign.test/v3/persons/identity-info?') => Http::response([
|
||||
'code' => 0, 'data' => ['realnameStatus' => 1, 'psnId' => 'person-courier'],
|
||||
]),
|
||||
$request->url() === 'https://smlopenapi.esign.test/v3/files/file-upload-url' => Http::response([
|
||||
'code' => 0,
|
||||
'data' => ['fileId' => 'file-business-error', 'fileUploadUrl' => 'https://upload.esign.test/business-error'],
|
||||
@ -1607,6 +1610,12 @@ class CourierAgreementSignatureWorkflowTest extends FeatureTestCase
|
||||
{
|
||||
Http::fake(function (ClientRequest $request) {
|
||||
return match (true) {
|
||||
str_starts_with($request->url(), 'https://smlopenapi.esign.test/v3/organizations/identity-info?') => Http::response([
|
||||
'code' => 0, 'data' => ['realnameStatus' => 1, 'orgId' => 'org-courier'],
|
||||
]),
|
||||
str_starts_with($request->url(), 'https://smlopenapi.esign.test/v3/persons/identity-info?') => Http::response([
|
||||
'code' => 0, 'data' => ['realnameStatus' => 1, 'psnId' => 'person-courier'],
|
||||
]),
|
||||
$request->url() === 'https://smlopenapi.esign.test/v3/files/file-upload-url' => Http::response([
|
||||
'code' => 0,
|
||||
'data' => ['fileId' => 'file-server-error', 'fileUploadUrl' => 'https://upload.esign.test/server-error'],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user