@stigg/react-sdk 4.5.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.5.0",
2
+ "version": "4.5.1",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -109,7 +109,7 @@
109
109
  "@emotion/react": "^11.10.5",
110
110
  "@emotion/styled": "^11.10.5",
111
111
  "@mui/material": "^5.10.13",
112
- "@stigg/js-client-sdk": "2.24.0",
112
+ "@stigg/js-client-sdk": "2.24.1",
113
113
  "@stripe/react-stripe-js": "^2.1.1",
114
114
  "@stripe/stripe-js": "^1.54.1",
115
115
  "@types/styled-components": "^5.1.26",
@@ -157,7 +157,7 @@ export const CheckoutSummary = ({
157
157
  const checkoutHasChanges =
158
158
  !!subscriptionPreview && (!!immediateInvoice?.proration || !!subscriptionPreview.hasScheduledUpdates);
159
159
  const showPromotionCodeLine = !disablePromotionCode && !isFreeDowngrade;
160
- const showDiscountLine = !!recurringInvoice && !!recurringInvoice?.discountDetails && !isFreeDowngrade;
160
+ const showDiscountLine = !!recurringInvoice?.discountDetails && !isFreeDowngrade;
161
161
  const hasDiscounts = showPromotionCodeLine || showDiscountLine;
162
162
 
163
163
  const hasPayAsYouGoCharges = usageCharges.some((price) => price.pricingModel === BillingModel.UsageBased);
@@ -311,7 +311,9 @@ export const CheckoutSummary = ({
311
311
  </>
312
312
  ) : null}
313
313
 
314
- {immediateInvoice?.subTotal && immediateInvoice?.subTotal.amount > 0 ? (
314
+ {immediateInvoice?.proration?.hasProrations &&
315
+ immediateInvoice?.subTotal &&
316
+ immediateInvoice?.subTotal.amount > 0 ? (
315
317
  <LineItemContainer>
316
318
  <LineItemRow>
317
319
  <Typography variant="body1" color="secondary">
@@ -140,6 +140,7 @@ export function mockPreviewSubscription(input: PreviewSubscription): Subscriptio
140
140
  credit: total.total,
141
141
  debit: total.total,
142
142
  netAmount: total.total,
143
+ hasProrations: false,
143
144
  },
144
145
  },
145
146