#StackBounty: #payment-gateway #payment #klarna #klarna-widget How to get the form in the Klarna Payments Widget displayed?

Bounty: 100

I’m building a kind of sandbox integration of Klarna Payments (to get it working in principle and implement the logic later into a real shop). The first step described in the docu, the session creating, has worked. Now I’m trying to get the Klarna widget displayed:

klarna-widget.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Klarna Widget</title>
</head>
<body>
<script>
    window.klarnaAsyncCallback = function () {
        Klarna.Payments.init({
            client_token: 'evstbGciOiJSUzI1...'
        })
        Klarna.Payments.load(
            {
                container: '#klarna-payments-container',
                payment_method_category: 'pay_later'
            },
            function (res) {
                console.debug(res);
            }
        )
    };
</script>
https://x.klarnacdn.net/kp/lib/v1/api.js
<div id="klarna-payments-container"></div>
</body>
</html>

The current result looks like this:

Klarna Widget without form

Instead of the expected result shown in the documentation:

Klarna Widget form

But the form is not there. How to get it displayed?

UPDATE

Just took a look at the console. There are some warnings and errors:

DevTools failed to load SourceMap: Could not load content for https://x.klarnacdn.net/device-recognition/1f14eaf/main.bundle.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
blob:https://klarna-payments-eu.playground.klarna.com/2ca435b3-87fb-4538-aa91-45c6c94e9243:16

WebSocket connection to 'wss://127.0.0.1:5939/' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED
td_zM @ blob:https://klarna-payments-eu.playground.klarna.com/2ca435b3-87fb-4538-aa91-45c6c94e9243:16
(anonymous) @ blob:https://klarna-payments-eu.playground.klarna.com/2ca435b3-87fb-4538-aa91-45c6c94e9243:14

(13) WebSocket connection to '<URL>' failed: WebSocket is closed before the connection is established.
...

klarna widget socket error

But the res object seems fine:

{show_form: true}
show_form: true
__proto__:
constructor: ƒ Object()
hasOwnProperty: ƒ hasOwnProperty()
isPrototypeOf: ƒ isPrototypeOf()
propertyIsEnumerable: ƒ propertyIsEnumerable()
toLocaleString: ƒ toLocaleString()
toString: ƒ toString()
valueOf: ƒ valueOf()
__defineGetter__: ƒ __defineGetter__()
__defineSetter__: ƒ __defineSetter__()
__lookupGetter__: ƒ __lookupGetter__()
__lookupSetter__: ƒ __lookupSetter__()
get __proto__: ƒ __proto__()
set __proto__: ƒ __proto__()


Get this bounty!!!

#StackBounty: #magento2.3 #sales-order #payment #magento2.3.5 #order-collection How to add payment filter in Order collection factory m…

Bounty: 50

I need to add the "po_number" as filter in order collection factory, i am trying to implement this in the sales order history page using getOrders function in the History.php

Full Code :

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace SmSalesOrderGridTableBlockOrder;

use MagentoFrameworkAppObjectManager;
use MagentoSalesModelResourceModelOrderCollectionFactoryInterface;

/**
 * Sales order history block
 *
 * @api
 * @since 100.0.2
 */
class History extends MagentoFrameworkViewElementTemplate
{
    /**
     * @var string
     */
    protected $_template = 'Magento_Sales::order/history.phtml';

    /**
     * @var MagentoSalesModelResourceModelOrderCollectionFactory
     */
    protected $_orderCollectionFactory;

    /**
     * @var MagentoCustomerModelSession
     */
    protected $_customerSession;

    /**
     * @var MagentoSalesModelOrderConfig
     */
    protected $_orderConfig;

    /**
     * @var MagentoSalesModelResourceModelOrderCollection
     */
    protected $orders;

    /**
     * @var CollectionFactoryInterface
     */
    private $orderCollectionFactory;

    /**
     * @param MagentoFrameworkViewElementTemplateContext $context
     * @param MagentoSalesModelResourceModelOrderCollectionFactory $orderCollectionFactory
     * @param MagentoCustomerModelSession $customerSession
     * @param MagentoSalesModelOrderConfig $orderConfig
     * @param array $data
     */
    public function __construct(
        MagentoFrameworkViewElementTemplateContext $context,
        MagentoSalesModelResourceModelOrderCollectionFactory $orderCollectionFactory,
        MagentoCustomerModelSession $customerSession,
        MagentoSalesModelOrderConfig $orderConfig,
        array $data = []
    ) {
        $this->_orderCollectionFactory = $orderCollectionFactory;
        $this->_customerSession = $customerSession;
        $this->_orderConfig = $orderConfig;
        parent::__construct($context, $data);
    }

    /**
     * @inheritDoc
     */
    protected function _construct()
    {
        parent::_construct();
        $this->pageConfig->getTitle()->set(__('My Orders'));
    }

    /**
     * Provide order collection factory
     *
     * @return CollectionFactoryInterface
     * @deprecated 100.1.1
     */
    private function getOrderCollectionFactory()
    {
        if ($this->orderCollectionFactory === null) {
            $this->orderCollectionFactory = ObjectManager::getInstance()->get(CollectionFactoryInterface::class);
        }
        return $this->orderCollectionFactory;
    }

    /**
     * Get customer orders
     *
     * @return bool|MagentoSalesModelResourceModelOrderCollection
     */
    public function getOrders()
    {
        if (!($customerId = $this->_customerSession->getCustomerId())) {
            return false;
        }
        if (!$this->orders) {
            $this->orders = $this->getOrderCollectionFactory()->create($customerId)->addFieldToSelect(
                '*'
            )->addFieldToFilter(
                'status',
                ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
            )->addFieldToFilter(
                'entity_id',
                ['num' => 362]
            )->setOrder(
                'ext_order_id',
                'desc'
            );
        }
        $this->orders->getSelect()
        ->join(
            ["sop" => $this->getTable("sales_order_payment")],
            'main_table.entity_id = sop.parent_id'
        )
        ->where('sop.po_number = ?','08RRR');

        echo "<pre>"; print_r($this->orders->getData()); die("dead");
        return $this->orders;
    }
}

Specific get Orders():

public function getOrders()
        {
            if (!($customerId = $this->_customerSession->getCustomerId())) {
                return false;
            }
            if (!$this->orders) {
                $this->orders = $this->getOrderCollectionFactory()->create($customerId)->addFieldToSelect(
                    '*'
                )->addFieldToFilter(
                    'status',
                    ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
                )->addFieldToFilter(
                    'entity_id',
                    ['num' => 362]
                )->setOrder(
                    'ext_order_id',
                    'desc'
                );
            }
            $this->orders->getSelect()
            ->join(
                ["sop" => $this->getTable("sales_order_payment")],
                'main_table.entity_id = sop.parent_id'
            )
            ->where('sop.po_number = ?','08RRR');
    
            echo "<pre>"; print_r($this->orders->getData()); die("dead");
            return $this->orders;
        }


Get this bounty!!!

#StackBounty: #magento2 #orders #payment #authorize.net #magento2.2.9 Magento 2: Authorize.Net Not Creating The Order After Order Placed

Bounty: 50

I am working on a Magento 2.2.9 project and using Authorize.net accept.js payment gateway (default Magento Module).

However, the website is working fine but the issue is, when a customer place an order (sometimes on random cases), after the payment process it is not creating the order in Magento admin. I have checked the payment logs before order place and the data inside log is correct.

Kindly help me how do I get to resolve this issue?

Thank you.


Get this bounty!!!

#StackBounty: #magento2 #orders #invoice #payment Order Problem – Products lost from the invoice – Magento 2.3.1

Bounty: 50

For the payment methods I am using the Mollie extension. A customer has placed an order, and has paid for it correctly. But, the information that I can see in the order view is the following:

enter image description here

As you can see, Magento says that the client has paid everything except € 5.42 (but this is not true because I received the total money).

And also Magento does not include one of my products in the invoice. You can see in the following picture how Magento includes a product in the invoice but not the last one.

enter image description here

In addition, I can not change the status of the order. If I try to issue an invoice, I receive the following error:

enter image description here

Any idea why this happens and how to solve it? I have 5 orders like this, with products that do not appear on the invoice and Magento says they must be paid (but I received the full amount of the order)


Get this bounty!!!

#StackBounty: #magento2 #api #payment-methods #payment Magento2 API to access internal payment method

Bounty: 50

I am working on creating a way to make an order via the magento api and wondering if it is possible to access internal payment methods (payment methods that are only enabled for the admin panel) via the api?

So for example I have a plugin that creates a payment method that can only be seen/used via the magento admin panel. however when I use the magento API to list out payment methods I do not see that payment method listed and think its because its set to be viewable/usable only on the admin panel. So what would i change in the api call to gain access to it?


Get this bounty!!!

#StackBounty: #payment-methods #forms #payment How to modify Bank Transfer Payment OR Cash On Delivery Payment methods? Looking to rena…

Bounty: 50

Magento 1.9.4
Porto theme

We urgently need to modify either the ‘Bank Transfer Payment’ payment method or the ‘Cash On Delivery’ payment method. What we are after is:

  1. label the existing form text field

and

  1. add 2 more drop-down type form fields

How can this be done so that it captures the information and adds it to the order?


Get this bounty!!!