CCBILL auto-recurring payment methodology

5 years 4 months ago #309229 by krileon
Replied by krileon on topic CCBILL auto-recurring payment methodology

where are these baskets with payments scheduled stored ?

The scheduler is attached to the basket within the _cbsubs_baskets table. All CBSubs database tables are prefixed with _cbsubs.

im trying to setup such a stored basket so i can call it with the cronjob.

You should only need to call scheduleAutoRecurringPayments in your return handling when the hosted page sends you back to CBSubs (see _returnParamsHandler function of CCBill gateway where it does this). This will setup the basket for scheduled payments. You then need to implement handling of scheduled payments in processScheduledAutoRecurringPayment. You don't need to do anything more beyond that for scheduled payments. The scheduling is done all automatically within CBSubs based off things like the duration of the plan so you don't need to manually calculate and store any of that.


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 4 months ago #309230 by buzibuzi
Replied by buzibuzi on topic CCBILL auto-recurring payment methodology
ok, this is more clear now.
im a bit stumbled here,
_returnParamsHandler function has this code (around line 1018) to determine first time payment or Autorecurring payment.
according to this condition, _scheduleAutoRecurringPayments is activated or not (if is $recurring = true but not of $type (A) )
$recurring    =	( $type == 'A' ? true : false );

					if ( $recurring ) {
						if ( $type != 'A' ) {
							// in case of first payment of auto-recurring payments:
							$ipn->txn_type    =	'subscr_signup';
							$ipn->subscr_id    =	(int) $paymentBasket->id;
							$ipn->subscr_date					=	$ipn->payment_date;

perhaps my PHP and logic are a bit rusty, but doesnt this line:
$recurring    =	( $type == 'A' ? true : false );

absolute the necessity of this test:
if ( $recurring ) {
						if ( $type != 'A' ) {

How can $recurring be true but not of $type "A" ?
am i missing something here ?

Please Log in to join the conversation.

5 years 4 months ago #309231 by krileon
Replied by krileon on topic CCBILL auto-recurring payment methodology
subscr_signup state is handled before the IPN or return handling needs to deal with it. $recurring used to have a different check. It's just a redundancy that was leftover that could be removed, but wasn't really any need to as it causes no harm.


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 4 months ago #309235 by buzibuzi
Replied by buzibuzi on topic CCBILL auto-recurring payment methodology
ok, i need to pick your brain a little more here.i really appreciate all your help:

for scheduleAutoRecurringPayments method to be called, its dependent on the value of "$recurring" to be TRUE && not be of value 'A':

but like i wrote in the previous message, because of this statement:
$recurring    =	( $type == 'A' ? true : false );

$recurring becomes FALSE ($type is 'R' in the first payment) and therefor scheduleAutoRecurringPayments is not being called in this statement:

if ( $recurring && ( $type != 'A' ) ) {
// Now we need to schedule the automatic payments to be done by CBSubs using DirectLink, and which will trigger the auto-renewals (if it's not already the autorecurring payment (A)):
$paymentBasket->scheduleAutoRecurringPayments();
}

i need scheduleAutoRecurringPayments to be called, what should i do ?

Please Log in to join the conversation.

5 years 4 months ago #309245 by krileon
Replied by krileon on topic CCBILL auto-recurring payment methodology
$recurring being set like that is probably a bug. I don't know as you're asking me questions about a gateway developed something like 6 years ago and effectively left untouched since then. We've had no complaints regarding it not working so there was no reason to review it any further. If DirectLink payments aren't working for you we'll open a bug ticket and review the issue further.

Call scheduleAutoRecurringPayments when you need recurring payments for a hosted payment page solution when the purchase type is a recurring subscription. So for example you don't want to be calling it for single payments. Whether you do this based off the $type or based off information from an IPN from the payment gateway is entirely dependent on the gateway and how you choose to handle it.


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 4 months ago #309275 by buzibuzi
Replied by buzibuzi on topic CCBILL auto-recurring payment methodology
Hi Kyle,
ok, seems i have got the scheduleAutoRecurringPayments called for recurring payment. lets see whats next :)
thanks for this support.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.225 seconds

Facebook Twitter LinkedIn