Results 1 to 10 of 475

Hybrid View

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

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by lat9 View Post
    I'm guessing that if you use the browser's developers' tools to inspect that dropdown, there's an 02 id for February but the text reads March. That's a weird date-related issue with the base Zen Cart zcDate class.
    Yep, if you navigate to the admin's index.php?cmd=banner_statistics&page=0&bID=0&type=monthly&month=4, you'll see that "Mar" is repeated there, too.

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

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by lat9 View Post
    Yep, if you navigate to the admin's index.php?cmd=banner_statistics&page=0&bID=0&type=monthly&month=4, you'll see that "Mar" is repeated there, too.
    I found the origin of this problem, and it is not ZcDate class, but the way it is used. It is generally called like this:
    PHP Code:
    $zcDate->output('%b'mktime(000$i))); 
    Where $i is the month number. Day and year are not given as parameter which means the actual date day and year are used.
    Problem is when actual date day is higher than the last day of a month. For PHP it is next month, like 30th of February is actually 2nd of March.
    This bug only appears at the end of the month, from 29 to 31! The 31th of the month is worse case where all month less than 31 days (Feb., April, June,Sept. and Nov.) will be set to next month...

    Solution is to call zcDate class output like this:
    PHP Code:
    $zcDate->output('%b'mktime(000$i,1))); 
    There might be other places in ZC where this needs to be modified...
    For this plugin, file paypalr.php needs to be modified on lines 782 and 1269. Line 874 might need it too, not sure yet.

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

    Default Re: PayPal RESTful API Payment Module

    No modification needed on line 874!

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

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by pilou2 View Post
    I found the origin of this problem, and it is not ZcDate class, but the way it is used. It is generally called like this:
    PHP Code:
    $zcDate->output('%b'mktime(000$i))); 
    Where $i is the month number. Day and year are not given as parameter which means the actual date day and year are used.
    Problem is when actual date day is higher than the last day of a month. For PHP it is next month, like 30th of February is actually 2nd of March.
    This bug only appears at the end of the month, from 29 to 31! The 31th of the month is worse case where all month less than 31 days (Feb., April, June,Sept. and Nov.) will be set to next month...

    Solution is to call zcDate class output like this:
    PHP Code:
    $zcDate->output('%b'mktime(000$i,1))); 
    There might be other places in ZC where this needs to be modified...
    For this plugin, file paypalr.php needs to be modified on lines 782 and 1269. Line 874 might need it too, not sure yet.
    Yep, thanks for the follow-up.

  5. #5
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by pilou2 View Post
    I found the origin of this problem, and it is not ZcDate class, but the way it is used. It is generally called like this:
    PHP Code:
    $zcDate->output('%b'mktime(000$i))); 
    Where $i is the month number. Day and year are not given as parameter which means the actual date day and year are used.
    Problem is when actual date day is higher than the last day of a month. For PHP it is next month, like 30th of February is actually 2nd of March.
    This bug only appears at the end of the month, from 29 to 31! The 31th of the month is worse case where all month less than 31 days (Feb., April, June,Sept. and Nov.) will be set to next month...

    Solution is to call zcDate class output like this:
    PHP Code:
    $zcDate->output('%b'mktime(000$i,1))); 
    There might be other places in ZC where this needs to be modified...
    For this plugin, file paypalr.php needs to be modified on lines 782 and 1269. Line 874 might need it too, not sure yet.
    Would it be possible to provide the specific fixes needed on lines 782 and 129?

    THX!

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

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by mikestaps View Post
    Would it be possible to provide the specific fixes needed on lines 782 and 129?

    THX!
    See this GitHub commit for the changes needed: https://github.com/lat9/paypalr/comm...6973e6a662156c

  7. #7
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: PayPal RESTful API Payment Module

    PERFECT! Thank you

  8. #8
    Join Date
    Aug 2004
    Posts
    823
    Plugin Contributions
    0

    Default Re: PayPal RESTful API Payment Module

    Cindy - Quick question: I know the module no longer uses the IPN Hander. My question is, if we do set an IPN Handler in PayPal (under the Settings --> Notifications), would that interfere with the module in any way?

    I ask because we are developing a product (completely separate from ZenCart but run on our same server), and this other product uses a PayPal button that relies on PayPal to post back to the IPN handler for that program.

    So if we put the URL for that other program into our PayPal IPN settings, would that somehow cause our ZenCart store (using the PayPal RESTFUL api) to stop processing the orders?
    - Jeff

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

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by Jeff_Mash View Post
    Cindy - Quick question: I know the module no longer uses the IPN Hander. My question is, if we do set an IPN Handler in PayPal (under the Settings --> Notifications), would that interfere with the module in any way?

    I ask because we are developing a product (completely separate from ZenCart but run on our same server), and this other product uses a PayPal button that relies on PayPal to post back to the IPN handler for that program.

    So if we put the URL for that other program into our PayPal IPN settings, would that somehow cause our ZenCart store (using the PayPal RESTFUL api) to stop processing the orders?
    The /ipn_main_handler.php processing has no bearing on the PayPal RESTful module's operation. Just be sure that you grab the current version of that file from the Zen Cart GitHub as there have been a bunch of changes since zc210 to correct various PHP warnings and notices in that file.

 

 

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