• Resolved mano.k

    (@manok-1)


    Hello,

    I’m trying for some time to setup Klarna Checkout with no luck.

    When i enter the Credentials and select Klarna as Payment Method the Checkout Page is blank. see: https://ibb.co/KwLn4yF

    If i refresh the Checkout page i get: https://ibb.co/By6YwQ0

    I have also in my console this error:

    Uncaught TypeError: Cannot read property 'redirect_url' of undefined
        at Object.complete (klarna-checkout-for-woocommerce.min.js?ver=2.0.14:1)
        at i (jquery.js?ver=1.12.4-wp:2)
        at Object.fireWith (jquery.js?ver=1.12.4-wp:2)
        at x (jquery.js?ver=1.12.4-wp:4)
        at XMLHttpRequest.c (jquery.js?ver=1.12.4-wp:4) 

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Experiencing the same issue. The browser console is screaming on me with the following issue:
    Uncaught TypeError: Cannot read property ‘success’ of undefined

    Logs from merchant center:
    order_id: 296873ad-8cd7-6ba5-bc37-3395f8195e72
    correlation_id: 18f05242-a4da-4fc5-ab8b-72a6fd8e959f
    request_timestamp: 2020-06-11, 18:52
    action: Read order
    merchant_id: K742727
    request_path: api/merchant/K742727/v3/orders/296873ad-8cd7-6ba5-bc37-3395f8195e72
    caller_ip: 162.241.253.81

    REQUEST HEADERS
    Accept: */*
    Klarna-Correlation-Id: 18f05242-a4da-4fc5-ab8b-72a6fd8e959f
    User-Agent: WordPress/5.4.2; https://www.amfium.no – WooCommerce: 4.2.0 – KCO:2.0.15 – PHP Version: 7.2.31 – Krokedil
    Host: api.klarna.com
    Accept-Encoding: deflate, gzip, br
    Content-Type: application/json

    BODY
    “”

    RESPONSE HEADERS
    Klarna-Correlation-Id: 18f05242-a4da-4fc5-ab8b-72a6fd8e959f
    Content-Type: application/json

    RESPONSE BODY
    “”

    In the test mode, everything works correctly.

    • This reply was modified 4 years, 5 months ago by zderekh.
    Plugin Author Kristi at Klarna

    (@klarna)

    Hi @zderekh
    For your provided example order, the Klarna logs show that the order was created against the Klarna test/playground endpoint, but the error you listed above is a 404 error, which is thrown because this order is not found again the Klarna production environment. When changing Klarna API credentials in your Woo store, please make sure to start a new session so that stale data is not used; a good way that is to test using a new incognito browser window. Hope that helps!

    Thank you for your response. I repeated the same in incognito mode with the same result: the Klarna iframe is not being generated.

    correlation_id: 7f56862b-cd2e-4b26-99f9-c879edf28949
    request_timestamp: 2020-06-11, 19:45
    action: Create order
    merchant_id: K742727
    request_path: api/merchant/K742727/v3/orders
    caller_ip: 162.241.253.81
    
    REQUEST HEADERS
    Accept: */*
    Klarna-Correlation-Id: 7f56862b-cd2e-4b26-99f9-c879edf28949
    User-Agent: WordPress/5.4.2; https://www.amfium.no/no/ - WooCommerce: 4.2.0 - KCO:2.0.15 - PHP Version: 7.2.31 - Krokedil
    Host: api.klarna.com
    Accept-Encoding: deflate, gzip, br
    Content-Length: 2329
    Content-Type: application/json
    
    REQUEST BODY
    {
      "purchase_country": "NO",
      "locale": "nb-NO",
      "merchant_urls": {
        "terms": "https://www.amfium.no/no/terms-conditions/",
        "checkout": "https://www.amfium.no/no/checkout/",
        "confirmation": "https://www.amfium.no/no/checkout/?kco_confirm=yes&kco_order_id={checkout.order.id}&wc_order_id=null",
        "push": "https://www.amfium.no/no/wc-api/KCO_WC_Push/?kco-action=push&kco_wc_order_id={checkout.order.id}&kco_session_id=623962f647532d6e8173354373299fd5",
        "shipping_option_update": "https://www.amfium.no/no/wc-api/KCO_WC_Shipping_Option_Update/",
        "notification": "https://www.amfium.no/no/wc-api/KCO_WC_Notification/?kco_wc_order_id={checkout.order.id}"
      },
      "billing_countries": [
        "NO"
      ],
      "shipping_countries": [
        "NO"
      ],
      "merchant_data": "{\"is_user_logged_in\":false}",
      "options": {
        "title_mandatory": false,
        "allow_separate_shipping_address": false,
        "date_of_birth_mandatory": false,
        "national_identification_number_mandatory": false,
        "allowed_customer_types": [
          "person"
        ],
        "require_client_validation": true,
        "require_client_validation_callback_response": true,
        "phone_mandatory": false,
        "color_button": "#212121",
        "color_button_text": "#ffffff",
        "color_checkbox": "#be237a",
        "color_checkbox_checkmark": "#ffffff",
        "color_header": "#212121",
        "color_link": "#be237a"
      },
      "customer": {
        "type": "person"
      },
      "purchase_currency": "NOK",
      "order_amount": 8499,
      "order_lines": [
        {
          "reference": "32916531792",
          "name": "Baseus USB Type C Cable - BLACK, 0.5m",
          "quantity": 1,
          "unit_price": 8499,
          "tax_rate": 0,
          "total_amount": 8499,
          "total_tax_amount": 0,
          "total_discount_amount": 0,
          "type": "physical"
        },
        {
          "type": "shipping_fee",
          "reference": "free_shipping:3",
          "name": "Gratis frakt",
          "quantity": 1,
          "unit_price": 0,
          "tax_rate": 0,
          "total_amount": 0,
          "total_tax_amount": 0
        }
      ],
      "order_tax_amount": 0,
      "billing_address": {
        "email": null,
        "postal_code": null,
        "country": "NO",
        "phone": null,
        "given_name": null,
        "family_name": null,
        "street_address": null,
        "street_address2": null,
        "city": null,
        "region": null
      },
      "shipping_options": [
        {
          "id": "free_shipping:3",
          "name": "Gratis frakt",
          "price": 0,
          "tax_amount": 0,
          "tax_rate": 0,
          "preselected": true
        }
      ],
      "external_payment_methods": [
        {
          "name": "Vipps",
          "redirect_url": "https://www.amfium.no/no/checkout/?kco_confirm=yes&kco_order_id=%7Bcheckout.order.id%7D&wc_order_id=null&kco-external-payment=vipps",
          "image_url": "https://www.amfium.no/wp-content/plugins/woo-vipps/img/vipps-rgb-sort.png",
          "description": ""
        }
      ]
    }
    
    RESPONSE HEADERS
    Klarna-Correlation-Id: 7f56862b-cd2e-4b26-99f9-c879edf28949
    Content-Type: application/json
    • This reply was modified 4 years, 5 months ago by zderekh.
    • This reply was modified 4 years, 5 months ago by zderekh.
    Plugin Author Kristi at Klarna

    (@klarna)

    Hi again @zderekh
    You are now receiving a different error, a 401 / unauthorized error, which you can check in the Logs app of the Klarna Merchant Portal, per: https://docs.krokedil.com/article/267-klarna-checkout-error-codes

    The MID you are using is configured in Klarna for Klarna Payments, not Klarna Checkout. Please either switch to use the Klarna Payments plugin (https://woocommerce.com/products/klarna-payments/) or update your Klarna contract if you want to use Klarna Checkout instead of Klarna Payments.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @krokedil @kristiankrokedil I have deleted your email and flagged your accounts for moderation.

    While I know you have the best of intentions, it’s forum policy that you not ask users for admin or server access. Users on the forums aren’t your customers, they’re your open source collaborators, and requesting that kind of access can put you and them at high risk.

    If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.

    Thankfully are other ways to get information you need:

    You get the idea.

    We know volunteer support is not easy, and this guideline can feel needlessly restrictive. It’s actually there to protect you as much as end users. Should their site be hacked or have any issues after you accessed it, you could be held legally liable for damages. In addition, it’s difficult for end users to know the difference between helpful developers and people with malicious intentions. Because of that, we rely on plugin developers and long-standing volunteers (like you) to help us and uphold this particular guideline.

    When you help users here and in public, you also help the next person with the same problem. They’ll be able to read the debugging and solution and educate themselves. That’s how we get the next generation of developers.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not Working’ is closed to new replies.