Skip to content

feat(token,payment): fund a VCN from a prior charge and allow Visa capture - #78

Merged
woshilixiaohao merged 3 commits into
mainfrom
feat/vcn-funding-charge
Nov 9, 2026
Merged

woshilixiaohao merged 3 commits into
mainfrom
feat/vcn-funding-charge

Conversation

@woshilixiaohao

@woshilixiaohao woshilixiaohao commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

背景

虚拟卡(VCN)发卡方从 AgentCard 换成 PhotonPay:先用用户已绑的卡(银联 / Visa / EVO)扣一笔「卡额度 + 手续费」,平台再拿这笔扣款号开卡。CLI 需要支持报价和带扣款号开卡;Visa 出资还要求 payment-cli 能对 Visa 令牌扣款。

改动

token-cli 0.10.4

  • 新增 payment-tokens vcn-quote --amount|--amount-cents [--currency] [--card-bin]:返回卡额度、手续费、应扣总额和开卡将用的 BIN。BIN 不可用时报价就拒绝,不扣款。
  • payment-tokens create --type vcn 新增 --funding-charge-no、--amount-cents、--card-bin;带扣款号时,交互确认前调 vcn-quote 按平台报价显示冻结额(total_cents)和手续费(fee_cents),不再用 5% 估算;报价被拒时不发开卡请求;--yes 不调报价。
  • --external-transaction-id 发 external_transaction_id(平台实际读取的字段;旧的 --external-tx-id 发的 external_tx_id 平台不读)。
  • README、verb-schema、SKILL.md 同步。

payment-cli 0.5.5

  • payments capture 允许 --payment-brand visa。

依赖

平台对应改动:agenzo-platform feat/photonpay-vcn(GET /payment-tokens/vcn-quote、funding_charge_no、card_bin)。合入发版后,orchestrator-base 的 TOKEN_CLI_VERSION / PAYMENT_CLI_VERSION 升到 0.10.4 / 0.5.5。

测试

  • npm run test:1036 passed,2 skipped;npm run build 通过;check:lockfile 通过。
  • 本地联调(PhotonPay 沙箱 + 本地平台):EVO / Visa / 银联出资开卡、指定与不指定 BIN、BIN 不可用拒绝、销卡退差额均实测通过。

…pture

token-cli:
- New `payment-tokens vcn-quote --amount|--amount-cents [--currency] [--card-bin]`
  returns the card limit, fee, charge total and the BIN the card will use.
- `payment-tokens create --type vcn` accepts `--funding-charge-no`,
  `--amount-cents` and `--card-bin`; with a funding charge no freeze/fee prompt
  is shown.
- `--external-transaction-id` sends `external_transaction_id` (the field the
  platform reads; `--external-tx-id` sends `external_tx_id`, which it ignores).

payment-cli:
- `payments capture` accepts `--payment-brand visa`.
Releases the VCN funding flags (vcn-quote, --funding-charge-no, --card-bin) and Visa capture. Additive and backward compatible, so patch bumps.
When --funding-charge-no is given, the interactive confirmation now
fetches GET /payment-tokens/vcn-quote and shows Freeze (total_cents)
and Fee (fee_cents) instead of hiding the warning. A rejected quote
stops before the create request. --yes skips the quote call.
@woshilixiaohao
woshilixiaohao merged commit 4eeb2af into main Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant