Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the value of the additional checkbox? #39

Closed
mbooh opened this issue Aug 27, 2018 · 9 comments
Closed

Get the value of the additional checkbox? #39

mbooh opened this issue Aug 27, 2018 · 9 comments

Comments

@mbooh
Copy link

mbooh commented Aug 27, 2018

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
Copy link
Author

mbooh commented Aug 29, 2018

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!

@marisks
Copy link
Member

marisks commented Aug 29, 2018

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
Copy link
Author

mbooh commented Aug 29, 2018 via email

@marisks
Copy link
Member

marisks commented Aug 29, 2018

I have created an issue on Klarna repo.

@kristibarbosky
Copy link
Collaborator

@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
Copy link
Author

mbooh commented Aug 29, 2018 via email

@mbooh
Copy link
Author

mbooh commented Aug 31, 2018

@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?

@kristibarbosky
Copy link
Collaborator

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.

@frederikvig
Copy link
Member

Closing because of age.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants