Ai
2 Star 0 Fork 0

mirrors_sourcegraph/stripe-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
bitcointransaction.go 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
package stripe
import "encoding/json"
// BitcoinTransactionListParams is the set of parameters that can be used when listing BitcoinTransactions.
type BitcoinTransactionListParams struct {
ListParams `form:"*"`
Customer *string `form:"customer"`
Receiver *string `form:"-"` // Sent in with the URL
}
// BitcoinTransactionList is a list object for BitcoinTransactions.
// It is a child object of BitcoinRecievers
// For more details see https://stripe.com/docs/api/#retrieve_bitcoin_receiver
type BitcoinTransactionList struct {
ListMeta
Data []*BitcoinTransaction `json:"data"`
}
// BitcoinTransaction is the resource representing a Stripe bitcoin transaction.
// For more details see https://stripe.com/docs/api/#bitcoin_receivers
type BitcoinTransaction struct {
Amount int64 `json:"amount"`
BitcoinAmount int64 `json:"bitcoin_amount"`
Created int64 `json:"created"`
Currency Currency `json:"currency"`
Customer string `json:"customer"`
ID string `json:"id"`
Receiver string `json:"receiver"`
}
// UnmarshalJSON handles deserialization of a BitcoinTransaction.
// This custom unmarshaling is needed because the resulting
// property may be an id or the full struct if it was expanded.
func (bt *BitcoinTransaction) UnmarshalJSON(data []byte) error {
if id, ok := ParseID(data); ok {
bt.ID = id
return nil
}
type bitcoinTransaction BitcoinTransaction
var v bitcoinTransaction
if err := json.Unmarshal(data, &v); err != nil {
return err
}
*bt = BitcoinTransaction(v)
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_sourcegraph/stripe-go.git
git@gitee.com:mirrors_sourcegraph/stripe-go.git
mirrors_sourcegraph
stripe-go
stripe-go
master

搜索帮助