Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
- Properly move remaining int to int64
- Rename Values to Data on missed List structs
  • Loading branch information
remi-stripe committed Jun 6, 2018
1 parent c395132 commit 266cda7
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ type AccountAddress struct {

// DOB is a structure for an account owner's date of birth.
type DOB struct {
Day int `json:"day"`
Month int `json:"month"`
Year int `json:"year"`
Day int64 `json:"day"`
Month int64 `json:"month"`
Year int64 `json:"year"`
}

// Gender is the gender of an account owner. International regulations require
Expand Down
4 changes: 2 additions & 2 deletions dispute.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type EvidenceDetails struct {
DueBy int64 `json:"due_by"`
HasEvidence bool `json:"has_evidence"`
PastDue bool `json:"past_due"`
SubmissionCount int `json:"submission_count"`
SubmissionCount int64 `json:"submission_count"`
}

// DisputeEvidence is the structure that contains various details about
Expand Down Expand Up @@ -137,7 +137,7 @@ type File struct {
ID string `json:"id"`
MIMEType string `json:"mime_type"`
Purpose string `json:"purpose"`
Size int `json:"size"`
Size int64 `json:"size"`
URL string `json:"url"`
}

Expand Down
2 changes: 1 addition & 1 deletion exchangerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ExchangeRate struct {
// ExchangeRateList is a list of exchange rates as retrieved from a list endpoint.
type ExchangeRateList struct {
ListMeta
Values []*ExchangeRate `json:"data"`
Data []*ExchangeRate `json:"data"`
}

// ExchangeRateListParams are the parameters allowed during ExchangeRate listing.
Expand Down
4 changes: 2 additions & 2 deletions exchangerate/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func (c Client) List(params *stripe.ExchangeRateListParams) *Iter {
list := &stripe.ExchangeRateList{}
err := c.B.Call("GET", "/exchange_rates", c.Key, b, p, list)

ret := make([]interface{}, len(list.Values))
for i, v := range list.Values {
ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

Expand Down
2 changes: 1 addition & 1 deletion params.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type ListParams struct {
EndingBefore string `form:"ending_before"`
Expand []string `form:"expand"`
Filters Filters `form:"*"`
Limit int `form:"limit"`
Limit int64 `form:"limit"`

// Single specifies whether this is a single page iterator. By default,
// listing through an iterator will automatically grab additional pages as
Expand Down
2 changes: 1 addition & 1 deletion sourcetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type SourceTransactionListParams struct {
// SourceTransactionList is a list object for SourceTransactions.
type SourceTransactionList struct {
ListMeta
Values []*SourceTransaction `json:"data"`
Data []*SourceTransaction `json:"data"`
}

// SourceTransaction is the resource representing a Stripe source transaction.
Expand Down
4 changes: 2 additions & 2 deletions sourcetransaction/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func (c Client) List(params *stripe.SourceTransactionListParams) *Iter {
err = errors.New("Invalid source transaction params: Source needs to be set")
}

ret := make([]interface{}, len(list.Values))
for i, v := range list.Values {
ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

Expand Down
2 changes: 1 addition & 1 deletion topup.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type TopupListParams struct {
// TopupList is a list of top-ups as retrieved from a list endpoint.
type TopupList struct {
ListMeta
Values []*Topup `json:"data"`
Data []*Topup `json:"data"`
}

// Topup is the resource representing a Stripe top-up.
Expand Down
4 changes: 2 additions & 2 deletions topup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func (c Client) List(params *stripe.TopupListParams) *Iter {
list := &stripe.TopupList{}
err := c.B.Call("GET", "/topups", c.Key, b, p, list)

ret := make([]interface{}, len(list.Values))
for i, v := range list.Values {
ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

Expand Down

0 comments on commit 266cda7

Please sign in to comment.