load btc invoice details in checkout session and storefront order queries
Ensure bitcoin invoice metadata is available when rendering checkout sessions and customer order pages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import type { CookieCartSummary } from '../../storefrontCart/types/CookieCartSum
|
||||
import { deriveCheckoutSessionState } from '../../../utils/checkout/deriveCheckoutSessionState';
|
||||
import { InvoiceReason } from '../../payment/types/InvoiceReason';
|
||||
import { InvoiceService } from '../../payment/services/InvoiceService';
|
||||
import { PaymentMethod } from '../../payment/types/PaymentMethod';
|
||||
import type { PaymentMethod } from '../../payment/types/PaymentMethod';
|
||||
import { CheckoutSessionDiscount } from '../entities/CheckoutSessionDiscount';
|
||||
import { CheckoutSessionLine } from '../entities/CheckoutSessionLine';
|
||||
import { CheckoutSession } from '../entities/CheckoutSession';
|
||||
@@ -26,7 +26,14 @@ export class CheckoutSessionService {
|
||||
async findById(id: string): Promise<CheckoutSession | null> {
|
||||
return this.sessionRepo.findOne({
|
||||
where: { id },
|
||||
relations: ['lines', 'discounts', 'invoice', 'invoice.moneroDetails', 'invoice.payments']
|
||||
relations: [
|
||||
'lines',
|
||||
'discounts',
|
||||
'invoice',
|
||||
'invoice.moneroDetails',
|
||||
'invoice.btcDetails',
|
||||
'invoice.payments'
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,7 +94,7 @@ export class CheckoutSessionService {
|
||||
async cancelSession(sessionId: string): Promise<void> {
|
||||
const session = await this.sessionRepo.findOne({
|
||||
where: { id: sessionId },
|
||||
relations: ['invoice', 'invoice.moneroDetails', 'invoice.payments']
|
||||
relations: ['invoice', 'invoice.moneroDetails', 'invoice.btcDetails', 'invoice.payments']
|
||||
});
|
||||
|
||||
if (!session) {
|
||||
|
||||
Reference in New Issue
Block a user