Page 36 of 45 FirstFirst ... 263435363738 ... LastLast
Results 351 to 360 of 449
  1. #351
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    331
    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?

  2. #352
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,903
    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

  3. #353
    Join Date
    Apr 2009
    Posts
    486
    Plugin Contributions
    2

    Default Re: PayPal RESTful API Payment Module

    Paypal restful 1.3 pay in 4/3. I have installed this on my test site in the uk the messaging for delayed payment is saying pay in 4 and displaying prices in usd not gbp. When i go through checkout to paypal to pay the messaging corrects to GBP and pay in 3.

    I don't know if this is me. The paypal js call has US not GB or UK for the javascript.
    Code:
    <script title="PayPalSDK" id="PayPalJSSDK" src="https://www.paypal.com/sdk/js?client-id=sb&amp;debug=true&amp;buyer-country=US&amp;locale=en_US&amp;components=messages&amp;integration-date=2025-08-01" data-page-type="cart" data-partner-attribution-id="ZenCart_SP_PPCP" data-namespace="PayPalSDK" defer="" data-uid-auto="uid_dhsiskdlptoqptaugsfxcqoceqicfv"></script>
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  4. #354
    Join Date
    Apr 2009
    Posts
    486
    Plugin Contributions
    2

    Default Re: PayPal RESTful API Payment Module

    Additional. have just checked all the location. The checkout is the only location where the js call looks ok but the message is not displayed.
    full list of js calls
    shopping cart
    <script title="PayPalSDK" id="PayPalJSSDK" src="https://www.paypal.com/sdk/js?client-id=sb&debug=true&buyer-country=US&locale=en_US&components=messages&integration-date=2025-08-01" data-page-type="cart" data-partner-attribution-id="ZenCart_SP_PPCP" data-namespace="PayPalSDK" defer></script>
    product page
    <script title="PayPalSDK" id="PayPalJSSDK" src="https://www.paypal.com/sdk/js?client-id=sb&debug=true&buyer-country=US&locale=en_US&components=messages&integration-date=2025-08-01" data-page-type="product-details" data-partner-attribution-id="ZenCart_SP_PPCP" data-namespace="PayPalSDK" defer></script>
    produt list
    <script title="PayPalSDK" id="PayPalJSSDK" src="https://www.paypal.com/sdk/js?client-id=sb&debug=true&buyer-country=US&locale=en_US&components=messages&integration-date=2025-08-01" data-page-type="product-listing" data-partner-attribution-id="ZenCart_SP_PPCP" data-namespace="PayPalSDK" defer></script>

    checkout
    <script title="PayPalSDK" id="PayPalJSSDK" src="https://www.paypal.com/sdk/js?client-id=sb&debug=true&buyer-country=GB&locale=en_US&currency=GBP&components=messages&integration-date=2025-08-01" data-page-type="checkout" data-partner-attribution-id="ZenCart_SP_PPCP" data-namespace="PayPalSDK" defer></script>
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  5. #355
    Join Date
    Apr 2009
    Posts
    486
    Plugin Contributions
    2

    Default Re: PayPal RESTful API Payment Module

    More info. I am using sandbox and i see that it defaults to US if there is noting in the cart. If i put something in the cart then it is changes to GB but still displaying $ usd. This appears to be because $order->info['currency'] is null
    if i change auto.paypalrestful.php to have line 283
    Code:
    $js_fields['currency'] = DEFAULT_CURRENCY;
    all messaging dissapears. The default currency is GBP.

    if i don't set the currency and set
    Code:
            $paypalSandboxBuyerCountryCodeOverride = 'GB';
            $paypalSandboxLocaleOverride = 'en_GB';
    still get messages in usd and pay in 4.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  6. #356
    Join Date
    Apr 2009
    Posts
    486
    Plugin Contributions
    2

    Default Re: PayPal RESTful API Payment Module

    Ok i have got it working!!
    If i remove (comment out) the line
    Code:
    $js_fields['client-id'] = 'sb'; // 'sb' for sandbox
    and use my sandbox id it works in all locations.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  7. #357
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by brittainmark View Post
    Ok i have got it working!!
    If i remove (comment out) the line
    Code:
    $js_fields['client-id'] = 'sb'; // 'sb' for sandbox
    and use my sandbox id it works in all locations.
    As you pointed out, the situation you describe would only happen in sandbox, where those settings are providing some overrides merely for testing/simulation/development purposes.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #358
    Join Date
    Apr 2009
    Posts
    486
    Plugin Contributions
    2

    Default Re: PayPal RESTful API Payment Module

    minor issue with old method. does not display messaging because it does not know header sent
    change function updateNotifyHtmlHeadEnd in includes/classes/observers/auto.paypalrestful.php lines 125-132to
    Code:
    public function updateNotifyHtmlHeadEnd(&$class, $eventID, $current_page_base)
        {
            // This is a fallback for older versions, to ensure we only output the header JS once.
            if ($this->headerAssetsSent) {
                return;
            }
            $this->headerAssetsSent = $this->outputJsSdkHeaderAssets($current_page_base);
        }
    will submit pr.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  9. #359
    Join Date
    Feb 2007
    Posts
    327
    Plugin Contributions
    0

    Default Re: PayPal RESTful API Payment Module

    I downloaded paypalr-1.3.0
    I unzipped it to have it installed on my site v2.1.0 on PHP Version: 8.0.30

    I know the Admin folder need to be changed to match the admin folder on my site, however,
    there is another Admin folder in the installation
    C:\Users\pc\Downloads\paypalr-1.3.0\paypalr-1.3.0\includes\modules\payment\paypal\PayPalRestful\Admin
    Do i need to change that also? just making sure doing right the first time. Thanks.

  10. #360
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,903
    Plugin Contributions
    96

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by TamyA View Post
    I downloaded paypalr-1.3.0
    I unzipped it to have it installed on my site v2.1.0 on PHP Version: 8.0.30

    I know the Admin folder need to be changed to match the admin folder on my site, however,
    there is another Admin folder in the installation
    C:\Users\pc\Downloads\paypalr-1.3.0\paypalr-1.3.0\includes\modules\payment\paypal\PayPalRestful\Admin
    Do i need to change that also? just making sure doing right the first time. Thanks.
    You don't need (or want) to change that `Admin` folder name ... "bad" things would result.

 

 
Page 36 of 45 FirstFirst ... 263435363738 ... LastLast

Similar Threads

  1. v158 UPS Shipping using RESTful/OAuth API [Support Thread]
    By lat9 in forum Addon Shipping Modules
    Replies: 187
    Last Post: 20 Apr 2026, 09:15 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