Please Log in or Create an account to join the conversation.
You can query for it, grab it using API, or loop through the baskets items. Not sure why you need it though.1. How do i get the newly created "subscription_id" that was just inserted to #_cbsubs_subscriptions Table by updatePaymentStatus ?
do i have access to it somehow from the cbpaidsubscriptions.class ?
or do i need to query the DB for the last inserted id ? (least preferred method)
The scheduler needs to be triggered, but yes after 5 minutes the plan would flip to an expired state and be renewed by the scheduler which executes processScheduledAutoRecurringPayment. The scheduler URL can be found in CBSubs > Settings > Global. Believe certain frontend actions will also trigger it (e.g. expired user logging in).2. i created a recurring plan with 5 minutes expiration date for testing purposes.
so, if i call after first payment
$paymentBasket->scheduleAutoRecurringPayments()
and if all works fine, the processScheduledAutoRecurringPayment should be processing my newly created subscription after 5 minutes, is this correct ?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Sorry, still don't understand. All the information you need to trigger a payment is already available in the provided functions. You don't send subscription id to a payment processor as the payment processor isn't paying a subscription it's paying a basket. The only ID relevant to a processor is the basket id. Your token should be stored as part of the basket or using cbpaidConfig class if it's reusable (see Stripe for usage of cbpaidConfig).i need to it insert into the record holding the IPN recurring token (the token that replaces the credit card data) so i when the recurring payment is triggered i'll pull the basket from the #_cbsubs_subscriptions Table.
That shouldn't be possible. Typically you send the basket id with your API call to your payment processor and it sends it back with whatever information it may also include.in a certain scenario, if two simultaneous payments are performed, the tokens and baskets might get mixed up. i want to make sure im using the correct subscription_id.
You don't need the subscription_id as again it's not relevant to the processor. It might not even exist yet as well depending on the state of the basket. Where it is relevant it is provided to the function, which is very few instances (e.g. few cancel functions).i couldnt find wher ethe baskets items dont hold this subscription_id. could you point me how to grab is using the API ?
When it's scheduled should be entirely based off the duration set within the plan. Don't think CCBill allows for 5 minute duration so the gateway maybe forcing it to no less than 1 day duration. Based off your previous reply though it went into retry state. This causes it to retry the next day if the payment failed. It'll do that I think 5 times before giving up.i figured out the date-time value in #_cbsubs_payment_baskets.scheduler_next_maturity is recorded one day ahead from when the basket was created. that's why the autopayments didn't complete. because it need to wait 24 hours before running again. im not sure why this is, since the autorecurring is set dynamically. but it probably doesnt matter. i can adjust the #_cbsubs_payment_baskets.scheduler_next_maturity date in the DB to Today and then it runs.
Please Log in or Create an account to join the conversation.