Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
172 stars 69 forks source link

[Klarna] Support payments in other presentment currencies when allowed #8984

Open danielmx-dev opened 2 months ago

danielmx-dev commented 2 months ago

Describe the bug

Klarna payments in general are restricted to domestic transactions; however, there is one exception that is outlined in the current documentation:

If you’re based in the EEA, UK, or Switzerland, then you can transact with consumers across the EEA, UK, and Switzerland, provided the presentment currency matches the currency of the customer’s country. For example, a Swedish business can present in EUR to accept Klarna from a buyer in Germany.

However, due to existing validations in the code, the Klarna payment method is not available when using a presentment currency different from the domestic currency used in the country that was selected during the WooPayments onboarding process.

To Reproduce

  1. Connect your store to a Stripe account from a Klarna-supported European country that doesn't use Euro as their domestic currency (e.g. United Kingdom)
  2. Enable Klarna
  3. As a shopper, set the currency to EUR, add a product to your cart and proceed to checkout
  4. As the billing country, select one Klarna-supported country that uses Euro as their domestic currency (e.g. Belgium)
  5. Notice the list of payment methods

Actual behavior

Klarna is not available as an option in the Payment Methods list.

Screenshots

Checkout

image

Expected behavior

Klarna should be available as an option in the Payment Methods list, and the order should succeed when using it.

Additional context

This issue related to #8718, however while the linked issue is focused on hiding Klarna when the location conditions are not met, while this issue should take care of showing Klarna when both the location and currency conditions are met.

The validations that are preventing Klarna from being displayed are mainly these two, since they force to only show the payment method when the cart currency matches the WooPayments account currency:

https://github.com/Automattic/woocommerce-payments/blob/fa7554041d08430a60fa232f9a91864d56bce398/includes/payment-methods/class-upe-payment-method.php#L173-L195

https://github.com/Automattic/woocommerce-payments/blob/fa7554041d08430a60fa232f9a91864d56bce398/includes/payment-methods/class-upe-payment-method.php#L229-L239

One of the biggest problems that would need to be solved is to figure out if the solution can be implemented entirely in the backend, or if it would be required to also implement frontend changes.

vbelolapotkov commented 2 months ago

I think the current behavior is by design. Yes, it has limitation, but I don't think it's a bug, so changed the type to enhancement. @c-shultz @pierorocca sending this one to you for further assessment and prioritization.

pierorocca commented 2 months ago

Yes that's right by design. Launch was scope limited to exclude intra-Europe currency use cases. Enhancement type would be the best fit. Thanks Vasily.

AashikP commented 1 month ago

@vbelolapotkov @pierorocca

As per Customer currency and BNPL - Documentation, Norway should be using NOK currency, but with that currency, you will not see the Klarna Option:

image

You need to enable USD currency for this to work. Is this expected?

User report in 8494388-zen