mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 07:15:06 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72004d3916 | ||
|
|
7ade038f0f | ||
|
|
175a170dec | ||
|
|
19e95016fa | ||
|
|
6fd7f2f421 | ||
|
|
1d1cdd7829 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,4 +1,25 @@
|
||||
# 版本更新日志
|
||||
### [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)
|
||||
|
||||
@@ -69,5 +69,5 @@
|
||||
"url": "https://mirrors.aliyun.com/composer/"
|
||||
}
|
||||
},
|
||||
"version": "1.12.3"
|
||||
"version": "1.13.1"
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user