-   Notifications  
You must be signed in to change notification settings  - Fork 402
 
feat(commerce): Add past due amount on checkout #6014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
 🦋 Changeset detectedLatest commit: f26e6e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
 Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR  |  
|   The latest updates on your projects. Learn more about Vercel for Git ↗︎ 
  |  
a960b7f to 3f993e8   Compare   e2b9173 to 5f81006   Compare   There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for displaying a "Past Due" amount on the checkout page when applicable.
- Added a new 
pastDuefield in localization resources, type definitions, and English translations - Extended JSON-to-model mapping to include 
data.past_due - Updated the checkout form UI to conditionally render the past due line item
 
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description | 
|---|---|
| packages/types/src/localization.ts | Added pastDue key to _LocalizationResource |  
| packages/types/src/commerce.ts | Extended CommerceCheckoutTotals with pastDue |  
| packages/localizations/src/en-US.ts | Added English translation for "Past Due" |  
| packages/clerk-js/src/utils/commerce.ts | Mapped data.past_due to totals.pastDue |  
| packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx | Displayed the past due amount in the checkout summary | 
| .changeset/shaky-seas-dream.md | Added changeset entry for the new past due feature | 
Comments suppressed due to low confidence (2)
packages/clerk-js/src/utils/commerce.ts:33
- Add a unit test for 
commerceTotalsFromJSONthat supplies apast_duevalue in the JSON and verifies thattotals.pastDueis populated correctly. 
if ('past_due' in data) { packages/localizations/src/en-US.ts:94
- [nitpick] String casing here is inconsistent with other labels (e.g., 
Total Due Today). Consider using title case:'Past Due'. 
pastDue: 'Past due',   @clerk/agent-toolkit
 @clerk/astro
 @clerk/backend
 @clerk/chrome-extension
 @clerk/clerk-js
 @clerk/dev-cli
 @clerk/elements
 @clerk/clerk-expo
 @clerk/express
 @clerk/fastify
 @clerk/expo-passkeys
 @clerk/nextjs
 @clerk/localizations
 @clerk/nuxt
 @clerk/clerk-react
 @clerk/react-router
 @clerk/remix
 @clerk/tanstack-react-start
 @clerk/testing
 @clerk/shared
 @clerk/themes
 @clerk/types
 @clerk/upgrade
 @clerk/vue
 commit:   |  
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, generate localizations?
 
 Will do right before merging to avoid any conflicts!  |  
0af1ce9 to 80d612a   Compare   
Description
This PR adds the Past due amount on checkout when available
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change