GithubHelp home page GithubHelp logo

paygate / payweb_magento_2 Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 5.0 415 KB

This is the PayGate PayWeb3 plugin for Magento 2.

License: GNU General Public License v3.0

PHP 92.21% HTML 3.31% JavaScript 3.96% CSS 0.51%
magento2 magento2-module payweb

payweb_magento_2's People

Contributors

andrevanzuydam avatar appinlet avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

payweb_magento_2's Issues

Place order throws "We could not find "Order" for processing" for paygate module latest version

We have installed the latest version of the PayGate module version 2.4.1. We're on Magento 2.4.2 and require this payment method going forward.

Do you plan on making this module stable for this Mgento version (2.4.2)?

[2021-05-19 20:05:10] report.CRITICAL: Exception message: We could not find "Order" for processing Trace: <pre>#1 PayGate\PayWeb\Controller\Redirect\Index->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58] #2 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #3 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php:51] #4 Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135] #5 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #6 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->___callPlugins() called at [generated/code/PayGate/PayWeb/Controller/Redirect/Index/Interceptor.php:23] #7 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111] #8 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #9 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #10 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #11 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->___callPlugins() called at [generated/code/PayGate/PayWeb/Controller/Redirect/Index/Interceptor.php:113] #12 PayGate\PayWeb\Controller\Redirect\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:186] #13 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:118] #14 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #15 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #16 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:99] #17 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #18 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:71] #19 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #20 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #21 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23] #22 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116] #23 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23] #24 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263] #25 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:41]

Payment information `paymentTypes` is not being used

The original topic mentioned here (which was closed) : Change paymentTypes in PayWeb/Model/PayGate.php to use static descriptions

At the time when I requested a change to use static descriptions I was still under the impression that paymentTypes have some use, but it turns out it is not used in v2.4.8 at all.

So, since I have now been waiting for the next release mentioned which would include the above changes, this is still not available, and since I am forced to use v2.4.8 at the moment, I investigated $paymentTypes further and to make a solution for our use.

I do not see $paymentTypes being used anywhere.

Inside PayWeb/Model/PayGate.php function prepareFields() does this:

    if ($paymentType !== '0' && $this->getConfigData('paygate_pay_method_active') != '0') {
        $fields['PAY_METHOD']        = $this->getPaymentType($paymentType);
        $fields['PAY_METHOD_DETAIL'] = $this->getPaymentTypeDetail($paymentType);
    }

getPaymentType():

    public function getPaymentType($pt)
    {
        switch ($pt) {
            case self::BANK_TRANSFER:
                return self::BANK_TRANSFER;
                break;
            case self::ZAPPER_METHOD:
                return 'EW';
                break;
            case self::SNAPSCAN_METHOD:
                return 'EW';
                break;
            case self::MOBICRED_METHOD:
                return 'EW';
                break;
            case self::MOMOPAY_METHOD:
                return 'EW';
                break;
            case self::MASTERPASS_METHOD:
                return 'EW';
                break;
            case self::PAYPAL_METHOD:
                return 'EW';
                break;
            default:
                return 'CC';
                break;
        }
    }

getPaymentDetail():

    public function getPaymentTypeDetail($ptd)
    {
        switch ($ptd) {
            case self::BANK_TRANSFER:
                return self::BANK_TRANSFER_METHOD_DETAIL;
                break;
            case self::ZAPPER_METHOD:
                return self::ZAPPER_DESCRIPTION;
                break;
            case self::SNAPSCAN_METHOD:
                return self::SNAPSCAN_DESCRIPTION;
                break;
            case self::MOBICRED_METHOD:
                return self::MOBICRED_DESCRIPTION;
                break;
            case self::MOMOPAY_METHOD:
                return self::MOMOPAY_METHOD_DETAIL;
                break;
            case self::MASTERPASS_METHOD:
                return self::MASTERPASS_DESCRIPTION;
                break;
            case self::PAYPAL_METHOD:
                return self::PAYPAL_DESCRIPTION;
                break;
            default:
                return self::CREDIT_CARD_DESCRIPTION;
                break;
        }
    }

At first when I opened this ticket I assumed it is that $paymentTypes inside /PayGate.php used, however I now realise this is not the case:

/view/frontend/web/template/payment/paygate.html

<!-- ko foreach: { data: JSON.parse(getPaymentTypesList()), as: 'option' }

This is referenced inside view/frontend/web/js/view/payment/method-renderer/paygate-method.js:

      getPaymentTypesList: function () {
        var paymentTypes = window.checkoutConfig.payment.paygate.paymentTypeList
        return paymentTypes
      },

paymentTypeList is defined in /PayWeb/Model/PaygateConfigProvider.php:

'paymentTypeList'           => $this->getPaymentTypes()

Relevant part inside PaygateConfigProvider->getPaymentTypes():

        $allTypes = array(
            'CC'            => array(
                'value' => 'CC',
                'label' => "Card",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/mastercard-visa.svg'),
            ),
            'BT'            => array(
                'value' => 'BT',
                'label' => "SiD Secure EFT",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/sid.svg'),
            ),
            'EW-ZAPPER'     => array(
                'value' => 'EW-ZAPPER',
                'label' => "Zapper",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/zapper.svg'),
            ),
            'EW-SNAPSCAN'   => array(
                'value' => 'EW-SNAPSCAN',
                'label' => "SnapScan",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/snapscan.svg'),
            ),
            'EW-MOBICRED'   => array(
                'value' => 'EW-MOBICRED',
                'label' => "Mobicred",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/mobicred.svg'),
            ),
            'EW-MOMOPAY'    => array(
                'value' => 'EW-MOMOPAY',
                'label' => "MoMoPay",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/momopay.svg'),
            ),
            'EW-MASTERPASS' => array(
                'value' => 'EW-MASTERPASS',
                'label' => "MasterPass",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/masterpass.svg'),
            ),
            'EW-PAYPAL'     => array(
                'value' => 'EW-PAYPAL',
                'label' => "PayPal",
                'image' => $this->getViewFileUrl('PayGate_PayWeb::images/paypal.svg'),
            )

In short:

  • Paygate->paymentTypes is not used anywhere in v2.4.8....

  • but getPaymentTypeDetail() converts paymentType into its relevant label. This process seems to be on order creation which is not useful when trying to update frontend labels

  • PaygateConfigProvider->getPaymentTypes() is using hard-coded Labels which would have been more useful if they actually referenced those constants in /Paygate.php ($paymentTypes).

Since I am using v2.4.8 there is no easy way to submit a Pull Request, as I will have to override both PayGate.php and PaygateConfigProvider.php

Compatibility of newest versions with Magento 2.3x

@appinlet

Sorry for highlighting something, but I need clarification:

I want to update your recent changes (#36), but I have now read in this thread that v2.5.1 requires Magento 2.4.5.

Am I correct in saying that there is not going to be any compatible version for Magento 2.3 anymore, I would not be able to upgrade to v2.5.1 or any 'future versions' as Paygate support continues to suggest I do... and don't understand the compatibility requirements

Magento 2.4 is still in branch 2.4-dev; and looking at the 1000s of open issues far from 'production ready'.

What about sites that are still running Magento 2.3, on PHP7.3/PHP7.4 ? I don't think we are the only ones?

Provide composer support

As most of the Magento2 world is now handled via composer, it would be great if you could include a composer.json file to make this module available via composer.

Paygate Web isssue on Magento 2.3.3

We have tried integrating the Pay web Magento plugin. We are successfully redirected to paygate page on checkout, but while redirecting back to our website we are redirected to the home page with an error "Invalid Form Key. Please refresh the page and try again."

go to portal
Add the product to the cart.
Select a country, province, and enter the south African Pincode. eg. South Africa, Gauteng, 2198.
Select Anyone Shipping Method.
Click on "Go To Checkout".
Enter Address and phone number.
Click on Next at button.
Select Paygate and click on "Place order"
Enter Test Credit Card Number as below
4000000000000002, Select any future expiry date and 123 as CVV
Click Next
Click ok in alert and submit.
On submission, the Magento takes back to the home page with the error " Invalid Form Key. Please refresh the page and try again. "

Installation with composer 2.1 the version of extension 2.5.1

Hello.
I got an error when try to install the PayWeb via composer.
Selection_305

Magento CLI 2.4.4-p1
PHP 8.1.6
Ubuntu 20.04.2 LTS
Composer version 2.1.14

The php 8.1 not allowed the library ext-http, but it required in the composer.json for this extension.

Please provide payment for the order on order success response

Hello,
We are getting error on paygate success redirect page "Please provide payment for the order".
pagegate success response redirect to checkout cart page not order success page.
We are using magento 2.3.4.
Let me know if you want any information from our side.

PayGate creating multiple orders

PayGate keeps creating multiple orders while a customer is busy paying via Credit Card or SID. When the customer cancels, the order gets cancelled and the session starts again which is undestandable. However we have a lot of cases where their order is Pending Payment and then then two or three orders later we get a Processing order.

E.g: https://cl.ly/5e80af3076dd/Image%202019-08-16%20at%2016.19.09.png

Something is causing the session to drop and instead of updating the Pending Payment order to Processing it keeps creating a new order.

Change paymentTypes in PayWeb/Model/PayGate.php to use `static` descriptions

I have a request from my company to change the text displayed for some of the payment options, and the current implementation of PayWeb/Model/PayGate.php uses constants for the descriptions:

    protected $paymentTypes = [
        self::CREDIT_CARD_METHOD   => self::CREDIT_CARD_DESCRIPTION,
        self::BANK_TRANSFER_METHOD => self::BANK_TRANSFER_METHOD_DETAIL,
        self::ZAPPER_METHOD        => self::ZAPPER_DESCRIPTION,
        self::SNAPSCAN_METHOD      => self::SNAPSCAN_DESCRIPTION,
        self::MOBICRED_METHOD      => self::MOBICRED_DESCRIPTION,
        self::MOMOPAY_METHOD       => self::MOMOPAY_METHOD_DETAIL,
        self::SCANTOPAY_METHOD     => self::SCANTOPAY_DESCRIPTION,
        self::PAYPAL_METHOD        => self::PAYPAL_DESCRIPTION,
    ];

I would like to override the descriptions for these payment types inside Model/PayGate.php without changing anything else, so that any updates you do on this file in the future remains.

I would like to request static to be used for these payment type descriptions instead of self:

    protected $paymentTypes = [
        self::CREDIT_CARD_METHOD   => static::CREDIT_CARD_DESCRIPTION,
        self::BANK_TRANSFER_METHOD => static::BANK_TRANSFER_METHOD_DETAIL,
        self::ZAPPER_METHOD        => static::ZAPPER_DESCRIPTION,
        self::SNAPSCAN_METHOD      => static::SNAPSCAN_DESCRIPTION,
        self::MOBICRED_METHOD      => static::MOBICRED_DESCRIPTION,
        self::MOMOPAY_METHOD       => static::MOMOPAY_METHOD_DETAIL,
        self::SCANTOPAY_METHOD     => static::SCANTOPAY_DESCRIPTION,
        self::PAYPAL_METHOD        => static::PAYPAL_DESCRIPTION,
    ];

This means that I just change the values for the constants inside the overriding class, without having to completely change protected $paymentTypes

const CREDIT_CARD_DESCRIPTION     = 'Credit Card';

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.