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 }
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 }
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 }
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 }
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 }