Skip to content

Commit 4b4264c

Browse files
committed
chore: bump version to 1.2.2 and add required name field to LineItem
- Add required 'name' field to LineItem interface for API alignment - Update test utilities to include name field in line item helpers - Update tests to use proper LineItem structure with name field - Maintain backward compatibility for existing API usage
1 parent be25e9f commit 4b4264c

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.2] - 2025-09-09
9+
10+
### Fixed
11+
12+
- **LineItem API Alignment** - Added missing required `name` field to LineItem interface to match API requirements
13+
- **Test Utilities** - Updated test utilities to include name field in line item creation helpers
14+
- **Type Safety** - Improved type safety for all line item operations across checkout sessions, payment links, and payment requests
15+
16+
### Technical Improvements
17+
18+
- Updated all test cases to include required name field in line item structures
19+
- Enhanced LineItem interface documentation with name field usage
20+
- Maintained full backward compatibility for existing LineItem API usage
21+
822
## [1.2.1] - 2025-09-08
923

1024
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@magpieim/magpie-node",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "The Magpie API Library for NodeJS enables you to work with Magpie APIs.",
55
"keywords": [
66
"magpie",

src/__tests__/testUtils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ export function createTestCharge(overrides: Record<string, any> = {}): Record<st
319319
*/
320320
export function createTestLineItem(overrides: Record<string, any> = {}): Record<string, any> {
321321
return {
322+
name: 'Test Product',
322323
amount: 10000,
323324
description: 'Test Product',
324325
quantity: 1,

src/resources/checkout.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('CheckoutResource', () => {
3131
it('should provide access to session creation through checkout.sessions', async () => {
3232
const sessionData = {
3333
line_items: [{
34+
name: 'Test Product',
3435
amount: 50000,
3536
description: 'Test Product',
3637
quantity: 1,

src/types/common.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ export type BillingAddressCollection = 'auto' | 'required';
9696
* to describe the products or services being purchased.
9797
*/
9898
export interface LineItem {
99+
/** The name of the line item. */
100+
name: string;
101+
99102
/** The amount of the line item in the smallest currency unit (e.g., cents). */
100103
amount: number;
101104

0 commit comments

Comments
 (0)