commercelayer / mfe-checkout

Commerce Layer Hosted Checkout
https://commercelayer.io
MIT License
42 stars 47 forks source link

Klarna payment method unavailable on initial selection #469

Open scriptology opened 4 months ago

scriptology commented 4 months ago

Description

In my attempts to add the Klarna payment method, I encountered a bug: the Klarna payment method becomes available after returning to the billing address and re-selecting the payment method. The error repeats with each new order.

Steps to Reproduce

  1. Create an order via API
  2. Go to the hosted version of the checkout page
  3. Fill in the billing address
  4. Click Continue payment
  5. Select the Klarna payment method (here I get a 422 error due to the missing country code)
  6. Return to the billing address
  7. Click Continue payment again
  8. Select the Klarna payment method (now the payment method is available)

Expected Result

I expect the Klarna payment method to be available immediately after filling in the billing address and clicking Continue payment.

Actual Results

When selecting the Klarna payment method for the first time, I get a 422 error due to the missing country code. The payment method becomes available after returning to the billing address and re-selecting the payment method.

Screenshots

https://github.com/commercelayer/mfe-checkout/assets/1895925/64e82ebf-b2f7-4d91-a791-890ad473a9fe

Desktop (please complete the following information):

Additional context I would appreciate recommendations on how to bypass this bug without deploying the checkout page on my side.