diff --git a/packages/klarna-integration/src/klarnav2/klarnav2-payment-strategy.ts b/packages/klarna-integration/src/klarnav2/klarnav2-payment-strategy.ts index c47a681a1ae..49adca1b117 100644 --- a/packages/klarna-integration/src/klarnav2/klarnav2-payment-strategy.ts +++ b/packages/klarna-integration/src/klarnav2/klarnav2-payment-strategy.ts @@ -147,7 +147,7 @@ export default class KlarnaV2PaymentStrategy { } // #1 - old request - const state = this.paymentIntegrationService.getState(); + // const state = this.paymentIntegrationService.getState(); // const cartId = state.getCartOrThrow().id; // const params = { params: cartId }; @@ -156,7 +156,9 @@ export default class KlarnaV2PaymentStrategy { // }); // #2 - new with params - const { method } = state.getPaymentMethodOrThrow(methodId); + const { method } = this.paymentIntegrationService + .getState() + .getPaymentMethodOrThrow(methodId); await this.paymentIntegrationService.loadPaymentMethod(gatewayId, { ...options, @@ -175,7 +177,9 @@ export default class KlarnaV2PaymentStrategy { return new Promise((resolve) => { const state = this.paymentIntegrationService.getState(); - const paymentMethod = state.getPaymentMethodOrThrow(methodId); + const paymentMethod = state.getPaymentMethodOrThrow(methodId, gatewayId); + + console.log('*** paymentMethod', paymentMethod); if (!this.klarnaPayments || !paymentMethod.clientToken) { throw new NotInitializedError(NotInitializedErrorType.PaymentNotInitialized);