Skip to content

Commit

Permalink
Merge pull request #683 from stripe/spastorelli-add-status-transition…
Browse files Browse the repository at this point in the history
…s-param

Add status_transitions filters to the List Orders params
  • Loading branch information
brandur-stripe authored Sep 5, 2018
2 parents 59fd8ad + d4cab50 commit 4736668
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,25 @@ type OrderList struct {

// OrderListParams is the set of parameters that can be used when listing orders.
type OrderListParams struct {
ListParams `form:"*"`
Created *int64 `form:"created"`
CreatedRange *RangeQueryParams `form:"created"`
Customer *string `form:"customer"`
IDs []*string `form:"ids"`
Status *string `form:"status"`
ListParams `form:"*"`
Created *int64 `form:"created"`
CreatedRange *RangeQueryParams `form:"created"`
Customer *string `form:"customer"`
IDs []*string `form:"ids"`
Status *string `form:"status"`
StatusTransitions *StatusTransitionsFilterParams `form:"status_transitions"`
}

// StatusTransitionsFilterParams are parameters that can used to filter on status_transition when listing orders.
type StatusTransitionsFilterParams struct {
Canceled *int64 `form:"canceled"`
CanceledRange *RangeQueryParams `form:"canceled"`
Fulfilled *int64 `form:"fulfilled"`
FulfilledRange *RangeQueryParams `form:"fulfilled"`
Paid *int64 `form:"paid"`
PaidRange *RangeQueryParams `form:"paid"`
Returned *int64 `form:"returned"`
ReturnedRange *RangeQueryParams `form:"returned"`
}

// StatusTransitions are the timestamps at which the order status was updated.
Expand Down

0 comments on commit 4736668

Please sign in to comment.