refactor
This commit is contained in:
@@ -451,6 +451,8 @@ type orderLine struct {
|
||||
Quantity int32 `json:"quantity"`
|
||||
UnitPrice money.Cents `json:"unitPrice"`
|
||||
TaxRate int32 `json:"taxRate"`
|
||||
DropShip bool `json:"drop_ship,omitempty"`
|
||||
Location string `json:"location,omitempty"`
|
||||
}
|
||||
|
||||
type orderPayment struct {
|
||||
@@ -549,6 +551,10 @@ func buildOrderLines(g *checkout.CheckoutGrain) []orderLine {
|
||||
if it.Meta != nil {
|
||||
name = it.Meta.Name
|
||||
}
|
||||
location := ""
|
||||
if it.StoreId != nil {
|
||||
location = *it.StoreId
|
||||
}
|
||||
lines = append(lines, orderLine{
|
||||
Reference: it.Sku,
|
||||
Sku: it.Sku,
|
||||
@@ -558,6 +564,8 @@ func buildOrderLines(g *checkout.CheckoutGrain) []orderLine {
|
||||
// CartItem.Tax and OrderLine.TaxRate share the platform basis-point scale
|
||||
// (2500 = 25%), so the rate passes through unchanged.
|
||||
TaxRate: int32(it.Tax),
|
||||
DropShip: it.DropShip,
|
||||
Location: location,
|
||||
})
|
||||
}
|
||||
for _, d := range g.Deliveries {
|
||||
|
||||
Reference in New Issue
Block a user