Geta/klarna

Get the value of the additional checkbox?

Closed this issue · 9 comments

mbooh commented

Hi!

I can't figure out how to get the value of the additional checkbox?
The checkbox is shown just fine if I add a value in the Commerce Manager settings but how do I retrieve it?

In your v2 version you had this:

`public bool IsNewsletterChecked(string orderId)
{
if (orderId == null) throw new ArgumentNullException("orderId");

        var order = FetchOrder(orderId);
        var request = order.GetValue("merchant_requested") as JObject;
        if (request != null)
        {
            return request["additional_checkbox"].ToObject<bool>();
        }
        return false;
    }

`

Maybe I'm just missing something here?

Thanks!

/Kristoffer

mbooh commented

I think I found some documentation:

https://developers.klarna.com/api/#checkout-api__order__merchant_requested

I'm happy to fix this but I'm not sure how to use the information. Could someone please guide me?

"merchant_requested": { "additional_checkbox": false, "additional_checkboxes": [ { "id": "string", "checked": false } ] },
Thanks!

In KCO v3 we are using Klarna's library and it doesn't have this feature. Here is what they have:
https://github.com/klarna/kco_rest_dotnet/blob/v2.2/Klarna.Rest/Klarna.Rest/Models/CheckoutOrderData.cs

mbooh commented

I have created an issue on Klarna repo.

@mbooh @marisks - Unfortunately Klarna has not been updating the SDK's. Klarna is reviewing the SDK's and the SDK's will likely be redone (but it will be a new SDK, not an update of these current SDK's). We don't have committed timelines for the new SDK's at this time.

Unfortunately the best approach is likely for you to directly update your own local SDK copy if necessary to allow retrieving the additional checkbox data.

mbooh commented
mbooh commented

@kristibarbosky I have now downloaded and updated the SDK to work with additional checkbox.
I have also created a pull request:
klarna/kco_rest_dotnet#9

Is that something you can look into?

Thanks for the update @mbooh - glad you're able to make progress! I don't believe that the PR will be processed directly as the Klarna team is looking to generate Klarna SDK's with a new process going forward.

Closing because of age.