wire checkout pay to selected payment method

This commit is contained in:
2026-09-05 22:07:02 +02:00
parent 7222d0c9be
commit b728c34357
4 changed files with 45 additions and 17 deletions
@@ -30,7 +30,10 @@ export class CheckoutSessionService {
});
}
async createFromCartSummary(summary: CookieCartSummary): Promise<CheckoutSession> {
async createFromCartSummary(
summary: CookieCartSummary,
requestedPaymentMethod: PaymentMethod
): Promise<CheckoutSession> {
if (summary.cartExtended.length === 0) {
throw new BadRequestException('Your cart is empty');
}
@@ -42,7 +45,7 @@ export class CheckoutSessionService {
const sessionId = randomUUID();
const invoice = await this.invoiceService.issueInvoice({
paymentMethod: PaymentMethod.Xmr,
paymentMethod: requestedPaymentMethod,
reason: InvoiceReason.Checkout,
contextId: sessionId,
amountFiat: summary.cartTotalPrice