mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 03:55:07 +08:00
feat(发票): 为发送发票接口添加可选邮箱参数
在发送发票接口中添加可选的邮箱参数,允许指定接收发票的邮箱地址。当不指定邮箱时,保持原有行为不变。
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* InvoiceRepoInterface.php@Pay
|
||||
*
|
||||
@@ -33,10 +34,11 @@ interface InvoiceRepoInterface
|
||||
|
||||
/**
|
||||
* @param string $invoiceNo
|
||||
* @param string|null $email
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function send(string $invoiceNo): void;
|
||||
public function send(string $invoiceNo, ?string $email): void;
|
||||
|
||||
/**
|
||||
* @param string $invoiceNo
|
||||
|
||||
@@ -85,12 +85,17 @@ final class InvoiceRepo extends AbstractRepo implements InvoiceRepoInterface
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function send(string $invoiceNo): void
|
||||
public function send(string $invoiceNo, ?string $email): void
|
||||
{
|
||||
if (empty($invoiceNo)) {
|
||||
throw new ValidateException(message: 'invoice no is required.');
|
||||
}
|
||||
$this->requestService->requestGet(url: "/rpc/v2/invoice/invoices/$invoiceNo/email");
|
||||
$this->requestService->requestGet(
|
||||
url: "/rpc/v2/invoice/invoices/$invoiceNo/email",
|
||||
data: [
|
||||
'email' => $email,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user