On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Jared Loman has hired me in the past month or so to create SubscribeMe (props for the name @splittingred).

    The key features of SubscribeMe include:

    - Ability to set up different recurring subscription plans
    - Payments done via PayPal subscriptions (Only PayPal or manual - NO other payment gateways supported or planned)
    - Component overview of users on different subscription plans and export of their details to CSV format
    - Manually provide users with a free subscription for a certain period (can be used for offline payments)
    - Read-only overview of transactions
    - Provides a FormIt hook which processes the registration and forwards user to Paypal or offline payment instructions

    It's open source and out now.

    Get it from Package Management (or the site: http://modx.com/extras/package/subscribeme) and checkout the code at Github (https://github.com/Mark-H/SubscribeMe) which is also the place for Bugs & Feature Requests (https://github.com/Mark-H/SubscribeMe/issues/).

    The documentation is at http://rtfm.modx.com/display/ADDON/SubscribeMe and hasn't been finished yet... there's basic info available but I'd love to work with some volunteers to help finish it up. Get in touch (hello at markhamstra.com or @mark_hamstra on twitter) if you could dedicate some time into helping out!
      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
    • I've been following what documentation I have found, but I am stuck at the smCheckout call. I see the chunk for the checkout options and the snippet for the inc file in the file tree, but the smCheckout call displays nothing on the page. A subid is being created and in the url.

      Below are the errors that returned, but I don't know if they have anything to do with my problem.

      [2011-10-16 12:49:09] (ERROR @ /index.php) `` is not a valid integer and may not be passed to makeUrl()
      [2011-10-16 12:49:09] (ERROR @ /index.php) `` is not a valid integer and may not be passed to makeUrl()
      [2011-10-16 12:49:10] (ERROR @ /index.php) 10404: ReturnURL is missing.
      [2011-10-16 12:49:10] (ERROR @ /index.php) `` is not a valid integer and may not be passed to makeUrl()
      [2011-10-16 12:49:10] (ERROR @ /index.php) Attempted to redirect to an empty URL.

      Any help would be greatly appreciated.
      • Few things come to mind, though in general it would be great if you could show your snippet call and set properties.

        - Did you set the subscribeme.paypal.return_id system setting, or specified &return_id in the smCheckout snippet call? (if not, also check the cancel_id and fail_id ones as those are also needed - they need to be filled with the ID of either the cancel or fail resource. )
        - Did you set up your PayPal details for sandbox (assuming you're still using sandbox mode) in the system settings as well?

        I'm going to assume, based on those errors, that there's no return_id set (first makeUrl error) and no cancel_id either (second makeUrl error). What happens next is that an error occurs sending off data to PayPal as it needs the return url (generated from your return_id), so in turn smCheckout wants to send you to the fail resource - but as it can't generate that url either (third makeUrl error), it gives the "attempted to redirect to an empty URL" error.


        It's cool to hear someone else is working with SubscribeMe now as well (would love to see some more about how you're applying it) and I can definitely try and help out a bit here and there.

        If you could help out a bit by documenting your progress in setting up SubscribeMe that would be real great as well... it's still more sparse then I had hoped it to be right now, but I'm insanely busy with other projects, too!
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • I set these through the settings, see attached snapshot, and I received the url errors.

          I tried this:
           [[smCheckout &return_id=`40` &cancel_id=`38` &fail_id=`39` ]] 

          and the url errors are now gone.

          There is still no content generating on the page and there is a list of errors I'm not sure how to follow.

           [2011-10-16 17:18:36] (ERROR @ /index.php) Fired SubscribeMe plugin on event: OnWebPageInit for user 2
          [2011-10-16 17:18:36] (ERROR @ /index.php) SELECT smSubscription.sub_id as sub_id, smSubscription.product_id as product_id, smSubscription.expires as expires, ProdPerms.usergroup as usergroup, ProdPerms.role as role, UserGroupMember.id as ugm_id FROM `sm_subscription` AS `smSubscription` RIGHT JOIN `sm_product_permissions` `ProdPerms` ON smSubscription.product_id = ProdPerms.product_id LEFT JOIN `member_groups` `UserGroupMember` ON (
                      UserGroupMember.member = smSubscription.user_id AND
                      UserGroupMember.user_group = ProdPerms.usergroup AND
                      UserGroupMember.role = ProdPerms.role) WHERE  (  ( `smSubscription`.`user_id` = 2 AND `UserGroupMember`.`id` > '0' )  AND NOT EXISTS(SELECT smSubscription.sub_id as sub_id, smSubscription.product_id as product_id, smSubscription.expires as expires, ProdPerms.usergroup as usergroup, ProdPerms.role as role, UserGroupMember.id as ugm_id FROM `sm_subscription` AS `smSubscription` RIGHT JOIN `sm_product_permissions` `ProdPerms` ON smSubscription.product_id = ProdPerms.product_id LEFT JOIN `member_groups` `UserGroupMember` ON (
                      UserGroupMember.member = smSubscription.user_id AND
                      UserGroupMember.user_group = ProdPerms.usergroup AND
                      UserGroupMember.role = ProdPerms.role) WHERE  ( `smSubscription`.`user_id` = 2 AND `UserGroupMember`.`id` > '0' )  AND smSubscription.expires > NOW()) )  
          [2011-10-16 17:18:36] (FATAL @ /index.php) Nothing needs to be taken care of!
          [2011-10-16 17:18:36] (FATAL @ /index.php) SELECT smSubscription.* FROM `sm_subscription` AS `smSubscription` WHERE  (  ( `smSubscription`.`user_id` = 2 AND `smSubscription`.`active` = 1 AND `smSubscription`.`expires` < NOW() )  AND NOT EXISTS(SELECT `id` FROM `sm_product_permissions` AS `smProductPermissions` WHERE `smSubscription`.`product_id` = `smProductPermissions`.`product_id` ) )  
          [2011-10-16 17:18:36] (FATAL @ /index.php) Found 0 subscriptions to action.
          [2011-10-16 17:18:36] (FATAL @ /index.php) Nothing to do.
          [2011-10-16 17:18:37] (ERROR @ /index.php) Fired SubscribeMe plugin on event: OnWebPageInit for user 2
          [2011-10-16 17:18:37] (ERROR @ /index.php) SELECT smSubscription.sub_id as sub_id, smSubscription.product_id as product_id, smSubscription.expires as expires, ProdPerms.usergroup as usergroup, ProdPerms.role as role, UserGroupMember.id as ugm_id FROM `sm_subscription` AS `smSubscription` RIGHT JOIN `sm_product_permissions` `ProdPerms` ON smSubscription.product_id = ProdPerms.product_id LEFT JOIN `member_groups` `UserGroupMember` ON (
                      UserGroupMember.member = smSubscription.user_id AND
                      UserGroupMember.user_group = ProdPerms.usergroup AND
                      UserGroupMember.role = ProdPerms.role) WHERE  (  ( `smSubscription`.`user_id` = 2 AND `UserGroupMember`.`id` > '0' )  AND NOT EXISTS(SELECT smSubscription.sub_id as sub_id, smSubscription.product_id as product_id, smSubscription.expires as expires, ProdPerms.usergroup as usergroup, ProdPerms.role as role, UserGroupMember.id as ugm_id FROM `sm_subscription` AS `smSubscription` RIGHT JOIN `sm_product_permissions` `ProdPerms` ON smSubscription.product_id = ProdPerms.product_id LEFT JOIN `member_groups` `UserGroupMember` ON (
                      UserGroupMember.member = smSubscription.user_id AND
                      UserGroupMember.user_group = ProdPerms.usergroup AND
                      UserGroupMember.role = ProdPerms.role) WHERE  ( `smSubscription`.`user_id` = 2 AND `UserGroupMember`.`id` > '0' )  AND smSubscription.expires > NOW()) )  
          [2011-10-16 17:18:37] (FATAL @ /index.php) Nothing needs to be taken care of!
          [2011-10-16 17:18:37] (FATAL @ /index.php) SELECT smSubscription.* FROM `sm_subscription` AS `smSubscription` WHERE  (  ( `smSubscription`.`user_id` = 2 AND `smSubscription`.`active` = 1 AND `smSubscription`.`expires` < NOW() )  AND NOT EXISTS(SELECT `id` FROM `sm_product_permissions` AS `smProductPermissions` WHERE `smSubscription`.`product_id` = `smProductPermissions`.`product_id` ) )  
          [2011-10-16 17:18:37] (FATAL @ /index.php) Found 0 subscriptions to action.
          [2011-10-16 17:18:37] (FATAL @ /index.php) Nothing to do.
          




          BTW: Took me a while to find this, so for anyone having trouble finding the chunk templates, you have to go to the file management: /core/components/subscribeme/elements/chunks/
          There you will find the smListProducts.outer.tpl chunk to set the optionsResource to get to the smCheckout page you defined.

          [[!FormIt?
            &hooks=`smNewSubscription`
            &optionsResource=`36`
          ]]
          <p>Choose the product you would like to subscribe to:</p>
          <ul class="products">
              [[+products]]
          </ul>
          


          Would be nice if this was in the settings too. Although I'm not having much luck with the settings anyways.

          I would be happy to help out on documentation, there is still plenty I'm not clear on. Like what is the product permissions used for. I've tried a few different things here to see if that might be my problem, just not even sure what that does.

          Thanks for the help.
          • The idea is that users override that file based chunk, tho I suppose that's one thing that needs to be documented.. this thing is a beast in terms of how to set it up and documenting it is as much work, lol.

            For one you will need to call that snippet uncached, and you are missing the question mark after the snippet name. At that point it should redirect you to PayPal. I'm not sure why it wouldn't be getting it from the system settings - that works fine on the three installs I've configured so far...

            This may be easier to debug if you can authorize me to the manager you're setting this up on - if you are okay with that, could you send me an email? Hello, markhamstra.com. I can also auth you for a test install - if you send me an email I'll set that up tomorrow as well so you can see a working test install.


            Product Permissions are MODX User Group + Role combos related to a product. So a "Premium" product could be linked to your "Premium" user group and when transactions are processed it will give the user that group, and when a subscription expires it is taken away (which is why you never use Administrator as a product permission, it can (and has for me) lock you out).

            Those errors are debug messages from the plugin. It triggers on page load and checks if you have any subscription running that has expired and if it needs to be unset. If the debug setting is on it will put all that into the error log. Nothing wrong there.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • The question mark did the trick, can't believe I forgot that. Think I've been staring at this thing to long. Thanks for the tip on calling it uncached. I will be back on this later tonight, if you have any more tips, that would be helpful.

              Product permissions sounds like it works the way I expect, but I am still a little new to modx (been using it for about a month). Can a user have more than one permission set, or does this replace whatever permissions a person already has with new permissions assigned by the subscription?

              I will send you an email, but I can't let you onto my customers modx installation, liability issues. If it was something that I was working on for myself, that would not be a problem. If you have a test version running, I would love to see that in action.

              Thanks
              • It's easy to miss stuff like that if you've been staring at it for hours wink Took me some time to spot it, too.

                Users can have many usergroups/roles assigned to it. There's a new concept in 2.2 called a primary user group, though I haven't yet checked that out to see if that works any different.

                The usergroup will be added, so existing groups will remain. It will match product permissions against user permissions, so only permissions that could have been set as part of a subscription will be unset when it expired.

                I can understand it's hard to give access to client sites, no problem. I'll set you up with a login for the test site tomorrow when I get your email smiley
                  Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                  Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • Something that my client would like to do, but it is not something they want right away, is a promotional link. They are doing web video shows and would like to print a card or email a url that will allow anyone to view just the one video using that url. The trick is, the video might be different depending which group they send it to, and the url should not be open to anyone without a code (either they have to type it in or it is embedded in the url link that is sent out. The user will then see a create account and subscribe button below the video. The code itself would only be good for limited amount of time.

                  It may be a few weeks, maybe even months, before I am ready to move forward on this. Does it sound like something that could be built into this project, or do you think this should be a separate add-on? BTW, I sent you an email using the address from your profile page.

                  Thanks
                  • I think that'd be better off as something different, adding a link / button to your subscribe button as you would've done normally.

                    I totally missed the email (expected it on my business account tongue) but I just sent you the details.
                      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • homebrewruss Reply #10, 8 years ago
                      Hi Mark,
                      I've started using trying this too and it seems great. I've followed the instructions at github Paypal subscriptions seem to be working ok but I am having trouble with Product Permssions which may just be my understanding of it. I wonder if you can help?

                      To my 'Annual Subscription' product I've added a Product permission with user group of "Paid Members" and role of "Paid member Role".
                      From this I assume that any new subscribed member would be added to the group "Paid Members" with role of "Paid member Role" ad using this I would be able to assign premium resources to subscribed users.

                      However any new subscribers are not automatically added to the group and role I have set up.
                      Am i missing something?

                      Thanks
                      Russell