Task at our online shop agency: The payment interface from the manufacturer Customweb used in our Magento 2 shop had to be replaced with the interface from the provider Fatchip, as Computop had transferred the support of its shop interfaces from Customweb to Fatchip. The new Fatchip interface was installed without any problems, and the Customweb modules were uninstalled.

 

 

However, after installing the Fatchip module, two payment methods were not working: credit card and PayPal. The errors occurred within the Magento 2 system before any communication with the Computop interface was initiated.

 

The issue in our Magento 2 agency was caused by the fact that we only offer virtual products. When the order was created, no shipping address was therefore requested. However, the Fatchip interface requires a shipping address. If it is not available, an error occurs.

 

Fortunately, this was easy to fix. One change was required for PayPal and another for credit card payments.

 

If you only sell virtual products (for physical products, the solution is similar), it was sufficient to modify two files:

 

The first change needs to be made in the file

 

app/code/Fatchip/Computop/Model/Method/PayPal.php

 

Here, it is sufficient to make the following change:

 

protected function getPayPalAddressData(Order $order)

{

    $address = $order->getShippingAddress();

    //econcess

    if ($address === null) $address = $order->getBillingAddress();

    //econcess

 

The following file also needed to be modified for credit card payments:

 

app/code/Fatchip/Computop/Model/Api/Request/Authorization.php

 

with the following adjustment:

 

        if ($methodInstance->isAddressDataNeeded() === true) {

//econcess

            $this->addParameter('shippingAddress', $this->getAddressInfo($order->getBillingAddress()));

//econcess

            $this->addParameter('shippingAddress', $this->getAddressInfo($order->getShippingAddress()));

        }

 

In simple terms: If the ShippingAddress is not available, use the BillingAddress instead.

 

Everything is now working correctly, as tested in our online shop agency with Magento 2.5.