Skip to content

Commit

Permalink
add order adjustments in refund (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-shang authored Dec 6, 2023
1 parent 25ac74a commit e40406f
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,15 +467,35 @@ type ClientDetails struct {
}

type Refund struct {
Id int64 `json:"id,omitempty"`
OrderId int64 `json:"order_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Note string `json:"note,omitempty"`
Restock bool `json:"restock,omitempty"`
UserId int64 `json:"user_id,omitempty"`
RefundLineItems []RefundLineItem `json:"refund_line_items,omitempty"`
Transactions []Transaction `json:"transactions,omitempty"`
}
Id int64 `json:"id,omitempty"`
OrderId int64 `json:"order_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Note string `json:"note,omitempty"`
Restock bool `json:"restock,omitempty"`
UserId int64 `json:"user_id,omitempty"`
RefundLineItems []RefundLineItem `json:"refund_line_items,omitempty"`
Transactions []Transaction `json:"transactions,omitempty"`
OrderAdjustments []OrderAdjustment `json:"order_adjustments,omitempty"`
}

type OrderAdjustment struct {
Id int64 `json:"id,omitempty"`
OrderId int64 `json:"order_id,omitempty"`
RefundId int64 `json:"refund_id,omitempty"`
Amount *decimal.Decimal `json:"amount,omitempty"`
TaxAmount *decimal.Decimal `json:"tax_amount,omitempty"`
Kind OrderAdjustmentType `json:"kind,omitempty"`
Reason string `json:"reason,omitempty"`
AmountSet *AmountSet `json:"amount_set,omitempty"`
TaxAmountSet *AmountSet `json:"tax_amount_set,omitempty"`
}

type OrderAdjustmentType string

const (
OrderAdjustmentTypeShippingRefund OrderAdjustmentType = "shipping_refund"
OrderAdjustmentTypeRefundDiscrepancy OrderAdjustmentType = "refund_discrepancy"
)

type RefundLineItem struct {
Id int64 `json:"id,omitempty"`
Expand Down

0 comments on commit e40406f

Please sign in to comment.