MCPcopy
hub / github.com/QuantumNous/new-api / FundingSource

Interface FundingSource

service/funding_source.go:14–23  ·  view source on GitHub ↗

--------------------------------------------------------------------------- FundingSource — 资金来源接口(钱包 or 订阅) --------------------------------------------------------------------------- FundingSource 抽象了预扣费的资金来源。

Source from the content-addressed store, hash-verified

12
13// FundingSource 抽象了预扣费的资金来源。
14type FundingSource interface {
15 // Source 返回资金来源标识:"wallet" 或 "subscription"
16 Source() string
17 // PreConsume 从该资金来源预扣 amount 额度
18 PreConsume(amount int) error
19 // Settle 根据差额调整资金来源(正数补扣,负数退还)
20 Settle(delta int) error
21 // Refund 退还所有预扣费
22 Refund() error
23}
24
25// ---------------------------------------------------------------------------
26// WalletFunding — 钱包资金来源实现

Callers 10

SettleMethod · 0.65
RefundMethod · 0.65
preConsumeMethod · 0.65
reserveFundingMethod · 0.65
shouldTrustMethod · 0.65
syncRelayInfoMethod · 0.65
preConsumeMethod · 0.65
SettleBillingFunction · 0.65
SettleMethod · 0.65
RefundMethod · 0.65

Implementers 2

WalletFundingservice/funding_source.go
SubscriptionFundingservice/funding_source.go

Calls

no outgoing calls

Tested by

no test coverage detected