[#7166] PostAfPro CBsubs

5 years 10 months ago - 5 years 10 months ago #304748 by activha
[#7166] PostAfPro CBsubs was created by activha
Hello

I have a question regarding recurring commissions for PAP integration.

Up to now we had set New Commission both for subscription upgrade and subscription renewal in our plans and that was working fine.

We would like to differentiate upgrade and renewal in PAP and then tried to set New Commission for subscription upgrade and Recurring Commission for subscription renewal in our plans.

The affiliate id is correctly set in the basket integrations area but the transaction for a renewing subscription is not registered in PAP

Both recurring and new commissions are correctly set in PAP. We have set the recurring duration as "various" in PAP recurring commissions setting.

Do we need to set something else somewhere ?
Do we need to set the duration as "none" in PAP ? we have CBsubs plans with different durations but the same percentage of commissions for these.

Thanks for the help
Best regards
Jean

Please Log in to join the conversation.

5 years 10 months ago #304755 by krileon
Replied by krileon on topic PostAfPro CBsubs
Honestly have no clue. Last time I used PAP was 2 years ago. We're simply using the below API passing the the Order ID created for the original commission.

support.qualityunit.com/197572-Pap_Api_RecurringCommission

If no original commission exists then the recurring commission probably won't work and since you're changing parameters mid-usage that is likely what's happening and will only work for new subscriptions and their subsequent renewals. The default behavior is as follows.

Subscription Upgrade: New Commission
Subscription Renewal: Recurring Commission


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.

5 years 10 months ago #304776 by activha
Replied by activha on topic PostAfPro CBsubs
Thanks for the explanation, butI have also tried on the dev website with a new subscription and tried to manually renew it.

It seems that the first subscription to a plan correctly sets the recurring commission as it is correctly recorded in PAP in the recurring commission panel.

As we use the same campaign for all our plans, we have set our recurring commissions models as "varied", which means that the time for the recurring commission should be triggered by CBsubs and not by PAP

So on the dev website, I noticed that when renewing CBsubs plans, PAP does not compute any new or recurring commissions.

Would setTotalCost($value); be useful somewhere to trigger the recurring commission from CBsubs as detailed in the page you referred to ?

The point is that we need to separate new and recurring commission in PAP for computing bonus reward.

Thanks for your ideas

Regards
Jean

Please Log in to join the conversation.

5 years 10 months ago - 5 years 10 months ago #304779 by krileon
Replied by krileon on topic PostAfPro CBsubs
Aha, I think I see the issue. For renewals it's checking the wrong parameter. Try the below quickfix and see if that resolves your issue.

IN: components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubspostafpro/cbsubs.postafpro.php
ON: Line 208
FROM:
} elseif ( ( $update == 1 ) && ( $status == 'A' ) ) {
TO:
} elseif ( ( $renewal == 1 ) && ( $status == 'A' ) ) {

#7166


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.

5 years 10 months ago #304799 by activha
Replied by activha on topic PostAfPro CBsubs
Yes that was it :-)

However there is now a protection in PAP recurring commission plugin for requiring authentication when recurring commissions are triggered by API . Could you take this into account ?

Also I have noticed that if the first payment was different from the other ones, the recurring commission does not adapt, so maybe that would be better to write :
if ( $registerRecurr ) {
				$session				=	new Gpf_Api_Session( $installPath . '/scripts/server.php' );
				$recurringCommission	=	new Pap_Api_RecurringCommission( $session );

				$recurringCommission->setOrderId( $orderId );
				$recurringCommission->setTotalCost($price);				
				$recurringCommission->createCommissions();
			}
by adding setTotalCost($price) as it is now supported ?
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

5 years 10 months ago #304810 by krileon
Replied by krileon on topic PostAfPro CBsubs

Also I have noticed that if the first payment was different from the other ones, the recurring commission does not adapt, so maybe that would be better to write :

Yup, that's what the setTotalCost function is for. Have added a feature ticket to implement in a future release. Am only pausing Bootstrap 4 progress for necessary bug fixes so it won't be for awhile, but you should be able to make the change your self if you like.

#7167


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

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.462 seconds

Facebook Twitter LinkedIn