id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
26,300
stripe/stripe-go
terminal/location/client.go
Get
func (c Client) Get(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} err := c.B.Call(http.MethodGet, path, c.Key, params, location) return location, err }
go
func (c Client) Get(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} err := c.B.Call(http.MethodGet, path, c.Key, params, location) return location, err }
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "TerminalLocationParams", ")", "(", "*", "stripe", ".", "TerminalLocation", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", ...
// Get returns the details of a terminal location.
[ "Get", "returns", "the", "details", "of", "a", "terminal", "location", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/terminal/location/client.go#L35-L40
26,301
stripe/stripe-go
terminal/location/client.go
Update
func Update(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Update(id, params) }
go
func Update(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Update(id, params) }
[ "func", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "TerminalLocationParams", ")", "(", "*", "stripe", ".", "TerminalLocation", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Update", "(", "id", ",", "params", ")", "\n"...
// Update updates a terminal location.
[ "Update", "updates", "a", "terminal", "location", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/terminal/location/client.go#L43-L45
26,302
stripe/stripe-go
error.go
Error
func (e *Error) Error() string { ret, _ := json.Marshal(e) return string(ret) }
go
func (e *Error) Error() string { ret, _ := json.Marshal(e) return string(ret) }
[ "func", "(", "e", "*", "Error", ")", "Error", "(", ")", "string", "{", "ret", ",", "_", ":=", "json", ".", "Marshal", "(", "e", ")", "\n", "return", "string", "(", "ret", ")", "\n", "}" ]
// Error serializes the error object to JSON and returns it as a string.
[ "Error", "serializes", "the", "error", "object", "to", "JSON", "and", "returns", "it", "as", "a", "string", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/error.go#L63-L66
26,303
stripe/stripe-go
recipient/client.go
Get
func (c Client) Get(id string, params *stripe.RecipientParams) (*stripe.Recipient, error) { path := stripe.FormatURLPath("/v1/recipients/%s", id) recipient := &stripe.Recipient{} err := c.B.Call(http.MethodGet, path, c.Key, params, recipient) return recipient, err }
go
func (c Client) Get(id string, params *stripe.RecipientParams) (*stripe.Recipient, error) { path := stripe.FormatURLPath("/v1/recipients/%s", id) recipient := &stripe.Recipient{} err := c.B.Call(http.MethodGet, path, c.Key, params, recipient) return recipient, err }
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "RecipientParams", ")", "(", "*", "stripe", ".", "Recipient", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"", ",", ...
// Get returns the details of a recipient.
[ "Get", "returns", "the", "details", "of", "a", "recipient", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/recipient/client.go#L26-L31
26,304
stripe/stripe-go
subschedulerevision/client.go
List
func (c Client) List(listParams *stripe.SubscriptionScheduleRevisionListParams) *Iter { path := stripe.FormatURLPath("/v1/subscription_schedules/%s/revisions", stripe.StringValue(listParams.Schedule)) return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, er...
go
func (c Client) List(listParams *stripe.SubscriptionScheduleRevisionListParams) *Iter { path := stripe.FormatURLPath("/v1/subscription_schedules/%s/revisions", stripe.StringValue(listParams.Schedule)) return &Iter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, er...
[ "func", "(", "c", "Client", ")", "List", "(", "listParams", "*", "stripe", ".", "SubscriptionScheduleRevisionListParams", ")", "*", "Iter", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"", ",", "stripe", ".", "StringValue", "(", "listParam...
// List returns a list of subscription schedule revisions.
[ "List", "returns", "a", "list", "of", "subscription", "schedule", "revisions", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/subschedulerevision/client.go#L45-L60
26,305
stripe/stripe-go
checkout_session.go
UnmarshalJSON
func (p *CheckoutSession) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { p.ID = id return nil } type session CheckoutSession var v session if err := json.Unmarshal(data, &v); err != nil { return err } *p = CheckoutSession(v) return nil }
go
func (p *CheckoutSession) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { p.ID = id return nil } type session CheckoutSession var v session if err := json.Unmarshal(data, &v); err != nil { return err } *p = CheckoutSession(v) return nil }
[ "func", "(", "p", "*", "CheckoutSession", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "p", ".", "ID", "=", "id", "\n", "return", "nil", "\n", ...
// UnmarshalJSON handles deserialization of a checkout session. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "checkout", "session", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expan...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/checkout_session.go#L122-L136
26,306
stripe/stripe-go
product.go
UnmarshalJSON
func (p *Product) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { p.ID = id return nil } type product Product var v product if err := json.Unmarshal(data, &v); err != nil { return err } *p = Product(v) return nil }
go
func (p *Product) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { p.ID = id return nil } type product Product var v product if err := json.Unmarshal(data, &v); err != nil { return err } *p = Product(v) return nil }
[ "func", "(", "p", "*", "Product", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "p", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "...
// UnmarshalJSON handles deserialization of a Product. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Product", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/product.go#L95-L109
26,307
stripe/stripe-go
filelink.go
UnmarshalJSON
func (c *FileLink) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type fileLink FileLink var v fileLink if err := json.Unmarshal(data, &v); err != nil { return err } *c = FileLink(v) return nil }
go
func (c *FileLink) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type fileLink FileLink var v fileLink if err := json.Unmarshal(data, &v); err != nil { return err } *c = FileLink(v) return nil }
[ "func", "(", "c", "*", "FileLink", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "c", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", ...
// UnmarshalJSON handles deserialization of a file link. // This custom unmarshaling is needed because the resulting // property may be an ID or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "file", "link", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "ID", "or", "the", "full", "struct", "if", "it", "was", "expanded", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/filelink.go#L40-L54
26,308
stripe/stripe-go
paymentsource.go
AppendTo
func (p *SourceParams) AppendTo(body *form.Values, keyParts []string) { if p.Card != nil { p.Card.AppendToAsCardSourceOrExternalAccount(body, keyParts) } }
go
func (p *SourceParams) AppendTo(body *form.Values, keyParts []string) { if p.Card != nil { p.Card.AppendToAsCardSourceOrExternalAccount(body, keyParts) } }
[ "func", "(", "p", "*", "SourceParams", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "if", "p", ".", "Card", "!=", "nil", "{", "p", ".", "Card", ".", "AppendToAsCardSourceOrExternalAccount", "(...
// AppendTo implements custom encoding logic for SourceParams.
[ "AppendTo", "implements", "custom", "encoding", "logic", "for", "SourceParams", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentsource.go#L30-L34
26,309
stripe/stripe-go
paymentsource.go
UnmarshalJSON
func (s *PaymentSource) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type paymentSource PaymentSource var v paymentSource if err := json.Unmarshal(data, &v); err != nil { return err } var err error *s = PaymentSource(v) switch s.Type { case PaymentSourceT...
go
func (s *PaymentSource) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type paymentSource PaymentSource var v paymentSource if err := json.Unmarshal(data, &v); err != nil { return err } var err error *s = PaymentSource(v) switch s.Type { case PaymentSourceT...
[ "func", "(", "s", "*", "PaymentSource", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "s", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}...
// UnmarshalJSON handles deserialization of a PaymentSource. // This custom unmarshaling is needed because the specific // type of payment instrument it refers to is specified in the JSON
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "PaymentSource", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "specific", "type", "of", "payment", "instrument", "it", "refers", "to", "is", "specified", "in", "the", "JSON" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentsource.go#L115-L142
26,310
stripe/stripe-go
paymentsource.go
MarshalJSON
func (s *PaymentSource) MarshalJSON() ([]byte, error) { var target interface{} switch s.Type { case PaymentSourceTypeBitcoinReceiver: target = struct { *BitcoinReceiver Type PaymentSourceType `json:"object"` }{ BitcoinReceiver: s.BitcoinReceiver, Type: s.Type, } case PaymentSourceTypeC...
go
func (s *PaymentSource) MarshalJSON() ([]byte, error) { var target interface{} switch s.Type { case PaymentSourceTypeBitcoinReceiver: target = struct { *BitcoinReceiver Type PaymentSourceType `json:"object"` }{ BitcoinReceiver: s.BitcoinReceiver, Type: s.Type, } case PaymentSourceTypeC...
[ "func", "(", "s", "*", "PaymentSource", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "target", "interface", "{", "}", "\n\n", "switch", "s", ".", "Type", "{", "case", "PaymentSourceTypeBitcoinReceiver", ":", "target...
// MarshalJSON handles serialization of a PaymentSource. // This custom marshaling is needed because the specific type // of payment instrument it represents is specified by the Type
[ "MarshalJSON", "handles", "serialization", "of", "a", "PaymentSource", ".", "This", "custom", "marshaling", "is", "needed", "because", "the", "specific", "type", "of", "payment", "instrument", "it", "represents", "is", "specified", "by", "the", "Type" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentsource.go#L147-L202
26,311
stripe/stripe-go
subschedulerevision.go
UnmarshalJSON
func (s *SubscriptionScheduleRevision) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type revision SubscriptionScheduleRevision var v revision if err := json.Unmarshal(data, &v); err != nil { return err } *s = SubscriptionScheduleRevision(v) return nil }
go
func (s *SubscriptionScheduleRevision) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type revision SubscriptionScheduleRevision var v revision if err := json.Unmarshal(data, &v); err != nil { return err } *s = SubscriptionScheduleRevision(v) return nil }
[ "func", "(", "s", "*", "SubscriptionScheduleRevision", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "s", ".", "ID", "=", "id", "\n", "return", "nil...
// UnmarshalJSON handles deserialization of a SubscriptionScheduleRevision. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "SubscriptionScheduleRevision", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/subschedulerevision.go#L43-L57
26,312
stripe/stripe-go
ephemeralkey.go
UnmarshalJSON
func (e *EphemeralKey) UnmarshalJSON(data []byte) error { type ephemeralKey EphemeralKey var ee ephemeralKey err := json.Unmarshal(data, &ee) if err == nil { *e = EphemeralKey(ee) } e.RawJSON = data return nil }
go
func (e *EphemeralKey) UnmarshalJSON(data []byte) error { type ephemeralKey EphemeralKey var ee ephemeralKey err := json.Unmarshal(data, &ee) if err == nil { *e = EphemeralKey(ee) } e.RawJSON = data return nil }
[ "func", "(", "e", "*", "EphemeralKey", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "type", "ephemeralKey", "EphemeralKey", "\n", "var", "ee", "ephemeralKey", "\n", "err", ":=", "json", ".", "Unmarshal", "(", "data", ",", "&", ...
// UnmarshalJSON handles deserialization of an EphemeralKey. // This custom unmarshaling is needed because we need to store the // raw JSON on the object so it may be passed back to the frontend.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "EphemeralKey", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "we", "need", "to", "store", "the", "raw", "JSON", "on", "the", "object", "so", "it", "may", "be", "passed", "back", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/ephemeralkey.go#L40-L51
26,313
stripe/stripe-go
recipienttransfer.go
UnmarshalJSON
func (t *RecipientTransfer) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { t.ID = id return nil } type recipientTransfer RecipientTransfer var v recipientTransfer if err := json.Unmarshal(data, &v); err != nil { return err } *t = RecipientTransfer(v) return nil }
go
func (t *RecipientTransfer) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { t.ID = id return nil } type recipientTransfer RecipientTransfer var v recipientTransfer if err := json.Unmarshal(data, &v); err != nil { return err } *t = RecipientTransfer(v) return nil }
[ "func", "(", "t", "*", "RecipientTransfer", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "t", ".", "ID", "=", "id", "\n", "return", "nil", "\n", ...
// UnmarshalJSON handles deserialization of a RecipientTransfer. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "RecipientTransfer", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded"...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/recipienttransfer.go#L113-L127
26,314
stripe/stripe-go
recipienttransfer.go
UnmarshalJSON
func (d *RecipientTransferDestination) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { d.ID = id return nil } type recipientTransferDestination RecipientTransferDestination var v recipientTransferDestination if err := json.Unmarshal(data, &v); err != nil { return err } var err error ...
go
func (d *RecipientTransferDestination) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { d.ID = id return nil } type recipientTransferDestination RecipientTransferDestination var v recipientTransferDestination if err := json.Unmarshal(data, &v); err != nil { return err } var err error ...
[ "func", "(", "d", "*", "RecipientTransferDestination", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "d", ".", "ID", "=", "id", "\n", "return", "nil...
// UnmarshalJSON handles deserialization of a RecipientTransferDestination. // This custom unmarshaling is needed because the specific // type of destination it refers to is specified in the JSON
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "RecipientTransferDestination", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "specific", "type", "of", "destination", "it", "refers", "to", "is", "specified", "in", "the", "JSON" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/recipienttransfer.go#L132-L155
26,315
stripe/stripe-go
paymentmethod/client.go
Detach
func Detach(id string, params *stripe.PaymentMethodDetachParams) (*stripe.PaymentMethod, error) { return getC().Detach(id, params) }
go
func Detach(id string, params *stripe.PaymentMethodDetachParams) (*stripe.PaymentMethod, error) { return getC().Detach(id, params) }
[ "func", "Detach", "(", "id", "string", ",", "params", "*", "stripe", ".", "PaymentMethodDetachParams", ")", "(", "*", "stripe", ".", "PaymentMethod", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Detach", "(", "id", ",", "params", ")", "\n"...
// Detach detaches a PaymentMethod.
[ "Detach", "detaches", "a", "PaymentMethod", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentmethod/client.go#L31-L33
26,316
stripe/stripe-go
paymentmethod/client.go
Get
func (c Client) Get(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s", id) fee := &stripe.PaymentMethod{} err := c.B.Call(http.MethodGet, path, c.Key, params, fee) return fee, err }
go
func (c Client) Get(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s", id) fee := &stripe.PaymentMethod{} err := c.B.Call(http.MethodGet, path, c.Key, params, fee) return fee, err }
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "PaymentMethodParams", ")", "(", "*", "stripe", ".", "PaymentMethod", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"",...
// Get returns the details of a PaymentMethod.
[ "Get", "returns", "the", "details", "of", "a", "PaymentMethod", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentmethod/client.go#L49-L54
26,317
stripe/stripe-go
paymentmethod/client.go
Update
func Update(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().Update(id, params) }
go
func Update(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().Update(id, params) }
[ "func", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "PaymentMethodParams", ")", "(", "*", "stripe", ".", "PaymentMethod", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Update", "(", "id", ",", "params", ")", "\n", "}...
// Update updates a PaymentMethod.
[ "Update", "updates", "a", "PaymentMethod", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentmethod/client.go#L89-L91
26,318
stripe/stripe-go
issuing_card.go
UnmarshalJSON
func (i *IssuingCard) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingCard IssuingCard var v issuingCard if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingCard(v) return nil }
go
func (i *IssuingCard) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingCard IssuingCard var v issuingCard if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingCard(v) return nil }
[ "func", "(", "i", "*", "IssuingCard", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}",...
// UnmarshalJSON handles deserialization of an IssuingCard. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "IssuingCard", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing_card.go#L188-L202
26,319
stripe/stripe-go
issuing_dispute.go
UnmarshalJSON
func (i *IssuingDispute) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingDispute IssuingDispute var v issuingDispute if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingDispute(v) return nil }
go
func (i *IssuingDispute) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingDispute IssuingDispute var v issuingDispute if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingDispute(v) return nil }
[ "func", "(", "i", "*", "IssuingDispute", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "...
// UnmarshalJSON handles deserialization of an IssuingDispute. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "IssuingDispute", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing_dispute.go#L107-L121
26,320
stripe/stripe-go
subschedule.go
UnmarshalJSON
func (s *SubscriptionSchedule) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type schedule SubscriptionSchedule var v schedule if err := json.Unmarshal(data, &v); err != nil { return err } *s = SubscriptionSchedule(v) return nil }
go
func (s *SubscriptionSchedule) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type schedule SubscriptionSchedule var v schedule if err := json.Unmarshal(data, &v); err != nil { return err } *s = SubscriptionSchedule(v) return nil }
[ "func", "(", "s", "*", "SubscriptionSchedule", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "s", ".", "ID", "=", "id", "\n", "return", "nil", "\n...
// UnmarshalJSON handles deserialization of a SubscriptionSchedule. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "SubscriptionSchedule", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expand...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/subschedule.go#L187-L201
26,321
stripe/stripe-go
taxrate.go
UnmarshalJSON
func (c *TaxRate) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type taxrate TaxRate var v taxrate if err := json.Unmarshal(data, &v); err != nil { return err } *c = TaxRate(v) return nil }
go
func (c *TaxRate) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type taxrate TaxRate var v taxrate if err := json.Unmarshal(data, &v); err != nil { return err } *c = TaxRate(v) return nil }
[ "func", "(", "c", "*", "TaxRate", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "c", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "...
// UnmarshalJSON handles deserialization of a TaxRate. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "TaxRate", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/taxrate.go#L62-L76
26,322
stripe/stripe-go
discount/client.go
DelSubscription
func DelSubscription(subscriptionID string, params *stripe.DiscountParams) (*stripe.Discount, error) { return getC().DelSub(subscriptionID, params) }
go
func DelSubscription(subscriptionID string, params *stripe.DiscountParams) (*stripe.Discount, error) { return getC().DelSub(subscriptionID, params) }
[ "func", "DelSubscription", "(", "subscriptionID", "string", ",", "params", "*", "stripe", ".", "DiscountParams", ")", "(", "*", "stripe", ".", "Discount", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "DelSub", "(", "subscriptionID", ",", "param...
// DelSubscription removes a discount from a customer's subscription.
[ "DelSubscription", "removes", "a", "discount", "from", "a", "customer", "s", "subscription", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/discount/client.go#L30-L32
26,323
stripe/stripe-go
sigma_scheduledqueryrun.go
UnmarshalJSON
func (i *SigmaScheduledQueryRun) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type sigmaScheduledQueryRun SigmaScheduledQueryRun var v sigmaScheduledQueryRun if err := json.Unmarshal(data, &v); err != nil { return err } *i = SigmaScheduledQueryRun(v) return ...
go
func (i *SigmaScheduledQueryRun) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type sigmaScheduledQueryRun SigmaScheduledQueryRun var v sigmaScheduledQueryRun if err := json.Unmarshal(data, &v); err != nil { return err } *i = SigmaScheduledQueryRun(v) return ...
[ "func", "(", "i", "*", "SigmaScheduledQueryRun", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "...
// UnmarshalJSON handles deserialization of an SigmaScheduledQueryRun. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "SigmaScheduledQueryRun", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "exp...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/sigma_scheduledqueryrun.go#L50-L64
26,324
stripe/stripe-go
customer.go
SetSource
func (cp *CustomerParams) SetSource(sp interface{}) error { source, err := SourceParamsFor(sp) cp.Source = source return err }
go
func (cp *CustomerParams) SetSource(sp interface{}) error { source, err := SourceParamsFor(sp) cp.Source = source return err }
[ "func", "(", "cp", "*", "CustomerParams", ")", "SetSource", "(", "sp", "interface", "{", "}", ")", "error", "{", "source", ",", "err", ":=", "SourceParamsFor", "(", "sp", ")", "\n", "cp", ".", "Source", "=", "source", "\n", "return", "err", "\n", "}"...
// SetSource adds valid sources to a CustomerParams object, // returning an error for unsupported sources.
[ "SetSource", "adds", "valid", "sources", "to", "a", "CustomerParams", "object", "returning", "an", "error", "for", "unsupported", "sources", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/customer.go#L103-L107
26,325
stripe/stripe-go
customer.go
UnmarshalJSON
func (c *Customer) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type customer Customer var v customer if err := json.Unmarshal(data, &v); err != nil { return err } *c = Customer(v) return nil }
go
func (c *Customer) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type customer Customer var v customer if err := json.Unmarshal(data, &v); err != nil { return err } *c = Customer(v) return nil }
[ "func", "(", "c", "*", "Customer", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "c", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", ...
// UnmarshalJSON handles deserialization of a Customer. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Customer", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/customer.go#L191-L205
26,326
stripe/stripe-go
sub.go
UnmarshalJSON
func (s *Subscription) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type subscription Subscription var v subscription if err := json.Unmarshal(data, &v); err != nil { return err } *s = Subscription(v) return nil }
go
func (s *Subscription) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type subscription Subscription var v subscription if err := json.Unmarshal(data, &v); err != nil { return err } *s = Subscription(v) return nil }
[ "func", "(", "s", "*", "Subscription", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "s", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}"...
// UnmarshalJSON handles deserialization of a Subscription. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Subscription", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/sub.go#L194-L208
26,327
stripe/stripe-go
order/client.go
Pay
func Pay(id string, params *stripe.OrderPayParams) (*stripe.Order, error) { return getC().Pay(id, params) }
go
func Pay(id string, params *stripe.OrderPayParams) (*stripe.Order, error) { return getC().Pay(id, params) }
[ "func", "Pay", "(", "id", "string", ",", "params", "*", "stripe", ".", "OrderPayParams", ")", "(", "*", "stripe", ".", "Order", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Pay", "(", "id", ",", "params", ")", "\n", "}" ]
// Pay pays an order.
[ "Pay", "pays", "an", "order", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/order/client.go#L42-L44
26,328
stripe/stripe-go
issuing/dispute/client.go
Get
func Get(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().Get(id, params) }
go
func Get(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().Get(id, params) }
[ "func", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "IssuingDisputeParams", ")", "(", "*", "stripe", ".", "IssuingDispute", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Get", "(", "id", ",", "params", ")", "\n", "}" ]
// Get returns the details of an issuing dispute.
[ "Get", "returns", "the", "details", "of", "an", "issuing", "dispute", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing/dispute/client.go#L32-L34
26,329
stripe/stripe-go
issuing/authorization/client.go
Get
func (c Client) Get(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s", id) authorization := &stripe.IssuingAuthorization{} err := c.B.Call(http.MethodGet, path, c.Key, params, authorization) return authorization...
go
func (c Client) Get(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s", id) authorization := &stripe.IssuingAuthorization{} err := c.B.Call(http.MethodGet, path, c.Key, params, authorization) return authorization...
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "IssuingAuthorizationParams", ")", "(", "*", "stripe", ".", "IssuingAuthorization", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", ...
// Get returns the details of an issuing authorization.
[ "Get", "returns", "the", "details", "of", "an", "issuing", "authorization", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing/authorization/client.go#L51-L56
26,330
stripe/stripe-go
issuing/authorization/client.go
Update
func Update(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().Update(id, params) }
go
func Update(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().Update(id, params) }
[ "func", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "IssuingAuthorizationParams", ")", "(", "*", "stripe", ".", "IssuingAuthorization", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Update", "(", "id", ",", "params", ")"...
// Update updates an issuing authorization.
[ "Update", "updates", "an", "issuing", "authorization", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing/authorization/client.go#L59-L61
26,331
stripe/stripe-go
refund.go
UnmarshalJSON
func (r *Refund) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type refund Refund var v refund if err := json.Unmarshal(data, &v); err != nil { return err } *r = Refund(v) return nil }
go
func (r *Refund) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type refund Refund var v refund if err := json.Unmarshal(data, &v); err != nil { return err } *r = Refund(v) return nil }
[ "func", "(", "r", "*", "Refund", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "r", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "\...
// UnmarshalJSON handles deserialization of a Refund. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Refund", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/refund.go#L74-L88
26,332
stripe/stripe-go
fee.go
UnmarshalJSON
func (f *ApplicationFee) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { f.ID = id return nil } type applicationFee ApplicationFee var v applicationFee if err := json.Unmarshal(data, &v); err != nil { return err } *f = ApplicationFee(v) return nil }
go
func (f *ApplicationFee) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { f.ID = id return nil } type applicationFee ApplicationFee var v applicationFee if err := json.Unmarshal(data, &v); err != nil { return err } *f = ApplicationFee(v) return nil }
[ "func", "(", "f", "*", "ApplicationFee", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "f", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "...
// UnmarshalJSON handles deserialization of an ApplicationFee. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "ApplicationFee", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/fee.go#L47-L61
26,333
stripe/stripe-go
source.go
AppendTo
func (p *SourceObjectParams) AppendTo(body *form.Values, keyParts []string) { if len(p.TypeData) > 0 && p.Type == nil { panic("You can not fill TypeData if you don't explicitly set Type") } for k, vs := range p.TypeData { body.Add(form.FormatKey(append(keyParts, StringValue(p.Type), k)), vs) } }
go
func (p *SourceObjectParams) AppendTo(body *form.Values, keyParts []string) { if len(p.TypeData) > 0 && p.Type == nil { panic("You can not fill TypeData if you don't explicitly set Type") } for k, vs := range p.TypeData { body.Add(form.FormatKey(append(keyParts, StringValue(p.Type), k)), vs) } }
[ "func", "(", "p", "*", "SourceObjectParams", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "if", "len", "(", "p", ".", "TypeData", ")", ">", "0", "&&", "p", ".", "Type", "==", "nil", "{",...
// AppendTo implements custom encoding logic for SourceObjectParams so that the special // "TypeData" value for is sent as the correct parameter based on the Source type
[ "AppendTo", "implements", "custom", "encoding", "logic", "for", "SourceObjectParams", "so", "that", "the", "special", "TypeData", "value", "for", "is", "sent", "as", "the", "correct", "parameter", "based", "on", "the", "Source", "type" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/source.go#L250-L258
26,334
stripe/stripe-go
webhookendpoint.go
UnmarshalJSON
func (c *WebhookEndpoint) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type endpoint WebhookEndpoint var v endpoint if err := json.Unmarshal(data, &v); err != nil { return err } *c = WebhookEndpoint(v) return nil }
go
func (c *WebhookEndpoint) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type endpoint WebhookEndpoint var v endpoint if err := json.Unmarshal(data, &v); err != nil { return err } *c = WebhookEndpoint(v) return nil }
[ "func", "(", "c", "*", "WebhookEndpoint", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "c", ".", "ID", "=", "id", "\n", "return", "nil", "\n", ...
// UnmarshalJSON handles deserialization of a WebhookEndpoint. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "WebhookEndpoint", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/webhookendpoint.go#L53-L67
26,335
stripe/stripe-go
paymentintent.go
UnmarshalJSON
func (p *PaymentIntent) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { p.ID = id return nil } type paymentintent PaymentIntent var v paymentintent if err := json.Unmarshal(data, &v); err != nil { return err } *p = PaymentIntent(v) return nil }
go
func (p *PaymentIntent) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { p.ID = id return nil } type paymentintent PaymentIntent var v paymentintent if err := json.Unmarshal(data, &v); err != nil { return err } *p = PaymentIntent(v) return nil }
[ "func", "(", "p", "*", "PaymentIntent", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "p", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}...
// UnmarshalJSON handles deserialization of a Payment Intent. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Payment", "Intent", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expande...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentintent.go#L201-L215
26,336
stripe/stripe-go
issuing/transaction/client.go
Get
func (c Client) Get(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath("/v1/issuing/transactions/%s", id) transaction := &stripe.IssuingTransaction{} err := c.B.Call(http.MethodGet, path, c.Key, params, transaction) return transaction, err }
go
func (c Client) Get(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath("/v1/issuing/transactions/%s", id) transaction := &stripe.IssuingTransaction{} err := c.B.Call(http.MethodGet, path, c.Key, params, transaction) return transaction, err }
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "IssuingTransactionParams", ")", "(", "*", "stripe", ".", "IssuingTransaction", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"...
// Get returns the details of an issuing transaction.
[ "Get", "returns", "the", "details", "of", "an", "issuing", "transaction", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing/transaction/client.go#L25-L30
26,337
stripe/stripe-go
issuing/transaction/client.go
Update
func Update(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { return getC().Update(id, params) }
go
func Update(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { return getC().Update(id, params) }
[ "func", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "IssuingTransactionParams", ")", "(", "*", "stripe", ".", "IssuingTransaction", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Update", "(", "id", ",", "params", ")", ...
// Update updates an issuing transaction.
[ "Update", "updates", "an", "issuing", "transaction", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing/transaction/client.go#L33-L35
26,338
stripe/stripe-go
creditnote/client.go
VoidCreditNote
func VoidCreditNote(id string, params *stripe.CreditNoteVoidParams) (*stripe.CreditNote, error) { return getC().VoidCreditNote(id, params) }
go
func VoidCreditNote(id string, params *stripe.CreditNoteVoidParams) (*stripe.CreditNote, error) { return getC().VoidCreditNote(id, params) }
[ "func", "VoidCreditNote", "(", "id", "string", ",", "params", "*", "stripe", ".", "CreditNoteVoidParams", ")", "(", "*", "stripe", ".", "CreditNote", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "VoidCreditNote", "(", "id", ",", "params", ")"...
// VoidCreditNote voids a credit note.
[ "VoidCreditNote", "voids", "a", "credit", "note", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/creditnote/client.go#L76-L78
26,339
stripe/stripe-go
issuing_cardholder.go
UnmarshalJSON
func (i *IssuingCardholder) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingCardholder IssuingCardholder var v issuingCardholder if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingCardholder(v) return nil }
go
func (i *IssuingCardholder) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingCardholder IssuingCardholder var v issuingCardholder if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingCardholder(v) return nil }
[ "func", "(", "i", "*", "IssuingCardholder", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "\n", ...
// UnmarshalJSON handles deserialization of an IssuingCardholder. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "IssuingCardholder", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing_cardholder.go#L86-L100
26,340
stripe/stripe-go
person/client.go
New
func New(params *stripe.PersonParams) (*stripe.Person, error) { return getC().New(params) }
go
func New(params *stripe.PersonParams) (*stripe.Person, error) { return getC().New(params) }
[ "func", "New", "(", "params", "*", "stripe", ".", "PersonParams", ")", "(", "*", "stripe", ".", "Person", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "New", "(", "params", ")", "\n", "}" ]
// New creates a new account person.
[ "New", "creates", "a", "new", "account", "person", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/person/client.go#L19-L21
26,341
stripe/stripe-go
person/client.go
Get
func (c Client) Get(id string, params *stripe.PersonParams) (*stripe.Person, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil, and params.Account must be set") } path := stripe.FormatURLPath("/v1/accounts/%s/persons/%s", stripe.StringValue(params.Account), id) person := &stripe.Person{}...
go
func (c Client) Get(id string, params *stripe.PersonParams) (*stripe.Person, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil, and params.Account must be set") } path := stripe.FormatURLPath("/v1/accounts/%s/persons/%s", stripe.StringValue(params.Account), id) person := &stripe.Person{}...
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "PersonParams", ")", "(", "*", "stripe", ".", "Person", ",", "error", ")", "{", "if", "params", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "E...
// Get returns the details of a account person.
[ "Get", "returns", "the", "details", "of", "a", "account", "person", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/person/client.go#L37-L47
26,342
stripe/stripe-go
client/api.go
New
func New(key string, backends *stripe.Backends) *API { api := API{} api.Init(key, backends) return &api }
go
func New(key string, backends *stripe.Backends) *API { api := API{} api.Init(key, backends) return &api }
[ "func", "New", "(", "key", "string", ",", "backends", "*", "stripe", ".", "Backends", ")", "*", "API", "{", "api", ":=", "API", "{", "}", "\n", "api", ".", "Init", "(", "key", ",", "backends", ")", "\n", "return", "&", "api", "\n", "}" ]
// New creates a new Stripe client with the appropriate secret key // as well as providing the ability to override the backends as needed.
[ "New", "creates", "a", "new", "Stripe", "client", "with", "the", "appropriate", "secret", "key", "as", "well", "as", "providing", "the", "ability", "to", "override", "the", "backends", "as", "needed", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/client/api.go#L282-L286
26,343
stripe/stripe-go
reversal.go
UnmarshalJSON
func (r *Reversal) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type reversal Reversal var v reversal if err := json.Unmarshal(data, &v); err != nil { return err } *r = Reversal(v) return nil }
go
func (r *Reversal) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type reversal Reversal var v reversal if err := json.Unmarshal(data, &v); err != nil { return err } *r = Reversal(v) return nil }
[ "func", "(", "r", "*", "Reversal", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "r", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", ...
// UnmarshalJSON handles deserialization of a Reversal. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Reversal", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/reversal.go#L43-L57
26,344
stripe/stripe-go
recipient.go
AppendTo
func (p *RecipientParams) AppendTo(body *form.Values, keyParts []string) { if p.BankAccount != nil { if p.BankAccount.Token != nil { body.Add("bank_account", StringValue(p.BankAccount.Token)) } else { form.AppendToPrefixed(body, p.BankAccount, append(keyParts, "bank_account")) } } }
go
func (p *RecipientParams) AppendTo(body *form.Values, keyParts []string) { if p.BankAccount != nil { if p.BankAccount.Token != nil { body.Add("bank_account", StringValue(p.BankAccount.Token)) } else { form.AppendToPrefixed(body, p.BankAccount, append(keyParts, "bank_account")) } } }
[ "func", "(", "p", "*", "RecipientParams", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "if", "p", ".", "BankAccount", "!=", "nil", "{", "if", "p", ".", "BankAccount", ".", "Token", "!=", "...
// AppendTo implements some custom behavior around a recipient's bank account. // This was probably the wrong way to go about this, but grandfather the // behavior for the time being.
[ "AppendTo", "implements", "some", "custom", "behavior", "around", "a", "recipient", "s", "bank", "account", ".", "This", "was", "probably", "the", "wrong", "way", "to", "go", "about", "this", "but", "grandfather", "the", "behavior", "for", "the", "time", "be...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/recipient.go#L37-L45
26,345
stripe/stripe-go
recipient.go
UnmarshalJSON
func (r *Recipient) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type recipient Recipient var v recipient if err := json.Unmarshal(data, &v); err != nil { return err } *r = Recipient(v) return nil }
go
func (r *Recipient) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type recipient Recipient var v recipient if err := json.Unmarshal(data, &v); err != nil { return err } *r = Recipient(v) return nil }
[ "func", "(", "r", "*", "Recipient", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "r", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", ...
// UnmarshalJSON handles deserialization of a Recipient. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Recipient", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/recipient.go#L81-L95
26,346
stripe/stripe-go
charge/client.go
Get
func Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().Get(id, params) }
go
func Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().Get(id, params) }
[ "func", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "ChargeParams", ")", "(", "*", "stripe", ".", "Charge", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Get", "(", "id", ",", "params", ")", "\n", "}" ]
// Get retrieves a charge.
[ "Get", "retrieves", "a", "charge", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/charge/client.go#L32-L34
26,347
stripe/stripe-go
invoiceitem.go
UnmarshalJSON
func (i *InvoiceItem) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type invoiceItem InvoiceItem var v invoiceItem if err := json.Unmarshal(data, &v); err != nil { return err } *i = InvoiceItem(v) return nil }
go
func (i *InvoiceItem) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type invoiceItem InvoiceItem var v invoiceItem if err := json.Unmarshal(data, &v); err != nil { return err } *i = InvoiceItem(v) return nil }
[ "func", "(", "i", "*", "InvoiceItem", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}",...
// UnmarshalJSON handles deserialization of an InvoiceItem. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "InvoiceItem", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoiceitem.go#L71-L85
26,348
stripe/stripe-go
event.go
GetObjectValue
func (e *Event) GetObjectValue(keys ...string) string { return getValue(e.Data.Object, keys) }
go
func (e *Event) GetObjectValue(keys ...string) string { return getValue(e.Data.Object, keys) }
[ "func", "(", "e", "*", "Event", ")", "GetObjectValue", "(", "keys", "...", "string", ")", "string", "{", "return", "getValue", "(", "e", ".", "Data", ".", "Object", ",", "keys", ")", "\n", "}" ]
// GetObjectValue returns the value from the e.Data.Object bag based on the keys hierarchy.
[ "GetObjectValue", "returns", "the", "value", "from", "the", "e", ".", "Data", ".", "Object", "bag", "based", "on", "the", "keys", "hierarchy", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/event.go#L68-L70
26,349
stripe/stripe-go
event.go
GetPreviousValue
func (e *Event) GetPreviousValue(keys ...string) string { return getValue(e.Data.PreviousAttributes, keys) }
go
func (e *Event) GetPreviousValue(keys ...string) string { return getValue(e.Data.PreviousAttributes, keys) }
[ "func", "(", "e", "*", "Event", ")", "GetPreviousValue", "(", "keys", "...", "string", ")", "string", "{", "return", "getValue", "(", "e", ".", "Data", ".", "PreviousAttributes", ",", "keys", ")", "\n", "}" ]
// GetPreviousValue returns the value from the e.Data.Prev bag based on the keys hierarchy.
[ "GetPreviousValue", "returns", "the", "value", "from", "the", "e", ".", "Data", ".", "Prev", "bag", "based", "on", "the", "keys", "hierarchy", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/event.go#L73-L75
26,350
stripe/stripe-go
event.go
UnmarshalJSON
func (e *EventData) UnmarshalJSON(data []byte) error { type eventdata EventData var ee eventdata err := json.Unmarshal(data, &ee) if err != nil { return err } *e = EventData(ee) return json.Unmarshal(e.Raw, &e.Object) }
go
func (e *EventData) UnmarshalJSON(data []byte) error { type eventdata EventData var ee eventdata err := json.Unmarshal(data, &ee) if err != nil { return err } *e = EventData(ee) return json.Unmarshal(e.Raw, &e.Object) }
[ "func", "(", "e", "*", "EventData", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "type", "eventdata", "EventData", "\n", "var", "ee", "eventdata", "\n", "err", ":=", "json", ".", "Unmarshal", "(", "data", ",", "&", "ee", ")...
// UnmarshalJSON handles deserialization of the EventData. // This custom unmarshaling exists so that we can keep both the map and raw data.
[ "UnmarshalJSON", "handles", "deserialization", "of", "the", "EventData", ".", "This", "custom", "unmarshaling", "exists", "so", "that", "we", "can", "keep", "both", "the", "map", "and", "raw", "data", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/event.go#L79-L89
26,351
stripe/stripe-go
event.go
getValue
func getValue(m map[string]interface{}, keys []string) string { node := m[keys[0]] for i := 1; i < len(keys); i++ { key := keys[i] sliceNode, ok := node.([]interface{}) if ok { intKey, err := strconv.Atoi(key) if err != nil { panic(fmt.Sprintf( "Cannot access nested slice element with non-integ...
go
func getValue(m map[string]interface{}, keys []string) string { node := m[keys[0]] for i := 1; i < len(keys); i++ { key := keys[i] sliceNode, ok := node.([]interface{}) if ok { intKey, err := strconv.Atoi(key) if err != nil { panic(fmt.Sprintf( "Cannot access nested slice element with non-integ...
[ "func", "getValue", "(", "m", "map", "[", "string", "]", "interface", "{", "}", ",", "keys", "[", "]", "string", ")", "string", "{", "node", ":=", "m", "[", "keys", "[", "0", "]", "]", "\n\n", "for", "i", ":=", "1", ";", "i", "<", "len", "(",...
// getValue returns the value from the m map based on the keys.
[ "getValue", "returns", "the", "value", "from", "the", "m", "map", "based", "on", "the", "keys", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/event.go#L92-L125
26,352
stripe/stripe-go
bitcoinreceiver.go
UnmarshalJSON
func (r *BitcoinReceiver) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type bitcoinReceiver BitcoinReceiver var v bitcoinReceiver if err := json.Unmarshal(data, &v); err != nil { return err } *r = BitcoinReceiver(v) return nil }
go
func (r *BitcoinReceiver) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type bitcoinReceiver BitcoinReceiver var v bitcoinReceiver if err := json.Unmarshal(data, &v); err != nil { return err } *r = BitcoinReceiver(v) return nil }
[ "func", "(", "r", "*", "BitcoinReceiver", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "r", ".", "ID", "=", "id", "\n", "return", "nil", "\n", ...
// UnmarshalJSON handles deserialization of a BitcoinReceiver. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "BitcoinReceiver", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/bitcoinreceiver.go#L49-L63
26,353
stripe/stripe-go
file.go
GetBody
func (f *FileParams) GetBody() (*bytes.Buffer, string, error) { body := &bytes.Buffer{} writer := multipart.NewWriter(body) if f.Purpose != nil { err := writer.WriteField("purpose", StringValue(f.Purpose)) if err != nil { return nil, "", err } } if f.FileReader != nil && f.Filename != nil { part, err ...
go
func (f *FileParams) GetBody() (*bytes.Buffer, string, error) { body := &bytes.Buffer{} writer := multipart.NewWriter(body) if f.Purpose != nil { err := writer.WriteField("purpose", StringValue(f.Purpose)) if err != nil { return nil, "", err } } if f.FileReader != nil && f.Filename != nil { part, err ...
[ "func", "(", "f", "*", "FileParams", ")", "GetBody", "(", ")", "(", "*", "bytes", ".", "Buffer", ",", "string", ",", "error", ")", "{", "body", ":=", "&", "bytes", ".", "Buffer", "{", "}", "\n", "writer", ":=", "multipart", ".", "NewWriter", "(", ...
// GetBody gets an appropriate multipart form payload to use in a request body // to create a new file.
[ "GetBody", "gets", "an", "appropriate", "multipart", "form", "payload", "to", "use", "in", "a", "request", "body", "to", "create", "a", "new", "file", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/file.go#L84-L129
26,354
stripe/stripe-go
file.go
UnmarshalJSON
func (f *File) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { f.ID = id return nil } type file File var v file if err := json.Unmarshal(data, &v); err != nil { return err } *f = File(v) return nil }
go
func (f *File) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { f.ID = id return nil } type file File var v file if err := json.Unmarshal(data, &v); err != nil { return err } *f = File(v) return nil }
[ "func", "(", "f", "*", "File", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "f", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "\n\...
// UnmarshalJSON handles deserialization of a File. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "File", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/file.go#L134-L148
26,355
stripe/stripe-go
card/client.go
List
func (c Client) List(listParams *stripe.CardListParams) *Iter { var path string var outerErr error // Because the external accounts and sources endpoints can return non-card // objects, CardListParam's `AppendTo` will add the filter `object=card` to // make sure that only cards come back with the response. if li...
go
func (c Client) List(listParams *stripe.CardListParams) *Iter { var path string var outerErr error // Because the external accounts and sources endpoints can return non-card // objects, CardListParam's `AppendTo` will add the filter `object=card` to // make sure that only cards come back with the response. if li...
[ "func", "(", "c", "Client", ")", "List", "(", "listParams", "*", "stripe", ".", "CardListParams", ")", "*", "Iter", "{", "var", "path", "string", "\n", "var", "outerErr", "error", "\n\n", "// Because the external accounts and sources endpoints can return non-card", ...
// List returns a list of cards.
[ "List", "returns", "a", "list", "of", "cards", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/card/client.go#L151-L188
26,356
stripe/stripe-go
application.go
UnmarshalJSON
func (a *Application) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { a.ID = id return nil } type application Application var v application if err := json.Unmarshal(data, &v); err != nil { return err } *a = Application(v) return nil }
go
func (a *Application) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { a.ID = id return nil } type application Application var v application if err := json.Unmarshal(data, &v); err != nil { return err } *a = Application(v) return nil }
[ "func", "(", "a", "*", "Application", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "a", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}",...
// UnmarshalJSON handles deserialization of an Application. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "Application", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/application.go#L14-L28
26,357
stripe/stripe-go
customer/client.go
Update
func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) cust := &stripe.Customer{} err := c.B.Call(http.MethodPost, path, c.Key, params, cust) return cust, err }
go
func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) cust := &stripe.Customer{} err := c.B.Call(http.MethodPost, path, c.Key, params, cust) return cust, err }
[ "func", "(", "c", "Client", ")", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "CustomerParams", ")", "(", "*", "stripe", ".", "Customer", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"", ",",...
// Update updates a customer's properties.
[ "Update", "updates", "a", "customer", "s", "properties", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/customer/client.go#L48-L53
26,358
stripe/stripe-go
customer/client.go
Del
func Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Del(id, params) }
go
func Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Del(id, params) }
[ "func", "Del", "(", "id", "string", ",", "params", "*", "stripe", ".", "CustomerParams", ")", "(", "*", "stripe", ".", "Customer", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Del", "(", "id", ",", "params", ")", "\n", "}" ]
// Del removes a customer.
[ "Del", "removes", "a", "customer", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/customer/client.go#L56-L58
26,359
stripe/stripe-go
paymentsource/client.go
New
func New(params *stripe.CustomerSourceParams) (*stripe.PaymentSource, error) { return getC().New(params) }
go
func New(params *stripe.CustomerSourceParams) (*stripe.PaymentSource, error) { return getC().New(params) }
[ "func", "New", "(", "params", "*", "stripe", ".", "CustomerSourceParams", ")", "(", "*", "stripe", ".", "PaymentSource", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "New", "(", "params", ")", "\n", "}" ]
// New creates a new source for a customer.
[ "New", "creates", "a", "new", "source", "for", "a", "customer", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/paymentsource/client.go#L19-L21
26,360
stripe/stripe-go
creditnote.go
UnmarshalJSON
func (i *CreditNote) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type note CreditNote var v note if err := json.Unmarshal(data, &v); err != nil { return err } *i = CreditNote(v) return nil }
go
func (i *CreditNote) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type note CreditNote var v note if err := json.Unmarshal(data, &v); err != nil { return err } *i = CreditNote(v) return nil }
[ "func", "(", "i", "*", "CreditNote", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", ...
// UnmarshalJSON handles deserialization of a CreditNote. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "CreditNote", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "."...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/creditnote.go#L89-L103
26,361
stripe/stripe-go
bitcointransaction.go
UnmarshalJSON
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 }
go
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 }
[ "func", "(", "bt", "*", "BitcoinTransaction", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "bt", ".", "ID", "=", "id", "\n", "return", "nil", "\n...
// 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.
[ "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...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/bitcointransaction.go#L35-L49
26,362
stripe/stripe-go
invoice.go
UnmarshalJSON
func (i *Invoice) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type invoice Invoice var v invoice if err := json.Unmarshal(data, &v); err != nil { return err } *i = Invoice(v) return nil }
go
func (i *Invoice) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type invoice Invoice var v invoice if err := json.Unmarshal(data, &v); err != nil { return err } *i = Invoice(v) return nil }
[ "func", "(", "i", "*", "Invoice", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "...
// UnmarshalJSON handles deserialization of an Invoice. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "Invoice", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoice.go#L340-L354
26,363
stripe/stripe-go
params.go
AppendTo
func (v ExtraValues) AppendTo(body *form.Values, keyParts []string) { for k, vs := range v.Values { for _, v := range vs { body.Add(form.FormatKey(append(keyParts, k)), v) } } }
go
func (v ExtraValues) AppendTo(body *form.Values, keyParts []string) { for k, vs := range v.Values { for _, v := range vs { body.Add(form.FormatKey(append(keyParts, k)), v) } } }
[ "func", "(", "v", "ExtraValues", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "for", "k", ",", "vs", ":=", "range", "v", ".", "Values", "{", "for", "_", ",", "v", ":=", "range", "vs", ...
// AppendTo implements custom form encoding for extra parameter values.
[ "AppendTo", "implements", "custom", "form", "encoding", "for", "extra", "parameter", "values", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/params.go#L37-L43
26,364
stripe/stripe-go
params.go
AddFilter
func (f *Filters) AddFilter(key, op, value string) { filter := &filter{Key: key, Op: op, Val: value} f.f = append(f.f, filter) }
go
func (f *Filters) AddFilter(key, op, value string) { filter := &filter{Key: key, Op: op, Val: value} f.f = append(f.f, filter) }
[ "func", "(", "f", "*", "Filters", ")", "AddFilter", "(", "key", ",", "op", ",", "value", "string", ")", "{", "filter", ":=", "&", "filter", "{", "Key", ":", "key", ",", "Op", ":", "op", ",", "Val", ":", "value", "}", "\n", "f", ".", "f", "=",...
// AddFilter adds a new filter with a given key, op and value.
[ "AddFilter", "adds", "a", "new", "filter", "with", "a", "given", "key", "op", "and", "value", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/params.go#L51-L54
26,365
stripe/stripe-go
params.go
AppendTo
func (f Filters) AppendTo(body *form.Values, keyParts []string) { if len(f.f) > 0 { for _, v := range f.f { if len(v.Op) > 0 { body.Add(form.FormatKey(append(keyParts, v.Key, v.Op)), v.Val) } else { body.Add(form.FormatKey(append(keyParts, v.Key)), v.Val) } } } }
go
func (f Filters) AppendTo(body *form.Values, keyParts []string) { if len(f.f) > 0 { for _, v := range f.f { if len(v.Op) > 0 { body.Add(form.FormatKey(append(keyParts, v.Key, v.Op)), v.Val) } else { body.Add(form.FormatKey(append(keyParts, v.Key)), v.Val) } } } }
[ "func", "(", "f", "Filters", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "if", "len", "(", "f", ".", "f", ")", ">", "0", "{", "for", "_", ",", "v", ":=", "range", "f", ".", "f", "...
// AppendTo implements custom form encoding for filters.
[ "AppendTo", "implements", "custom", "form", "encoding", "for", "filters", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/params.go#L57-L67
26,366
stripe/stripe-go
params.go
ToParams
func (p *ListParams) ToParams() *Params { return &Params{ Context: p.Context, StripeAccount: p.StripeAccount, } }
go
func (p *ListParams) ToParams() *Params { return &Params{ Context: p.Context, StripeAccount: p.StripeAccount, } }
[ "func", "(", "p", "*", "ListParams", ")", "ToParams", "(", ")", "*", "Params", "{", "return", "&", "Params", "{", "Context", ":", "p", ".", "Context", ",", "StripeAccount", ":", "p", ".", "StripeAccount", ",", "}", "\n", "}" ]
// ToParams converts a ListParams to a Params by moving over any fields that // have valid targets in the new type. This is useful because fields in // Params can be injected directly into an http.Request while generally // ListParams is only used to build a set of parameters.
[ "ToParams", "converts", "a", "ListParams", "to", "a", "Params", "by", "moving", "over", "any", "fields", "that", "have", "valid", "targets", "in", "the", "new", "type", ".", "This", "is", "useful", "because", "fields", "in", "Params", "can", "be", "injecte...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/params.go#L139-L144
26,367
stripe/stripe-go
params.go
AddExtra
func (p *Params) AddExtra(key, value string) { if p.Extra == nil { p.Extra = &ExtraValues{Values: make(url.Values)} } p.Extra.Add(key, value) }
go
func (p *Params) AddExtra(key, value string) { if p.Extra == nil { p.Extra = &ExtraValues{Values: make(url.Values)} } p.Extra.Add(key, value) }
[ "func", "(", "p", "*", "Params", ")", "AddExtra", "(", "key", ",", "value", "string", ")", "{", "if", "p", ".", "Extra", "==", "nil", "{", "p", ".", "Extra", "=", "&", "ExtraValues", "{", "Values", ":", "make", "(", "url", ".", "Values", ")", "...
// AddExtra adds a new arbitrary key-value pair to the request data
[ "AddExtra", "adds", "a", "new", "arbitrary", "key", "-", "value", "pair", "to", "the", "request", "data" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/params.go#L188-L194
26,368
stripe/stripe-go
params.go
AddMetadata
func (p *Params) AddMetadata(key, value string) { if p.Metadata == nil { p.Metadata = make(map[string]string) } p.Metadata[key] = value }
go
func (p *Params) AddMetadata(key, value string) { if p.Metadata == nil { p.Metadata = make(map[string]string) } p.Metadata[key] = value }
[ "func", "(", "p", "*", "Params", ")", "AddMetadata", "(", "key", ",", "value", "string", ")", "{", "if", "p", ".", "Metadata", "==", "nil", "{", "p", ".", "Metadata", "=", "make", "(", "map", "[", "string", "]", "string", ")", "\n", "}", "\n\n", ...
// AddMetadata adds a new key-value pair to the Metadata.
[ "AddMetadata", "adds", "a", "new", "key", "-", "value", "pair", "to", "the", "Metadata", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/params.go#L197-L203
26,369
stripe/stripe-go
params.go
NewIdempotencyKey
func NewIdempotencyKey() string { now := time.Now().UnixNano() buf := make([]byte, 4) rand.Read(buf) return fmt.Sprintf("%v_%v", now, base64.URLEncoding.EncodeToString(buf)[:6]) }
go
func NewIdempotencyKey() string { now := time.Now().UnixNano() buf := make([]byte, 4) rand.Read(buf) return fmt.Sprintf("%v_%v", now, base64.URLEncoding.EncodeToString(buf)[:6]) }
[ "func", "NewIdempotencyKey", "(", ")", "string", "{", "now", ":=", "time", ".", "Now", "(", ")", ".", "UnixNano", "(", ")", "\n", "buf", ":=", "make", "(", "[", "]", "byte", ",", "4", ")", "\n", "rand", ".", "Read", "(", "buf", ")", "\n", "retu...
// // Public functions // // NewIdempotencyKey generates a new idempotency key that // can be used on a request.
[ "Public", "functions", "NewIdempotencyKey", "generates", "a", "new", "idempotency", "key", "that", "can", "be", "used", "on", "a", "request", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/params.go#L254-L259
26,370
stripe/stripe-go
iter.go
Next
func (it *Iter) Next() bool { if len(it.values) == 0 && it.meta.HasMore && !it.listParams.Single { // determine if we're moving forward or backwards in paging if it.listParams.EndingBefore != nil { it.listParams.EndingBefore = String(listItemID(it.cur)) it.formValues.Set(EndingBefore, *it.listParams.EndingBe...
go
func (it *Iter) Next() bool { if len(it.values) == 0 && it.meta.HasMore && !it.listParams.Single { // determine if we're moving forward or backwards in paging if it.listParams.EndingBefore != nil { it.listParams.EndingBefore = String(listItemID(it.cur)) it.formValues.Set(EndingBefore, *it.listParams.EndingBe...
[ "func", "(", "it", "*", "Iter", ")", "Next", "(", ")", "bool", "{", "if", "len", "(", "it", ".", "values", ")", "==", "0", "&&", "it", ".", "meta", ".", "HasMore", "&&", "!", "it", ".", "listParams", ".", "Single", "{", "// determine if we're movin...
// Next advances the Iter to the next item in the list, // which will then be available // through the Current method. // It returns false when the iterator stops // at the end of the list.
[ "Next", "advances", "the", "Iter", "to", "the", "next", "item", "in", "the", "list", "which", "will", "then", "be", "available", "through", "the", "Current", "method", ".", "It", "returns", "false", "when", "the", "iterator", "stops", "at", "the", "end", ...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/iter.go#L55-L73
26,371
stripe/stripe-go
iter.go
GetIter
func GetIter(container ListParamsContainer, query Query) *Iter { var listParams *ListParams formValues := &form.Values{} if container != nil { reflectValue := reflect.ValueOf(container) // See the comment on Call in stripe.go. if reflectValue.Kind() == reflect.Ptr && !reflectValue.IsNil() { listParams = c...
go
func GetIter(container ListParamsContainer, query Query) *Iter { var listParams *ListParams formValues := &form.Values{} if container != nil { reflectValue := reflect.ValueOf(container) // See the comment on Call in stripe.go. if reflectValue.Kind() == reflect.Ptr && !reflectValue.IsNil() { listParams = c...
[ "func", "GetIter", "(", "container", "ListParamsContainer", ",", "query", "Query", ")", "*", "Iter", "{", "var", "listParams", "*", "ListParams", "\n", "formValues", ":=", "&", "form", ".", "Values", "{", "}", "\n\n", "if", "container", "!=", "nil", "{", ...
// // Public functions // // GetIter returns a new Iter for a given query and its options.
[ "Public", "functions", "GetIter", "returns", "a", "new", "Iter", "for", "a", "given", "query", "and", "its", "options", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/iter.go#L93-L119
26,372
stripe/stripe-go
orderreturn.go
UnmarshalJSON
func (r *OrderReturn) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type orderReturn OrderReturn var v orderReturn if err := json.Unmarshal(data, &v); err != nil { return err } *r = OrderReturn(v) return nil }
go
func (r *OrderReturn) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type orderReturn OrderReturn var v orderReturn if err := json.Unmarshal(data, &v); err != nil { return err } *r = OrderReturn(v) return nil }
[ "func", "(", "r", "*", "OrderReturn", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "r", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}",...
// UnmarshalJSON handles deserialization of an OrderReturn. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "OrderReturn", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/orderreturn.go#L35-L49
26,373
stripe/stripe-go
charge.go
SetSource
func (p *ChargeParams) SetSource(sp interface{}) error { source, err := SourceParamsFor(sp) p.Source = source return err }
go
func (p *ChargeParams) SetSource(sp interface{}) error { source, err := SourceParamsFor(sp) p.Source = source return err }
[ "func", "(", "p", "*", "ChargeParams", ")", "SetSource", "(", "sp", "interface", "{", "}", ")", "error", "{", "source", ",", "err", ":=", "SourceParamsFor", "(", "sp", ")", "\n", "p", ".", "Source", "=", "source", "\n", "return", "err", "\n", "}" ]
// SetSource adds valid sources to a ChargeParams object, // returning an error for unsupported sources.
[ "SetSource", "adds", "valid", "sources", "to", "a", "ChargeParams", "object", "returning", "an", "error", "for", "unsupported", "sources", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/charge.go#L112-L116
26,374
stripe/stripe-go
charge.go
UnmarshalJSON
func (c *Charge) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type charge Charge var v charge if err := json.Unmarshal(data, &v); err != nil { return err } *c = Charge(v) return nil }
go
func (c *Charge) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type charge Charge var v charge if err := json.Unmarshal(data, &v); err != nil { return err } *c = Charge(v) return nil }
[ "func", "(", "c", "*", "Charge", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "c", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "\...
// UnmarshalJSON handles deserialization of a charge. // This custom unmarshaling is needed because the resulting // property may be an ID or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "charge", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "ID", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/charge.go#L475-L489
26,375
stripe/stripe-go
charge.go
UnmarshalJSON
func (c *ChargeOutcomeRule) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type chargeOutcomeRule ChargeOutcomeRule var v chargeOutcomeRule if err := json.Unmarshal(data, &v); err != nil { return err } *c = ChargeOutcomeRule(v) return nil }
go
func (c *ChargeOutcomeRule) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { c.ID = id return nil } type chargeOutcomeRule ChargeOutcomeRule var v chargeOutcomeRule if err := json.Unmarshal(data, &v); err != nil { return err } *c = ChargeOutcomeRule(v) return nil }
[ "func", "(", "c", "*", "ChargeOutcomeRule", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "c", ".", "ID", "=", "id", "\n", "return", "nil", "\n", ...
// UnmarshalJSON handles deserialization of a ChargeOutcomeRule. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "ChargeOutcomeRule", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded"...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/charge.go#L536-L550
26,376
stripe/stripe-go
product/client.go
Get
func (c Client) Get(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) p := &stripe.Product{} err := c.B.Call(http.MethodGet, path, c.Key, params, p) return p, err }
go
func (c Client) Get(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) p := &stripe.Product{} err := c.B.Call(http.MethodGet, path, c.Key, params, p) return p, err }
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "ProductParams", ")", "(", "*", "stripe", ".", "Product", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"", ",", "i...
// Get returns the details of a product.
[ "Get", "returns", "the", "details", "of", "a", "product", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/product/client.go#L47-L52
26,377
stripe/stripe-go
product/client.go
Del
func Del(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Del(id, params) }
go
func Del(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Del(id, params) }
[ "func", "Del", "(", "id", "string", ",", "params", "*", "stripe", ".", "ProductParams", ")", "(", "*", "stripe", ".", "Product", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Del", "(", "id", ",", "params", ")", "\n", "}" ]
// Del deletes a product
[ "Del", "deletes", "a", "product" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/product/client.go#L75-L77
26,378
stripe/stripe-go
issuing_authorization.go
UnmarshalJSON
func (i *IssuingAuthorization) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingAuthorization IssuingAuthorization var v issuingAuthorization if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingAuthorization(v) return nil }
go
func (i *IssuingAuthorization) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { i.ID = id return nil } type issuingAuthorization IssuingAuthorization var v issuingAuthorization if err := json.Unmarshal(data, &v); err != nil { return err } *i = IssuingAuthorization(v) return nil }
[ "func", "(", "i", "*", "IssuingAuthorization", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "i", ".", "ID", "=", "id", "\n", "return", "nil", "\n...
// UnmarshalJSON handles deserialization of an IssuingAuthorization. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "IssuingAuthorization", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expan...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/issuing_authorization.go#L154-L168
26,379
stripe/stripe-go
account.go
AppendTo
func (p *PayoutScheduleParams) AppendTo(body *form.Values, keyParts []string) { if BoolValue(p.DelayDaysMinimum) { body.Add(form.FormatKey(append(keyParts, "delay_days")), "minimum") } }
go
func (p *PayoutScheduleParams) AppendTo(body *form.Values, keyParts []string) { if BoolValue(p.DelayDaysMinimum) { body.Add(form.FormatKey(append(keyParts, "delay_days")), "minimum") } }
[ "func", "(", "p", "*", "PayoutScheduleParams", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "if", "BoolValue", "(", "p", ".", "DelayDaysMinimum", ")", "{", "body", ".", "Add", "(", "form", "...
// AppendTo implements custom encoding logic for PayoutScheduleParams // so that we can send a special value for `delay_days` field if needed.
[ "AppendTo", "implements", "custom", "encoding", "logic", "for", "PayoutScheduleParams", "so", "that", "we", "can", "send", "a", "special", "value", "for", "delay_days", "field", "if", "needed", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/account.go#L183-L187
26,380
stripe/stripe-go
account.go
AppendTo
func (p *AccountExternalAccountParams) AppendTo(body *form.Values, keyParts []string) { if p.Token != nil { body.Add(form.FormatKey(keyParts), StringValue(p.Token)) } else { body.Add(form.FormatKey(append(keyParts, "object")), "bank_account") } }
go
func (p *AccountExternalAccountParams) AppendTo(body *form.Values, keyParts []string) { if p.Token != nil { body.Add(form.FormatKey(keyParts), StringValue(p.Token)) } else { body.Add(form.FormatKey(append(keyParts, "object")), "bank_account") } }
[ "func", "(", "p", "*", "AccountExternalAccountParams", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "if", "p", ".", "Token", "!=", "nil", "{", "body", ".", "Add", "(", "form", ".", "FormatKe...
// AppendTo implements custom encoding logic for AccountExternalAccountParams // so that we can send the special required `object` field up along with the // other specified parameters or the token value.
[ "AppendTo", "implements", "custom", "encoding", "logic", "for", "AccountExternalAccountParams", "so", "that", "we", "can", "send", "the", "special", "required", "object", "field", "up", "along", "with", "the", "other", "specified", "parameters", "or", "the", "toke...
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/account.go#L256-L262
26,381
stripe/stripe-go
account.go
UnmarshalJSON
func (a *Account) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { a.ID = id return nil } type account Account var v account if err := json.Unmarshal(data, &v); err != nil { return err } *a = Account(v) return nil }
go
func (a *Account) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { a.ID = id return nil } type account Account var v account if err := json.Unmarshal(data, &v); err != nil { return err } *a = Account(v) return nil }
[ "func", "(", "a", "*", "Account", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "a", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "...
// UnmarshalJSON handles deserialization of an account. // This custom unmarshaling is needed because the resulting // property may be an ID or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "an", "account", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "ID", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/account.go#L399-L413
26,382
stripe/stripe-go
account.go
UnmarshalJSON
func (ea *ExternalAccount) UnmarshalJSON(data []byte) error { type externalAccount ExternalAccount var v externalAccount if err := json.Unmarshal(data, &v); err != nil { return err } var err error *ea = ExternalAccount(v) switch ea.Type { case ExternalAccountTypeBankAccount: err = json.Unmarshal(data, &ea...
go
func (ea *ExternalAccount) UnmarshalJSON(data []byte) error { type externalAccount ExternalAccount var v externalAccount if err := json.Unmarshal(data, &v); err != nil { return err } var err error *ea = ExternalAccount(v) switch ea.Type { case ExternalAccountTypeBankAccount: err = json.Unmarshal(data, &ea...
[ "func", "(", "ea", "*", "ExternalAccount", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "type", "externalAccount", "ExternalAccount", "\n", "var", "v", "externalAccount", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "d...
// UnmarshalJSON implements Unmarshaler.UnmarshalJSON.
[ "UnmarshalJSON", "implements", "Unmarshaler", ".", "UnmarshalJSON", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/account.go#L448-L466
26,383
stripe/stripe-go
review.go
UnmarshalJSON
func (r *Review) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type review Review var v review if err := json.Unmarshal(data, &v); err != nil { return err } *r = Review(v) return nil }
go
func (r *Review) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { r.ID = id return nil } type review Review var v review if err := json.Unmarshal(data, &v); err != nil { return err } *r = Review(v) return nil }
[ "func", "(", "r", "*", "Review", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "r", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "\...
// UnmarshalJSON handles deserialization of a Review. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Review", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/review.go#L57-L71
26,384
stripe/stripe-go
transfer.go
UnmarshalJSON
func (t *Transfer) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { t.ID = id return nil } type transfer Transfer var v transfer if err := json.Unmarshal(data, &v); err != nil { return err } *t = Transfer(v) return nil }
go
func (t *Transfer) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { t.ID = id return nil } type transfer Transfer var v transfer if err := json.Unmarshal(data, &v); err != nil { return err } *t = Transfer(v) return nil }
[ "func", "(", "t", "*", "Transfer", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "t", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", ...
// UnmarshalJSON handles deserialization of a Transfer. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Transfer", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/transfer.go#L77-L91
26,385
stripe/stripe-go
transfer.go
UnmarshalJSON
func (d *TransferDestination) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { d.ID = id return nil } type transferDestination TransferDestination var v transferDestination if err := json.Unmarshal(data, &v); err != nil { return err } *d = TransferDestination(v) return json.Unmarshal(...
go
func (d *TransferDestination) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { d.ID = id return nil } type transferDestination TransferDestination var v transferDestination if err := json.Unmarshal(data, &v); err != nil { return err } *d = TransferDestination(v) return json.Unmarshal(...
[ "func", "(", "d", "*", "TransferDestination", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "d", ".", "ID", "=", "id", "\n", "return", "nil", "\n"...
// UnmarshalJSON handles deserialization of a TransferDestination. // This custom unmarshaling is needed because the specific // type of destination it refers to is specified in the JSON
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "TransferDestination", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "specific", "type", "of", "destination", "it", "refers", "to", "is", "specified", "in", "the", "JSON" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/transfer.go#L96-L110
26,386
stripe/stripe-go
invoice/client.go
Pay
func Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice, error) { return getC().Pay(id, params) }
go
func Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice, error) { return getC().Pay(id, params) }
[ "func", "Pay", "(", "id", "string", ",", "params", "*", "stripe", ".", "InvoicePayParams", ")", "(", "*", "stripe", ".", "Invoice", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Pay", "(", "id", ",", "params", ")", "\n", "}" ]
// Pay pays an invoice.
[ "Pay", "pays", "an", "invoice", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoice/client.go#L56-L58
26,387
stripe/stripe-go
invoice/client.go
Update
func Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Update(id, params) }
go
func Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Update(id, params) }
[ "func", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "InvoiceParams", ")", "(", "*", "stripe", ".", "Invoice", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Update", "(", "id", ",", "params", ")", "\n", "}" ]
// Update updates an invoice.
[ "Update", "updates", "an", "invoice", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoice/client.go#L69-L71
26,388
stripe/stripe-go
invoice/client.go
ListLines
func (c Client) ListLines(listParams *stripe.InvoiceLineListParams) *LineIter { path := stripe.FormatURLPath("/v1/invoices/%s/lines", stripe.StringValue(listParams.ID)) return &LineIter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) { list := &stripe.Invoic...
go
func (c Client) ListLines(listParams *stripe.InvoiceLineListParams) *LineIter { path := stripe.FormatURLPath("/v1/invoices/%s/lines", stripe.StringValue(listParams.ID)) return &LineIter{stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListMeta, error) { list := &stripe.Invoic...
[ "func", "(", "c", "Client", ")", "ListLines", "(", "listParams", "*", "stripe", ".", "InvoiceLineListParams", ")", "*", "LineIter", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"", ",", "stripe", ".", "StringValue", "(", "listParams", "....
// ListLines returns a list of line items on an invoice.
[ "ListLines", "returns", "a", "list", "of", "line", "items", "on", "an", "invoice", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoice/client.go#L119-L132
26,389
stripe/stripe-go
invoice/client.go
FinalizeInvoice
func FinalizeInvoice(id string, params *stripe.InvoiceFinalizeParams) (*stripe.Invoice, error) { return getC().FinalizeInvoice(id, params) }
go
func FinalizeInvoice(id string, params *stripe.InvoiceFinalizeParams) (*stripe.Invoice, error) { return getC().FinalizeInvoice(id, params) }
[ "func", "FinalizeInvoice", "(", "id", "string", ",", "params", "*", "stripe", ".", "InvoiceFinalizeParams", ")", "(", "*", "stripe", ".", "Invoice", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "FinalizeInvoice", "(", "id", ",", "params", ")"...
// FinalizeInvoice finalizes an invoice.
[ "FinalizeInvoice", "finalizes", "an", "invoice", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoice/client.go#L135-L137
26,390
stripe/stripe-go
invoice/client.go
MarkUncollectible
func MarkUncollectible(id string, params *stripe.InvoiceMarkUncollectibleParams) (*stripe.Invoice, error) { return getC().MarkUncollectible(id, params) }
go
func MarkUncollectible(id string, params *stripe.InvoiceMarkUncollectibleParams) (*stripe.Invoice, error) { return getC().MarkUncollectible(id, params) }
[ "func", "MarkUncollectible", "(", "id", "string", ",", "params", "*", "stripe", ".", "InvoiceMarkUncollectibleParams", ")", "(", "*", "stripe", ".", "Invoice", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "MarkUncollectible", "(", "id", ",", "p...
// MarkUncollectible marks an invoice as uncollectible.
[ "MarkUncollectible", "marks", "an", "invoice", "as", "uncollectible", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoice/client.go#L148-L150
26,391
stripe/stripe-go
invoice/client.go
SendInvoice
func SendInvoice(id string, params *stripe.InvoiceSendParams) (*stripe.Invoice, error) { return getC().SendInvoice(id, params) }
go
func SendInvoice(id string, params *stripe.InvoiceSendParams) (*stripe.Invoice, error) { return getC().SendInvoice(id, params) }
[ "func", "SendInvoice", "(", "id", "string", ",", "params", "*", "stripe", ".", "InvoiceSendParams", ")", "(", "*", "stripe", ".", "Invoice", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "SendInvoice", "(", "id", ",", "params", ")", "\n", ...
// SendInvoice sends an invoice.
[ "SendInvoice", "sends", "an", "invoice", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoice/client.go#L161-L163
26,392
stripe/stripe-go
subschedule/client.go
Cancel
func Cancel(id string, params *stripe.SubscriptionScheduleCancelParams) (*stripe.SubscriptionSchedule, error) { return getC().Cancel(id, params) }
go
func Cancel(id string, params *stripe.SubscriptionScheduleCancelParams) (*stripe.SubscriptionSchedule, error) { return getC().Cancel(id, params) }
[ "func", "Cancel", "(", "id", "string", ",", "params", "*", "stripe", ".", "SubscriptionScheduleCancelParams", ")", "(", "*", "stripe", ".", "SubscriptionSchedule", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Cancel", "(", "id", ",", "params",...
// Cancel removes a subscription schedule.
[ "Cancel", "removes", "a", "subscription", "schedule", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/subschedule/client.go#L18-L20
26,393
stripe/stripe-go
subschedule/client.go
Update
func Update(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().Update(id, params) }
go
func Update(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().Update(id, params) }
[ "func", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "SubscriptionScheduleParams", ")", "(", "*", "stripe", ".", "SubscriptionSchedule", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Update", "(", "id", ",", "params", ")"...
// Update updates a subscription schedule's properties.
[ "Update", "updates", "a", "subscription", "schedule", "s", "properties", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/subschedule/client.go#L90-L92
26,394
stripe/stripe-go
refund/client.go
Get
func (c Client) Get(id string, params *stripe.RefundParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s", id) refund := &stripe.Refund{} err := c.B.Call(http.MethodGet, path, c.Key, params, refund) return refund, err }
go
func (c Client) Get(id string, params *stripe.RefundParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s", id) refund := &stripe.Refund{} err := c.B.Call(http.MethodGet, path, c.Key, params, refund) return refund, err }
[ "func", "(", "c", "Client", ")", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "RefundParams", ")", "(", "*", "stripe", ".", "Refund", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"", ",", "id"...
// Get returns the details of a refund.
[ "Get", "returns", "the", "details", "of", "a", "refund", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/refund/client.go#L35-L40
26,395
stripe/stripe-go
refund/client.go
Update
func Update(id string, params *stripe.RefundParams) (*stripe.Refund, error) { return getC().Update(id, params) }
go
func Update(id string, params *stripe.RefundParams) (*stripe.Refund, error) { return getC().Update(id, params) }
[ "func", "Update", "(", "id", "string", ",", "params", "*", "stripe", ".", "RefundParams", ")", "(", "*", "stripe", ".", "Refund", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Update", "(", "id", ",", "params", ")", "\n", "}" ]
// Update updates a refund's properties.
[ "Update", "updates", "a", "refund", "s", "properties", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/refund/client.go#L43-L45
26,396
stripe/stripe-go
plan.go
AppendTo
func (p *PlanTierParams) AppendTo(body *form.Values, keyParts []string) { if BoolValue(p.UpToInf) { body.Add(form.FormatKey(append(keyParts, "up_to")), "inf") } else { body.Add(form.FormatKey(append(keyParts, "up_to")), strconv.FormatInt(Int64Value(p.UpTo), 10)) } }
go
func (p *PlanTierParams) AppendTo(body *form.Values, keyParts []string) { if BoolValue(p.UpToInf) { body.Add(form.FormatKey(append(keyParts, "up_to")), "inf") } else { body.Add(form.FormatKey(append(keyParts, "up_to")), strconv.FormatInt(Int64Value(p.UpTo), 10)) } }
[ "func", "(", "p", "*", "PlanTierParams", ")", "AppendTo", "(", "body", "*", "form", ".", "Values", ",", "keyParts", "[", "]", "string", ")", "{", "if", "BoolValue", "(", "p", ".", "UpToInf", ")", "{", "body", ".", "Add", "(", "form", ".", "FormatKe...
// AppendTo implements custom up_to serialisation logic for tiers configuration
[ "AppendTo", "implements", "custom", "up_to", "serialisation", "logic", "for", "tiers", "configuration" ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/plan.go#L159-L165
26,397
stripe/stripe-go
plan.go
UnmarshalJSON
func (s *Plan) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type plan Plan var v plan if err := json.Unmarshal(data, &v); err != nil { return err } *s = Plan(v) return nil }
go
func (s *Plan) UnmarshalJSON(data []byte) error { if id, ok := ParseID(data); ok { s.ID = id return nil } type plan Plan var v plan if err := json.Unmarshal(data, &v); err != nil { return err } *s = Plan(v) return nil }
[ "func", "(", "s", "*", "Plan", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "id", ",", "ok", ":=", "ParseID", "(", "data", ")", ";", "ok", "{", "s", ".", "ID", "=", "id", "\n", "return", "nil", "\n", "}", "\n\...
// UnmarshalJSON handles deserialization of a Plan. // This custom unmarshaling is needed because the resulting // property may be an id or the full struct if it was expanded.
[ "UnmarshalJSON", "handles", "deserialization", "of", "a", "Plan", ".", "This", "custom", "unmarshaling", "is", "needed", "because", "the", "resulting", "property", "may", "be", "an", "id", "or", "the", "full", "struct", "if", "it", "was", "expanded", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/plan.go#L182-L196
26,398
stripe/stripe-go
invoiceitem/client.go
Del
func (c Client) Del(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) ii := &stripe.InvoiceItem{} err := c.B.Call(http.MethodDelete, path, c.Key, params, ii) return ii, err }
go
func (c Client) Del(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) ii := &stripe.InvoiceItem{} err := c.B.Call(http.MethodDelete, path, c.Key, params, ii) return ii, err }
[ "func", "(", "c", "Client", ")", "Del", "(", "id", "string", ",", "params", "*", "stripe", ".", "InvoiceItemParams", ")", "(", "*", "stripe", ".", "InvoiceItem", ",", "error", ")", "{", "path", ":=", "stripe", ".", "FormatURLPath", "(", "\"", "\"", "...
// Del removes an invoice item.
[ "Del", "removes", "an", "invoice", "item", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/invoiceitem/client.go#L61-L66
26,399
stripe/stripe-go
applepaydomain/client.go
Get
func Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().Get(id, params) }
go
func Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().Get(id, params) }
[ "func", "Get", "(", "id", "string", ",", "params", "*", "stripe", ".", "ApplePayDomainParams", ")", "(", "*", "stripe", ".", "ApplePayDomain", ",", "error", ")", "{", "return", "getC", "(", ")", ".", "Get", "(", "id", ",", "params", ")", "\n", "}" ]
// Get retrieves an Apple Pay domain.
[ "Get", "retrieves", "an", "Apple", "Pay", "domain", "." ]
aa901d66c475fdd6d86581c5e1f2f85ec1f074f6
https://github.com/stripe/stripe-go/blob/aa901d66c475fdd6d86581c5e1f2f85ec1f074f6/applepaydomain/client.go#L30-L32