代码拉取完成,页面将自动刷新
package stripe
import "encoding/json"
// SourceTransactionListParams is the set of parameters that can be used when listing SourceTransactions.
type SourceTransactionListParams struct {
ListParams `form:"*"`
Source *string `form:"-"` // Sent in with the URL
}
// SourceTransactionList is a list object for SourceTransactions.
type SourceTransactionList struct {
ListMeta
Data []*SourceTransaction `json:"data"`
}
// SourceTransaction is the resource representing a Stripe source transaction.
type SourceTransaction struct {
Amount int64 `json:"amount"`
Created int64 `json:"created"`
Currency Currency `json:"currency"`
CustomerData string `json:"customer_data"`
ID string `json:"id"`
Live bool `json:"livemode"`
Source string `json:"source"`
Type string `json:"type"`
TypeData map[string]interface{}
}
// UnmarshalJSON handles deserialization of a SourceTransaction. This custom
// unmarshaling is needed to extract the type specific data (accessible under
// `TypeData`) but stored in JSON under a hash named after the `type` of the
// source transaction.
func (t *SourceTransaction) UnmarshalJSON(data []byte) error {
type sourceTransaction SourceTransaction
var v sourceTransaction
err := json.Unmarshal(data, &v)
if err != nil {
return err
}
*t = SourceTransaction(v)
var raw map[string]interface{}
err = json.Unmarshal(data, &raw)
if err != nil {
return err
}
if d, ok := raw[t.Type]; ok {
if m, ok := d.(map[string]interface{}); ok {
t.TypeData = m
}
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。