• Resolved Lethalmiko

    (@lethalmiko)


    I set up a custom payment gateway that handles manual payments whereby an admin has to activate. It creates an order with “pending” state but once that order is created, the user has immediate access to locked content which is not the expected behaviour. I expected that by default, access is restricted whenever levels are set on a post and an order is in the pending state. So how do I set the plugin to deny access by default until the order status is set to successful by an admin?

    NOTE: I have active the Approvals Add On.

    • This topic was modified 2 years, 7 months ago by Lethalmiko.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Kim White

    (@kimwhite)

    Hello @lethalmiko,
    Thank you for using Paid Memberships Pro.

    Pending orders should not have access to your content, only to their account page and profile information.

    For the Approvals Add On, we are not allowed to support any premium plugin-related issues or questions according to the www.ads-software.com support guidelines – https://www.ads-software.com/support/guidelines/

    Please can you open a ticket on https://www.paidmembershipspro.com/support, and someone from our team will continue to assist you?

    Thank you for understanding.

    Kim W

    Thread Starter Lethalmiko

    (@lethalmiko)

    Thanks for the reply.

    I only mentioned Approvals Add On in case it is relevant information to my issue, not that I am asking for support on that. My experience is that users have access just by creating a pending order and that is not the expected behaviour. That is a core plugin matter.

    My question thus remains unanswered.

    • This reply was modified 2 years, 7 months ago by Lethalmiko.
    Plugin Author Andrew Lima

    (@andrewza)

    We do not restrict access based on a user’s order status if they already have an active membership. Their membership may not be applied to their WordPress account if their order isn’t successful during the checkout process.

    Regarding your custom coded gateway, you would need to write a function to restrict access for orders that are on the pending status. You would have to get the user’s latest order, or any order that is in pending mode and restrict their access with the pmpro_has_membership_access_filterhttps://www.paidmembershipspro.com/hook/pmpro_has_membership_access_filter/

    If the member’s order is pending, and they have a membership level you may set the $hasaccess parameter to false.

    We are not allowed to support or answer any pre-sale/possible conflicts regarding to a Plus Add On and those questions should be immediately redirected to our website support on https://www.paidmemebrshipspro.com/support as mentioned it breaks the WordPress guidelines.

    I hope this helps get you started, thank you for understanding.

    Thread Starter Lethalmiko

    (@lethalmiko)

    Thank you @andrewza for your guidance. However, please note that in my testing, the user does NOT have an active subscription initially. All they are doing is registering and then creating an order that goes into a pending state and yet they have access immediately that pending order is created.

    I do not believe this should be the case and the $hasaccess parameter should be set to false by default for all users unless they have a successful order, without having to code a custom access function. In fact, for the pay by check addon, this is precisely what happens as orders go into a pending state but no access is granted until the admin marks the order as successful. May I suggest that you consider adding this no-access-by-default setting to the core plugin codebase. Or maybe write a guide on your website since it is a core plugin issue.

    And finally, I am not asking for support for any paid addons, so I am not sure why there is a constant reference to it. I reiterate that I only mentioned the addon to give extra information that may be deemed relevant to my problem.

    Plugin Author Andrew Lima

    (@andrewza)

    Thanks for the feedback, we will consider it. However, as mentioned we restrict access based initially on the membership level status attached to the user which gives admins flexibility of changing levels without creating orders.

    We have to mention the WordPress guidelines as we have to strictly follow these while supporting our free users on this channel.

    For now, I cannot guarantee order restriction will be included into core and you will need to create a custom solution similar to the Pay By Check Add On as you’ve referenced.

    Thread Starter Lethalmiko

    (@lethalmiko)

    Another idea I suppose is to put a switch in the settings to enable an admin decide the default setting for access. Perhaps that is a good compromise between the two positions. Thanks for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I set default access settings?’ is closed to new replies.