Page 1 of 2 12 LastLast
Results 1 to 10 of 475

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,247
    Plugin Contributions
    58

    Default Re: PayPal RESTful API Payment Module

    Zen Cart 2.1.0
    PHP 8.3
    Bootstrap 3.7.4
    PayPal RESTful 1.1.0

    The credit card expiration field, the month of March is there twice, and there is## no expiration option for the month of February.

    Click image for larger version. 

Name:	Image2.jpg 
Views:	88 
Size:	32.9 KB 
ID:	20957
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by mprough View Post
    Zen Cart 2.1.0
    PHP 8.3
    Bootstrap 3.7.4
    PayPal RESTful 1.1.0

    The credit card expiration field, the month of March is there twice, and there is## no expiration option for the month of February.

    Click image for larger version. 

Name:	Image2.jpg 
Views:	88 
Size:	32.9 KB 
ID:	20957
    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.

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

  4. #4
    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.

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

    Default Re: PayPal RESTful API Payment Module

    No modification needed on line 874!

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

  7. #7
    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!

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

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

    Default Re: PayPal RESTful API Payment Module

    PERFECT! Thank you

  10. #10
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,247
    Plugin Contributions
    58

    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.
    That's a negative ghost rider =) Looks like PayPal fixed it =)
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v158 UPS Shipping using RESTful/OAuth API [Support Thread]
    By lat9 in forum Addon Shipping Modules
    Replies: 191
    Last Post: 29 Jun 2026, 01:17 AM
  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