Skip to content

Commit 81ffbd3

Browse files
committed
release: v1.0.1
1 parent 5074247 commit 81ffbd3

33 files changed

Lines changed: 2840 additions & 301 deletions

.github/workflows/docker-publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,26 @@ jobs:
5959
labels: ${{ steps.meta.outputs.labels }}
6060
cache-from: type=gha
6161
cache-to: type=gha,mode=max
62+
63+
release:
64+
if: startsWith(github.ref, 'refs/tags/v')
65+
needs: docker
66+
runs-on: ubuntu-latest
67+
permissions:
68+
contents: write
69+
70+
steps:
71+
- name: Create GitHub Release
72+
env:
73+
GH_TOKEN: ${{ github.token }}
74+
TAG_NAME: ${{ github.ref_name }}
75+
run: |
76+
if gh release view "$TAG_NAME" >/dev/null 2>&1; then
77+
echo "GitHub Release $TAG_NAME already exists"
78+
else
79+
gh release create "$TAG_NAME" \
80+
--repo "$GITHUB_REPOSITORY" \
81+
--verify-tag \
82+
--title "$TAG_NAME" \
83+
--generate-notes
84+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Python-generated files
2+
.DS_Store
23
__pycache__/
34
*.py[oc]
45
build/

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.0.1 - 2026-07-15
4+
5+
+ [新增] Pix 新增方案 3 BR/VN 独立协议,支持 BR Checkout/Provider 与 VN Promotion 双 sticky 出口,并保留方案 1、方案 2 独立选择。
6+
+ [优化] Pix 方案 1、方案 2 补齐 Checkout、Stripe、PaymentMethod、Approve、Poll 与最终提取进度,收敛同一 sticky 出口的重试次数和请求超时,避免任务长时间无反馈。
7+
+ [新增] Grok 注册默认执行 xAI Device Code OAuth;账号管理合并显示 OAuth 绑定状态,并提供授权、刷新、删除与模型测试操作。
8+
+ [优化] 注册配置中的 Sub2API 同步和邮箱请求改为可展开/收起区块,收起时保留常用操作,展开切换不丢失未保存内容。
9+
+ [新增] 推送 `v*` 标签后,在多架构 GHCR 镜像构建成功时自动创建 GitHub Release 并生成发布说明。
10+
311
## 1.0.0 - 2026-07-15
412

513
+ [变更] 注册 Checkout 仅保留 UPI 最终支付链接提取,IN Checkout / Provider / Approve 共享同一 sticky 出口,VN Promotion 使用独立代理与持续轮换重试。

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.0.1

api/checkout.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class CheckoutSessionCreateRequest(BaseModel):
1616
access_token: str = Field(min_length=1, max_length=20_000)
1717
checkout_channel: Literal["upi", "pix"] | None = None
18-
pix_protocol: Literal["enhanced", "reference"] | None = None
18+
pix_protocol: Literal["enhanced", "reference", "standalone"] | None = None
1919

2020

2121
class CheckoutRetryRequest(BaseModel):
@@ -70,8 +70,11 @@ def _configured_checkout_settings() -> dict[str, str]:
7070
channel = str(checkout.get("channel") or "upi").strip().lower()
7171
if channel not in {"upi", "pix"}:
7272
channel = "upi"
73-
pix_protocol = "reference" if checkout.get("pix_protocol") == "reference" else "enhanced"
74-
promotion_proxy = _configured_stage_proxy(checkout, "promotion") if channel == "upi" else checkout_proxy
73+
configured_protocol = str(checkout.get("pix_protocol") or "").strip().lower()
74+
pix_protocol = configured_protocol if configured_protocol in {"enhanced", "reference", "standalone"} else "enhanced"
75+
uses_promotion_proxy = channel == "upi" or (channel == "pix" and pix_protocol == "standalone")
76+
promotion_proxy = _configured_stage_proxy(checkout, "promotion") if uses_promotion_proxy else ""
77+
promotion_proxy = promotion_proxy or checkout_proxy
7578
return {
7679
"checkout_channel": channel,
7780
"pix_protocol": pix_protocol,

api/checkout_test.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,45 @@ def test_uses_configured_pix_channel_and_one_br_proxy(self) -> None:
119119
provider_proxy="http://br-shared.example.test:8000",
120120
)
121121

122+
def test_scheme3_uses_configured_vn_promotion_proxy(self) -> None:
123+
with (
124+
patch("api.checkout.require_admin", return_value={"id": "admin", "role": "admin"}),
125+
patch.object(
126+
checkout.register_service,
127+
"get",
128+
return_value={
129+
"checkout": {
130+
"channel": "pix",
131+
"pix_protocol": "standalone",
132+
"checkout_proxy_enabled": True,
133+
"checkout_proxy_url": "http://br.example.test:8000",
134+
"promotion_proxy_enabled": True,
135+
"promotion_proxy_url": "http://vn.example.test:8001",
136+
}
137+
},
138+
),
139+
patch.object(
140+
checkout.openai_checkout_service,
141+
"extract_and_store_checkout_link",
142+
return_value={"checkout_final_url": "https://payments.stripe.com/qr/instructions/pix_scheme3"},
143+
) as create,
144+
):
145+
response = self.client.post(
146+
"/api/accounts/checkout-session",
147+
headers={"Authorization": "Bearer test-admin-key"},
148+
json={"access_token": "stored-access-token"},
149+
)
150+
151+
self.assertEqual(response.status_code, 200)
152+
create.assert_called_once_with(
153+
"stored-access-token",
154+
checkout_channel="pix",
155+
pix_protocol="standalone",
156+
checkout_proxy="http://br.example.test:8000",
157+
promotion_proxy="http://vn.example.test:8001",
158+
provider_proxy="http://br.example.test:8000",
159+
)
160+
122161
def test_enqueues_selected_accounts_for_continuous_retries(self) -> None:
123162
with (
124163
patch("api.checkout.require_admin", return_value={"id": "admin", "role": "admin"}),

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "chatgpt2api"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Add your description here"
55
readme = "README.md"
66
requires-python = ">=3.13"

0 commit comments

Comments
 (0)