Advertisement:

Author Topic: Paid Subscription - Subscriptions-PayPal fails to activate new sub  (Read 9497 times)

Offline HoverClub

  • Jr. Member
  • **
  • Posts: 202
  • hoverclub.org.uk
    • The Hovercraft Cruising Club
    Version(s) of SMF
2.0.5 (but shouldn't matter)
    Your Setup:
        Curve theme
    Where the Error Occurred
        File:  Subscriptions-PayPal.php
        Line: 216
Code: [Select]
// Verify the currency!
if (strtolower($_POST['mc_currency']) != $modSettings['paid_currency_code'])
exit;

If paid_currency is set to 'other' in the paid subscription settings AND paid_currency_code uses any uppercase letters then the test above always fails.  Either strtolower should be used on both variables (good practice) OR ManagePaid.php should lcase paid_currency_code before saving it.  Note that the pre-set codes (USD, GBP, EURO.) are have lowercase ID's as default.

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 23,510
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Paid Subscription - Subscriptions-PayPal fails to activate new sub
« Reply #1 on: October 04, 2013, 04:24:30 PM »
Nice catch!
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline live627

  • Developer
  • SMF Hero
  • *
  • Posts: 5,934
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Paid Subscription - Subscriptions-PayPal fails to activate new sub
« Reply #2 on: October 04, 2013, 05:05:44 PM »
Reposted to GitHub. Thanks!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Paid Subscription - Subscriptions-PayPal fails to activate new sub
« Reply #3 on: October 04, 2013, 05:07:53 PM »
Thank you for the report and thanks for reporting to Github :)
No good deed goes unpunished
All helpful urges should be circumvented

Offline HoverClub

  • Jr. Member
  • **
  • Posts: 202
  • hoverclub.org.uk
    • The Hovercraft Cruising Club
Re: Paid Subscription - Subscriptions-PayPal fails to activate new sub
« Reply #4 on: October 04, 2013, 06:18:05 PM »
You're welcome (another few hours of my life gone  :P).

There is something that bugged me when looking at this code and that is the fairly extensive use of exit within functions.  IMHO it would be a LOT easier to find strange problems like this one if all errors were logged (even if they should never happen  ;)).

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Paid Subscription - Subscriptions-PayPal fails to activate new sub
« Reply #5 on: January 09, 2014, 11:11:20 PM »
Looks like this was fixed as per Github: https://github.com/SimpleMachines/SMF2.1/issues/660
No good deed goes unpunished
All helpful urges should be circumvented