Code Monkey home page Code Monkey logo

opencart's Introduction

MultiSafepay plugin for OpenCart 3.x

Easily integrate MultiSafepay payment solutions into your OpenCart webshop with our free plugin.

Latest stable version

About MultiSafepay

MultiSafepay is a collecting payment service provider, which means we take care of electronic contracts, technical details, and payment collection for each payment method. You can start selling online today and manage all your transactions in one place.

Supported payment methods

See MultiSafepay Docs – OpenCart > Payment methods.

Prerequisites

  • You will need a MultiSafepay account. Consider a test account first.
  • OpenCart 2.X, 3.x
  • Tested on PHP 7.2, 7.3

Installation via the OpenCart installer

  1. Download the Plugin_OpenCart_3.x.x.ocmod.zip.
  2. Sign in to your OpenCart backend.
  3. Go to Extensions > Installer.
  4. Click Upload, and then select the downloaded file.
  5. Once installed, click the Dashboard menu.
  6. To clear both caches, click the blue cog wheel button in the top-right corner, and then click the Refresh icon.
  7. Go to Extensions > Modifications, and then click Refresh.
  8. Go to Extensions > Payments > MultiSafepay, and then click Install.

For more information and configuration instructions, see MultiSafepay Docs – OpenCart.

Support

Want to be part of the team?

Are you a developer interested in working at MultiSafepay? Check out our job openings and feel free to get in touch!

opencart's People

Contributors

danielcivit avatar jasper-multisafepay avatar miguel-multisafepay avatar ronald-multisafepay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencart's Issues

Coupons of percantage type in MultisafePay Control

I don't know if it's a bug or a feature request, but we're having trouble displaying coupons in the Multisafepay Control dasbboard. It comes with coupons that are valid for all products and thus have no product or category restriction.

Situation

Coupons is sorted higher by order totals than taxes. Type of coupons used is: Percentage for all items in the order. If we put the Coupons before the tax totals then fixed price coupons will be applied proportionally to all products. Which can come at negative prices.

Coupon = FIXED_TYPE
is_order_lower_than_taxes = true
image

Coupon = FIXED_TYPE
is_order_lower_than_taxes = false
image

Coupon = PERCENTAGE_TYPE
is_order_lower_than_taxes = true
image

Coupon = PERCENTAGE_TYPE
is_order_lower_than_taxes = false
Discount is not shown and calculated at all. Order ammout of € 891,65 had been paid en is the correct total
image

Result

Percentage discount is not displayed correctly in the Multisafepay Control panel.

Cause

Percent off all products is not applied if the order comes after the tax totals.

Solution

Percent discount that applies to all products should always be executed regardless of whether this order is higher or lower than the tax totals.

Coupon = PERCENTAGE_TYPE
is_order_lower_than_taxes = false
image

I felt so free to make a pull request for this. If this is not the correct way of working, I would like to apologize.

MSP payment screen is not displaying correct tax when credits are used!

Hi

See attachment.
msp

When I have an order with credits in it, I see that in the MSP overview, the tax calculation is wrong. The tax calculation is done over the subtotal amount of 1,95 but with credits of -1,95, there is no tax on the products.
So only tax on the shipping costs of 6 euro must be calculated, is 1,26.

When I go forward with the payment, the amount to pay IS correct 7,26.

Can this be fixed, is this the opencart extension or the MSP page.

Best regards
Dennis

Working with customer balance problem

Hi

When I pay an order with customer account that has a balance amount available, this balance amount is always just in the Multisafepay transaction, see attachement. Two things, you can see it does not check the order total against the balance amount, so I must pay a negative amount. Second when in the order I don't use credits, so total['credit'] is not available, I don't want to see it in Multisafepay.

So I change the code to check if total credit is available and use that amount in the order. See code below.

private function getCustomerBalanceItem($order_id) {
$order_totals = $this->getOrderTotals($order_id);
/* Dennis */
$has_credit = array_search('credit', array_column($order_totals, 'code'));
if ($has_credit === false) {
return false;
}

    $this->load->language($this->route);
    $customer_additional_data = $this->getAdditionalCustomerData();
    $order_info = $this->getOrderInfo($order_id);
    return $this->getNegativeCartItemObject(
        -$order_totals[$has_credit]['value'], // Dennis $customer_additional_data['customer_balance'],
        $order_info,
        $this->language->get('text_customer_balance'),
        1,
        'CREDIT',
        0
    );
}

Also on line about 107 an extra check:

// Customer Balance - Credit
$customer_additional_data = $this->getAdditionalCustomerData();
if ($customer_additional_data['customer_balance'] > 0) {
$customer_balance_item = $this->getCustomerBalanceItem($order_id);
/* Dennis */
if ($customer_balance_item) {
$shopping_cart_items[$this->config->get($this->total_extension_key_prefix . 'credit_sort_order')][] = $customer_balance_item;
}
}

In order with zero tax I must still pay tax in MSP payment screen

Hi

I have just upgraded from a very old MSP OpenCart extensie to the latest. Most things went well and it was quite easy to upgrade.
Now I have one issue.
I have an extension that add 'Reverse charge - VAT exempt' so when a valid vat number is applied, the VAT will be zero.
So I have an order with order total tax with 0 euro, and in the table order_product the product records have all field 'tax' is also
zero.

msp1
msp2

But when I want to pay, in the MultisafePay payment screen I must pay taxes again.
After investigation I see in system\library\multisafepay.php at line 673: $cart_item->addTaxRate((float)$tax_rate);
This will get the tax_rate from the product table again, and it is ignoring the order_product->tax field that is zero.

I have a workaraound for myself, but maybe its good to also use and check order_product->tax field, or maybe order total tax.

Best regards
Dennis

Order payment method in database exceeds 128 characters

Hi

Enother small issue. I saw a lot of logging entries like:

Callback received with a non registered payment method for 115480 on 14/03/2022 10:21:03 with status: expired, and PSP ID:

I checked and I think the problem is when you display payment methods with icoons, a very large string will be added in table order->payment_method, more then 128 characters. This depend a bit on the image url with domain name.

You can say, I do the img src without domein name, but then I think when a pdf invoice is generated the image will not be displayed.

I have made the field order->payment_method 256 characters max to solve it.

Best regards
Dennis

Add support for OpenCart 4.0.2.x & PHP 8.3

Starting from OpenCart v4.0.2.x, the GetMethod function in payment modules is renamed to GetMethods. This is a breaking change and results in an notice while fetching the built-in payment methods, which terminates execution of the event method.

Notice: Undefined property: Proxy::getMethod in /htdocs/extension/multisafepay/system/library/multisafepayevents.php on line 102

The result is that no MultiSafePay payment methods are displayed in the checkout.

See https://github.com/opencart/opencart/blame/fa8ecb37df3ce9894f75465a5b40ff41b48b8f5f/upload/extension/opencart/catalog/model/payment/cod.php#L4

Affected plugin version: 1.3.0 (is this the correct repo?)

Using PayCharge extension will not redirect on checkout to Multisafepay

Hi

Another issue that I couldn't find myself yet. I am using an extension https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=5040&filter_download_id=44&sort=price that adds another order total with name paycharge.
When paycharge apply and I press the payment button to goto Multisafepay, its loading and not redirected to Multisafepay but stay in the checkout page. Enabled logging but no error.

Best regards
Dennis

open_basedir restrictions

Opencart version 3.0.3.7, php 7.4.3
In the latest opencart distro's storage directory must be moved outof the public web directory.
The MSP module seems to use vendor files from that directory and more outside of that?
With open_basedir opened for publicweb and storage directories the module still generates restriction errors.

Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client1/web5/web/system/library/multisafepay/vendor/composer/../../../../../../src/Sdk.php) is not within the allowed path(s): (/var/www/clients/client1/web5/web:/var/www/clients/client1/web5/storage) in /var/www/clients/client1/web5/storage/vendor/composer/ClassLoader.php on line 384

Opencart 4

Will this module be available for Opencart 4 soon? Otherwise we make the choice to still use opencart 3 so that this module can be used.

Thanks in advance.

Shipping tax not applied in OpenCart 2.3

Hi

I saw that the tax calculation was not working for the tax over the shipping costs. I see in the code function system\library\multisafepay.php -> getShippingTaxClassId() that the tax_class_id is checked from the configuration, thats good :-)
The way you try to check opencart settings for tax_class_id will work for most extensions if they applay to the standard, I can see its working for OpenCart 3 extensions. I am using OpenCart 2.3, so you must use code for most extensions:

$shipping_tax_class_id_key = $shipping_code['0'] . '_tax_class_id';

Best regards
Dennis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.