当前位置: 首页>>代码示例>>Golang>>正文


Golang stripe-go.AccountParams类代码示例

本文整理汇总了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 = &params.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
}
开发者ID:mousadialo,项目名称:stripe-go,代码行数:15,代码来源:client.go

示例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 = &params.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
}
开发者ID:BearchInc,项目名称:stripe-go,代码行数:18,代码来源:client.go

示例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, &params.Params, acct)

	return acct, err
}
开发者ID:BearchInc,项目名称:stripe-go,代码行数:18,代码来源:client.go

示例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, &params.Params, acct)

	return acct, err
}
开发者ID:carriercomm,项目名称:stripe-go,代码行数:18,代码来源:client.go

示例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, &params.Params, acct)

	return acct, err
}
开发者ID:captain401,项目名称:stripe-go,代码行数:20,代码来源:client.go


注:本文中的github.com/stripe/stripe-go.AccountParams类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。