How to get trial days remaining

billyjones26's Avatar

billyjones26

04 Dec, 2012 10:09 AM

I'd like to get the customers remaining trial days and/or if the trial period has expired. Here is a var_dump of my customer:

array(25) { ["id"]=> string(36) "89f511e4-f818-11e1-a22b-40403c39f8d9" ["code"]=> string(6) "MEDIUM" ["name"]=> string(6) "Medium" ["displayName"]=> string(24) "Medium • 10.00 / Month" ["description"]=> string(0) "" ["isActive"]=> string(1) "1" ["isFree"]=> string(1) "0" ["paymentMethodIsRequired"]=> string(1) "0" ["trialDays"]=> string(1) "0" ["initialBillCount"]=> string(2) "30" ["initialBillCountUnit"]=> string(4) "days" ["initialInvoiceBillingDatetime"]=> string(25) "2013-01-03T09:59:01+00:00" ["billingFrequency"]=> string(7) "monthly" ["billingFrequencyPer"]=> string(5) "month" ["billingFrequencyUnit"]=> string(6) "months" ["billingFrequencyQuantity"]=> string(1) "1" ["nextInvoiceBillingDatetime"]=> string(25) "2013-02-03T09:59:01+00:00" ["setupChargeCode"]=> string(0) "" ["setupChargeAmount"]=> string(4) "0.00" ["recurringChargeCode"]=> string(14) "PLUS_RECURRING" ["recurringChargeAmount"]=> string(5) "10.00" ["onChangeInitialBillHandler"]=> string(4) "next" ["setupChargeBillHandler"]=> string(3) "now" ["onChangeSetupChargeBillHandler"]=> string(2) "no" ["createdDatetime"]=> string(25) "2012-09-06T11:46:47+00:00" }

You can see trialDays is 0. If that is the amount of days they have had of their trial that should be 8 days.

  1. Support Staff 1 Posted by Marc Guyer on 04 Dec, 2012 09:57 PM

    Marc Guyer's Avatar

    Hi Billy -- That var_dump is just the plan information. The trialDays node is deprecated and is not relevant at all to new accounts. You want to look at the current pending invoice on the subscription (not in that var_dump). The billingDatetime is the end of the trial when that invoice isInitial.

  2. Dean closed this discussion on 23 Jan, 2013 05:37 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM