mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 05:55:08 +08:00
feat(发票): 为发送发票接口添加可选邮箱参数
在发送发票接口中添加可选的邮箱参数,允许指定接收发票的邮箱地址。当不指定邮箱时,保持原有行为不变。
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* InvoiceRepoInterface.php@Pay
|
* InvoiceRepoInterface.php@Pay
|
||||||
*
|
*
|
||||||
@@ -33,14 +34,15 @@ interface InvoiceRepoInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $invoiceNo
|
* @param string $invoiceNo
|
||||||
|
* @param string|null $email
|
||||||
* @return void
|
* @return void
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
public function send(string $invoiceNo): void;
|
public function send(string $invoiceNo, ?string $email): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $invoiceNo
|
* @param string $invoiceNo
|
||||||
* @return InvoiceInfo
|
* @return InvoiceInfo
|
||||||
*/
|
*/
|
||||||
public function findOne(string $invoiceNo): InvoiceInfo;
|
public function findOne(string $invoiceNo): InvoiceInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,12 +85,17 @@ final class InvoiceRepo extends AbstractRepo implements InvoiceRepoInterface
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function send(string $invoiceNo): void
|
public function send(string $invoiceNo, ?string $email): void
|
||||||
{
|
{
|
||||||
if (empty($invoiceNo)) {
|
if (empty($invoiceNo)) {
|
||||||
throw new ValidateException(message: 'invoice no is required.');
|
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