【问题标题】:Magento 2 Klarna checkoutMagento 2 Klarna 结帐
【发布时间】:2019-10-04 23:09:07
【问题描述】:

我需要将 Klarna Checkout 模块集成到 magento 2.1.2 中。我正在使用“klarna/m2-checkout 模块”的版本:4.2.2。 选择送货方式时,总是弹窗报错:

抱歉,您选择的送货方式无法处理。请选择其他送货方式。

当我选择送货方式时,我会收到以下回复:

   {
        "shared": {
            "customer": {
                "type": "person"
            },
            "user_preferences": {
                "remember_me": true
            },
            "language": "en",
            "locale": "en-US",
            "customer_details": {
                "client_token": "eyJhbGciOiJSUzUxMiJ9.eyJz",
                "country": "swe",
                "completed": true,
                "fields_with_obfuscation": {
                    "email": "melosicuva@royalhost.info",
                    "given_name": "Testperson-se",
                    "family_name": "Approved",
                    "street_address": "Stårgatan 1",
                    "postal_code": "123 45",
                    "city": "Ankeborg",
                    "country": "SE",
                    "phone": "076-526 00 00",
                    "date_of_birth": "1941-03-21",
                    "national_identification_number": "19410321-9202"
                },
                "reference": "2f9a445a57a49215175178099002fc7165ee"
            },
            "shipping_details": {
                "client_token": "eyJhbGciOiJSUzUxMiJ9.eyJzZXNzaW9uX"
            },
            "currency": "SEK",
            "obfuscated_fields": []
        },
        "cart": {
            "total_tax_amount": 30000,
            "total_price_including_tax": 150000,
            "total_price_excluding_tax": 120000,
            "total_shipping_amount_excluding_tax": 0,
            "total_surcharge_amount_excluding_tax": 0,
            "total_discount_amount_excluding_tax": 0,
            "total_shipping_amount_including_tax": 0,
            "total_surcharge_amount_including_tax": 0,
            "total_discount_amount_including_tax": 0,
            "subtotal": 120000,
            "total_store_credit": 0,
            "items": [{
                "type": "physical",
                "reference": "1201018390010",
                "name": "Armour Bib Shorts",
                "quantity": 1,
                "unit_price": 150000,
                "total_tax_amount": 30000,
                "tax_rate": 2500,
                "total_price_including_tax": 150000,
                "total_price_excluding_tax": 120000,
                "product_url": "https://local.com/armour-bib-shorts-black.html?___store%5B_data%5D%5Bstore_id%5D=2&___store%5B_data%5D%5Bcode%5D=se&___store%5B_data%5D%5Bwebsite_id%5D=2&___store%5B_data%5D%5Bgroup_id%5D=2&___store%5B_data%5D%5Bname%5D=Sweden+Store&___store%5B_data%5D%5Bsort_order%5D=30&___store%5B_data%5D%5Bis_active%5D=1&___store%5B_data%5D%5Balias%5D=Sweden&___store%5B_data%5D%5Bavailable_currency_codes%5D%5B0%5D=SEK",
                "image_url": "https://local.com//media/catalog/product/a/r/armour-bib-shorts-aw18-01.jpg"
            }]
        },
        "errors": {
            "generic": ["shipping_service_failed"]
        },
        "options": {
            "allow_separate_shipping_address": false,
            "date_of_birth_mandatory": false,
            "title_mandatory": false,
            "national_identification_number_mandatory": false,
            "phone_mandatory": true,
            "allowed_customer_types": ["person"],
            "payment_selector_on_load": false
        },
        "preview_payment_methods": [{
            "id": "-1",
            "type": "invoice",
            "locked": false,
            "selected": false,
            "data": {
                "days": 14
            }
        }, {
            "id": "-1",
            "type": "direct_debit",
            "locked": false,
            "selected": false
        }, {
            "id": "-1",
            "type": "credit_card",
            "locked": false,
            "selected": false,
            "data": {
                "available_cards": ["VISA", "MASTER"],
                "allow_saved_card": false,
                "do_save_card": false,
                "collect_consent": false,
                "consent_given": false
            }
        }],
        "allowed_billing_countries": ["swe"],
        "status": {
            "prescreened": false
        },
        "analytics_user_id": "ELmpDn1f600JYxHtagC7FcsOdAXe9-2iwWhIzHSfmhM=",
        "merchant": {
            "hashed_id": "a9c814c7a780d46a7fb2403e452829b3",
            "name": "Your business name"
        },
        "merchant_urls": {
            "checkout": "https://local.com/checkout/klarna",
            "confirmation": "https://checkout-eu.playground.klarna.com/yaco/orders/ffc4101d-00cb-5e63-81fc-0f0c15baeac3/redirect?auth_token=0el7mltb89prfz2fz2mw",
            "terms": "https://local.com/terms",
            "confirmation_page": "https://local.com/checkout/klarna/confirmation/id/ffc4101d-00cb-5e63-81fc-0f0c15baeac3"
        }
    }

这里我不喜欢这个块:

 "errors": {
        "generic": ["shipping_service_failed"]
    }

有人知道怎么解决吗?

传送错误:

【问题讨论】:

  • 您是否设法继续前进?我有同样的问题,在瑞典商店/商家使用 V3。
  • @kb。您是否找到任何解决方案我在 magento 1.9 上也面临同样的问题

标签: magento payment checkout klarna


【解决方案1】:

如果您在 localhost 上运行 Klarna Checkout,那么您应该使基于 localhost 的应用程序可以通过 HTTP 协议从 Klarna 访问(例如,对于 address_update 回调)。
您可以通过Ngrok 等服务来实现。

【讨论】:

    【解决方案2】:

    当您设置address_update 回调并且没有以正确的方式处理时,会发生此错误。如果您需要更新订单的地址,则应设置此回调,并且不应超过 10 秒。

    这是一个例子:https://developers.klarna.com/api/#checkout-api-callbacks-address-update

    还有一些最佳实践:https://developers.klarna.com/documentation/klarna-checkout/best-practices/#address-updated

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-15
      • 1970-01-01
      • 2017-03-28
      相关资源
      最近更新 更多