Skip to content

feat(chore): support retrieval of invoice PDF download URLs#28

Open
Sourav-kashyap wants to merge 7 commits into
masterfrom
GH-27
Open

feat(chore): support retrieval of invoice PDF download URLs#28
Sourav-kashyap wants to merge 7 commits into
masterfrom
GH-27

Conversation

@Sourav-kashyap
Copy link
Copy Markdown

@Sourav-kashyap Sourav-kashyap commented May 4, 2026

Description

This change introduces enhancements for invoice data access and payment-related operations.

Changes

  • Added support for retrieving invoice PDF download URLs
  • Added functionality to fetch payment method details associated with invoices
  • Introduced payment intent operations:
  • Retrieve payment intents by ID for payment tracking

Using Stripe:

Stripe.mov

Using Chargebee:

Chargebee.mov

support retrieval of invoice PDF download URLs

GH-27
… support

add invoice payment details and payment intent retrieval support

GH-27
Comment thread src/providers/sdk/stripe/stripe.service.ts Outdated
Comment thread src/providers/sdk/stripe/stripe.service.ts Outdated
@Sourav-kashyap Sourav-kashyap requested a review from Tyagi-Sunny May 8, 2026 10:21
Comment thread src/types.ts Outdated
* - canceled
* - succeeded
*/
status: string;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define a enum

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Comment thread src/types.ts Outdated
Comment on lines +281 to +292
/** Card brand: visa, mastercard, amex, etc. */
brand: string;
/** Last 4 digits */
last4: string;
/** Expiration month */
expMonth: number;
/** Expiration year */
expYear: number;
/** Funding type: credit, debit, prepaid, unknown */
funding: string;
/** Country code */
country?: string;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define these separately

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Comment thread src/types.ts Outdated
Comment on lines +298 to +305
bankName: string;
/** Last 4 digits */
last4: string;
/** Routing number */
routingNumber?: string;
/** Account type: checking, savings */
accountType?: string;
};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved


// Payment method default values
const DEFAULT_EXPIRY_MONTH = 12;
const DEFAULT_EXPIRY_YEAR = 2025;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is default 2025 valid ?
take these from config user will pass via env

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved


// Payment method default values
const DEFAULT_EXPIRY_MONTH = 12;
const DEFAULT_EXPIRY_YEAR = 2025;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@sonarqubecloud
Copy link
Copy Markdown

SonarQube reviewer guide

Summary: Add invoice PDF retrieval, payment details, and payment intent tracking for both Stripe and ChargeBee providers, with comprehensive adapters and type definitions.

Review Focus:

  1. The new ChargebeePaymentIntentAdapter and StripePaymentIntentAdapter classes—ensure the status mappings between provider models and the generic PaymentStatus enum are correct and handle edge cases.
  2. Error handling in the three new service methods (getInvoicePdf, getInvoicePaymentDetails, getPaymentIntent)—verify provider-specific error codes are properly caught and translated.
  3. Type safety in adapter methods that extract fields from flexible provider responses (e.g., snake_case vs camelCase field access).

Start review at: src/types.ts. This file defines the new domain types (TInvoicePdf, TPaymentMethod, TPaymentIntent, PaymentStatus) that are the foundation for all adapter implementations. Understanding the contract first ensures all adapter logic correctly maps provider responses to these types.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add invoice data access and payment operations support

3 participants