Skip to content

Commit

Permalink
chore: fix jwp coupon discount price
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer authored and AntonLantukh committed Apr 3, 2024
1 parent 5097e60 commit 2a04031
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default class JWPCheckoutService extends CheckoutService {
totalPrice: payload.offer.customerPriceInclTax,
priceBreakdown: {
offerPrice: payload.offer.customerPriceInclTax,
// @TODO is this correct?
discountAmount: payload.offer.customerPriceInclTax,
discountedPrice: payload.offer.customerPriceInclTax,
paymentMethodFee: 0,
Expand Down Expand Up @@ -181,14 +182,14 @@ export default class JWPCheckoutService extends CheckoutService {
accessFeeId: order.id,
});

const discountedAmount = order.totalPrice - response.data.amount;
const updatedOrder = {
const discountAmount = order.totalPrice - response.data.amount;
const updatedOrder: Order = {
...order,
totalPrice: response.data.amount,
priceBreakdown: {
...order.priceBreakdown,
discountedAmount,
discountedPrice: discountedAmount,
discountAmount,
discountedPrice: discountAmount,
},
discount: {
applied: true,
Expand Down

0 comments on commit 2a04031

Please sign in to comment.