本文整理汇总了Golang中github.com/stripe/stripe-go.AccountParams类的典型用法代码示例。如果您正苦于以下问题:Golang AccountParams类的具体用法?Golang AccountParams怎么用?Golang AccountParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AccountParams类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GetByID
func (c Client) GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) {
var body *url.Values
var commonParams *stripe.Params
if params != nil {
commonParams = ¶ms.Params
body = &url.Values{}
params.AppendTo(body)
}
account := &stripe.Account{}
err := c.B.Call("GET", "/accounts/"+id, c.Key, body, commonParams, account)
return account, err
}
示例2: Update
func (c Client) Update(id string, params *stripe.AccountParams) (*stripe.Account, error) {
var body *url.Values
var commonParams *stripe.Params
if params != nil {
commonParams = ¶ms.Params
body = &url.Values{}
writeAccountParams(params, body)
params.AppendTo(body)
}
acct := &stripe.Account{}
err := c.B.Call("POST", "/accounts/"+id, c.Key, body, commonParams, acct)
return acct, err
}
示例3: New
func (c Client) New(params *stripe.AccountParams) (*stripe.Account, error) {
body := &url.Values{
"managed": {strconv.FormatBool(params.Managed)},
}
writeAccountParams(params, body)
if params.TOSAcceptance != nil {
params.TOSAcceptance.AppendDetails(body)
}
params.AppendTo(body)
acct := &stripe.Account{}
err := c.B.Call("POST", "/accounts", c.Key, body, ¶ms.Params, acct)
return acct, err
}
示例4: New
func (c Client) New(params *stripe.AccountParams) (*stripe.Account, error) {
body := &stripe.RequestValues{}
body.Add("managed", strconv.FormatBool(params.Managed))
body.Add("debit_negative_balances", strconv.FormatBool(params.DebitNegativeBal))
writeAccountParams(params, body)
if params.TOSAcceptance != nil {
params.TOSAcceptance.AppendDetails(body)
}
params.AppendTo(body)
acct := &stripe.Account{}
err := c.B.Call("POST", "/accounts", c.Key, body, ¶ms.Params, acct)
return acct, err
}
示例5: New
func (c Client) New(params *stripe.AccountParams) (*stripe.Account, error) {
body := &stripe.RequestValues{}
if len(params.FromRecipient) == 0 {
body.Add("managed", strconv.FormatBool(params.Managed))
}
writeAccountParams(params, body)
if params.TOSAcceptance != nil {
params.TOSAcceptance.AppendDetails(body)
}
params.AppendTo(body)
acct := &stripe.Account{}
err := c.B.Call("POST", "/accounts", c.Key, body, ¶ms.Params, acct)
return acct, err
}