WPIntell

Source evidence

Add filter for credentials

Klarna Order Management for WooCommerce · support · 2023-02-23T11:38:00+00:00

neutralsentiment
highseverity
0.57relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

10 / 67 rows with source links

14.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

57 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Greg resolved
Hi there, A client or ours runs a multilanguage e-commerce website (with WPML) and uses Klarna Checkout on several languages of the site, including german, swedish, danish, etc. (We are also using the Klarna Checkout for WooCommerce plugin.) The client has multiple Klarna accounts and thus has different keys for each language. In order for the checkout to work, currently we are using a WP filter in the step where the Klarna Checkout plugin fetches the credentials (kco_wc_credentials_from_session filter) to replace the keys based on the current WPML language, but we don’t have such an option for the Klarna Order Management plugin. Based on the 1.7.1 version of the plugin, we are suggesting the following change to the KOM_Request class, line 275: Instead of return $options[ $key ]; we should have return apply_filters( 'kom_auth_component', $options[ $key ], $component_name, $this->order_id ); Of course, the filter name is just a suggestion, but this would allow us to hook in and use the appropriate credentials that matches the language of the order. Can you let us know if this change (or something very similar to this) can make it into the next minor release? Thanks. Hello @pappgergely You can override which credential to use by setting the auth component directly in the order’s metadata: https://github.com/krokedil/klarna-order-management-for-woocommerce/blob/master/classes/request/class-kom-request.php#L246 Will that work for you? Hopefully Montazars answer worked for you so we are setting this to solved. Let us know otherwise.

Comments

2 shown
montazar 2023-03-06T15:57:00+00:00

Hello @pappgergely You can override which credential to use by setting the auth component directly in the order’s metadata: https://github.com/krokedil/klarna-order-management-for-woocommerce/blob/master/classes/request/class-kom-request.php#L246 Will that work for you?

Andreas – Krokedil 2023-05-22T09:15:00+00:00

Hopefully Montazars answer worked for you so we are setting this to solved. Let us know otherwise.