Skip to Content Skip to Menu

CB Triggers Help Needed for onCbSubsAfterPaymentBasket

10 years 8 months ago #241789 by prestoproducts
I have a PHP script that I would like to run after the user pays for a plan with CB Subs. I have tried a handful of triggers like:

onCbSubsAfterPaymentBasket

but the script is not firing at that point. If I change the script to trigger onAfterLogin it works just fine. This tells me that it is the trigger point. How can I update this trigger to fire after a successful payment?

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 8 months ago #241818 by nant

prestoproducts wrote: I have a PHP script that I would like to run after the user pays for a plan with CB Subs. I have tried a handful of triggers like:

onCbSubsAfterPaymentBasket

but the script is not firing at that point. If I change the script to trigger onAfterLogin it works just fine. This tells me that it is the trigger point. How can I update this trigger to fire after a successful payment?


Can't you just use the CBSubs URL action plugin and execute your script like this?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #241843 by krileon
You would need to use the onCPayUserStateChange trigger and check for the status change. See the various CBSubs integrations for example usages of the trigger, but as Nick suggested using the CBSubs URL integration is best approach.


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.

10 years 8 months ago #241875 by prestoproducts
Replied by prestoproducts on topic CB Triggers Help Needed for onCbSubsAfterPaymentBasket
Just tried onCPayUserStateChange trigger with no luck. I am going to look into the URL integration as I think it may do the trick. I'll let you know what I find.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago #241902 by krileon
It's the appropriate trigger, but as mentioned in my previous reply you have to check the status. That trigger fires multiple times for a subscription based off its status. For example the status could be pending, active, expired, etc...


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.

10 years 8 months ago - 10 years 8 months ago #241996 by prestoproducts
Replied by prestoproducts on topic CB Triggers Help Needed for onCbSubsAfterPaymentBasket
Okay, so it sounds like in order to have the onCPayUserStateChange trigger fire after basket payment I have to have the user disabled prior to subscribing. If so, can you please outline the configuration points to check for this to occur?
Last edit: 10 years 8 months ago by prestoproducts.

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

Moderators: beatnantkrileon
Powered by Kunena Forum