Skip to content

Commit

Permalink
added subtotal and total tax sets to refund line item. Re-used Amount…
Browse files Browse the repository at this point in the history
…SetEntry for presentmentPrices (#289)
  • Loading branch information
lologarithm authored May 19, 2024
1 parent c8f0c86 commit 3cc7152
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
14 changes: 8 additions & 6 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,14 @@ const (
)

type RefundLineItem struct {
Id uint64 `json:"id,omitempty"`
Quantity int `json:"quantity,omitempty"`
LineItemId uint64 `json:"line_item_id,omitempty"`
LineItem *LineItem `json:"line_item,omitempty"`
Subtotal *decimal.Decimal `json:"subtotal,omitempty"`
TotalTax *decimal.Decimal `json:"total_tax,omitempty"`
Id uint64 `json:"id,omitempty"`
Quantity int `json:"quantity,omitempty"`
LineItemId uint64 `json:"line_item_id,omitempty"`
LineItem *LineItem `json:"line_item,omitempty"`
Subtotal *decimal.Decimal `json:"subtotal,omitempty"`
TotalTax *decimal.Decimal `json:"total_tax,omitempty"`
SubTotalSet *AmountSet `json:"subtotal_set,omitempty"`
TotalTaxSet *AmountSet `json:"total_tax_set,omitempty"`
}

// List orders
Expand Down
9 changes: 2 additions & 7 deletions variant.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,8 @@ type Variant struct {
}

type presentmentPrices struct {
Price *presentmentPrice `json:"price,omitempty"`
CompareAtPrice *presentmentPrice `json:"compare_at_price,omitempty"`
}

type presentmentPrice struct {
Amount string `json:"amount,omitempty"`
CurrencyCode string `json:"currency_code,omitempty"`
Price *AmountSetEntry `json:"price,omitempty"`
CompareAtPrice *AmountSetEntry `json:"compare_at_price,omitempty"`
}

// VariantResource represents the result from the variants/X.json endpoint
Expand Down

0 comments on commit 3cc7152

Please sign in to comment.