Results 1 to 10 of 475

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    333
    Plugin Contributions
    7

    Default Re: PayPal RESTful API Payment Module

    I did some quick fix so that PayPalr module does not do its checking every time you want to do some setting on other modules.
    But I think a more efficient approach would be to do the API checking only when PayPalr module is installed or one of its settings is modified, and at most when it is selected. More than that and it is useless and just add a time penalty on all your other actions. Two or three modules doing this could render the admin modules page nearly unusable.
    Here is the code I changed in
    Code:
    includes/modules/payment/paypalr.php
    after line 293:
    PHP Code:
            $this->enabled = ($this->enabled === true && $this->validateConfiguration($curl_installed));
            if (
    $this->enabled && IS_ADMIN_FLAG === true) {
                
    // register/update known webhooks
                
    $this->ppr->registerAndUpdateSubscribedWebhooks();
            } 
    to this:
    PHP Code:
            if (IS_ADMIN_FLAG === false || ($this->enabled === true && $_GET['module'] === 'paypalr')) {
                
    $this->enabled = ($this->enabled === true && $this->validateConfiguration($curl_installed));
                if (
    $this->enabled && IS_ADMIN_FLAG === true) {
                    
    // register/update known webhooks
                    
    $this->ppr->registerAndUpdateSubscribedWebhooks();
                }
            } 
    This just a quick fix for those who might have the same problem.

  2. #2
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    333
    Plugin Contributions
    7

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by pilou2 View Post
    I did some quick fix so that PayPalr module does not do its checking every time you want to do some setting on other modules.
    But I think a more efficient approach would be to do the API checking only when PayPalr module is installed or one of its settings is modified, and at most when it is selected. More than that and it is useless and just add a time penalty on all your other actions. Two or three modules doing this could render the admin modules page nearly unusable.
    Here is the code I changed in
    Code:
    includes/modules/payment/paypalr.php
    after line 293:
    PHP Code:
            $this->enabled = ($this->enabled === true && $this->validateConfiguration($curl_installed));
            if (
    $this->enabled && IS_ADMIN_FLAG === true) {
                
    // register/update known webhooks
                
    $this->ppr->registerAndUpdateSubscribedWebhooks();
            } 
    to this:
    PHP Code:
            if (IS_ADMIN_FLAG === false || ($this->enabled === true && $_GET['module'] === 'paypalr')) {
                
    $this->enabled = ($this->enabled === true && $this->validateConfiguration($curl_installed));
                if (
    $this->enabled && IS_ADMIN_FLAG === true) {
                    
    // register/update known webhooks
                    
    $this->ppr->registerAndUpdateSubscribedWebhooks();
                }
            } 
    This just a quick fix for those who might have the same problem.
    Forgot about this code, although it works when in admin module page, it will crash when editing an order that uses PayPal RESTful.
    It seems that API initialization is taking time, validation is done at the same time but does not change much about delay...
    I am adraid I am out of option.
    Do you think it is possible to limit API connection to only when the module is actually used?

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,948
    Plugin Contributions
    96

    Default Re: PayPal RESTful API Payment Module

    v1.3.0 of the PayPal/RESTful payment module is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2382

    This release contains changes associated with these GitHub issues:

    #100: Account for sites where allow_url_fopen is set to false.
    #90: curl_close is deprecated in PHP 8.5
    #89: Webhook accesses unconditionally create logs
    #88: webhook auto-loader, PHP Fatal errors on ZC versions prior to 2.1.0
    #86: Provide polyfills and extra-functions to enable additional PHP/ZenCart versions to be supported
    #81: Warning messages caused by conflict with messageStack
    #76: Integrate PayPal's PayLater Messaging via PayPal JS SDK

 

 

Similar Threads

  1. v158 UPS Shipping using RESTful/OAuth API [Support Thread]
    By lat9 in forum Addon Shipping Modules
    Replies: 198
    Last Post: 9 Jul 2026, 08:30 PM
  2. IPower & FirstData API Payment Module
    By spence in forum Addon Payment Modules
    Replies: 6
    Last Post: 7 Jul 2011, 06:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg