Compare commits

...

8 Commits

Author SHA1 Message Date
李东云
72004d3916 chore(release): 1.13.1 2025-12-24 14:11:33 +08:00
李东云
7ade038f0f fix(ProductRepo): 将isset检查改为!empty检查以确保数据有效性 2025-12-24 14:11:13 +08:00
李东云
175a170dec chore(release): 1.13.0 2025-12-02 17:59:45 +08:00
李东云
19e95016fa feat(发票): 为发送发票接口添加可选邮箱参数
在发送发票接口中添加可选的邮箱参数,允许指定接收发票的邮箱地址。当不指定邮箱时,保持原有行为不变。
2025-12-02 17:59:18 +08:00
李东云
6fd7f2f421 chore(release): 1.12.4 2025-12-02 16:05:11 +08:00
李东云
1d1cdd7829 fix(invoice): 修正发票金额计算逻辑
- 将金额乘以100改为除以100以获得正确的数值
- 确保货币金额在存储前被正确转换为浮点数
- 保留两位小数精度以匹配财务数据标准
2025-12-02 16:04:53 +08:00
李东云
98fa6262a9 chore(release): 1.12.3 2025-12-01 15:32:07 +08:00
李东云
7d836f50df chore(release): 1.12.2 2025-12-01 15:18:19 +08:00
5 changed files with 40 additions and 8 deletions

View File

@@ -1,4 +1,29 @@
# 版本更新日志
### [1.13.1](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.13.0...v1.13.1) (2025-12-24)
### 🐛 Bug Fixes | Bug 修复
* **ProductRepo:** 将isset检查改为!empty检查以确保数据有效性 ([7ade038](http://124.126.16.154:8888/singularity/hdk-pay/commit/7ade038f0fb1c6a857428d75667ccb2289d392fd))
## [1.13.0](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.12.4...v1.13.0) (2025-12-02)
### ✨ Features | 新功能
* **发票:** 为发送发票接口添加可选邮箱参数 ([19e9501](http://124.126.16.154:8888/singularity/hdk-pay/commit/19e95016fae1230cce88b3ead5c9ae2474bfdafc))
### [1.12.4](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.12.3...v1.12.4) (2025-12-02)
### 🐛 Bug Fixes | Bug 修复
* **invoice:** 修正发票金额计算逻辑 ([1d1cdd7](http://124.126.16.154:8888/singularity/hdk-pay/commit/1d1cdd7829942984f4dcdd16e7e0d1ba9ac9d1ce))
### [1.12.3](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.12.2...v1.12.3) (2025-12-01)
### [1.12.2](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.12.1...v1.12.2) (2025-12-01)
### [1.12.1](http://124.126.16.154:8888/singularity/hdk-pay/compare/v1.12.0...v1.12.1) (2025-12-01)

View File

@@ -69,5 +69,5 @@
"url": "https://mirrors.aliyun.com/composer/"
}
},
"version": "1.12.1"
"version": "1.13.1"
}

View File

@@ -1,4 +1,5 @@
<?php
/**
* InvoiceRepoInterface.php@Pay
*
@@ -33,14 +34,15 @@ 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
* @return InvoiceInfo
*/
public function findOne(string $invoiceNo): InvoiceInfo;
}
}

View File

@@ -47,7 +47,7 @@ final class InvoiceRepo extends AbstractRepo implements InvoiceRepoInterface
'country' => $cmd->country,
'zip' => $cmd->zipCode,
'price' => [
'amount' => (float)bcmul($money->getAmount(), '100', 2),
'amount' => (float)bcdiv($money->getAmount(), '100', 2),
'currency' => [
'code' => $money->getCurrency()->getCode(),
'symbol' => $cmd->currencySymbol,
@@ -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,
],
);
}
/**

View File

@@ -148,7 +148,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
$result = Json::decode($content);
return new RechargeProduct(
oneTime: isset($result['one_time'])
oneTime: !empty($result['one_time'])
? new ProductItem(
id: $result['one_time']['id'],
description: $result['one_time']['name'],
@@ -164,7 +164,7 @@ final class ProductRepo extends AbstractRepo implements RechargeProductRepoInter
),
)
: null,
renew: isset($result['renew'])
renew: !empty($result['renew'])
? new ProductItem(
id: $result['renew']['id'],
description: $result['renew']['name'],