[SOLVED] AUP points How to Assign the value of a Donation plan in points

10 years 1 week ago - 10 years 4 days ago #244787 by HowardTheDuck
Hi Guys,
we have developed an integration with AlphauserPoints using your integration. But we have a problem with Donation Plans. Is there a way, or can you suggest a warkaround to:

Given a certain Donation plan in CBSUBS
Credit the amount of the donation plan in credits to the user.

We need to pickup the donation amount and convert it in Points for AUP. And then send those points to AUP with their API.

Any suggestion?

Thank you
Cristiano

Please Log in to join the conversation.

10 years 1 week ago #244806 by krileon
No idea how your plugin was developed or functions, but if it's using onCPayUserStateChange it should function fine as onCPayUserStateChange is fired for all plan types. You don't need a new plugin for this though as you can use CB Auto Actions and a Code action with Method set to PHP then run AUP API on the onCPayUserStateChange trigger using the below conditions.

Plan Active
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To A

Plan Expired
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To X

Can probably remove the second conditional though for donation/merchandise type 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.

Please Log in to join the conversation.

10 years 1 week ago #244854 by HowardTheDuck
Hi Kyle,
yeah, I understand. But the plan ID was not an issue, the issue is... how can I bring out the total invoice amount that you save in DB as: mc_gross in the table #__cbsubs_payment_baskets?

Thanks
Cristiano

Please Log in to join the conversation.

10 years 1 week ago - 10 years 1 week ago #244857 by krileon
That trigger contains the following variables.

&$user, $status, $planId, $replacedPlanId, $integrationParams, $cause, $reason, $now, $subscription, $autorenewed

That trigger does not act on the basket, but acts on a plans state being change. So you can not get the baskets values from this. You can try grabbing the most recent basket though if using PHP using the following API call.

$basket = cbpaidPaymentBasket::getInstanceBasketOfUser( USER_ID_HERE, false );

You can then get the basket amount using $basket->mc_gross.


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 to join the conversation.

10 years 1 week ago #244872 by HowardTheDuck
Hi Kyle.
yes, that is helpful. We will go like that...thanks!
Cristiano

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.400 seconds

Facebook Twitter LinkedIn