wire checkout pay to selected payment method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user