Skip to Content Skip to Menu

Random failure to set a usergroup with subscription

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 82
  • Thanks: 16
  • Karma: 3
2 years 10 months ago #327578 by agaudin
Hello

I am implementing an online payment with CBSubs on one of my site. There are several plans.

Joomla is set to put users to "Registered" usergroup (ID =2). So users with pending payments (offline) or expired plan are set to this
Plans are set to put completed payements in "Members" usergroups (ID = 3) . So users withactive plan are set to "Registered" AND "Members" usergroup (ID = 2 AND 3).
It works fine most of the time.

BUT randomly, when an expired user (only in "Registered" usergroup) renews his plan, he is not set to "Members" usergroup and keeps only in registered.

I cannot get why it happens. If I look to the "log" panel of CBSubs, it appears he is expired as soon as the payment was terminated (see image)


Do you have any idea ??

Also : I tried to set an AutoAction to monitor this trouble but I wasn't able to get it properly. Any suggestion ?

Thans by advance, it is really ennoying.

Best regards

Antoine

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 10 months ago #327580 by krileon
They're renewing and expiring at the same time. Are you using recurring payments? It's recommended to always use a grace period of at least 3 days to allow payment processors to communicate the status of the payment to your site. This will prevent odd situations like this where it renews and expires at the same time.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 82
  • Thanks: 16
  • Karma: 3
2 years 10 months ago #327588 by agaudin
Hello,

No I am not using reccuring payments. I want to use yearly subscription (from 01/01 to 12/31) and when testing I set the system on ten minutes subscriptions.

AND when testing, just to be sure the expiration is correctly done, I use the mass expiration link in cbsubs admin panel /settings.

So expiration should be correct... but it seems it is not the case and the system makes renew and expire at the same time which is a pain...

Do you have any idea where to check ?

Also : if I want to monitor this, which AutoAction trigger should I use ?

Thanx by advance.

Best regards
Antoine

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 10 months ago #327590 by krileon
Ok, then it might an issue of your expirations aren't processing. You should be using a wget or curl CRON task to run the expiration link daily. The above happened because expiration was never triggered so it ended up triggering when their subscription was accessed again. Within CBSubs > Settings > Global under "Mass expiry settings" use the following.

Mass expire subscriptions method: Cron task and admin access (100 max/page)

Next setup a CRON task with your host for the URL supplied by "Url of cron task". This should run daily and ideally at a time where your site has little activity (e.g. so late at night usually).

In addition to this I still recommend configuring a grace period as it gives time for payment processors to communicate with your site as it can take a few days sometimes. 3 days should be plenty.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: agaudin

Please Log in or Create an account to join the conversation.

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 82
  • Thanks: 16
  • Karma: 3
2 years 9 months ago #327599 by agaudin
OK I see, thanks a lot (fingerscrossed)

Addiotionnaly : which AutoActions trigger do you recommand to trigger when subscription expires (when user subscription deactivated) ? I cannot get it.

Regards

Antoine

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
2 years 9 months ago - 2 years 9 months ago #327601 by krileon
You can use the below to perform whatever action you like on subscription state changes.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Not Equal To
Value: A

Be sure to replace PLAN_ID_HERE with the actual id of your plan as found in CBSubs > Plans.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 2 years 9 months ago by krileon.
The following user(s) said Thank You: agaudin

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum