Code Monkey home page Code Monkey logo

sezzle-magento2's People

Contributors

aholdahl avatar arijit-codilar avatar arijit-de avatar arijit-sezzle avatar carlodekker avatar rishimukherjee avatar sitikanthasezzle avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sezzle-magento2's Issues

Order view plugin does not call proceed so prevents after plugins added to the execute method

We have a custom plugin that runs afterExecute on the order view controller. However your module adds a plugin aroundExecute on the same class that does not call proceed and thus stops our plugin from firing.

When reading this code it seems like the only requirement is setting a specific flag on the order before the page is rendered.
https://github.com/sezzle/sezzle-magento2/blob/master/Plugin/Sales/Controller/Adminhtml/Order/ViewPlugin.php

If that is the case, there is no need to us an around plugin, and especially not to have the plugin also extend the class it is plugging into. Could you not instead use a before plugin like so?:

<?php

namespace Sezzle\Sezzlepay\Plugin\Sales\Controller\Adminhtml\Order;

use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Sales\Controller\Adminhtml\Order\View;
use Magento\Sales\Model\Order;
use Sezzle\Sezzlepay\Model\Sezzle;
use Sezzle\Sezzlepay\Model\System\Config\Container\SezzleConfigInterface;

class CheckAuthExpiry
{
    private $sezzleModel;
    private $sezzleConfig;
    private $orderRepository;

    /**
     * @param OrderRepositoryInterface $orderRepository
     * @param Sezzle $sezzleModel
     * @param SezzleConfigInterface $sezzleConfig
     */
    public function __construct(
        OrderRepositoryInterface $orderRepository,
        Sezzle $sezzleModel,
        SezzleConfigInterface $sezzleConfig
    ) {
        $this->orderRepository = $orderRepository;
        $this->sezzleModel = $sezzleModel;
        $this->sezzleConfig = $sezzleConfig;
    }

    public function beforeExecute(
        View $subject
    ) {
        try {
            $order = $this->orderRepository->get($subject->getRequest()->getParam('order_id'));
        } catch (NoSuchEntityException $e) {
            //Early exit, this exception will be thrown later in the request and exit before any of this
            //plugin's modifications are required
            return;
        }
        $isTokenizedAllowed = $this->sezzleConfig->isTokenizationAllowed();
        $order->setActionFlag(
            Order::ACTION_FLAG_INVOICE,
            $this->sezzleModel->canInvoice($order)
            || $isTokenizedAllowed
        );
    }
}

This would set the flag at the correct time without requiring you to extend the view controller or block other plugins. Thoughts?

Cheers
Luke

Undefined index: pdp_widget_enabled or Undefined index: sezzle_enabled - Sezzle 7.0.7

Magento 2.4.3-p3
Sezzle: 7.0.7

When saving payment methods on anything other than the Scope: Default config I am receiving the error undefined index: pdp_widget_enabled or Undefined index: sezzle_enabled.

Output of one of Payment method configuration changes made when within a site level scope.

{"0":"Notice: Undefined index: pdp_widget_enabled in /vendor/sezzle/sezzlepay/Plugin/Config/Controller/Adminhtml/System/Config/SavePlugin.php on line 257","1":"#1 Sezzle\Sezzlepay\Plugin\Config\Controller\Adminhtml\System\Config\SavePlugin->getNewConfig() called at [vendor/sezzle/sezzlepay/Plugin/Config/Controller/Adminhtml/System/Config/SavePlugin.php:122]\n#2 Sezzle\Sezzlepay\Plugin\Config\Controller\Adminhtml\System\Config\SavePlugin->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#3 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#4 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Config/Controller/Adminhtml/System/Config/Save/Interceptor.php:23]\n#5 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]\n#6 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]\n#7 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/module-config/Controller/Adminhtml/System/AbstractConfig.php:69]\n#8 Magento\Config\Controller\Adminhtml\System\AbstractConfig->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#9 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#10 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143]\n#11 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#12 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#13 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Config/Controller/Adminhtml/System/Config/Save/Interceptor.php:32]\n#14 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]\n#15 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]\n#16 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:147]\n#17 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#18 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#19 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#20 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]\n#21 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]\n#22 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]\n#23 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]\n#24 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]\n","url":"/a0725885fc_admin/admin/system_config/save/key/4ab8aa3235981acca390c525584bb8ddfe0c5881b172020869313045db5ebad5/section/payment/website/2/","script_name":"/

Guest checkout with tokenization - Error - Customer is charged but order is not saved in M2

Sezzle version : 5.0.0
Magento version : 2.3.3-p1

STR:

  1. enable customer tokenization
  2. in-context checkout disabled
  3. Place an order as a guest
  4. You will be redirected to Sezzle
  5. Note the Option to "Approve STORE to process payments from your Sezzle account for future transactions. You may revoke this authorization at any time in your Sezzle Dashboard." is showing on the "You're approved" page.
  6. Check the option to "Approve .... future transactions...."
  7. Complete the order.
  8. It will fail to save the data and cause an error.

This is due to the fact that there is not check if the customer is logged in when creating preparing the customer payload.
See :

$tokenize = $this->sezzleConfig->isInContextCheckout()
? false
: $this->sezzleConfig->isTokenizationAllowed();

This will fail when the response is returned on this line :

$customer->setCustomAttributes($tokenAttributes);

because there is no customer id hence no customer.

I will submit a PR for this in a minute.

Auth Expires after 30 min.

Sezzle : 5.0.0
Magento: 2.3.3-p1

STR

Configuration :

  • Payment action : Authorize only
  1. Place an order and wait, don't capture it right away.
  2. After 30 min the order will be cancelled because it was not captured.

Issue

It might be that the merchant can not process or ship the order right away. There could be a delay up to even a few days if there is no stock. Hence this should be configurable in the admin or the min increased to at least two weeks.

I believe the API does offer this option to set the expiration time under https://docs.sezzle.com/#create-a-session under Order object and checkout_expiration. This should be added when building the order payload based on an admin config or a minimum of 7 days if not more.

Solution

Add the checkout_expiration to the payload returned by this method.

private function buildOrderPayload($quote, $reference)
{
$orderPayload = [
"intent" => "AUTH",
"reference_id" => $reference,
"description" => $this->storeManager->getStore()->getName(),
"requires_shipping_info" => false,
"items" => $this->buildItemPayload($quote),
"discounts" => [$this->getPriceObject($quote->getShippingAddress()->getBaseDiscountAmount())],
"shipping_amount" => $this->getPriceObject($quote->getShippingAddress()
->getBaseShippingAmount()),
"tax_amount" => $this->getPriceObject($quote->getShippingAddress()->getBaseTaxAmount()),
"order_amount" => $this->getPriceObject($quote->getBaseGrandTotal()),
];
if ($this->sezzleConfig->isInContextCheckout()) {
return array_merge($orderPayload, ['checkout_mode' => $this->sezzleConfig->getInContextMode()]);
}
return $orderPayload;
}

Product Detail Page (PDP) Widget is not working

Magento ver. 2.4.2
Sezzle - 5.5.5

Product Detail Page (PDP) Widget is not working.

I debugged JS. It seems they ignore path and use hardcoded in widget-renderer.js one.

<div id="sezzle-widget"/> after the price element in the PDP is present.

Change introduced in release 5.2 breaks sandbox connection

The update to the file Model/System/Config/Container/SezzleIdentity.php which changes the sandboxGatewayUrl from https://sandbox.gateway.sezzle.com to https://staging.gateway.sezzle.com causes my authentication requests to have a 401 response. It would appear that the API keys generated from https://sandbox.dashboard.sezzle.com/merchant/settings/apikeys are not valid for the staging.gateway.sezzle.com domain.

As a result I have to force composer to install version 5.1.1, which does work.

Issue With Merchant Id Validation

We have our merchant id a mix of Characters and Numbers .
Ex: tp0g0ovtiu1m2ci1 (this is not a real merchant_id )

When we configured the extension in our Magento 2.3.2-p2 site .
And set this two options to Yes :
Add Widget Script in Pdp
Add Widget Script in Cart Page
https://cl.ly/3a4ad49ab33c

Going into product page and cart page , we faced a js issue :
uncaught SyntaxError: Unexpected token b in JSON at position 91
https://cl.ly/3cbd743bdfca

This issue was related to the merchant_id being a mixed chars and int , while in templates :
https://github.com/sezzle/sezzle-magento2/blob/master/view/frontend/templates/product.phtml
https://github.com/sezzle/sezzle-magento2/blob/master/view/frontend/templates/cart.phtml
It want to be an integer.

I added "" on the merchant id value , and it removed the js issue .

Magento 2.3.1 compatibility

The Sezzle M2 extension is not compatible with Magento version 2.3.1 because it requires "magento/framework": ">=100.0.4 <=102".

Do you have a release schedule for adjusting the requirements and compatibility?

PHP 7.2 compatibility

When I try to install the extension via composer I get this error:
[InvalidArgumentException]
Package sezzle/sezzlepay at version has a PHP requirement incompatible with your PHP version (7.1.25)

Magento 2.4.2-P1 Sezzle Error The requested qty is not available

Team,

When Configurable Child Last Item into Cart It is throwing error The requested qty is not available.

Senario,
Add Product Configurable with Simple Product into cart Which Simple Product (Child) have qty "1" (Last Item).
Process For Checkout Payment with Sezzle it is throwing Error "The requested qty is not available"

Screen Shot 2021-08-27 at 4 36 21 PM

Screen Shot 2021-08-27 at 4 56 27 PM

For Example there is Configurable Child Product 2 qty & add to Cart 2 qty. It is also given Same Error.

https://test.com/checkout/?deliveryType=ship#payment

image

image

Sezzle Trying Both Version 5.5.1 & 5.5.2 But Still Same issue.
image

Other Magento Default Payment Method working Fine with successful Order Placed ( Like PayPal, Amazon Pay, Check / Money Order etc)

Please Help me with that..

Public repo has higher version than private repo causing composer errors in 2.4.3

In Magento 2.4.3, a new composer plugin was added: magento/composer-dependency-version-audit-plugin

This plugin only does one thing and that is to check if there are any versions of a package on a public repo (https://repo.packagist.org/) that have a version number that is higher than that package on the private repo (https://repo.magento.com/).

Running composer update sezzle/sezzlepay results in the following error message being displayed:

 [Exception]                                                                                                                                   
  Higher matching version 5.5.3 of sezzle/sezzlepay was found in public repository packagist.org                                                
                               than 5.5.2 in private https://repo.magento.com. Public package might've been taken over by a malicious entity,   
                               please investigate and update package requirement to match the version from the private repository         

The this is a major problem for any Magento store on 2.4.3 currently running sezzle as it prevents us from running any composer commands while this package is installed via composer. The immediate fix would be to publish the 5.5.3 upgrade to the magento marketplace and to avoid publishing the public releases before the private releases.

Class 'Zend\Log\Writer\Stream' not found

Preconditions (*)

Magento 2.4.3

Steps to reproduce (*)

  • payment/sezzlepay/log_tracker config has to be enabled
  • save the payment admin config for Sezzle payment

Expected result (*)

Admin config is saved

Actual result (*)

An error is thrown. Class 'Zend\Log\Writer\Stream' not found

In Magento 2.4.3 'laminas-log' has been removed. So the laminas-zendframework-bridge doesn't work anymore for the Log.

This is the magento commit that deleted the composer dependency:
magento/magento2@f0840b1#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34

This is the problematic line in sezzle-magento2:
https://github.com/sezzle/sezzle-magento2/blob/master/Helper/Data.php#L18

Undefined array key sezzlepay

Hello everyone.

I am having problems with Sezzle, because it is giving me an error when I give it "save configuration" in the store configuration, when I review the error, it indicates this message:

{"0":"Warning: Undefined array key "sezzlepay" in /var/www/vhosts/dev9.sbmedicaldeveloper.com/httpdocs/vendor/sezzle/sezzlepay/Plugin/Config/Controller/Adminhtml/System/Config/SavePlugin.php on line 113","1":"#1 Sezzle\Sezzlepay\Plugin\Config\Controller\Adminhtml\System\Config\SavePlugin->aroundExecute() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#2 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#3 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Config/Controller/Adminhtml/System/Config/Save/Interceptor.php:23]\n#4 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]\n#5 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]\n#6 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/module-config/Controller/Adminhtml/System/AbstractConfig.php:69]\n#7 Magento\Config\Controller\Adminhtml\System\AbstractConfig->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#8 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#9 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:145]\n#10 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#11 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#12 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->___callPlugins() called at [generated/code/Magento/Config/Controller/Adminhtml/System/Config/Save/Interceptor.php:32]\n#13 Magento\Config\Controller\Adminhtml\System\Config\Save\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]\n#14 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]\n#15 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:147]\n#16 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#17 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#18 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#19 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]\n#20 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]\n#21 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]\n#22 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]\n","url":"/admin_baiq83FNQt2d26W2K6Vuw5AQ6UVqua/admin/system_config/save/key/c8424a6fca5604a6f8bac98cabeb55424e271fce658a2890457c4584c5e07240/section/themecore/","script_name":"/pub/index.php","report_id":"6a808a4b9d2b1113b9c6d01d87c134e8744d2fe859318c16c1b134aec2bd319f"}

I am running magento 2.4.5-p1 and php 8.1

Error in Graphql when executing createSezzleCheckout mutation

When we execute this mutation
mutation createSezzleCheckout($cart_id: String!) {
action:createSezzleCheckout(input: { cart_id: $cart_id }) {
success
checkout_url
}
}
We always get "Internal server error"
and in the log we have
main.ERROR: Sezzle\Sezzlepay\Gateway\Request\Session\OrderRequestBuilder::getPriceObject(): Argument #1 ($amount) must be of type float, null given

we are using Postman to re-produce this issue
do you have any idea?
in other hand this mutaton is working as expected "createSezzleCustomerOrder"

Sezzle payment option at checkout not working

Sezzle payment is not working, the option is showing at checkout but when you click place order nothing is happening. no error in log.
Magento ver. 2.2.3
Amasty One Step Checkout ( I tried with default checkout but to no avail)

Sizzle url: https://gateway.sezzle.com
I entered public and private key as per dashboard.
Did I missed something? What gives?

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.