[SOLVED] Trying to find out when onCPayUserStateChange is triggered

8 years 6 months ago #272429 by c_schmitz

krileon wrote: I've no idea where you're calling this from. Is it from a CB plugin, CBSubs plugin, or is it from outside of CB? If it's from outside of CB you need to first load CB API then load CBs plugins.


Ah, I'm using a CB plugin, not a CBSubs plugin, so I guess that's the problem. I copied the code from CBSubs plugin SQlActions into a CB plugin. Out of curiosity, why would the file-location matter for triggers?

Please Log in to join the conversation.

8 years 6 months ago #272436 by c_schmitz
Another important question: How to fire the event programmatically? Otherwise I would have to do a "real" payment each time to test the function, which would be slow.

Please Log in to join the conversation.

8 years 6 months ago #272450 by nant

c_schmitz wrote: Another important question: How to fire the event programmatically? Otherwise I would have to do a "real" payment each time to test the function, which would be slow.


most payment gateways have a test mode that can be used for testing.

Please Log in to join the conversation.

8 years 6 months ago #272465 by krileon
CB plugin and CBSubs plugins can both act on that trigger fine. As I didn't write your plugin or code I've no idea if there's something outside of the code snippet you provided that's a problem. For example if the plugin isn't published or accessible then it won't act on the trigger.

Another important question: How to fire the event programmatically? Otherwise I would have to do a "real" payment each time to test the function, which would be slow.

You can't simulate a trigger without writing a bunch of code to ensure the appropriate variables are passed. Use the Dummy gateway to do testing in CBSubs to test the triggers and workflows.


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: nant

Please Log in to join the conversation.

8 years 6 months ago #272521 by c_schmitz

krileon wrote: CB plugin and CBSubs plugins can both act on that trigger fine. As I didn't write your plugin or code I've no idea if there's something outside of the code snippet you provided that's a problem. For example if the plugin isn't published or accessible then it won't act on the trigger.

Another important question: How to fire the event programmatically? Otherwise I would have to do a "real" payment each time to test the function, which would be slow.

You can't simulate a trigger without writing a bunch of code to ensure the appropriate variables are passed. Use the Dummy gateway to do testing in CBSubs to test the triggers and workflows.


What riddled me was the fact that the onBeforeUserProfileDisplay trigger was triggered fine, but not onCPayUserStateChange. Anyway, it works now when I use your scaffolding CBSubs plugin.

Will have a look at the dummy gateway, thanks!
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.305 seconds

Facebook Twitter LinkedIn