You can check the status of the subscription as follows:
customer = Stripe::Customer.retrieve("cus_7G9REJXtaW05QY")
subscription = customer.subscriptions.retrieve("sub_7HFIqkWIDqEhho")
if subscription.status == 'trialing'
next_payment_date = Time.at(subscription.trial_end).strftime("%B %d, %Y")
end
After the trail ends you can check the current_period_end
attribute from the subscription
next_payment_date = Time.at(subscription.current_period_end).strftime("%B %d, %Y")
Moreover, you can use the current_period_end
if you have only one month trial. That would work in all the cases.
PS: For the status check, the word is trialing
and not trialling
, if I am not wrong, there is a spelling mistake by Stripe team. :-)