Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit b77cd6f

Browse files
authored
Merge pull request #2092 from OpenBazaar/brian.fixCheckoutBreakdownBug
Push fix for shipping price
2 parents fe13ac0 + 75f5f81 commit b77cd6f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/order.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,13 @@ func (n *OpenBazaarNode) CheckoutBreakdown(data *repo.PurchaseData) (repo.Checko
973973
}
974974
}
975975
// Convert to final currency
976-
shippingCurrencyValue := repo.NewCurrencyValueFromBigInt(shippingTotal, listingCurDef)
977-
finalShippingTotal, _, err := shippingCurrencyValue.ConvertUsingProtobufDef(v5Order.Payment.AmountCurrency, cc)
976+
originalPrice, err := nrl.GetPrice()
977+
if err != nil {
978+
return emptyCheckoutBreakdown, err
979+
}
980+
originalPrice.Amount = shippingTotal
981+
982+
finalShippingTotal, _, err := originalPrice.ConvertUsingProtobufDef(v5Order.Payment.AmountCurrency, cc)
978983
if err != nil {
979984
return emptyCheckoutBreakdown, err
980985
}

0 commit comments

Comments
 (0)