File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/clerk-js/src/utils Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,17 @@ export const billingTotalsFromJSON = <T extends BillingStatementTotalsJSON | Bil
2525 taxTotal : billingMoneyAmountFromJSON ( data . tax_total ) ,
2626 } ;
2727
28- if ( 'total_due_now' in data ) {
28+ if ( 'total_due_now' in data && data . total_due_now ) {
2929 totals . totalDueNow = billingMoneyAmountFromJSON ( data . total_due_now ) ;
3030 }
31- if ( 'credit' in data ) {
31+ if ( 'credit' in data && data . credit ) {
3232 totals . credit = billingMoneyAmountFromJSON ( data . credit ) ;
3333 }
34- if ( 'past_due' in data ) {
34+ if ( 'past_due' in data && data . past_due ) {
3535 totals . pastDue = billingMoneyAmountFromJSON ( data . past_due ) ;
3636 }
3737
38+ // WHY `total_due_after_free_trial` and why `proration`
39+
3840 return totals as T extends { total_due_now : BillingMoneyAmountJSON } ? BillingCheckoutTotals : BillingStatementTotals ;
3941} ;
You can’t perform that action at this time.
0 commit comments